vue 3.4.24 → 3.4.26

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.4.24
2
+ * vue v3.4.26
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.4.24
2
+ * vue v3.4.26
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -84,10 +84,11 @@ var Vue = (function (exports) {
84
84
  fns[i](arg);
85
85
  }
86
86
  };
87
- const def = (obj, key, value) => {
87
+ const def = (obj, key, value, writable = false) => {
88
88
  Object.defineProperty(obj, key, {
89
89
  configurable: true,
90
90
  enumerable: false,
91
+ writable,
91
92
  value
92
93
  });
93
94
  };
@@ -544,11 +545,10 @@ var Vue = (function (exports) {
544
545
  }
545
546
  }
546
547
  stop() {
547
- var _a;
548
548
  if (this.active) {
549
549
  preCleanupEffect(this);
550
550
  postCleanupEffect(this);
551
- (_a = this.onStop) == null ? void 0 : _a.call(this);
551
+ this.onStop && this.onStop();
552
552
  this.active = false;
553
553
  }
554
554
  }
@@ -761,8 +761,8 @@ var Vue = (function (exports) {
761
761
  resetScheduling();
762
762
  }
763
763
  function getDepFromReactive(object, key) {
764
- var _a;
765
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
764
+ const depsMap = targetMap.get(object);
765
+ return depsMap && depsMap.get(key);
766
766
  }
767
767
 
768
768
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
@@ -2478,7 +2478,7 @@ getter: `, this.getter);
2478
2478
  true ? {
2479
2479
  get attrs() {
2480
2480
  markAttrsAccessed();
2481
- return attrs;
2481
+ return shallowReadonly(attrs);
2482
2482
  },
2483
2483
  slots,
2484
2484
  emit
@@ -2511,7 +2511,7 @@ getter: `, this.getter);
2511
2511
  propsOptions
2512
2512
  );
2513
2513
  }
