vue 3.4.25 → 3.4.27

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.4.25
2
+ * vue v3.4.27
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.25
2
+ * vue v3.4.27
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.25
2
+ * vue v3.4.27
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -81,10 +81,11 @@ const invokeArrayFns = (fns, arg) => {
81
81
  fns[i](arg);
82
82
  }
83
83
  };
84
- const def = (obj, key, value) => {
84
+ const def = (obj, key, value, writable = false) => {
85
85
  Object.defineProperty(obj, key, {
86
86
  configurable: true,
87
87
  enumerable: false,
88
+ writable,
88
89
  value
89
90
  });
90
91
  };
@@ -204,8 +205,8 @@ function stringifyStyle(styles) {
204
205
  }
205
206
  for (const key in styles) {
206
207
  const value = styles[key];
207
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
208
208
  if (isString(value) || typeof value === "number") {
209
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
209
210
  ret += `${normalizedKey}:${value};`;
210
211
  }
211
212
  }
@@ -541,11 +542,10 @@ class ReactiveEffect {
541
542
  }
542
543
  }
543
544
  stop() {
544
- var _a;
545
545
  if (this.active) {
546
546
  preCleanupEffect(this);
547
547
  postCleanupEffect(this);
548
- (_a = this.onStop) == null ? void 0 : _a.call(this);
548
+ this.onStop && this.onStop();
549
549
  this.active = false;
550
550
  }
551
551
  }
@@ -758,8 +758,8 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
758
758
  resetScheduling();
759
759
  }
760
760
  function getDepFromReactive(object, key) {
761
- var _a;
762
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
761
+ const depsMap = targetMap.get(object);
762
+ return depsMap && depsMap.get(key);
763
763
  }
764
764
 
765
765
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
@@ -2475,7 +2475,7 @@ function renderComponentRoot(instance) {
2475
2475
  true ? {
2476
2476
  get attrs() {
2477
2477
  markAttrsAccessed();
2478
- return attrs;
2478
+ return shallowReadonly(attrs);
2479
2479
  },
2480
2480
  slots,
2481
2481
  emit
@@ -2508,7 +2508,7 @@ function renderComponentRoot(instance) {
2508
2508
  propsOptions
2509
2509
  );
2510
2510
  }
2511
- root = cloneVNode(root, fallthroughAttrs);
2511
+ root = cloneVNode(root, fallthroughAttrs, false, true);
2512
2512
  } else if (!accessedAttrs && root.type !== Comment) {
2513
2513
  const allAttrs = Object.keys(attrs);
2514
2514
  const eventAttrs = [];
@@ -2542,7 +2542,7 @@ function renderComponentRoot(instance) {
2542
2542
  `Runtime directive used on component with non-element root node. The directives will not function as intended.`
2543
2543
  );
2544
2544
  }
2545
- root = cloneVNode(root);
2545
+ root = cloneVNode(root, null, false, true);
2546
2546
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2547
2547
  }
2548
2548
  if (vnode.transition) {
@@ -3033,7 +3033,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3033
3033
  let parentSuspenseId;
3034
3034
  const isSuspensible = isVNodeSuspensible(vnode);
3035
3035
  if (isSuspensible) {
3036
- if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
3036
+ if (parentSuspense && parentSuspense.pendingBranch) {
3037
3037
  parentSuspenseId = parentSuspense.pendingId;
3038
3038
  parentSuspense.deps++;
3039
3039
  }
@@ -3345,8 +3345,8 @@ function setActiveBranch(suspense, branch) {
3345
3345
  }
3346
3346
  }
3347
3347
  function isVNodeSuspensible(vnode) {
3348
- var _a;
3349
- return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3348
+ const suspensible = vnode.props && vnode.props.suspensible;
3349
+ return suspensible != null && suspensible !== false;
3350
3350
  }
3351
3351
 
3352
3352
  const ssrContextKey = Symbol.for("v-scx");
@@ -3579,34 +3579,29 @@ function createPathGetter(ctx, path) {
3579
3579
  return cur;
3580
3580
  };
3581
3581
  }
