@vue/runtime-dom 3.6.0-beta.3 → 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.3
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
  **/
@@ -1154,6 +1154,12 @@ class VueElementBase extends BaseClass {
1154
1154
  this._update();
1155
1155
  }
1156
1156
  }
1157
+ /**
1158
+ * @internal
1159
+ */
1160
+ _hasShadowRoot() {
1161
+ return this._def.shadowRoot !== false;
1162
+ }
1157
1163
  /**
1158
1164
  * @internal
1159
1165
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.3
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
  **/
@@ -1093,6 +1093,12 @@ class VueElementBase extends BaseClass {
1093
1093
  this._update();
1094
1094
  }
1095
1095
  }
1096
+ /**
1097
+ * @internal
1098
+ */
1099
+ _hasShadowRoot() {
1100
+ return this._def.shadowRoot !== false;
1101
+ }
1096
1102
  /**
1097
1103
  * @internal
1098
1104
  */
@@ -613,10 +613,22 @@ export interface InsHTMLAttributes extends HTMLAttributes {
613
613
  datetime?: string | undefined;
614
614
  }
615
615
  export type InputTypeHTMLAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
616
+ type AutoFillAddressKind = 'billing' | 'shipping';
617
+ type AutoFillBase = '' | 'off' | 'on';
618
+ type AutoFillContactField = 'email' | 'tel' | 'tel-area-code' | 'tel-country-code' | 'tel-extension' | 'tel-local' | 'tel-local-prefix' | 'tel-local-suffix' | 'tel-national';
619
+ type AutoFillContactKind = 'home' | 'mobile' | 'work';
620
+ type AutoFillCredentialField = 'webauthn';
621
+ type AutoFillNormalField = 'additional-name' | 'address-level1' | 'address-level2' | 'address-level3' | 'address-level4' | 'address-line1' | 'address-line2' | 'address-line3' | 'bday-day' | 'bday-month' | 'bday-year' | 'cc-csc' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-family-name' | 'cc-given-name' | 'cc-name' | 'cc-number' | 'cc-type' | 'country' | 'country-name' | 'current-password' | 'family-name' | 'given-name' | 'honorific-prefix' | 'honorific-suffix' | 'name' | 'new-password' | 'one-time-code' | 'organization' | 'postal-code' | 'street-address' | 'transaction-amount' | 'transaction-currency' | 'username';
622
+ type OptionalPrefixToken<T extends string> = `${T} ` | '';
623
+ type OptionalPostfixToken<T extends string> = ` ${T}` | '';
624
+ type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`;
625
+ type AutoFillSection = `section-${string}`;
626
+ type AutoFill = AutoFillBase | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`;
627
+ export type InputAutoCompleteAttribute = AutoFill | (string & {});
616
628
  export interface InputHTMLAttributes extends HTMLAttributes {
617
629
  accept?: string | undefined;
618
630
  alt?: string | undefined;
619
- autocomplete?: string | undefined;
631
+ autocomplete?: InputAutoCompleteAttribute | undefined;
620
632
  autofocus?: Booleanish | undefined;
621
633
  capture?: boolean | 'user' | 'environment' | undefined;
622
634
  checked?: Booleanish | any[] | Set<any> | undefined;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.3
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
  **/
@@ -1247,20 +1247,20 @@ function createIterableMethod(method, isReadonly2, isShallow2) {
1247
1247
  "iterate",
1248
1248
  isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
1249
1249
  );
1250
- return {
1251
- // iterator protocol
1252
- next() {
1253
- const { value, done } = innerIterator.next();
1254
- return done ? { value, done } : {
1255
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
1256
- done
1257
- };
1258
- },
1259
- // iterable protocol
1260
- [Symbol.iterator]() {
1261
- return this;
1250
+ return extend(
1251
+ // inheriting all iterator properties
1252
+ Object.create(innerIterator),
1253
+ {
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
1262
  }
1263
- };
1263
+ );
1264
1264
  };
1265
1265
  }