2514
- root = cloneVNode(root, fallthroughAttrs);
2514
+ root = cloneVNode(root, fallthroughAttrs, false, true);
2515
2515
  } else if (!accessedAttrs && root.type !== Comment) {
2516
2516
  const allAttrs = Object.keys(attrs);
2517
2517
  const eventAttrs = [];
@@ -2545,7 +2545,7 @@ getter: `, this.getter);
2545
2545
  `Runtime directive used on component with non-element root node. The directives will not function as intended.`
2546
2546
  );
2547
2547
  }
2548
- root = cloneVNode(root);
2548
+ root = cloneVNode(root, null, false, true);
2549
2549
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2550
2550
  }
2551
2551
  if (vnode.transition) {
@@ -3036,7 +3036,7 @@ If this is a native custom element, make sure to exclude it from component resol
3036
3036
  let parentSuspenseId;
3037
3037
  const isSuspensible = isVNodeSuspensible(vnode);
3038
3038
  if (isSuspensible) {
3039
- if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
3039
+ if (parentSuspense && parentSuspense.pendingBranch) {
3040
3040
  parentSuspenseId = parentSuspense.pendingId;
3041
3041
  parentSuspense.deps++;
3042
3042
  }
@@ -3348,8 +3348,8 @@ If this is a native custom element, make sure to exclude it from component resol
3348
3348
  }
3349
3349
  }
3350
3350
  function isVNodeSuspensible(vnode) {
3351
- var _a;
3352
- return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3351
+ const suspensible = vnode.props && vnode.props.suspensible;
3352
+ return suspensible != null && suspensible !== false;
3353
3353
  }
3354
3354
 
3355
3355
  const ssrContextKey = Symbol.for("v-scx");
@@ -3576,34 +3576,29 @@ If this is a native custom element, make sure to exclude it from component resol
3576
3576
  return cur;
3577
3577
  };
3578
3578
  }
3579
- function traverse(value, depth, currentDepth = 0, seen) {
3580
- if (!isObject(value) || value["__v_skip"]) {
3579
+ function traverse(value, depth = Infinity, seen) {
3580
+ if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
3581
3581
  return value;
3582
3582
  }
3583
- if (depth && depth > 0) {
3584
- if (currentDepth >= depth) {
3585
- return value;
3586
- }
3587
- currentDepth++;
3588
- }
3589
3583
  seen = seen || /* @__PURE__ */ new Set();
3590
3584
  if (seen.has(value)) {
3591
3585
  return value;
3592
3586
  }
3593
3587
  seen.add(value);
3588
+ depth--;
3594
3589
  if (isRef(value)) {
3595
- traverse(value.value, depth, currentDepth, seen);
3590
+ traverse(value.value, depth, seen);
3596
3591
  } else if (isArray(value)) {
3597
3592
  for (let i = 0; i < value.length; i++) {
3598
- traverse(value[i], depth, currentDepth, seen);
3593
+ traverse(value[i], depth, seen);
3599
3594
  }
3600
3595
  } else if (isSet(value) || isMap(value)) {
3601
3596
  value.forEach((v) => {
3602
- traverse(v, depth, currentDepth, seen);
3597
+ traverse(v, depth, seen);
3603
3598
  });
3604
3599
  } else if (isPlainObject(value)) {
3605
3600
  for (const key in value) {
3606
- traverse(value[key], depth, currentDepth, seen);
3601
+ traverse(value[key], depth, seen);
3607
3602
  }
3608
3603
  }
3609
3604
  return value;
@@ -3761,7 +3756,7 @@ If this is a native custom element, make sure to exclude it from component resol
3761
3756
  instance
3762
3757
  );
3763
3758
  setTransitionHooks(oldInnerChild, leavingHooks);
3764
- if (mode === "out-in") {
3759
+ if (mode === "out-in" && innerChild.type !== Comment) {
3765
3760
  state.isLeaving = true;
3766
3761
  leavingHooks.afterLeave = () => {
3767
3762
  state.isLeaving = false;
@@ -3953,11 +3948,13 @@ If this is a native custom element, make sure to exclude it from component resol
3953
3948
  return vnode.component.subTree;
3954
3949
  }
3955
3950
  const { shapeFlag, children } = vnode;
3956
- if (shapeFlag & 16) {
3957
- return children[0];
3958
- }
3959
- if (shapeFlag & 32 && isFunction(children.default)) {
3960
- return children.default();
3951
+ if (children) {
3952
+ if (shapeFlag & 16) {
3953
+ return children[0];
3954
+ }
3955
+ if (shapeFlag & 32 && isFunction(children.default)) {
3956
+ return children.default();
3957
+ }
3961
3958
  }
3962
3959
  }
3963
3960
  function setTransitionHooks(vnode, hooks) {
@@ -4274,7 +4271,7 @@ If this is a native custom element, make sure to exclude it from component resol
4274
4271
  return () => {
4275
4272
  pendingCacheKey = null;
4276
4273
  if (!slots.default) {
4277
- return current = null;
4274
+ return null;
4278
4275
  }
4279
4276
  const children = slots.default();
4280
4277
  const rawVNode = children[0];
@@ -5557,7 +5554,7 @@ If you want to remount the same app, move your app creation logic into a factory
5557
5554
  return !!(currentInstance || currentRenderingInstance || currentApp);
5558
5555
  }
5559
5556
 
5560
- const internalObjectProto = /* @__PURE__ */ Object.create(null);
5557
+ const internalObjectProto = {};
5561
5558
  const createInternalObject = () => Object.create(internalObjectProto);
5562
5559
  const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
5563
5560
 
@@ -6015,7 +6012,7 @@ If you want to remount the same app, move your app creation logic into a factory
6015
6012
  const type = children._;
6016
6013
  if (type) {
6017
6014
  extend(slots, children);
6018
- def(slots, "_", type);
6015
+ def(slots, "_", type, true);
6019
6016
  } else {
6020
6017
  normalizeObjectSlots(children, slots);
6021
6018
  }
@@ -8762,8 +8759,8 @@ Component that was made reactive: `,
8762
8759
  return null;
8763
8760
  return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
8764
8761
  }
8765
- function cloneVNode(vnode, extraProps, mergeRef = false) {
8766
- const { props, ref, patchFlag, children } = vnode;
8762
+ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
8763
+ const { props, ref, patchFlag, children, transition } = vnode;
8767
8764
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
8768
8765
  const cloned = {
8769
8766
  __v_isVNode: true,
@@ -8793,7 +8790,7 @@ Component that was made reactive: `,
8793
8790
  dynamicChildren: vnode.dynamicChildren,
8794
8791
  appContext: vnode.appContext,
8795
8792
  dirs: vnode.dirs,
8796
- transition: vnode.transition,
8793
+ transition,
8797
8794
  // These should technically only be non-null on mounted VNodes. However,
8798
8795
  // they *should* be copied for kept-alive vnodes. So we just always copy
8799
8796
  // them since them being non-null during a mount doesn't affect the logic as
@@ -8807,6 +8804,9 @@ Component that was made reactive: `,
8807
8804
  ctx: vnode.ctx,
8808
8805
  ce: vnode.ce
8809
8806
  };
8807
+ if (transition && cloneTransition) {
8808
+ cloned.transition = transition.clone(cloned);
8809
+ }
8810
8810
  return cloned;
8811
8811
  }