3582
- function traverse(value, depth, currentDepth = 0, seen) {
3583
- if (!isObject(value) || value["__v_skip"]) {
3582
+ function traverse(value, depth = Infinity, seen) {
3583
+ if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
3584
3584
  return value;
3585
3585
  }
3586
- if (depth && depth > 0) {
3587
- if (currentDepth >= depth) {
3588
- return value;
3589
- }
3590
- currentDepth++;
3591
- }
3592
3586
  seen = seen || /* @__PURE__ */ new Set();
3593
3587
  if (seen.has(value)) {
3594
3588
  return value;
3595
3589
  }
3596
3590
  seen.add(value);
3591
+ depth--;
3597
3592
  if (isRef(value)) {
3598
- traverse(value.value, depth, currentDepth, seen);
3593
+ traverse(value.value, depth, seen);
3599
3594
  } else if (isArray(value)) {
3600
3595
  for (let i = 0; i < value.length; i++) {
3601
- traverse(value[i], depth, currentDepth, seen);
3596
+ traverse(value[i], depth, seen);
3602
3597
  }
3603
3598
  } else if (isSet(value) || isMap(value)) {
3604
3599
  value.forEach((v) => {
3605
- traverse(v, depth, currentDepth, seen);
3600
+ traverse(v, depth, seen);
3606
3601
  });
3607
3602
  } else if (isPlainObject(value)) {
3608
3603
  for (const key in value) {
3609
- traverse(value[key], depth, currentDepth, seen);
3604
+ traverse(value[key], depth, seen);
3610
3605
  }
3611
3606
  }
3612
3607
  return value;
@@ -3764,7 +3759,7 @@ const BaseTransitionImpl = {
3764
3759
  instance
3765
3760
  );
3766
3761
  setTransitionHooks(oldInnerChild, leavingHooks);
3767
- if (mode === "out-in") {
3762
+ if (mode === "out-in" && innerChild.type !== Comment) {
3768
3763
  state.isLeaving = true;
3769
3764
  leavingHooks.afterLeave = () => {
3770
3765
  state.isLeaving = false;
@@ -4279,7 +4274,7 @@ const KeepAliveImpl = {
4279
4274
  return () => {
4280
4275
  pendingCacheKey = null;
4281
4276
  if (!slots.default) {
4282
- return current = null;
4277
+ return null;
4283
4278
  }
4284
4279
  const children = slots.default();
4285
4280
  const rawVNode = children[0];
@@ -6020,7 +6015,7 @@ const initSlots = (instance, children) => {
6020
6015
  const type = children._;
6021
6016
  if (type) {
6022
6017
  extend(slots, children);
6023
- def(slots, "_", type);
6018
+ def(slots, "_", type, true);
6024
6019
  } else {
6025
6020
  normalizeObjectSlots(children, slots);
6026
6021
  }
@@ -6634,7 +6629,7 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
6634
6629
  mismatchType = mismatchKey = `class`;
6635
6630
  }
6636
6631
  } else if (key === "style") {
6637
- actual = el.getAttribute("style");
6632
+ actual = el.getAttribute("style") || "";
6638
6633
  expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
6639
6634
  const actualMap = toStyleMap(actual);
6640
6635
  const expectedMap = toStyleMap(expected);
@@ -8767,8 +8762,8 @@ function guardReactiveProps(props) {
8767
8762
  return null;
8768
8763
  return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
8769
8764
  }
8770
- function cloneVNode(vnode, extraProps, mergeRef = false) {
8771
- const { props, ref, patchFlag, children } = vnode;
8765
+ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
8766
+ const { props, ref, patchFlag, children, transition } = vnode;
8772
8767
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
8773
8768
  const cloned = {
8774
8769
  __v_isVNode: true,
@@ -8798,7 +8793,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
8798
8793
  dynamicChildren: vnode.dynamicChildren,
8799
8794
  appContext: vnode.appContext,
8800
8795
  dirs: vnode.dirs,
8801
- transition: vnode.transition,
8796
+ transition,
8802
8797
  // These should technically only be non-null on mounted VNodes. However,
8803
8798
  // they *should* be copied for kept-alive vnodes. So we just always copy
8804
8799
  // them since them being non-null during a mount doesn't affect the logic as
@@ -8812,6 +8807,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
8812
8807
  ctx: vnode.ctx,
8813
8808
  ce: vnode.ce
8814
8809
  };
8810
+ if (transition && cloneTransition) {
8811
+ cloned.transition = transition.clone(cloned);
8812
+ }
8815
8813
  return cloned;
8816
8814
  }
8817
8815
  function deepCloneVNode(vnode) {
@@ -9619,7 +9617,7 @@ function isMemoSame(cached, memo) {
9619
9617
  return true;
9620
9618
  }
9621
9619
 
9622
- const version = "3.4.25";
9620
+ const version = "3.4.27";
9623
9621
  const warn = warn$1 ;
9624
9622
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9625
9623
  const devtools = devtools$1 ;
@@ -12813,11 +12811,10 @@ const tokenizer = new Tokenizer(stack, {
12813
12811
  }
12814
12812
  },
12815
12813
  onselfclosingtag(end) {
12816
- var _a;
12817
12814
  const name = currentOpenTag.tag;
12818
12815
  currentOpenTag.isSelfClosing = true;
12819
12816
  endOpenTag(end);
12820
- if (((_a = stack[0]) == null ? void 0 : _a.tag) === name) {
12817
+ if (stack[0] && stack[0].tag === name) {
12821
12818
  onCloseTag(stack.shift(), end);
12822
12819
  }
12823
12820
  },
@@ -13118,16 +13115,15 @@ function endOpenTag(end) {
13118
13115
  currentOpenTag = null;
13119
13116
  }
13120
13117
  function onText(content, start, end) {
13121
- var _a;
13122
13118
  {
13123
- const tag = (_a = stack[0]) == null ? void 0 : _a.tag;
13119
+ const tag = stack[0] && stack[0].tag;
13124
13120
  if (tag !== "script" && tag !== "style" && content.includes("&")) {
13125
13121
  content = currentOptions.decodeEntities(content, false);
13126
13122
  }
13127
13123
  }
13128
13124
  const parent = stack[0] || currentRoot;
13129
13125
  const lastNode = parent.children[parent.children.length - 1];
13130
- if ((lastNode == null ? void 0 : lastNode.type) === 2) {
13126
+ if (lastNode && lastNode.type === 2) {
13131
13127
  lastNode.content += content;
13132
13128
  setLocEnd(lastNode.loc, end);
13133
13129
  } else {
@@ -13203,11 +13199,10 @@ function isFragmentTemplate({ tag, props }) {
13203
13199
  return false;
13204
13200
  }
13205
13201
  function isComponent({ tag, props }) {
13206
- var _a;
13207
13202
  if (currentOptions.isCustomElement(tag)) {
13208
13203
  return false;
13209
13204
  }
13210
- if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || ((_a = currentOptions.isBuiltInComponent) == null ? void 0 : _a.call(currentOptions, tag)) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
13205
+ if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
13211
13206
  return true;
13212
13207
  }
13213
13208
  for (let i = 0; i < props.length; i++) {
@@ -13227,7 +13222,6 @@ function isUpperCase(c) {
13227
13222
  }
13228
13223
  const windowsNewlineRE = /\r\n/g;
13229
13224
  function condenseWhitespace(nodes, tag) {
13230
- var _a, _b;
13231
13225
  const shouldCondense = currentOptions.whitespace !== "preserve";
13232
13226
  let removedWhitespace = false;
13233
13227
  for (let i = 0; i < nodes.length; i++) {
@@ -13235,8 +13229,8 @@ function condenseWhitespace(nodes, tag) {
13235
13229
  if (node.type === 2) {
13236
13230
  if (!inPre) {
13237
13231
  if (isAllWhitespace(node.content)) {
13238
- const prev = (_a = nodes[i - 1]) == null ? void 0 : _a.type;
13239
- const next = (_b = nodes[i + 1]) == null ? void 0 : _b.type;
13232
+ const prev = nodes[i - 1] && nodes[i - 1].type;
13233
+ const next = nodes[i + 1] && nodes[i + 1].type;
13240
13234
  if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
13241
13235
  removedWhitespace = true;
13242
13236
  nodes[i] = null;
@@ -13374,7 +13368,7 @@ function baseParse(input, options) {
13374
13368
  }
13375
13369
  tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
13376
13370
  tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
13377
- const delimiters = options == null ? void 0 : options.delimiters;
13371
+ const delimiters = options && options.delimiters;
13378
13372
  if (delimiters) {
13379
13373
  tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
13380
13374
  tokenizer.delimiterClose = toCharCodes(delimiters[1]);
@@ -15825,7 +15819,7 @@ function processSlotOutlet(node, context) {
15825
15819
  };
15826
15820
  }
15827
15821
 
15828
- const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15822
+ const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15829
15823
  const transformOn$1 = (dir, node, context, augmentor) => {
15830
15824
  const { loc, modifiers, arg } = dir;
15831
15825
  if (!dir.exp && !modifiers.length) {