1266
1266
  function createReadonlyMethod(type) {
@@ -1474,8 +1474,9 @@ function targetTypeMap(rawType) {
1474
1474
  function getTargetType(value) {
1475
1475
  return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1476
1476
  }
1477
+ // @__NO_SIDE_EFFECTS__
1477
1478
  function reactive(target) {
1478
- if (isReadonly(target)) {
1479
+ if (/* @__PURE__ */ isReadonly(target)) {
1479
1480
  return target;
1480
1481
  }
1481
1482
  return createReactiveObject(
@@ -1486,6 +1487,7 @@ function reactive(target) {
1486
1487
  reactiveMap
1487
1488
  );
1488
1489
  }
1490
+ // @__NO_SIDE_EFFECTS__
1489
1491
  function shallowReactive(target) {
1490
1492
  return createReactiveObject(
1491
1493
  target,
@@ -1495,6 +1497,7 @@ function shallowReactive(target) {
1495
1497
  shallowReactiveMap
1496
1498
  );
1497
1499
  }
1500
+ // @__NO_SIDE_EFFECTS__
1498
1501
  function readonly(target) {
1499
1502
  return createReactiveObject(
1500
1503
  target,
@@ -1504,6 +1507,7 @@ function readonly(target) {
1504
1507
  readonlyMap
1505
1508
  );
1506
1509
  }
1510
+ // @__NO_SIDE_EFFECTS__
1507
1511
  function shallowReadonly(target) {
1508
1512
  return createReactiveObject(
1509
1513
  target,
@@ -1542,24 +1546,29 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1542
1546
  proxyMap.set(target, proxy);
1543
1547
  return proxy;
1544
1548
  }
1549
+ // @__NO_SIDE_EFFECTS__
1545
1550
  function isReactive(value) {
1546
- if (isReadonly(value)) {
1547
- return isReactive(value["__v_raw"]);
1551
+ if (/* @__PURE__ */ isReadonly(value)) {
1552
+ return /* @__PURE__ */ isReactive(value["__v_raw"]);
1548
1553
  }
1549
1554
  return !!(value && value["__v_isReactive"]);
1550
1555
  }
1556
+ // @__NO_SIDE_EFFECTS__
1551
1557
  function isReadonly(value) {
1552
1558
  return !!(value && value["__v_isReadonly"]);
1553
1559
  }
1560
+ // @__NO_SIDE_EFFECTS__
1554
1561
  function isShallow(value) {
1555
1562
  return !!(value && value["__v_isShallow"]);
1556
1563
  }
1564
+ // @__NO_SIDE_EFFECTS__
1557
1565
  function isProxy(value) {
1558
1566
  return value ? !!value["__v_raw"] : false;
1559
1567
  }
1568
+ // @__NO_SIDE_EFFECTS__
1560
1569
  function toRaw(observed) {
1561
1570
  const raw = observed && observed["__v_raw"];
1562
- return raw ? toRaw(raw) : observed;
1571
+ return raw ? /* @__PURE__ */ toRaw(raw) : observed;
1563
1572
  }
1564
1573
  function markRaw(value) {
1565
1574
  if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
@@ -1567,20 +1576,23 @@ function markRaw(value) {
1567
1576
  }
1568
1577
  return value;
1569
1578
  }
1570
- const toReactive = (value) => isObject(value) ? reactive(value) : value;
1571
- const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1579
+ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value) : value;
1580
+ const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
1572
1581
 
1582
+ // @__NO_SIDE_EFFECTS__
1573
1583
  function isRef(r) {
1574
1584
  return r ? r["__v_isRef"] === true : false;
1575
1585
  }
1586
+ // @__NO_SIDE_EFFECTS__
1576
1587
  function ref(value) {
1577
1588
  return createRef(value, toReactive);
1578
1589
  }
1590
+ // @__NO_SIDE_EFFECTS__
1579
1591
  function shallowRef(value) {
1580
1592
  return createRef(value);
1581
1593
  }
1582
1594
  function createRef(rawValue, wrap) {
1583
- if (isRef(rawValue)) {
1595
+ if (/* @__PURE__ */ isRef(rawValue)) {
1584
1596
  return rawValue;
1585
1597
  }
1586
1598
  return new RefImpl(rawValue, wrap);
@@ -1675,7 +1687,7 @@ function trackRef(dep) {
1675
1687
  }
1676
1688
  }
1677
1689
  function unref(ref2) {
1678
- return isRef(ref2) ? ref2.value : ref2;
1690
+ return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
1679
1691
  }
1680
1692
  function toValue(source) {
1681
1693
  return isFunction(source) ? source() : unref(source);
@@ -1684,7 +1696,7 @@ const shallowUnwrapHandlers = {
1684
1696
  get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1685
1697
  set: (target, key, value, receiver) => {
1686
1698
  const oldValue = target[key];
1687
- if (isRef(oldValue) && !isRef(value)) {
1699
+ if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1688
1700
  oldValue.value = value;
1689
1701
  return true;
1690
1702
  } else {
@@ -1722,6 +1734,7 @@ class CustomRefImpl {
1722
1734
  function customRef(factory) {
1723
1735
  return new CustomRefImpl(factory);
1724
1736
  }
1737
+ // @__NO_SIDE_EFFECTS__
1725
1738
  function toRefs(object) {
1726
1739
  const ret = isArray(object) ? new Array(object.length) : {};
1727
1740
  for (const key in object) {
@@ -1754,9 +1767,9 @@ class ObjectRefImpl {
1754
1767
  return this._value = val === void 0 ? this._defaultValue : val;
1755
1768
  }
1756
1769
  set value(newVal) {
1757
- if (this._shallow && isRef(this._raw[this._key])) {
1770
+ if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
1758
1771
  const nestedRef = this._object[this._key];
1759
- if (isRef(nestedRef)) {
1772
+ if (/* @__PURE__ */ isRef(nestedRef)) {
1760
1773
  nestedRef.value = newVal;
1761
1774
  return;
1762
1775
  }
@@ -1778,15 +1791,16 @@ class GetterRefImpl {
1778
1791
  return this._value = this._getter();
1779
1792
  }
1780
1793
  }
1794
+ // @__NO_SIDE_EFFECTS__
1781
1795
  function toRef(source, key, defaultValue) {
1782
- if (isRef(source)) {
1796
+ if (/* @__PURE__ */ isRef(source)) {
1783
1797
  return source;
1784
1798
  } else if (isFunction(source)) {
1785
1799
  return new GetterRefImpl(source);
1786
1800
  } else if (isObject(source) && arguments.length > 1) {
1787
1801
  return propertyToRef(source, key, defaultValue);
1788
1802
  } else {
1789
- return ref(source);
1803
+ return /* @__PURE__ */ ref(source);
1790
1804
  }
1791
1805
  }
1792
1806
  function propertyToRef(source, key, defaultValue) {
@@ -2152,6 +2166,7 @@ class ComputedRefImpl {
2152
2166
  {
2153
2167
  setupOnTrigger(ComputedRefImpl);
2154
2168
  }
2169
+ // @__NO_SIDE_EFFECTS__
2155
2170
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2156
2171
  let getter;
2157
2172
  let setter;
@@ -4642,7 +4657,7 @@ Server rendered element contains more child nodes than client vdom.`
4642
4657
  logMismatchError();
4643
4658
  }
4644
4659
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4645
- key[0] === "." || isCustomElement) {
4660
+ key[0] === "." || isCustomElement && !isReservedProp(key)) {
4646
4661
  patchProp(el, key, null, props[key], void 0, parentComponent);
4647
4662
  }
4648
4663
  }
@@ -8163,7 +8178,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8163
8178
  optimized
8164
8179
  );
8165
8180
  } else {
8166
- const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
8181
+ const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
8167
8182
  try {
8168
8183
  if (customElement) {
8169
8184
  customElement._beginPatch();
@@ -8699,7 +8714,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8699
8714
  if (!instance.isMounted) {
8700
8715
  let vnodeHook;
8701
8716
  const { el, props } = initialVNode;
8702
- const { bm, m, parent, root, type } = instance;
8717
+ const { bm, parent, root, type } = instance;
8703
8718
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
8704
8719
  toggleRecurse(instance, false);
8705
8720
  if (bm) {
@@ -8742,8 +8757,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8742
8757
  hydrateSubTree();
8743
8758
  }
8744
8759
  } else {
8745
- if (root.ce && // @ts-expect-error _def is private
8746
- root.ce._def.shadowRoot !== false) {
8760
+ if (root.ce && root.ce._hasShadowRoot()) {
8747
8761
  root.ce._injectChildStyle(type);
8748
8762
  }
8749
8763
  {
@@ -8770,8 +8784,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8770
8784
  }
8771
8785
  initialVNode.el = subTree.el;
8772
8786
  }
8773
- if (m) {
8774
- queuePostRenderEffect(m, void 0, parentSuspense);
8787
+ if (instance.m) {
8788
+ queuePostRenderEffect(instance.m, void 0, parentSuspense);
8775
8789
  }
8776
8790
  if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
8777
8791
  const scopedInitialVNode = initialVNode;
@@ -11342,7 +11356,7 @@ function isMemoSame(cached, memo) {
11342
11356
  return true;
11343
11357
  }
11344
11358
 
11345
- const version = "3.6.0-beta.3";
11359
+ const version = "3.6.0-beta.4";
11346
11360
  const warn = warn$1 ;
11347
11361
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11348
11362
  const devtools = devtools$1 ;
@@ -11847,17 +11861,24 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
11847
11861
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11848
11862
  ).forEach((node) => setVarsOnNode(node, vars));
11849
11863
  };
11850
- const applyCssCars = () => {
11851
- const vars = getVars();
11864
+ const applyCssVars = (vars = getVars()) => {
11852
11865
  setVars(vars);
11853
11866
  updateTeleports(vars);
11854
11867
  };
11855
11868
  onBeforeUpdate(() => {
11856
- queuePostFlushCb(applyCssCars);
11869
+ queuePostFlushCb(applyCssVars);
11857
11870
  });
11858
11871
  onMounted(() => {
11859
- watch(applyCssCars, NOOP, { flush: "post" });
11860
- const ob = new MutationObserver(applyCssCars);
11872
+ watch(
11873
+ () => {
11874
+ const vars = getVars();
11875
+ extend({}, vars);
11876
+ applyCssVars(vars);
11877
+ },
11878
+ NOOP,
11879
+ { flush: "post" }
11880
+ );
11881
+ const ob = new MutationObserver(() => applyCssVars());
11861
11882
  ob.observe(getParentNode(), { childList: true });
11862
11883
  onUnmounted(() => ob.disconnect());
11863
11884
  });
@@ -12588,6 +12609,12 @@ class VueElementBase extends BaseClass {
12588
12609
  this._update();
12589
12610
  }
12590
12611
  }
12612
+ /**
12613
+ * @internal
12614
+ */
12615
+ _hasShadowRoot() {
12616
+ return this._def.shadowRoot !== false;
12617
+ }
12591
12618
  /**
12592
12619
  * @internal
12593
12620
  */