vue 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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.2
2
+ * vue v3.6.0-beta.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.2
2
+ * vue v3.6.0-beta.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.2
2
+ * vue v3.6.0-beta.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1320,20 +1320,20 @@ function createIterableMethod(method, isReadonly2, isShallow2) {
1320
1320
  "iterate",
1321
1321
  isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
1322
1322
  );
1323
- return {
1324
- // iterator protocol
1325
- next() {
1326
- const { value, done } = innerIterator.next();
1327
- return done ? { value, done } : {
1328
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
1329
- done
1330
- };
1331
- },
1332
- // iterable protocol
1333
- [Symbol.iterator]() {
1334
- return this;
1323
+ return extend(
1324
+ // inheriting all iterator properties
1325
+ Object.create(innerIterator),
1326
+ {
1327
+ // iterator protocol
1328
+ next() {
1329
+ const { value, done } = innerIterator.next();
1330
+ return done ? { value, done } : {
1331
+ value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
1332
+ done
1333
+ };
1334
+ }
1335
1335
  }
1336
- };
1336
+ );
1337
1337
  };
1338
1338
  }
1339
1339
  function createReadonlyMethod(type) {
@@ -1547,8 +1547,9 @@ function targetTypeMap(rawType) {
1547
1547
  function getTargetType(value) {
1548
1548
  return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1549
1549
  }
1550
+ // @__NO_SIDE_EFFECTS__
1550
1551
  function reactive(target) {
1551
- if (isReadonly(target)) {
1552
+ if (/* @__PURE__ */ isReadonly(target)) {
1552
1553
  return target;
1553
1554
  }
1554
1555
  return createReactiveObject(
@@ -1559,6 +1560,7 @@ function reactive(target) {
1559
1560
  reactiveMap
1560
1561
  );
1561
1562
  }
1563
+ // @__NO_SIDE_EFFECTS__
1562
1564
  function shallowReactive(target) {
1563
1565
  return createReactiveObject(
1564
1566
  target,
@@ -1568,6 +1570,7 @@ function shallowReactive(target) {
1568
1570
  shallowReactiveMap
1569
1571
  );
1570
1572
  }
1573
+ // @__NO_SIDE_EFFECTS__
1571
1574
  function readonly(target) {
1572
1575
  return createReactiveObject(
1573
1576
  target,
@@ -1577,6 +1580,7 @@ function readonly(target) {
1577
1580
  readonlyMap
1578
1581
  );
1579
1582
  }
1583
+ // @__NO_SIDE_EFFECTS__
1580
1584
  function shallowReadonly(target) {
1581
1585
  return createReactiveObject(
1582
1586
  target,
@@ -1615,24 +1619,29 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1615
1619
  proxyMap.set(target, proxy);
1616
1620
  return proxy;
1617
1621
  }
1622
+ // @__NO_SIDE_EFFECTS__
1618
1623
  function isReactive(value) {
1619
- if (isReadonly(value)) {
1620
- return isReactive(value["__v_raw"]);
1624
+ if (/* @__PURE__ */ isReadonly(value)) {
1625
+ return /* @__PURE__ */ isReactive(value["__v_raw"]);
1621
1626
  }
1622
1627
  return !!(value && value["__v_isReactive"]);
1623
1628
  }
1629
+ // @__NO_SIDE_EFFECTS__
1624
1630
  function isReadonly(value) {
1625
1631
  return !!(value && value["__v_isReadonly"]);
1626
1632
  }
1633
+ // @__NO_SIDE_EFFECTS__
1627
1634
  function isShallow(value) {
1628
1635
  return !!(value && value["__v_isShallow"]);
1629
1636
  }
1637
+ // @__NO_SIDE_EFFECTS__
1630
1638
  function isProxy(value) {
1631
1639
  return value ? !!value["__v_raw"] : false;
1632
1640
  }
1641
+ // @__NO_SIDE_EFFECTS__
1633
1642
  function toRaw(observed) {
1634
1643
  const raw = observed && observed["__v_raw"];
1635
- return raw ? toRaw(raw) : observed;
1644
+ return raw ? /* @__PURE__ */ toRaw(raw) : observed;
1636
1645
  }
1637
1646
  function markRaw(value) {
1638
1647
  if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
@@ -1640,20 +1649,23 @@ function markRaw(value) {
1640
1649
  }
1641
1650
  return value;
1642
1651
  }
1643
- const toReactive = (value) => isObject(value) ? reactive(value) : value;
1644
- const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1652
+ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value) : value;
1653
+ const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
1645
1654
 
1655
+ // @__NO_SIDE_EFFECTS__
1646
1656
  function isRef(r) {
1647
1657
  return r ? r["__v_isRef"] === true : false;
1648
1658
  }
1659
+ // @__NO_SIDE_EFFECTS__
1649
1660
  function ref(value) {
1650
1661
  return createRef(value, toReactive);
1651
1662
  }
1663
+ // @__NO_SIDE_EFFECTS__
1652
1664
  function shallowRef(value) {
1653
1665
  return createRef(value);
1654
1666
  }
1655
1667
  function createRef(rawValue, wrap) {
1656
- if (isRef(rawValue)) {
1668
+ if (/* @__PURE__ */ isRef(rawValue)) {
1657
1669
  return rawValue;
1658
1670
  }
1659
1671
  return new RefImpl(rawValue, wrap);
@@ -1748,7 +1760,7 @@ function trackRef(dep) {
1748
1760
  }
1749
1761
  }
1750
1762
  function unref(ref2) {
1751
- return isRef(ref2) ? ref2.value : ref2;
1763
+ return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
1752
1764
  }
1753
1765
  function toValue(source) {
1754
1766
  return isFunction(source) ? source() : unref(source);
@@ -1757,7 +1769,7 @@ const shallowUnwrapHandlers = {
1757
1769
  get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1758
1770
  set: (target, key, value, receiver) => {
1759
1771
  const oldValue = target[key];
1760
- if (isRef(oldValue) && !isRef(value)) {
1772
+ if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1761
1773
  oldValue.value = value;
1762
1774
  return true;
1763
1775
  } else {
@@ -1795,6 +1807,7 @@ class CustomRefImpl {
1795
1807
  function customRef(factory) {
1796
1808
  return new CustomRefImpl(factory);
1797
1809
  }
1810
+ // @__NO_SIDE_EFFECTS__
1798
1811
  function toRefs(object) {
1799
1812
  const ret = isArray(object) ? new Array(object.length) : {};
1800
1813
  for (const key in object) {
@@ -1827,9 +1840,9 @@ class ObjectRefImpl {
1827
1840
  return this._value = val === void 0 ? this._defaultValue : val;
1828
1841
  }
1829
1842
  set value(newVal) {
1830
- if (this._shallow && isRef(this._raw[this._key])) {
1843
+ if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
1831
1844
  const nestedRef = this._object[this._key];
1832
- if (isRef(nestedRef)) {
1845
+ if (/* @__PURE__ */ isRef(nestedRef)) {
1833
1846
  nestedRef.value = newVal;
1834
1847
  return;
1835
1848
  }
@@ -1851,15 +1864,16 @@ class GetterRefImpl {
1851
1864
  return this._value = this._getter();
1852
1865
  }
1853
1866
  }
1867
+ // @__NO_SIDE_EFFECTS__
1854
1868
  function toRef(source, key, defaultValue) {
1855
- if (isRef(source)) {
1869
+ if (/* @__PURE__ */ isRef(source)) {
1856
1870
  return source;
1857
1871
  } else if (isFunction(source)) {
1858
1872
  return new GetterRefImpl(source);
1859
1873
  } else if (isObject(source) && arguments.length > 1) {
1860
1874
  return propertyToRef(source, key, defaultValue);
1861
1875
  } else {
1862
- return ref(source);
1876
+ return /* @__PURE__ */ ref(source);
1863
1877
  }
1864
1878
  }
1865
1879
  function propertyToRef(source, key, defaultValue) {
@@ -2225,6 +2239,7 @@ class ComputedRefImpl {
2225
2239
  {
2226
2240
  setupOnTrigger(ComputedRefImpl);
2227
2241
  }
2242
+ // @__NO_SIDE_EFFECTS__
2228
2243
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2229
2244
  let getter;
2230
2245
  let setter;
@@ -4715,7 +4730,7 @@ Server rendered element contains more child nodes than client vdom.`
4715
4730
  logMismatchError();
4716
4731
  }
4717
4732
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4718
- key[0] === "." || isCustomElement) {
4733
+ key[0] === "." || isCustomElement && !isReservedProp(key)) {
4719
4734
  patchProp(el, key, null, props[key], void 0, parentComponent);
4720
4735
  }
4721
4736
  }
@@ -5867,9 +5882,10 @@ function createSlots(slots, dynamicSlots) {
5867
5882
 
5868
5883
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5869
5884
  let slot = slots[name];
5870
- if (slot && slot.__vapor) {
5885
+ const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
5886
+ if (vaporSlot) {
5871
5887
  const ret = (openBlock(), createBlock(VaporSlot, props));
5872
- ret.vs = { slot, fallback };
5888
+ ret.vs = { slot: vaporSlot, fallback };
5873
5889
  return ret;
5874
5890
  }
5875
5891
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -5932,14 +5948,14 @@ function ensureVaporSlotFallback(vnodes, fallback) {
5932
5948
  }
5933
5949
  }
5934
5950
 
5935
- function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
5951
+ function toHandlers(obj, preserveCaseIfNecessary) {
5936
5952
  const ret = {};
5937
5953
  if (!isObject(obj)) {
5938
5954
  warn$1(`v-on with no argument expects an object value.`);
5939
5955
  return ret;
5940
5956
  }
5941
5957
  for (const key in obj) {
5942
- ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
5958
+ ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
5943
5959
  }
5944
5960
  return ret;
5945
5961
  }
@@ -8235,7 +8251,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8235
8251
  optimized
8236
8252
  );
8237
8253
  } else {
8238
- const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
8254
+ const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
8239
8255
  try {
8240
8256
  if (customElement) {
8241
8257
  customElement._beginPatch();
@@ -8771,7 +8787,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8771
8787
  if (!instance.isMounted) {
8772
8788
  let vnodeHook;
8773
8789
  const { el, props } = initialVNode;
8774
- const { bm, m, parent, root, type } = instance;
8790
+ const { bm, parent, root, type } = instance;
8775
8791
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
8776
8792
  toggleRecurse(instance, false);
8777
8793
  if (bm) {
@@ -8814,8 +8830,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8814
8830
  hydrateSubTree();
8815
8831
  }
8816
8832
  } else {
8817
- if (root.ce && // @ts-expect-error _def is private
8818
- root.ce._def.shadowRoot !== false) {
8833
+ if (root.ce && root.ce._hasShadowRoot()) {
8819
8834
  root.ce._injectChildStyle(type);
8820
8835
  }
8821
8836
  {
@@ -8842,8 +8857,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8842
8857
  }
8843
8858
  initialVNode.el = subTree.el;
8844
8859
  }
8845
- if (m) {
8846
- queuePostRenderEffect(m, void 0, parentSuspense);
8860
+ if (instance.m) {
8861
+ queuePostRenderEffect(instance.m, void 0, parentSuspense);
8847
8862
  }
8848
8863
  if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
8849
8864
  const scopedInitialVNode = initialVNode;
@@ -11414,7 +11429,7 @@ function isMemoSame(cached, memo) {
11414
11429
  return true;
11415
11430
  }
11416
11431
 
11417
- const version = "3.6.0-beta.2";
11432
+ const version = "3.6.0-beta.4";
11418
11433
  const warn = warn$1 ;
11419
11434
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11420
11435
  const devtools = devtools$1 ;
@@ -11919,17 +11934,24 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
11919
11934
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11920
11935
  ).forEach((node) => setVarsOnNode(node, vars));
11921
11936
  };
11922
- const applyCssCars = () => {
11923
- const vars = getVars();
11937
+ const applyCssVars = (vars = getVars()) => {
11924
11938
  setVars(vars);
11925
11939
  updateTeleports(vars);
11926
11940
  };
11927
11941
  onBeforeUpdate(() => {
11928
- queuePostFlushCb(applyCssCars);
11942
+ queuePostFlushCb(applyCssVars);
11929
11943
  });
11930
11944
  onMounted(() => {
11931
- watch(applyCssCars, NOOP, { flush: "post" });
11932
- const ob = new MutationObserver(applyCssCars);
11945
+ watch(
11946
+ () => {
11947
+ const vars = getVars();
11948
+ extend({}, vars);
11949
+ applyCssVars(vars);
11950
+ },
11951
+ NOOP,
11952
+ { flush: "post" }
11953
+ );
11954
+ const ob = new MutationObserver(() => applyCssVars());
11933
11955
  ob.observe(getParentNode(), { childList: true });
11934
11956
  onUnmounted(() => ob.disconnect());
11935
11957
  });
@@ -12660,6 +12682,12 @@ class VueElementBase extends BaseClass {
12660
12682
  this._update();
12661
12683
  }
12662
12684
  }
12685
+ /**
12686
+ * @internal
12687
+ */
12688
+ _hasShadowRoot() {
12689
+ return this._def.shadowRoot !== false;
12690
+ }
12663
12691
  /**
12664
12692
  * @internal
12665
12693
  */
@@ -13438,6 +13466,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
13438
13466
  Fragment: Fragment,
13439
13467
  KeepAlive: KeepAlive,
13440
13468
  MoveType: MoveType,
13469
+ NULL_DYNAMIC_COMPONENT: NULL_DYNAMIC_COMPONENT,
13441
13470
  ReactiveEffect: ReactiveEffect,
13442
13471
  Static: Static,
13443
13472
  Suspense: Suspense,
@@ -19279,4 +19308,4 @@ ${codeFrame}` : message);
19279
19308
  }
19280
19309
  registerRuntimeCompiler(compileToFunction);
19281
19310
 
19282
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MoveType, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, VueElementBase, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, nodeOps, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
19311
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, VueElementBase, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, nodeOps, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };