vue 3.5.21 → 3.5.22

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 v3.5.21
2
+ * vue v3.5.22
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1142,7 +1142,7 @@ function iterator(self, method, wrapValue) {
1142
1142
  iter._next = iter.next;
1143
1143
  iter.next = () => {
1144
1144
  const result = iter._next();
1145
- if (result.value) {
1145
+ if (!result.done) {
1146
1146
  result.value = wrapValue(result.value);
1147
1147
  }
1148
1148
  return result;
@@ -1269,7 +1269,8 @@ class BaseReactiveHandler {
1269
1269
  return res;
1270
1270
  }
1271
1271
  if (isRef(res)) {
1272
- return targetIsArray && isIntegerKey(key) ? res : res.value;
1272
+ const value = targetIsArray && isIntegerKey(key) ? res : res.value;
1273
+ return isReadonly2 && isObject(value) ? readonly(value) : value;
1273
1274
  }
1274
1275
  if (isObject(res)) {
1275
1276
  return isReadonly2 ? readonly(res) : reactive(res);
@@ -2619,14 +2620,11 @@ function checkRecursiveUpdates(seen, fn) {
2619
2620
  let isHmrUpdating = false;
2620
2621
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2621
2622
  {
2622
- const g = getGlobalThis();
2623
- if (!g.__VUE_HMR_RUNTIME__) {
2624
- g.__VUE_HMR_RUNTIME__ = {
2625
- createRecord: tryWrap(createRecord),
2626
- rerender: tryWrap(rerender),
2627
- reload: tryWrap(reload)
2628
- };
2629
- }
2623
+ getGlobalThis().__VUE_HMR_RUNTIME__ = {
2624
+ createRecord: tryWrap(createRecord),
2625
+ rerender: tryWrap(rerender),
2626
+ reload: tryWrap(reload)
2627
+ };
2630
2628
  }
2631
2629
  const map = /* @__PURE__ */ new Map();
2632
2630
  function registerHMR(instance) {
@@ -2993,9 +2991,6 @@ const TeleportImpl = {
2993
2991
  insert(mainAnchor, container, anchor);
2994
2992
  const mount = (container2, anchor2) => {
2995
2993
  if (shapeFlag & 16) {
2996
- if (parentComponent && parentComponent.isCE) {
2997
- parentComponent.ce._teleportTarget = container2;
2998
- }
2999
2994
  mountChildren(
3000
2995
  children,
3001
2996
  container2,
@@ -3017,6 +3012,9 @@ const TeleportImpl = {
3017
3012
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
3018
3013
  namespace = "mathml";
3019
3014
  }
3015
+ if (parentComponent && parentComponent.isCE) {
3016
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3017
+ }
3020
3018
  if (!disabled) {
3021
3019
  mount(target, targetAnchor);
3022
3020
  updateCssVars(n2, false);
@@ -5182,12 +5180,13 @@ function createSlots(slots, dynamicSlots) {
5182
5180
 
5183
5181
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5184
5182
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5183
+ const hasProps = Object.keys(props).length > 0;
5185
5184
  if (name !== "default") props.name = name;
5186
5185
  return openBlock(), createBlock(
5187
5186
  Fragment,
5188
5187
  null,
5189
5188
  [createVNode("slot", props, fallback && fallback())],
5190
- 64
5189
+ hasProps ? -2 : 64
5191
5190
  );
5192
5191
  }
5193
5192
  let slot = slots[name];
@@ -10362,31 +10361,28 @@ const computed = (getterOrOptions, debugOptions) => {
10362
10361
  };
10363
10362
 
10364
10363
  function h(type, propsOrChildren, children) {
10365
- const doCreateVNode = (type2, props, children2) => {
10364
+ try {
10366
10365
  setBlockTracking(-1);
10367
- try {
10368
- return createVNode(type2, props, children2);
10369
- } finally {
10370
- setBlockTracking(1);
10371
- }
10372
- };
10373
- const l = arguments.length;
10374
- if (l === 2) {
10375
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10376
- if (isVNode(propsOrChildren)) {
10377
- return doCreateVNode(type, null, [propsOrChildren]);
10366
+ const l = arguments.length;
10367
+ if (l === 2) {
10368
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10369
+ if (isVNode(propsOrChildren)) {
10370
+ return createVNode(type, null, [propsOrChildren]);
10371
+ }
10372
+ return createVNode(type, propsOrChildren);
10373
+ } else {
10374
+ return createVNode(type, null, propsOrChildren);
10378
10375
  }
10379
- return doCreateVNode(type, propsOrChildren);
10380
10376
  } else {
10381
- return doCreateVNode(type, null, propsOrChildren);
10382
- }
10383
- } else {
10384
- if (l > 3) {
10385
- children = Array.prototype.slice.call(arguments, 2);
10386
- } else if (l === 3 && isVNode(children)) {
10387
- children = [children];
10377
+ if (l > 3) {
10378
+ children = Array.prototype.slice.call(arguments, 2);
10379
+ } else if (l === 3 && isVNode(children)) {
10380
+ children = [children];
10381
+ }
10382
+ return createVNode(type, propsOrChildren, children);
10388
10383
  }
10389
- return doCreateVNode(type, propsOrChildren, children);
10384
+ } finally {
10385
+ setBlockTracking(1);
10390
10386
  }
10391
10387
  }
10392
10388
 
@@ -10596,7 +10592,7 @@ function isMemoSame(cached, memo) {
10596
10592
  return true;
10597
10593
  }
10598
10594
 
10599
- const version = "3.5.21";
10595
+ const version = "3.5.22";
10600
10596
  const warn = warn$1 ;
10601
10597
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10602
10598
  const devtools = devtools$1 ;
@@ -10825,11 +10821,11 @@ function resolveTransitionProps(rawProps) {
10825
10821
  const resolve = () => finishLeave(el, done);
10826
10822
  addTransitionClass(el, leaveFromClass);
10827
10823
  if (!el._enterCancelled) {
10828
- forceReflow();
10824
+ forceReflow(el);
10829
10825
  addTransitionClass(el, leaveActiveClass);
10830
10826
  } else {
10831
10827
  addTransitionClass(el, leaveActiveClass);
10832
- forceReflow();
10828
+ forceReflow(el);
10833
10829
  }
10834
10830
  nextFrame(() => {
10835
10831
  if (!el._isLeaving) {
@@ -10975,8 +10971,9 @@ function toMs(s) {
10975
10971
  if (s === "auto") return 0;
10976
10972
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
10977
10973
  }
10978
- function forceReflow() {
10979
- return document.body.offsetHeight;
10974
+ function forceReflow(el) {
10975
+ const targetDocument = el ? el.ownerDocument : document;
10976
+ return targetDocument.body.offsetHeight;
10980
10977
  }
10981
10978
 
10982
10979
  function patchClass(el, value, isSVG) {
@@ -11489,7 +11486,11 @@ class VueElement extends BaseClass {
11489
11486
  );
11490
11487
  }
11491
11488
  if (_def.shadowRoot !== false) {
11492
- this.attachShadow({ mode: "open" });
11489
+ this.attachShadow(
11490
+ extend({}, _def.shadowRootOptions, {
11491
+ mode: "open"
11492
+ })
11493
+ );
11493
11494
  this._root = this.shadowRoot;
11494
11495
  } else {
11495
11496
  this._root = this;
@@ -11549,9 +11550,18 @@ class VueElement extends BaseClass {
11549
11550
  this._app && this._app.unmount();
11550
11551
  if (this._instance) this._instance.ce = void 0;
11551
11552
  this._app = this._instance = null;
11553
+ if (this._teleportTargets) {
11554
+ this._teleportTargets.clear();
11555
+ this._teleportTargets = void 0;
11556
+ }
11552
11557
  }
11553
11558
  });
11554
11559
  }
11560
+ _processMutations(mutations) {
11561
+ for (const m of mutations) {
11562
+ this._setAttr(m.attributeName);
11563
+ }
11564
+ }
11555
11565
  /**
11556
11566
  * resolve inner component definition (handle possible async component)
11557
11567
  */
@@ -11562,11 +11572,7 @@ class VueElement extends BaseClass {
11562
11572
  for (let i = 0; i < this.attributes.length; i++) {
11563
11573
  this._setAttr(this.attributes[i].name);
11564
11574
  }
11565
- this._ob = new MutationObserver((mutations) => {
11566
- for (const m of mutations) {
11567
- this._setAttr(m.attributeName);
11568
- }
11569
- });
11575
+ this._ob = new MutationObserver(this._processMutations.bind(this));
11570
11576
  this._ob.observe(this, { attributes: true });
11571
11577
  const resolve = (def, isAsync = false) => {
11572
11578
  this._resolved = true;
@@ -11682,7 +11688,10 @@ class VueElement extends BaseClass {
11682
11688
  }
11683
11689
  if (shouldReflect) {
11684
11690
  const ob = this._ob;
11685
- ob && ob.disconnect();
11691
+ if (ob) {
11692
+ this._processMutations(ob.takeRecords());
11693
+ ob.disconnect();
11694
+ }
11686
11695
  if (val === true) {
11687
11696
  this.setAttribute(hyphenate(key), "");
11688
11697
  } else if (typeof val === "string" || typeof val === "number") {
@@ -11786,7 +11795,7 @@ class VueElement extends BaseClass {
11786
11795
  * Only called when shadowRoot is false
11787
11796
  */
11788
11797
  _renderSlots() {
11789
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
11798
+ const outlets = this._getSlots();
11790
11799
  const scopeId = this._instance.type.__scopeId;
11791
11800
  for (let i = 0; i < outlets.length; i++) {
11792
11801
  const o = outlets[i];
@@ -11812,6 +11821,19 @@ class VueElement extends BaseClass {
11812
11821
  parent.removeChild(o);
11813
11822
  }
11814
11823
  }
11824
+ /**
11825
+ * @internal
11826
+ */
11827
+ _getSlots() {
11828
+ const roots = [this];
11829
+ if (this._teleportTargets) {
11830
+ roots.push(...this._teleportTargets);
11831
+ }
11832
+ return roots.reduce((res, i) => {
11833
+ res.push(...Array.from(i.querySelectorAll("slot")));
11834
+ return res;
11835
+ }, []);
11836
+ }
11815
11837
  /**
11816
11838
  * @internal
11817
11839
  */
@@ -11913,7 +11935,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11913
11935
  prevChildren.forEach(callPendingCbs);
11914
11936
  prevChildren.forEach(recordPosition);
11915
11937
  const movedChildren = prevChildren.filter(applyTranslation);
11916
- forceReflow();
11938
+ forceReflow(instance.vnode.el);
11917
11939
  movedChildren.forEach((c) => {
11918
11940
  const el = c.el;
11919
11941
  const style = el.style;