@vue/compat 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/compat v3.5.21
2
+ * @vue/compat 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) {
@@ -3521,9 +3519,6 @@ const TeleportImpl = {
3521
3519
  insert(mainAnchor, container, anchor);
3522
3520
  const mount = (container2, anchor2) => {
3523
3521
  if (shapeFlag & 16) {
3524
- if (parentComponent && parentComponent.isCE) {
3525
- parentComponent.ce._teleportTarget = container2;
3526
- }
3527
3522
  mountChildren(
3528
3523
  children,
3529
3524
  container2,
@@ -3545,6 +3540,9 @@ const TeleportImpl = {
3545
3540
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
3546
3541
  namespace = "mathml";
3547
3542
  }
3543
+ if (parentComponent && parentComponent.isCE) {
3544
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3545
+ }
3548
3546
  if (!disabled) {
3549
3547
  mount(target, targetAnchor);
3550
3548
  updateCssVars(n2, false);
@@ -6004,12 +6002,13 @@ function createSlots(slots, dynamicSlots) {
6004
6002
 
6005
6003
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6006
6004
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6005
+ const hasProps = Object.keys(props).length > 0;
6007
6006
  if (name !== "default") props.name = name;
6008
6007
  return openBlock(), createBlock(
6009
6008
  Fragment,
6010
6009
  null,
6011
6010
  [createVNode("slot", props, fallback && fallback())],
6012
- 64
6011
+ hasProps ? -2 : 64
6013
6012
  );
6014
6013
  }
6015
6014
  let slot = slots[name];
@@ -7200,7 +7199,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7200
7199
  return vm;
7201
7200
  }
7202
7201
  }
7203
- Vue.version = `2.6.14-compat:${"3.5.21"}`;
7202
+ Vue.version = `2.6.14-compat:${"3.5.22"}`;
7204
7203
  Vue.config = singletonApp.config;
7205
7204
  Vue.use = (plugin, ...options) => {
7206
7205
  if (plugin && isFunction(plugin.install)) {
@@ -12125,31 +12124,28 @@ const computed = (getterOrOptions, debugOptions) => {
12125
12124
  };
12126
12125
 
12127
12126
  function h(type, propsOrChildren, children) {
12128
- const doCreateVNode = (type2, props, children2) => {
12127
+ try {
12129
12128
  setBlockTracking(-1);
12130
- try {
12131
- return createVNode(type2, props, children2);
12132
- } finally {
12133
- setBlockTracking(1);
12134
- }
12135
- };
12136
- const l = arguments.length;
12137
- if (l === 2) {
12138
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
12139
- if (isVNode(propsOrChildren)) {
12140
- return doCreateVNode(type, null, [propsOrChildren]);
12129
+ const l = arguments.length;
12130
+ if (l === 2) {
12131
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
12132
+ if (isVNode(propsOrChildren)) {
12133
+ return createVNode(type, null, [propsOrChildren]);
12134
+ }
12135
+ return createVNode(type, propsOrChildren);
12136
+ } else {
12137
+ return createVNode(type, null, propsOrChildren);
12141
12138
  }
12142
- return doCreateVNode(type, propsOrChildren);
12143
12139
  } else {
12144
- return doCreateVNode(type, null, propsOrChildren);
12145
- }
12146
- } else {
12147
- if (l > 3) {
12148
- children = Array.prototype.slice.call(arguments, 2);
12149
- } else if (l === 3 && isVNode(children)) {
12150
- children = [children];
12140
+ if (l > 3) {
12141
+ children = Array.prototype.slice.call(arguments, 2);
12142
+ } else if (l === 3 && isVNode(children)) {
12143
+ children = [children];
12144
+ }
12145
+ return createVNode(type, propsOrChildren, children);
12151
12146
  }
12152
- return doCreateVNode(type, propsOrChildren, children);
12147
+ } finally {
12148
+ setBlockTracking(1);
12153
12149
  }
12154
12150
  }
12155
12151
 
@@ -12359,7 +12355,7 @@ function isMemoSame(cached, memo) {
12359
12355
  return true;
12360
12356
  }
12361
12357
 
12362
- const version = "3.5.21";
12358
+ const version = "3.5.22";
12363
12359
  const warn = warn$1 ;
12364
12360
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12365
12361
  const devtools = devtools$1 ;
@@ -12629,11 +12625,11 @@ function resolveTransitionProps(rawProps) {
12629
12625
  addTransitionClass(el, legacyLeaveFromClass);
12630
12626
  }
12631
12627
  if (!el._enterCancelled) {
12632
- forceReflow();
12628
+ forceReflow(el);
12633
12629
  addTransitionClass(el, leaveActiveClass);
12634
12630
  } else {
12635
12631
  addTransitionClass(el, leaveActiveClass);
12636
- forceReflow();
12632
+ forceReflow(el);
12637
12633
  }
12638
12634
  nextFrame(() => {
12639
12635
  if (!el._isLeaving) {
@@ -12782,8 +12778,9 @@ function toMs(s) {
12782
12778
  if (s === "auto") return 0;
12783
12779
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
12784
12780
  }
12785
- function forceReflow() {
12786
- return document.body.offsetHeight;
12781
+ function forceReflow(el) {
12782
+ const targetDocument = el ? el.ownerDocument : document;
12783
+ return targetDocument.body.offsetHeight;
12787
12784
  }
12788
12785
 
12789
12786
  function patchClass(el, value, isSVG) {
@@ -13340,7 +13337,11 @@ class VueElement extends BaseClass {
13340
13337
  );
13341
13338
  }
13342
13339
  if (_def.shadowRoot !== false) {
13343
- this.attachShadow({ mode: "open" });
13340
+ this.attachShadow(
13341
+ extend({}, _def.shadowRootOptions, {
13342
+ mode: "open"
13343
+ })
13344
+ );
13344
13345
  this._root = this.shadowRoot;
13345
13346
  } else {
13346
13347
  this._root = this;
@@ -13400,9 +13401,18 @@ class VueElement extends BaseClass {
13400
13401
  this._app && this._app.unmount();
13401
13402
  if (this._instance) this._instance.ce = void 0;
13402
13403
  this._app = this._instance = null;
13404
+ if (this._teleportTargets) {
13405
+ this._teleportTargets.clear();
13406
+ this._teleportTargets = void 0;
13407
+ }
13403
13408
  }
13404
13409
  });
13405
13410
  }
13411
+ _processMutations(mutations) {
13412
+ for (const m of mutations) {
13413
+ this._setAttr(m.attributeName);
13414
+ }
13415
+ }
13406
13416
  /**
13407
13417
  * resolve inner component definition (handle possible async component)
13408
13418
  */
@@ -13413,11 +13423,7 @@ class VueElement extends BaseClass {
13413
13423
  for (let i = 0; i < this.attributes.length; i++) {
13414
13424
  this._setAttr(this.attributes[i].name);
13415
13425
  }
13416
- this._ob = new MutationObserver((mutations) => {
13417
- for (const m of mutations) {
13418
- this._setAttr(m.attributeName);
13419
- }
13420
- });
13426
+ this._ob = new MutationObserver(this._processMutations.bind(this));
13421
13427
  this._ob.observe(this, { attributes: true });
13422
13428
  const resolve = (def, isAsync = false) => {
13423
13429
  this._resolved = true;
@@ -13533,7 +13539,10 @@ class VueElement extends BaseClass {
13533
13539
  }
13534
13540
  if (shouldReflect) {
13535
13541
  const ob = this._ob;
13536
- ob && ob.disconnect();
13542
+ if (ob) {
13543
+ this._processMutations(ob.takeRecords());
13544
+ ob.disconnect();
13545
+ }
13537
13546
  if (val === true) {
13538
13547
  this.setAttribute(hyphenate(key), "");
13539
13548
  } else if (typeof val === "string" || typeof val === "number") {
@@ -13637,7 +13646,7 @@ class VueElement extends BaseClass {
13637
13646
  * Only called when shadowRoot is false
13638
13647
  */
13639
13648
  _renderSlots() {
13640
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
13649
+ const outlets = this._getSlots();
13641
13650
  const scopeId = this._instance.type.__scopeId;
13642
13651
  for (let i = 0; i < outlets.length; i++) {
13643
13652
  const o = outlets[i];
@@ -13663,6 +13672,19 @@ class VueElement extends BaseClass {
13663
13672
  parent.removeChild(o);
13664
13673
  }
13665
13674
  }
13675
+ /**
13676
+ * @internal
13677
+ */
13678
+ _getSlots() {
13679
+ const roots = [this];
13680
+ if (this._teleportTargets) {
13681
+ roots.push(...this._teleportTargets);
13682
+ }
13683
+ return roots.reduce((res, i) => {
13684
+ res.push(...Array.from(i.querySelectorAll("slot")));
13685
+ return res;
13686
+ }, []);
13687
+ }
13666
13688
  /**
13667
13689
  * @internal
13668
13690
  */
@@ -13767,7 +13789,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13767
13789
  prevChildren.forEach(callPendingCbs);
13768
13790
  prevChildren.forEach(recordPosition);
13769
13791
  const movedChildren = prevChildren.filter(applyTranslation);
13770
- forceReflow();
13792
+ forceReflow(instance.vnode.el);
13771
13793
  movedChildren.forEach((c) => {
13772
13794
  const el = c.el;
13773
13795
  const style = el.style;