@vue/runtime-dom 3.6.0-beta.2 → 3.6.0-beta.4

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.6.0-beta.2
2
+ * @vue/runtime-dom v3.6.0-beta.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -490,17 +490,24 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
490
490
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
491
491
  ).forEach((node) => setVarsOnNode(node, vars));
492
492
  };
493
- const applyCssCars = () => {
494
- const vars = getVars();
493
+ const applyCssVars = (vars = getVars()) => {
495
494
  setVars(vars);
496
495
  updateTeleports(vars);
497
496
  };
498
497
  onBeforeUpdate(() => {
499
- queuePostFlushCb(applyCssCars);
498
+ queuePostFlushCb(applyCssVars);
500
499
  });
501
500
  onMounted(() => {
502
- watch(applyCssCars, NOOP, { flush: "post" });
503
- const ob = new MutationObserver(applyCssCars);
501
+ watch(
502
+ () => {
503
+ const vars = getVars();
504
+ extend({}, vars);
505
+ applyCssVars(vars);
506
+ },
507
+ NOOP,
508
+ { flush: "post" }
509
+ );
510
+ const ob = new MutationObserver(() => applyCssVars());
504
511
  ob.observe(getParentNode(), { childList: true });
505
512
  onUnmounted(() => ob.disconnect());
506
513
  });
@@ -1231,6 +1238,12 @@ class VueElementBase extends BaseClass {
1231
1238
  this._update();
1232
1239
  }
1233
1240
  }
1241
+ /**
1242
+ * @internal
1243
+ */
1244
+ _hasShadowRoot() {
1245
+ return this._def.shadowRoot !== false;
1246
+ }
1234
1247
  /**
1235
1248
  * @internal
1236
1249
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.2
2
+ * @vue/runtime-dom v3.6.0-beta.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1250,20 +1250,20 @@ var VueRuntimeDOM = (function (exports) {
1250
1250
  "iterate",
1251
1251
  isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
1252
1252
  );
1253
- return {
1254
- // iterator protocol
1255
- next() {
1256
- const { value, done } = innerIterator.next();
1257
- return done ? { value, done } : {
1258
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
1259
- done
1260
- };
1261
- },
1262
- // iterable protocol
1263
- [Symbol.iterator]() {
1264
- return this;
1253
+ return extend(
1254
+ // inheriting all iterator properties
1255
+ Object.create(innerIterator),
1256
+ {
1257
+ // iterator protocol
1258
+ next() {
1259
+ const { value, done } = innerIterator.next();
1260
+ return done ? { value, done } : {
1261
+ value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
1262
+ done
1263
+ };
1264
+ }
1265
1265
  }
1266
- };
1266
+ );
1267
1267
  };
1268
1268
  }
1269
1269
  function createReadonlyMethod(type) {
@@ -1477,8 +1477,9 @@ var VueRuntimeDOM = (function (exports) {
1477
1477
  function getTargetType(value) {
1478
1478
  return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1479
1479
  }
1480
+ // @__NO_SIDE_EFFECTS__
1480
1481
  function reactive(target) {
1481
- if (isReadonly(target)) {
1482
+ if (/* @__PURE__ */ isReadonly(target)) {
1482
1483
  return target;
1483
1484
  }
