vue 3.5.3 → 3.5.5

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.3
2
+ * vue v3.5.5
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.5.3
2
+ * vue v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -8,9 +8,10 @@ var Vue = (function (exports) {
8
8
 
9
9
  /*! #__NO_SIDE_EFFECTS__ */
10
10
  // @__NO_SIDE_EFFECTS__
11
- function makeMap(str, expectsLowerCase) {
12
- const set = new Set(str.split(","));
13
- return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
11
+ function makeMap(str) {
12
+ const map = /* @__PURE__ */ Object.create(null);
13
+ for (const key of str.split(",")) map[key] = 1;
14
+ return (val) => val in map;
14
15
  }
15
16
 
16
17
  const EMPTY_OBJ = Object.freeze({}) ;
@@ -665,9 +666,11 @@ var Vue = (function (exports) {
665
666
  function cleanupDeps(sub) {
666
667
  let head;
667
668
  let tail = sub.depsTail;
668
- for (let link = tail; link; link = link.prevDep) {
669
+ let link = tail;
670
+ while (link) {
671
+ const prev = link.prevDep;
669
672
  if (link.version === -1) {
670
- if (link === tail) tail = link.prevDep;
673
+ if (link === tail) tail = prev;
671
674
  removeSub(link);
672
675
  removeDep(link);
673
676
  } else {
@@ -675,13 +678,14 @@ var Vue = (function (exports) {
675
678
  }
676
679
  link.dep.activeLink = link.prevActiveLink;
677
680
  link.prevActiveLink = void 0;
681
+ link = prev;
678
682
  }
679
683
  sub.deps = head;
680
684
  sub.depsTail = tail;
681
685
  }
682
686
  function isDirty(sub) {
683
687
  for (let link = sub.deps; link; link = link.nextDep) {
684
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
688
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
685
689
  return true;
686
690
  }
687
691
  }
@@ -691,9 +695,6 @@ var Vue = (function (exports) {
691
695
  return false;
692
696
  }
693
697
  function refreshComputed(computed) {
694
- if (computed.flags & 2) {
695
- return false;
696
- }
697
698
  if (computed.flags & 4 && !(computed.flags & 16)) {
698
699
  return;
699
700
  }
@@ -806,6 +807,14 @@ var Vue = (function (exports) {
806
807
  }
807
808
 
808
809
  let globalVersion = 0;
810
+ class Link {
811
+ constructor(sub, dep) {
812
+ this.sub = sub;
813
+ this.dep = dep;
814
+ this.version = dep.version;
815
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
816
+ }
817
+ }
809
818
  class Dep {
810
819
  constructor(computed) {
811
820
  this.computed = computed;
@@ -828,16 +837,7 @@ var Vue = (function (exports) {
828
837
  }
829
838
  let link = this.activeLink;
830
839
  if (link === void 0 || link.sub !== activeSub) {
831
- link = this.activeLink = {
832
- dep: this,
833
- sub: activeSub,
834
- version: this.version,
835
- nextDep: void 0,
836
- prevDep: void 0,
837
- nextSub: void 0,
838
- prevSub: void 0,
839
- prevActiveLink: void 0
840
- };
840
+ link = this.activeLink = new Link(activeSub, this);
841
841
  if (!activeSub.deps) {
842
842
  activeSub.deps = activeSub.depsTail = link;
843
843
  } else {
@@ -960,9 +960,23 @@ var Vue = (function (exports) {
960
960
  globalVersion++;
961
961
  return;
962
962
  }
963
- let deps = [];
963
+ const run = (dep) => {
964
+ if (dep) {
965
+ {
966
+ dep.trigger({
967
+ target,
968
+ type,
969
+ key,
970
+ newValue,
971
+ oldValue,
972
+ oldTarget
973
+ });
974
+ }
975
+ }
976
+ };
977
+ startBatch();
964
978
  if (type === "clear") {
965
- deps = [...depsMap.values()];
979
+ depsMap.forEach(run);
966
980
  } else {
967
981
  const targetIsArray = isArray(target);
968
982
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -970,57 +984,43 @@ var Vue = (function (exports) {
970
984
  const newLength = Number(newValue);
971
985
  depsMap.forEach((dep, key2) => {
972
986
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
973
- deps.push(dep);
987
+ run(dep);
974
988
  }
975
989
  });
976
990
  } else {
977
- const push = (dep) => dep && deps.push(dep);
978
991
  if (key !== void 0) {
979
- push(depsMap.get(key));
992
+ run(depsMap.get(key));
980
993
  }
981
994
  if (isArrayIndex) {
982
- push(depsMap.get(ARRAY_ITERATE_KEY));
995
+ run(depsMap.get(ARRAY_ITERATE_KEY));
983
996
  }
984
997
  switch (type) {
985
998
  case "add":
986
999
  if (!targetIsArray) {
987
- push(depsMap.get(ITERATE_KEY));
1000
+ run(depsMap.get(ITERATE_KEY));
988
1001
  if (isMap(target)) {
989
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
1002
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
990
1003
  }
991
1004
  } else if (isArrayIndex) {
992
- push(depsMap.get("length"));
1005
+ run(depsMap.get("length"));
993
1006
  }
994
1007
  break;
995
1008
  case "delete":
996
1009
  if (!targetIsArray) {
997
- push(depsMap.get(ITERATE_KEY));
1010
+ run(depsMap.get(ITERATE_KEY));
998
1011
  if (isMap(target)) {
999
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
1012
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
1000
1013
  }
1001
1014
  }
1002
1015
  break;
1003
1016
  case "set":
1004
1017
  if (isMap(target)) {
1005
- push(depsMap.get(ITERATE_KEY));
1018
+ run(depsMap.get(ITERATE_KEY));
1006
1019
  }
1007
1020
  break;
1008
1021
  }
1009
1022
  }
1010
1023
  }
1011
- startBatch();
1012
- for (const dep of deps) {
1013
- {
1014
- dep.trigger({
1015
- target,
1016
- type,
1017
- key,
1018
- newValue,
1019
- oldValue,
1020
- oldTarget
1021
- });
1022
- }
1023
- }
1024
1024
  endBatch();
1025
1025
  }
1026
1026
  function getDepFromReactive(object, key) {
@@ -1758,7 +1758,7 @@ var Vue = (function (exports) {
1758
1758
  return raw ? toRaw(raw) : observed;
1759
1759
  }
1760
1760
  function markRaw(value) {
1761
- if (Object.isExtensible(value)) {
1761
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1762
1762
  def(value, "__v_skip", true);
1763
1763
  }
1764
1764
  return value;
@@ -1968,8 +1968,8 @@ var Vue = (function (exports) {
1968
1968
  * @internal
1969
1969
  */
1970
1970
  notify() {
1971
+ this.flags |= 16;
1971
1972
  if (activeSub !== this) {
1972
- this.flags |= 16;
1973
1973
  this.dep.notify();
1974
1974
  }
1975
1975
  }
@@ -2657,23 +2657,19 @@ var Vue = (function (exports) {
2657
2657
  }
2658
2658
  }
2659
2659
  function checkRecursiveUpdates(seen, fn) {
2660
- if (!seen.has(fn)) {
2661
- seen.set(fn, 1);
2662
- } else {
2663
- const count = seen.get(fn);
2664
- if (count > RECURSION_LIMIT) {
2665
- const instance = fn.i;
2666
- const componentName = instance && getComponentName(instance.type);
2667
- handleError(
2668
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
2669
- null,
2670
- 10
2671
- );
2672
- return true;
2673
- } else {
2674
- seen.set(fn, count + 1);
2675
- }
2660
+ const count = seen.get(fn) || 0;
2661
+ if (count > RECURSION_LIMIT) {
2662
+ const instance = fn.i;
2663
+ const componentName = instance && getComponentName(instance.type);
2664
+ handleError(
2665
+ `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
2666
+ null,
2667
+ 10
2668
+ );
2669
+ return true;
2676
2670
  }
2671
+ seen.set(fn, count + 1);
2672
+ return false;
2677
2673
  }
2678
2674
 
2679
2675
  let isHmrUpdating = false;
@@ -2754,7 +2750,9 @@ var Vue = (function (exports) {
2754
2750
  dirtyInstances.delete(instance);
2755
2751
  } else if (instance.parent) {
2756
2752
  queueJob(() => {
2753
+ isHmrUpdating = true;
2757
2754
  instance.parent.update();
2755
+ isHmrUpdating = false;
2758
2756
  dirtyInstances.delete(instance);
2759
2757
  });
2760
2758
  } else if (instance.appContext.reload) {
@@ -3045,6 +3043,9 @@ var Vue = (function (exports) {
3045
3043
  insert(mainAnchor, container, anchor);
3046
3044
  const mount = (container2, anchor2) => {
3047
3045
  if (shapeFlag & 16) {
3046
+ if (parentComponent && parentComponent.isCE) {
3047
+ parentComponent.ce._teleportTarget = container2;
3048
+ }
3048
3049
  mountChildren(
3049
3050
  children,
3050
3051
  container2,
@@ -4075,7 +4076,11 @@ Server rendered element contains more child nodes than client vdom.`
4075
4076
  remove(cur);
4076
4077
  }
4077
4078
  } else if (shapeFlag & 8) {
4078
- if (el.textContent !== vnode.children) {
4079
+ let clientText = vnode.children;
4080
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4081
+ clientText = clientText.slice(1);
4082
+ }
4083
+ if (el.textContent !== clientText) {
4079
4084
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4080
4085
  warn$1(
4081
4086
  `Hydration text content mismatch on`,
@@ -4274,7 +4279,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4274
4279
  }
4275
4280
  };
4276
4281
  const isTemplateNode = (node) => {
4277
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4282
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4278
4283
  };
4279
4284
  return [hydrate, hydrateNode];
4280
4285
  }
@@ -4626,7 +4631,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4626
4631
  load().then(() => {
4627
4632
  loaded.value = true;
4628
4633
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4629
- queueJob(instance.parent.update);
4634
+ instance.parent.update();
4630
4635
  }
4631
4636
  }).catch((err) => {
4632
4637
  onError(err);
@@ -5021,13 +5026,15 @@ If this is a native custom element, make sure to exclude it from component resol
5021
5026
  const sourceIsArray = isArray(source);
5022
5027
  if (sourceIsArray || isString(source)) {
5023
5028
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5029
+ let needsWrap = false;
5024
5030
  if (sourceIsReactiveArray) {
5031
+ needsWrap = !isShallow(source);
5025
5032
  source = shallowReadArray(source);
5026
5033
  }
5027
5034
  ret = new Array(source.length);
5028
5035
  for (let i = 0, l = source.length; i < l; i++) {
5029
5036
  ret[i] = renderItem(
5030
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
5037
+ needsWrap ? toReactive(source[i]) : source[i],
5031
5038
  i,
5032
5039
  void 0,
5033
5040
  cached && cached[i]
@@ -7297,6 +7304,7 @@ If you want to remount the same app, move your app creation logic into a factory
7297
7304
  }
7298
7305
  }
7299
7306
  if (instance.asyncDep) {
7307
+ if (isHmrUpdating) initialVNode.el = null;
7300
7308
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
7301
7309
  if (!initialVNode.el) {
7302
7310
  const placeholder = instance.subTree = createVNode(Comment);
@@ -10412,7 +10420,7 @@ Component that was made reactive: `,
10412
10420
  return true;
10413
10421
  }
10414
10422
 
10415
- const version = "3.5.3";
10423
+ const version = "3.5.5";
10416
10424
  const warn = warn$1 ;
10417
10425
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10418
10426
  const devtools = devtools$1 ;
@@ -11293,6 +11301,7 @@ Expected function or array of functions, received type ${typeof value}.`
11293
11301
  }
11294
11302
  }
11295
11303
  connectedCallback() {
11304
+ if (!this.isConnected) return;
11296
11305
  if (!this.shadowRoot) {
11297
11306
  this._parseSlots();
11298
11307
  }
@@ -11335,7 +11344,7 @@ Expected function or array of functions, received type ${typeof value}.`
11335
11344
  this._ob = null;
11336
11345
  }
11337
11346
  this._app && this._app.unmount();
11338
- this._instance.ce = void 0;
11347
+ if (this._instance) this._instance.ce = void 0;
11339
11348
  this._app = this._instance = null;
11340
11349
  }
11341
11350
  });
@@ -11554,7 +11563,7 @@ Expected function or array of functions, received type ${typeof value}.`
11554
11563
  }
11555
11564
  }
11556
11565
  /**
11557
- * Only called when shaddowRoot is false
11566
+ * Only called when shadowRoot is false
11558
11567
  */
11559
11568
  _parseSlots() {
11560
11569
  const slots = this._slots = {};
@@ -11566,10 +11575,10 @@ Expected function or array of functions, received type ${typeof value}.`
11566
11575
  }
11567
11576
  }
11568
11577
  /**
11569
- * Only called when shaddowRoot is false
11578
+ * Only called when shadowRoot is false
11570
11579
  */
11571
11580
  _renderSlots() {
11572
- const outlets = this.querySelectorAll("slot");
11581
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
11573
11582
  const scopeId = this._instance.type.__scopeId;
11574
11583
  for (let i = 0; i < outlets.length; i++) {
11575
11584
  const o = outlets[i];
@@ -11736,7 +11745,7 @@ Expected function or array of functions, received type ${typeof value}.`
11736
11745
  child,
11737
11746
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
11738
11747
  );
11739
- } else {
11748
+ } else if (child.type !== Text) {
11740
11749
  warn(`<TransitionGroup> children must be keyed.`);
11741
11750
  }
11742
11751
  }
@@ -12697,7 +12706,7 @@ Make sure to use the production build (*.prod.js) when deploying for production.
12697
12706
  this.sequenceIndex += 1;
12698
12707
  } else if (this.sequenceIndex === 0) {
12699
12708
  if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
12700
- if (c === this.delimiterOpen[0]) {
12709
+ if (!this.inVPre && c === this.delimiterOpen[0]) {
12701
12710
  this.state = 2;
12702
12711
  this.delimiterIndex = 0;
12703
12712
  this.stateInterpolationOpen(c);
@@ -13600,6 +13609,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13600
13609
  getNamespace: () => 0,
13601
13610
  isVoidTag: NO,
13602
13611
  isPreTag: NO,
13612
+ isIgnoreNewlineTag: NO,
13603
13613
  isCustomElement: NO,
13604
13614
  onError: defaultOnError,
13605
13615
  onWarn: defaultOnWarn,
@@ -14030,7 +14040,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14030
14040
  el.innerLoc.end.offset
14031
14041
  );
14032
14042
  }
14033
- const { tag, ns } = el;
14043
+ const { tag, ns, children } = el;
14034
14044
  if (!inVPre) {
14035
14045
  if (tag === "slot") {
14036
14046
  el.tagType = 2;
@@ -14041,7 +14051,13 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14041
14051
  }
14042
14052
  }
14043
14053
  if (!tokenizer.inRCDATA) {
14044
- el.children = condenseWhitespace(el.children, el.tag);
14054
+ el.children = condenseWhitespace(children);
14055
+ }
14056
+ if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
14057
+ const first = children[0];
14058
+ if (first && first.type === 2) {
14059
+ first.content = first.content.replace(/^\r?\n/, "");
14060
+ }
14045
14061
  }
14046
14062
  if (ns === 0 && currentOptions.isPreTag(tag)) {
14047
14063
  inPre--;
@@ -14122,12 +14138,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14122
14138
  }
14123
14139
  }
14124
14140
  }
14125
- if (inPre && tag && currentOptions.isPreTag(tag)) {
14126
- const first = nodes[0];
14127
- if (first && first.type === 2) {
14128
- first.content = first.content.replace(/^\r?\n/, "");
14129
- }
14130
- }
14131
14141
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
14132
14142
  }
14133
14143
  function isAllWhitespace(str) {
@@ -14729,10 +14739,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14729
14739
  }
14730
14740
  } else if (children.length > 1) {
14731
14741
  let patchFlag = 64;
14732
- let patchFlagText = PatchFlagNames[64];
14733
14742
  if (children.filter((c) => c.type !== 3).length === 1) {
14734
14743
  patchFlag |= 2048;
14735
- patchFlagText += `, ${PatchFlagNames[2048]}`;
14736
14744
  }
14737
14745
  root.codegenNode = createVNodeCall(
14738
14746
  context,
@@ -15632,10 +15640,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15632
15640
  return vnodeCall;
15633
15641
  } else {
15634
15642
  let patchFlag = 64;
15635
- let patchFlagText = PatchFlagNames[64];
15636
15643
  if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
15637
15644
  patchFlag |= 2048;
15638
- patchFlagText += `, ${PatchFlagNames[2048]}`;
15639
15645
  }
15640
15646
  return createVNodeCall(
15641
15647
  context,
@@ -17192,6 +17198,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17192
17198
  isVoidTag,
17193
17199
  isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
17194
17200
  isPreTag: (tag) => tag === "pre",
17201
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
17195
17202
  decodeEntities: decodeHtmlBrowser ,
17196
17203
  isBuiltInComponent: (tag) => {
17197
17204
  if (tag === "Transition" || tag === "transition") {
@@ -17419,10 +17426,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17419
17426
  `stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
17420
17427
  );
17421
17428
  const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
17422
- const isKeyboardEvent = /* @__PURE__ */ makeMap(
17423
- `onkeyup,onkeydown,onkeypress`,
17424
- true
17425
- );
17429
+ const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`);
17426
17430
  const resolveModifiers = (key, modifiers, context, loc) => {
17427
17431
  const keyModifiers = [];
17428
17432
  const nonKeyModifiers = [];
@@ -17434,7 +17438,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17434
17438
  } else {
17435
17439
  if (maybeKeyModifier(modifier)) {
17436
17440
  if (isStaticExp(key)) {
17437
- if (isKeyboardEvent(key.content)) {
17441
+ if (isKeyboardEvent(key.content.toLowerCase())) {
17438
17442
  keyModifiers.push(modifier);
17439
17443
  } else {
17440
17444
  nonKeyModifiers.push(modifier);
@@ -17487,7 +17491,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17487
17491
  ]);
17488
17492
  }
17489
17493
  if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
17490
- (!isStaticExp(key) || isKeyboardEvent(key.content))) {
17494
+ (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
17491
17495
  handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
17492
17496
  handlerExp,
17493
17497
  JSON.stringify(keyModifiers)