@vue/compat 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.25
2
+ * @vue/compat v3.4.27
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -84,10 +84,11 @@ var Vue = (function () {
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
  };
@@ -207,8 +208,8 @@ var Vue = (function () {
207
208
  }
208
209
  for (const key in styles) {
209
210
  const value = styles[key];
210
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
211
211
  if (isString(value) || typeof value === "number") {
212
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
212
213
  ret += `${normalizedKey}:${value};`;
213
214
  }
214
215
  }
@@ -544,11 +545,10 @@ var Vue = (function () {
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 () {
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`);
@@ -2974,7 +2974,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
2974
2974
  true ? {
2975
2975
  get attrs() {
2976
2976
  markAttrsAccessed();
2977
- return attrs;
2977
+ return shallowReadonly(attrs);
2978
2978
  },
2979
2979
  slots,
2980
2980
  emit
@@ -3007,7 +3007,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3007
3007
  propsOptions
3008
3008
  );
3009
3009
  }
3010
- root = cloneVNode(root, fallthroughAttrs);
3010
+ root = cloneVNode(root, fallthroughAttrs, false, true);
3011
3011
  } else if (!accessedAttrs && root.type !== Comment) {
3012
3012
  const allAttrs = Object.keys(attrs);
3013
3013
  const eventAttrs = [];
@@ -3045,10 +3045,15 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3045
3045
  getComponentName(instance.type)
3046
3046
  );
3047
3047
  }
3048
- root = cloneVNode(root, {
3049
- class: cls,
3050
- style
3051
- });
3048
+ root = cloneVNode(
3049
+ root,
3050
+ {
3051
+ class: cls,
3052
+ style
3053
+ },
3054
+ false,
3055
+ true
3056
+ );
3052
3057
  }
3053
3058
  }
3054
3059
  if (vnode.dirs) {
@@ -3057,7 +3062,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3057
3062
  `Runtime directive used on component with non-element root node. The directives will not function as intended.`
3058
3063
  );
3059
3064
  }
3060
- root = cloneVNode(root);
3065
+ root = cloneVNode(root, null, false, true);
3061
3066
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
3062
3067
  }
3063
3068
  if (vnode.transition) {
@@ -3552,7 +3557,7 @@ If this is a native custom element, make sure to exclude it from component resol
3552
3557
  let parentSuspenseId;
3553
3558
  const isSuspensible = isVNodeSuspensible(vnode);
3554
3559
  if (isSuspensible) {
3555
- if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
3560
+ if (parentSuspense && parentSuspense.pendingBranch) {
3556
3561
  parentSuspenseId = parentSuspense.pendingId;
3557
3562
  parentSuspense.deps++;
3558
3563
  }
@@ -3864,8 +3869,8 @@ If this is a native custom element, make sure to exclude it from component resol
3864
3869
  }
3865
3870
  }
3866
3871
  function isVNodeSuspensible(vnode) {
3867
- var _a;
3868
- return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3872
+ const suspensible = vnode.props && vnode.props.suspensible;
3873
+ return suspensible != null && suspensible !== false;
3869
3874
  }
3870
3875
 
3871
3876
  const legacyDirectiveHookMap = {
@@ -4140,34 +4145,29 @@ If this is a native custom element, make sure to exclude it from component resol
4140
4145
  return cur;
4141
4146
  };
4142
4147
  }
4143
- function traverse(value, depth, currentDepth = 0, seen) {
4144
- if (!isObject(value) || value["__v_skip"]) {
4148
+ function traverse(value, depth = Infinity, seen) {
4149
+ if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
4145
4150
  return value;
4146
4151
  }
4147
- if (depth && depth > 0) {
4148
- if (currentDepth >= depth) {
4149
- return value;
4150
- }
4151
- currentDepth++;
4152
- }
4153
4152
  seen = seen || /* @__PURE__ */ new Set();
4154
4153
  if (seen.has(value)) {
4155
4154
  return value;
4156
4155
  }
4157
4156
  seen.add(value);
4157
+ depth--;
4158
4158
  if (isRef(value)) {
4159
- traverse(value.value, depth, currentDepth, seen);
4159
+ traverse(value.value, depth, seen);
4160
4160
  } else if (isArray(value)) {
4161
4161
  for (let i = 0; i < value.length; i++) {
4162
- traverse(value[i], depth, currentDepth, seen);
4162
+ traverse(value[i], depth, seen);
4163
4163
  }
4164
4164
  } else if (isSet(value) || isMap(value)) {
4165
4165
  value.forEach((v) => {
4166
- traverse(v, depth, currentDepth, seen);
4166
+ traverse(v, depth, seen);
4167
4167
  });
4168
4168
  } else if (isPlainObject(value)) {
4169
4169
  for (const key in value) {
4170
- traverse(value[key], depth, currentDepth, seen);
4170
+ traverse(value[key], depth, seen);
4171
4171
  }
4172
4172
  }
4173
4173
  return value;
@@ -4328,7 +4328,7 @@ If this is a native custom element, make sure to exclude it from component resol
4328
4328
  instance
4329
4329
  );
4330
4330
  setTransitionHooks(oldInnerChild, leavingHooks);
4331
- if (mode === "out-in") {
4331
+ if (mode === "out-in" && innerChild.type !== Comment) {
4332
4332
  state.isLeaving = true;
4333
4333
  leavingHooks.afterLeave = () => {
4334
4334
  state.isLeaving = false;
@@ -4846,7 +4846,7 @@ If this is a native custom element, make sure to exclude it from component resol
4846
4846
  return () => {
4847
4847
  pendingCacheKey = null;
4848
4848
  if (!slots.default) {
4849
- return current = null;
4849
+ return null;
4850
4850
  }
4851
4851
  const children = slots.default();
4852
4852
  const rawVNode = children[0];
@@ -5564,14 +5564,7 @@ If this is a native custom element, make sure to exclude it from component resol
5564
5564
  },
5565
5565
  $scopedSlots: (i) => {
5566
5566
  assertCompatEnabled("INSTANCE_SCOPED_SLOTS", i);
5567
- const res = {};
5568
- for (const key in i.slots) {
5569
- const fn = i.slots[key];
5570
- if (!fn._ns) {
5571
- res[key] = fn;
5572
- }
5573
- }
5574
- return res;
5567
+ return shallowReadonly(i.slots) ;
5575
5568
  },
5576
5569
  $on: (i) => on.bind(null, i),
5577
5570
  $once: (i) => once.bind(null, i),
@@ -6542,13 +6535,13 @@ If this is a native custom element, make sure to exclude it from component resol
6542
6535
  return vm;
6543
6536
  }
6544
6537
  }
6545
- Vue.version = `2.6.14-compat:${"3.4.25"}`;
6538
+ Vue.version = `2.6.14-compat:${"3.4.27"}`;
6546
6539
  Vue.config = singletonApp.config;
6547
- Vue.use = (p, ...options) => {
6548
- if (p && isFunction(p.install)) {
6549
- p.install(Vue, ...options);
6550
- } else if (isFunction(p)) {
6551
- p(Vue, ...options);
6540
+ Vue.use = (plugin, ...options) => {
6541
+ if (plugin && isFunction(plugin.install)) {
6542
+ plugin.install(Vue, ...options);
6543
+ } else if (isFunction(plugin)) {
6544
+ plugin(Vue, ...options);
6552
6545
  }
6553
6546
  return Vue;
6554
6547
  };
@@ -7666,7 +7659,7 @@ If you want to remount the same app, move your app creation logic into a factory
7666
7659
  const type = children._;
7667
7660
  if (type) {
7668
7661
  extend(slots, children);
7669
- def(slots, "_", type);
7662
+ def(slots, "_", type, true);
7670
7663
  } else {
7671
7664
  normalizeObjectSlots(children, slots, instance);
7672
7665
  }
@@ -8280,7 +8273,7 @@ Server rendered element contains fewer child nodes than client vdom.`
8280
8273
  mismatchType = mismatchKey = `class`;
8281
8274
  }
8282
8275
  } else if (key === "style") {
8283
- actual = el.getAttribute("style");
8276
+ actual = el.getAttribute("style") || "";
8284
8277
  expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
8285
8278
  const actualMap = toStyleMap(actual);
8286
8279
  const expectedMap = toStyleMap(expected);
@@ -10505,8 +10498,8 @@ Component that was made reactive: `,
10505
10498
  return null;
10506
10499
  return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
10507
10500
  }
10508
- function cloneVNode(vnode, extraProps, mergeRef = false) {
10509
- const { props, ref, patchFlag, children } = vnode;
10501
+ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
10502
+ const { props, ref, patchFlag, children, transition } = vnode;
10510
10503
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
10511
10504
  const cloned = {
10512
10505
  __v_isVNode: true,
@@ -10536,7 +10529,7 @@ Component that was made reactive: `,
10536
10529
  dynamicChildren: vnode.dynamicChildren,
10537
10530
  appContext: vnode.appContext,
10538
10531
  dirs: vnode.dirs,
10539
- transition: vnode.transition,
10532
+ transition,
10540
10533
  // These should technically only be non-null on mounted VNodes. However,
10541
10534
  // they *should* be copied for kept-alive vnodes. So we just always copy
10542
10535
  // them since them being non-null during a mount doesn't affect the logic as
@@ -10550,6 +10543,9 @@ Component that was made reactive: `,
10550
10543
  ctx: vnode.ctx,
10551
10544
  ce: vnode.ce
10552
10545
  };
10546
+ if (transition && cloneTransition) {
10547
+ cloned.transition = transition.clone(cloned);
10548
+ }
10553
10549
  {
10554
10550
  defineLegacyVNodeProperties(cloned);
10555
10551
  }
@@ -11372,7 +11368,7 @@ Component that was made reactive: `,
11372
11368
  return true;
11373
11369
  }
11374
11370
 
11375
- const version = "3.4.25";
11371
+ const version = "3.4.27";
11376
11372
  const warn = warn$1 ;
11377
11373
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11378
11374
  const devtools = devtools$1 ;
@@ -14786,11 +14782,10 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14786
14782
  }
14787
14783
  },
14788
14784
  onselfclosingtag(end) {
14789
- var _a;
14790
14785
  const name = currentOpenTag.tag;
14791
14786
  currentOpenTag.isSelfClosing = true;
14792
14787
  endOpenTag(end);
14793
- if (((_a = stack[0]) == null ? void 0 : _a.tag) === name) {
14788
+ if (stack[0] && stack[0].tag === name) {
14794
14789
  onCloseTag(stack.shift(), end);
14795
14790
  }
14796
14791
  },
@@ -15101,16 +15096,15 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15101
15096
  currentOpenTag = null;
15102
15097
  }
15103
15098
  function onText(content, start, end) {
15104
- var _a;
15105
15099
  {
15106
- const tag = (_a = stack[0]) == null ? void 0 : _a.tag;
15100
+ const tag = stack[0] && stack[0].tag;
15107
15101
  if (tag !== "script" && tag !== "style" && content.includes("&")) {
15108
15102
  content = currentOptions.decodeEntities(content, false);
15109
15103
  }
15110
15104
  }
15111
15105
  const parent = stack[0] || currentRoot;
15112
15106
  const lastNode = parent.children[parent.children.length - 1];
15113
- if ((lastNode == null ? void 0 : lastNode.type) === 2) {
15107
+ if (lastNode && lastNode.type === 2) {
15114
15108
  lastNode.content += content;
15115
15109
  setLocEnd(lastNode.loc, end);
15116
15110
  } else {
@@ -15244,11 +15238,10 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15244
15238
  return false;
15245
15239
  }
15246
15240
  function isComponent({ tag, props }) {
15247
- var _a;
15248
15241
  if (currentOptions.isCustomElement(tag)) {
15249
15242
  return false;
15250
15243
  }
15251
- if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || ((_a = currentOptions.isBuiltInComponent) == null ? void 0 : _a.call(currentOptions, tag)) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
15244
+ if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
15252
15245
  return true;
15253
15246
  }
15254
15247
  for (let i = 0; i < props.length; i++) {
@@ -15281,7 +15274,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15281
15274
  }
15282
15275
  const windowsNewlineRE = /\r\n/g;
15283
15276
  function condenseWhitespace(nodes, tag) {
15284
- var _a, _b;
15285
15277
  const shouldCondense = currentOptions.whitespace !== "preserve";
15286
15278
  let removedWhitespace = false;
15287
15279
  for (let i = 0; i < nodes.length; i++) {
@@ -15289,8 +15281,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15289
15281
  if (node.type === 2) {
15290
15282
  if (!inPre) {
15291
15283
  if (isAllWhitespace(node.content)) {
15292
- const prev = (_a = nodes[i - 1]) == null ? void 0 : _a.type;
15293
- const next = (_b = nodes[i + 1]) == null ? void 0 : _b.type;
15284
+ const prev = nodes[i - 1] && nodes[i - 1].type;
15285
+ const next = nodes[i + 1] && nodes[i + 1].type;
15294
15286
  if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
15295
15287
  removedWhitespace = true;
15296
15288
  nodes[i] = null;
@@ -15428,7 +15420,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15428
15420
  }
15429
15421
  tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
15430
15422
  tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
15431
- const delimiters = options == null ? void 0 : options.delimiters;
15423
+ const delimiters = options && options.delimiters;
15432
15424
  if (delimiters) {
15433
15425
  tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
15434
15426
  tokenizer.delimiterClose = toCharCodes(delimiters[1]);
@@ -17935,7 +17927,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17935
17927
  };
17936
17928
  }
17937
17929
 
17938
- const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
17930
+ const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
17939
17931
  const transformOn$1 = (dir, node, context, augmentor) => {
17940
17932
  const { loc, modifiers, arg } = dir;
17941
17933
  if (!dir.exp && !modifiers.length) {