8812
8812
  function deepCloneVNode(vnode) {
@@ -9614,7 +9614,7 @@ Component that was made reactive: `,
9614
9614
  return true;
9615
9615
  }
9616
9616
 
9617
- const version = "3.4.24";
9617
+ const version = "3.4.26";
9618
9618
  const warn = warn$1 ;
9619
9619
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9620
9620
  const devtools = devtools$1 ;
@@ -12634,11 +12634,10 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
12634
12634
  }
12635
12635
  },
12636
12636
  onselfclosingtag(end) {
12637
- var _a;
12638
12637
  const name = currentOpenTag.tag;
12639
12638
  currentOpenTag.isSelfClosing = true;
12640
12639
  endOpenTag(end);
12641
- if (((_a = stack[0]) == null ? void 0 : _a.tag) === name) {
12640
+ if (stack[0] && stack[0].tag === name) {
12642
12641
  onCloseTag(stack.shift(), end);
12643
12642
  }
12644
12643
  },
@@ -12939,16 +12938,15 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
12939
12938
  currentOpenTag = null;
12940
12939
  }
12941
12940
  function onText(content, start, end) {
12942
- var _a;
12943
12941
  {
12944
- const tag = (_a = stack[0]) == null ? void 0 : _a.tag;
12942
+ const tag = stack[0] && stack[0].tag;
12945
12943
  if (tag !== "script" && tag !== "style" && content.includes("&")) {
12946
12944
  content = currentOptions.decodeEntities(content, false);
12947
12945
  }
12948
12946
  }
12949
12947
  const parent = stack[0] || currentRoot;
12950
12948
  const lastNode = parent.children[parent.children.length - 1];
12951
- if ((lastNode == null ? void 0 : lastNode.type) === 2) {
12949
+ if (lastNode && lastNode.type === 2) {
12952
12950
  lastNode.content += content;
12953
12951
  setLocEnd(lastNode.loc, end);
12954
12952
  } else {
@@ -13024,11 +13022,10 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13024
13022
  return false;
13025
13023
  }
13026
13024
  function isComponent({ tag, props }) {
13027
- var _a;
13028
13025
  if (currentOptions.isCustomElement(tag)) {
13029
13026
  return false;
13030
13027
  }
13031
- if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || ((_a = currentOptions.isBuiltInComponent) == null ? void 0 : _a.call(currentOptions, tag)) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
13028
+ if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
13032
13029
  return true;
13033
13030
  }
13034
13031
  for (let i = 0; i < props.length; i++) {
@@ -13048,7 +13045,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13048
13045
  }
13049
13046
  const windowsNewlineRE = /\r\n/g;
13050
13047
  function condenseWhitespace(nodes, tag) {
13051
- var _a, _b;
13052
13048
  const shouldCondense = currentOptions.whitespace !== "preserve";
13053
13049
  let removedWhitespace = false;
13054
13050
  for (let i = 0; i < nodes.length; i++) {
@@ -13056,8 +13052,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13056
13052
  if (node.type === 2) {
13057
13053
  if (!inPre) {
13058
13054
  if (isAllWhitespace(node.content)) {
13059
- const prev = (_a = nodes[i - 1]) == null ? void 0 : _a.type;
13060
- const next = (_b = nodes[i + 1]) == null ? void 0 : _b.type;
13055
+ const prev = nodes[i - 1] && nodes[i - 1].type;
13056
+ const next = nodes[i + 1] && nodes[i + 1].type;
13061
13057
  if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
13062
13058
  removedWhitespace = true;
13063
13059
  nodes[i] = null;
@@ -13195,7 +13191,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13195
13191
  }
13196
13192
  tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
13197
13193
  tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
13198
- const delimiters = options == null ? void 0 : options.delimiters;
13194
+ const delimiters = options && options.delimiters;
13199
13195
  if (delimiters) {
13200
13196
  tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
13201
13197
  tokenizer.delimiterClose = toCharCodes(delimiters[1]);