1484
1485
  return createReactiveObject(
@@ -1489,6 +1490,7 @@ var VueRuntimeDOM = (function (exports) {
1489
1490
  reactiveMap
1490
1491
  );
1491
1492
  }
1493
+ // @__NO_SIDE_EFFECTS__
1492
1494
  function shallowReactive(target) {
1493
1495
  return createReactiveObject(
1494
1496
  target,
@@ -1498,6 +1500,7 @@ var VueRuntimeDOM = (function (exports) {
1498
1500
  shallowReactiveMap
1499
1501
  );
1500
1502
  }
1503
+ // @__NO_SIDE_EFFECTS__
1501
1504
  function readonly(target) {
1502
1505
  return createReactiveObject(
1503
1506
  target,
@@ -1507,6 +1510,7 @@ var VueRuntimeDOM = (function (exports) {
1507
1510
  readonlyMap
1508
1511
  );
1509
1512
  }
1513
+ // @__NO_SIDE_EFFECTS__
1510
1514
  function shallowReadonly(target) {
1511
1515
  return createReactiveObject(
1512
1516
  target,
@@ -1545,24 +1549,29 @@ var VueRuntimeDOM = (function (exports) {
1545
1549
  proxyMap.set(target, proxy);
1546
1550
  return proxy;
1547
1551
  }
1552
+ // @__NO_SIDE_EFFECTS__
1548
1553
  function isReactive(value) {
1549
- if (isReadonly(value)) {
1550
- return isReactive(value["__v_raw"]);
1554
+ if (/* @__PURE__ */ isReadonly(value)) {
1555
+ return /* @__PURE__ */ isReactive(value["__v_raw"]);
1551
1556
  }
1552
1557
  return !!(value && value["__v_isReactive"]);
1553
1558
  }
1559
+ // @__NO_SIDE_EFFECTS__
1554
1560
  function isReadonly(value) {
1555
1561
  return !!(value && value["__v_isReadonly"]);
1556
1562
  }
1563
+ // @__NO_SIDE_EFFECTS__
1557
1564
  function isShallow(value) {
1558
1565
  return !!(value && value["__v_isShallow"]);
1559
1566
  }
1567
+ // @__NO_SIDE_EFFECTS__
1560
1568
  function isProxy(value) {
1561
1569
  return value ? !!value["__v_raw"] : false;
1562
1570
  }
1571
+ // @__NO_SIDE_EFFECTS__
1563
1572
  function toRaw(observed) {
1564
1573
  const raw = observed && observed["__v_raw"];
1565
- return raw ? toRaw(raw) : observed;
1574
+ return raw ? /* @__PURE__ */ toRaw(raw) : observed;
1566
1575
  }
1567
1576
  function markRaw(value) {
1568
1577
  if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
@@ -1570,20 +1579,23 @@ var VueRuntimeDOM = (function (exports) {
1570
1579
  }
1571
1580
  return value;
1572
1581
  }
1573
- const toReactive = (value) => isObject(value) ? reactive(value) : value;
1574
- const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1582
+ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value) : value;
1583
+ const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
1575
1584
 
1585
+ // @__NO_SIDE_EFFECTS__
1576
1586
  function isRef(r) {
1577
1587
  return r ? r["__v_isRef"] === true : false;
1578
1588
  }
1589
+ // @__NO_SIDE_EFFECTS__
1579
1590
  function ref(value) {
1580
1591
  return createRef(value, toReactive);
1581
1592
  }
1593
+ // @__NO_SIDE_EFFECTS__
1582
1594
  function shallowRef(value) {
1583
1595
  return createRef(value);
1584
1596
  }
1585
1597
  function createRef(rawValue, wrap) {
1586
- if (isRef(rawValue)) {
1598
+ if (/* @__PURE__ */ isRef(rawValue)) {
1587
1599
  return rawValue;
1588
1600
  }
1589
1601
  return new RefImpl(rawValue, wrap);
@@ -1678,7 +1690,7 @@ var VueRuntimeDOM = (function (exports) {
1678
1690
  }
1679
1691
  }
1680
1692
  function unref(ref2) {
1681
- return isRef(ref2) ? ref2.value : ref2;
1693
+ return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
1682
1694
  }
1683
1695
  function toValue(source) {
1684
1696
  return isFunction(source) ? source() : unref(source);
@@ -1687,7 +1699,7 @@ var VueRuntimeDOM = (function (exports) {
1687
1699
  get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1688
1700
  set: (target, key, value, receiver) => {
1689
1701
  const oldValue = target[key];
1690
- if (isRef(oldValue) && !isRef(value)) {
1702
+ if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1691
1703
  oldValue.value = value;
1692
1704
  return true;
1693
1705
  } else {
@@ -1725,6 +1737,7 @@ var VueRuntimeDOM = (function (exports) {
1725
1737
  function customRef(factory) {
1726
1738
  return new CustomRefImpl(factory);
1727
1739
  }
1740
+ // @__NO_SIDE_EFFECTS__
1728
1741
  function toRefs(object) {
1729
1742
  const ret = isArray(object) ? new Array(object.length) : {};
1730
1743
  for (const key in object) {
@@ -1757,9 +1770,9 @@ var VueRuntimeDOM = (function (exports) {
1757
1770
  return this._value = val === void 0 ? this._defaultValue : val;
1758
1771
  }
1759
1772
  set value(newVal) {
1760
- if (this._shallow && isRef(this._raw[this._key])) {
1773
+ if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
1761
1774
  const nestedRef = this._object[this._key];
1762
- if (isRef(nestedRef)) {
1775
+ if (/* @__PURE__ */ isRef(nestedRef)) {
1763
1776
  nestedRef.value = newVal;
1764
1777
  return;
1765
1778
  }
@@ -1781,15 +1794,16 @@ var VueRuntimeDOM = (function (exports) {
1781
1794
  return this._value = this._getter();
1782
1795
  }
1783
1796
  }
1797
+ // @__NO_SIDE_EFFECTS__
1784
1798
  function toRef(source, key, defaultValue) {
1785
- if (isRef(source)) {
1799
+ if (/* @__PURE__ */ isRef(source)) {
1786
1800
  return source;
1787
1801
  } else if (isFunction(source)) {
1788
1802
  return new GetterRefImpl(source);
1789
1803
  } else if (isObject(source) && arguments.length > 1) {
1790
1804
  return propertyToRef(source, key, defaultValue);
1791
1805
  } else {
1792
- return ref(source);
1806
+ return /* @__PURE__ */ ref(source);
1793
1807
  }
1794
1808
  }
1795
1809
  function propertyToRef(source, key, defaultValue) {
@@ -2155,6 +2169,7 @@ var VueRuntimeDOM = (function (exports) {
2155
2169
  {
2156
2170
  setupOnTrigger(ComputedRefImpl);
2157
2171
  }
2172
+ // @__NO_SIDE_EFFECTS__
2158
2173
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2159
2174
  let getter;
2160
2175
  let setter;
@@ -4617,7 +4632,7 @@ Server rendered element contains more child nodes than client vdom.`
4617
4632
  logMismatchError();
4618
4633
  }
4619
4634
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4620
- key[0] === "." || isCustomElement) {
4635
+ key[0] === "." || isCustomElement && !isReservedProp(key)) {
4621
4636
  patchProp(el, key, null, props[key], void 0, parentComponent);
4622
4637
  }
4623
4638
  }
@@ -5763,9 +5778,10 @@ If this is a native custom element, make sure to exclude it from component resol
5763
5778
 
5764
5779
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5765
5780
  let slot = slots[name];
5766
- if (slot && slot.__vapor) {
5781
+ const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
5782
+ if (vaporSlot) {
5767
5783
  const ret = (openBlock(), createBlock(VaporSlot, props));
5768
- ret.vs = { slot, fallback };
5784
+ ret.vs = { slot: vaporSlot, fallback };
5769
5785
  return ret;
5770
5786
  }
5771
5787
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -5828,14 +5844,14 @@ If this is a native custom element, make sure to exclude it from component resol
5828
5844
  }
5829
5845
  }
5830
5846
 
5831
- function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
5847
+ function toHandlers(obj, preserveCaseIfNecessary) {
5832
5848
  const ret = {};
5833
5849
  if (!isObject(obj)) {
5834
5850
  warn$1(`v-on with no argument expects an object value.`);
5835
5851
  return ret;
5836
5852
  }
5837
5853
  for (const key in obj) {
5838
- ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
5854
+ ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
5839
5855
  }
5840
5856
  return ret;
5841
5857
  }
@@ -8128,7 +8144,7 @@ If you want to remount the same app, move your app creation logic into a factory
8128
8144
  optimized
8129
8145
  );
8130
8146
  } else {
8131
- const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
8147
+ const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
8132
8148
  try {
8133
8149
  if (customElement) {
8134
8150
  customElement._beginPatch();
@@ -8664,7 +8680,7 @@ If you want to remount the same app, move your app creation logic into a factory
8664
8680
  if (!instance.isMounted) {
8665
8681
  let vnodeHook;
8666
8682
  const { el, props } = initialVNode;
8667
- const { bm, m, parent, root, type } = instance;
8683
+ const { bm, parent, root, type } = instance;
8668
8684
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
8669
8685
  toggleRecurse(instance, false);
8670
8686
  if (bm) {
@@ -8707,8 +8723,7 @@ If you want to remount the same app, move your app creation logic into a factory
8707
8723
  hydrateSubTree();
8708
8724
  }
8709
8725
  } else {
8710
- if (root.ce && // @ts-expect-error _def is private
8711
- root.ce._def.shadowRoot !== false) {
8726
+ if (root.ce && root.ce._hasShadowRoot()) {
8712
8727
  root.ce._injectChildStyle(type);
8713
8728
  }
8714
8729
  {
@@ -8735,8 +8750,8 @@ If you want to remount the same app, move your app creation logic into a factory
8735
8750
  }
8736
8751
  initialVNode.el = subTree.el;
8737
8752
  }
8738
- if (m) {
8739
- queuePostRenderEffect(m, void 0, parentSuspense);
8753
+ if (instance.m) {
8754
+ queuePostRenderEffect(instance.m, void 0, parentSuspense);
8740
8755
  }
8741
8756
  if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
8742
8757
  const scopedInitialVNode = initialVNode;
@@ -11293,7 +11308,7 @@ Component that was made reactive: `,
11293
11308
  return true;
11294
11309
  }
11295
11310
 
11296
- const version = "3.6.0-beta.2";
11311
+ const version = "3.6.0-beta.4";
11297
11312
  const warn = warn$1 ;
11298
11313
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11299
11314
  const devtools = devtools$1 ;
@@ -11779,17 +11794,24 @@ Component that was made reactive: `,
11779
11794
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11780
11795
  ).forEach((node) => setVarsOnNode(node, vars));
11781
11796
  };
11782
- const applyCssCars = () => {
11783
- const vars = getVars();
11797
+ const applyCssVars = (vars = getVars()) => {
11784
11798
  setVars(vars);
11785
11799
  updateTeleports(vars);
11786
11800
  };
11787
11801
  onBeforeUpdate(() => {
11788
- queuePostFlushCb(applyCssCars);
11802
+ queuePostFlushCb(applyCssVars);
11789
11803
  });
11790
11804
  onMounted(() => {
11791
- watch(applyCssCars, NOOP, { flush: "post" });
11792
- const ob = new MutationObserver(applyCssCars);
11805
+ watch(
11806
+ () => {
11807
+ const vars = getVars();
11808
+ extend({}, vars);
11809
+ applyCssVars(vars);
11810
+ },
11811
+ NOOP,
11812
+ { flush: "post" }
11813
+ );
11814
+ const ob = new MutationObserver(() => applyCssVars());
11793
11815
  ob.observe(getParentNode(), { childList: true });
11794
11816
  onUnmounted(() => ob.disconnect());
11795
11817
  });
@@ -12520,6 +12542,12 @@ Expected function or array of functions, received type ${typeof value}.`
12520
12542
  this._update();
12521
12543
  }
12522
12544
  }
12545
+ /**
12546
+ * @internal
12547
+ */
12548
+ _hasShadowRoot() {
12549
+ return this._def.shadowRoot !== false;
12550
+ }
12523
12551
  /**
12524
12552
  * @internal
12525
12553
  */
@@ -13243,6 +13271,7 @@ Expected function or array of functions, received type ${typeof value}.`
13243
13271
  exports.Fragment = Fragment;
13244
13272
  exports.KeepAlive = KeepAlive;
13245
13273
  exports.MoveType = MoveType;
13274
+ exports.NULL_DYNAMIC_COMPONENT = NULL_DYNAMIC_COMPONENT;
13246
13275
  exports.ReactiveEffect = ReactiveEffect;
13247
13276
  exports.Static = Static;
13248
13277
  exports.Suspense = Suspense;