@vue/compat 3.5.4 → 3.5.6

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.4
2
+ * @vue/compat v3.5.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -220,6 +220,9 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
220
220
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
221
221
  `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
222
222
  );
223
+ const isKnownMathMLAttr = /* @__PURE__ */ makeMap(
224
+ `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`
225
+ );
223
226
 
224
227
  const escapeRE = /["'&<>]/;
225
228
  function escapeHtml(string) {
@@ -493,7 +496,7 @@ class ReactiveEffect {
493
496
  /**
494
497
  * @internal
495
498
  */
496
- this.nextEffect = void 0;
499
+ this.next = void 0;
497
500
  /**
498
501
  * @internal
499
502
  */
@@ -523,9 +526,7 @@ class ReactiveEffect {
523
526
  return;
524
527
  }
525
528
  if (!(this.flags & 8)) {
526
- this.flags |= 8;
527
- this.nextEffect = batchedEffect;
528
- batchedEffect = this;
529
+ batch(this);
529
530
  }
530
531
  }
531
532
  run() {
@@ -581,7 +582,12 @@ class ReactiveEffect {
581
582
  }
582
583
  }
583
584
  let batchDepth = 0;
584
- let batchedEffect;
585
+ let batchedSub;
586
+ function batch(sub) {
587
+ sub.flags |= 8;
588
+ sub.next = batchedSub;
589
+ batchedSub = sub;
590
+ }
585
591
  function startBatch() {
586
592
  batchDepth++;
587
593
  }
@@ -590,15 +596,16 @@ function endBatch() {
590
596
  return;
591
597
  }
592
598
  let error;
593
- while (batchedEffect) {
594
- let e = batchedEffect;
595
- batchedEffect = void 0;
599
+ while (batchedSub) {
600
+ let e = batchedSub;
601
+ batchedSub = void 0;
596
602
  while (e) {
597
- const next = e.nextEffect;
598
- e.nextEffect = void 0;
603
+ const next = e.next;
604
+ e.next = void 0;
599
605
  e.flags &= ~8;
600
606
  if (e.flags & 1) {
601
607
  try {
608
+ ;
602
609
  e.trigger();
603
610
  } catch (err) {
604
611
  if (!error) error = err;
@@ -619,9 +626,11 @@ function prepareDeps(sub) {
619
626
  function cleanupDeps(sub) {
620
627
  let head;
621
628
  let tail = sub.depsTail;
622
- for (let link = tail; link; link = link.prevDep) {
629
+ let link = tail;
630
+ while (link) {
631
+ const prev = link.prevDep;
623
632
  if (link.version === -1) {
624
- if (link === tail) tail = link.prevDep;
633
+ if (link === tail) tail = prev;
625
634
  removeSub(link);
626
635
  removeDep(link);
627
636
  } else {
@@ -629,13 +638,14 @@ function cleanupDeps(sub) {
629
638
  }
630
639
  link.dep.activeLink = link.prevActiveLink;
631
640
  link.prevActiveLink = void 0;
641
+ link = prev;
632
642
  }
633
643
  sub.deps = head;
634
644
  sub.depsTail = tail;
635
645
  }
636
646
  function isDirty(sub) {
637
647
  for (let link = sub.deps; link; link = link.nextDep) {
638
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
648
+ if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
639
649
  return true;
640
650
  }
641
651
  }
@@ -655,7 +665,7 @@ function refreshComputed(computed) {
655
665
  computed.globalVersion = globalVersion;
656
666
  const dep = computed.dep;
657
667
  computed.flags |= 2;
658
- if (dep.version > 0 && !computed.isSSR && !isDirty(computed)) {
668
+ if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
659
669
  computed.flags &= ~2;
660
670
  return;
661
671
  }
@@ -757,6 +767,14 @@ function cleanupEffect(e) {
757
767
  }
758
768
 
759
769
  let globalVersion = 0;
770
+ class Link {
771
+ constructor(sub, dep) {
772
+ this.sub = sub;
773
+ this.dep = dep;
774
+ this.version = dep.version;
775
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
776
+ }
777
+ }
760
778
  class Dep {
761
779
  constructor(computed) {
762
780
  this.computed = computed;
@@ -776,16 +794,7 @@ class Dep {
776
794
  }
777
795
  let link = this.activeLink;
778
796
  if (link === void 0 || link.sub !== activeSub) {
779
- link = this.activeLink = {
780
- dep: this,
781
- sub: activeSub,
782
- version: this.version,
783
- nextDep: void 0,
784
- prevDep: void 0,
785
- nextSub: void 0,
786
- prevSub: void 0,
787
- prevActiveLink: void 0
788
- };
797
+ link = this.activeLink = new Link(activeSub, this);
789
798
  if (!activeSub.deps) {
790
799
  activeSub.deps = activeSub.depsTail = link;
791
800
  } else {
@@ -825,7 +834,10 @@ class Dep {
825
834
  try {
826
835
  if (false) ;
827
836
  for (let link = this.subs; link; link = link.prevSub) {
828
- link.sub.notify();
837
+ if (link.sub.notify()) {
838
+ ;
839
+ link.sub.dep.notify();
840
+ }
829
841
  }
830
842
  } finally {
831
843
  endBatch();
@@ -1822,8 +1834,10 @@ class ComputedRefImpl {
1822
1834
  */
1823
1835
  notify() {
1824
1836
  this.flags |= 16;
1825
- if (activeSub !== this) {
1826
- this.dep.notify();
1837
+ if (!(this.flags & 8) && // avoid infinite self recursion
1838
+ activeSub !== this) {
1839
+ batch(this);
1840
+ return true;
1827
1841
  }
1828
1842
  }
1829
1843
  get value() {
@@ -1947,20 +1961,12 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1947
1961
  remove(scope.effects, effect);
1948
1962
  }
1949
1963
  };
1950
- if (once) {
1951
- if (cb) {
1952
- const _cb = cb;
1953
- cb = (...args) => {
1954
- _cb(...args);
1955
- watchHandle();
1956
- };
1957
- } else {
1958
- const _getter = getter;
1959
- getter = () => {
1960
- _getter();
1961
- watchHandle();
1962
- };
1963
- }
1964
+ if (once && cb) {
1965
+ const _cb = cb;
1966
+ cb = (...args) => {
1967
+ _cb(...args);
1968
+ watchHandle();
1969
+ };
1964
1970
  }
1965
1971
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
1966
1972
  const job = (immediateFirstRun) => {
@@ -2725,6 +2731,9 @@ const TeleportImpl = {
2725
2731
  insert(mainAnchor, container, anchor);
2726
2732
  const mount = (container2, anchor2) => {
2727
2733
  if (shapeFlag & 16) {
2734
+ if (parentComponent && parentComponent.isCE) {
2735
+ parentComponent.ce._teleportTarget = container2;
2736
+ }
2728
2737
  mountChildren(
2729
2738
  children,
2730
2739
  container2,
@@ -3677,7 +3686,11 @@ function createHydrationFunctions(rendererInternals) {
3677
3686
  remove(cur);
3678
3687
  }
3679
3688
  } else if (shapeFlag & 8) {
3680
- if (el.textContent !== vnode.children) {
3689
+ let clientText = vnode.children;
3690
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
3691
+ clientText = clientText.slice(1);
3692
+ }
3693
+ if (el.textContent !== clientText) {
3681
3694
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
3682
3695
  logMismatchError();
3683
3696
  }
@@ -3856,7 +3869,7 @@ function createHydrationFunctions(rendererInternals) {
3856
3869
  }
3857
3870
  };
3858
3871
  const isTemplateNode = (node) => {
3859
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
3872
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
3860
3873
  };
3861
3874
  return [hydrate, hydrateNode];
3862
3875
  }
@@ -4080,7 +4093,7 @@ function defineAsyncComponent(source) {
4080
4093
  load().then(() => {
4081
4094
  loaded.value = true;
4082
4095
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4083
- queueJob(instance.parent.update);
4096
+ instance.parent.update();
4084
4097
  }
4085
4098
  }).catch((err) => {
4086
4099
  onError(err);
@@ -5743,7 +5756,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5743
5756
  return vm;
5744
5757
  }
5745
5758
  }
5746
- Vue.version = `2.6.14-compat:${"3.5.4"}`;
5759
+ Vue.version = `2.6.14-compat:${"3.5.6"}`;
5747
5760
  Vue.config = singletonApp.config;
5748
5761
  Vue.use = (plugin, ...options) => {
5749
5762
  if (plugin && isFunction(plugin.install)) {
@@ -8090,11 +8103,12 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
8090
8103
  } else if (!cb || immediate) {
8091
8104
  baseWatchOptions.once = true;
8092
8105
  } else {
8093
- return {
8094
- stop: NOOP,
8095
- resume: NOOP,
8096
- pause: NOOP
8106
+ const watchStopHandle = () => {
8097
8107
  };
8108
+ watchStopHandle.stop = NOOP;
8109
+ watchStopHandle.resume = NOOP;
8110
+ watchStopHandle.pause = NOOP;
8111
+ return watchStopHandle;
8098
8112
  }
8099
8113
  }
8100
8114
  const instance = currentInstance;
@@ -9863,7 +9877,7 @@ function isMemoSame(cached, memo) {
9863
9877
  return true;
9864
9878
  }
9865
9879
 
9866
- const version = "3.5.4";
9880
+ const version = "3.5.6";
9867
9881
  const warn$1 = NOOP;
9868
9882
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9869
9883
  const devtools = void 0;
@@ -10744,6 +10758,7 @@ class VueElement extends BaseClass {
10744
10758
  }
10745
10759
  }
10746
10760
  connectedCallback() {
10761
+ if (!this.isConnected) return;
10747
10762
  if (!this.shadowRoot) {
10748
10763
  this._parseSlots();
10749
10764
  }
@@ -10786,7 +10801,7 @@ class VueElement extends BaseClass {
10786
10801
  this._ob = null;
10787
10802
  }
10788
10803
  this._app && this._app.unmount();
10789
- this._instance.ce = void 0;
10804
+ if (this._instance) this._instance.ce = void 0;
10790
10805
  this._app = this._instance = null;
10791
10806
  }
10792
10807
  });
@@ -10971,7 +10986,7 @@ class VueElement extends BaseClass {
10971
10986
  }
10972
10987
  }
10973
10988
  /**
10974
- * Only called when shaddowRoot is false
10989
+ * Only called when shadowRoot is false
10975
10990
  */
10976
10991
  _parseSlots() {
10977
10992
  const slots = this._slots = {};
@@ -10983,10 +10998,10 @@ class VueElement extends BaseClass {
10983
10998
  }
10984
10999
  }
10985
11000
  /**
10986
- * Only called when shaddowRoot is false
11001
+ * Only called when shadowRoot is false
10987
11002
  */
10988
11003
  _renderSlots() {
10989
- const outlets = this.querySelectorAll("slot");
11004
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
10990
11005
  const scopeId = this._instance.type.__scopeId;
10991
11006
  for (let i = 0; i < outlets.length; i++) {
10992
11007
  const o = outlets[i];
@@ -12312,7 +12327,7 @@ class Tokenizer {
12312
12327
  if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
12313
12328
  if (c === 38) {
12314
12329
  this.startEntity();
12315
- } else if (c === this.delimiterOpen[0]) {
12330
+ } else if (!this.inVPre && c === this.delimiterOpen[0]) {
12316
12331
  this.state = 2;
12317
12332
  this.delimiterIndex = 0;
12318
12333
  this.stateInterpolationOpen(c);
@@ -13661,6 +13676,7 @@ const defaultParserOptions = {
13661
13676
  getNamespace: () => 0,
13662
13677
  isVoidTag: NO,
13663
13678
  isPreTag: NO,
13679
+ isIgnoreNewlineTag: NO,
13664
13680
  isCustomElement: NO,
13665
13681
  onError: defaultOnError,
13666
13682
  onWarn: defaultOnWarn,
@@ -14100,7 +14116,7 @@ function onCloseTag(el, end, isImplied = false) {
14100
14116
  el.innerLoc.end.offset
14101
14117
  );
14102
14118
  }
14103
- const { tag, ns } = el;
14119
+ const { tag, ns, children } = el;
14104
14120
  if (!inVPre) {
14105
14121
  if (tag === "slot") {
14106
14122
  el.tagType = 2;
@@ -14111,7 +14127,13 @@ function onCloseTag(el, end, isImplied = false) {
14111
14127
  }
14112
14128
  }
14113
14129
  if (!tokenizer.inRCDATA) {
14114
- el.children = condenseWhitespace(el.children, el.tag);
14130
+ el.children = condenseWhitespace(children);
14131
+ }
14132
+ if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
14133
+ const first = children[0];
14134
+ if (first && first.type === 2) {
14135
+ first.content = first.content.replace(/^\r?\n/, "");
14136
+ }
14115
14137
  }
14116
14138
  if (ns === 0 && currentOptions.isPreTag(tag)) {
14117
14139
  inPre--;
@@ -14233,12 +14255,6 @@ function condenseWhitespace(nodes, tag) {
14233
14255
  }
14234
14256
  }
14235
14257
  }
14236
- if (inPre && tag && currentOptions.isPreTag(tag)) {
14237
- const first = nodes[0];
14238
- if (first && first.type === 2) {
14239
- first.content = first.content.replace(/^\r?\n/, "");
14240
- }
14241
- }
14242
14258
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
14243
14259
  }
14244
14260
  function isAllWhitespace(str) {
@@ -17995,6 +18011,7 @@ const parserOptions = {
17995
18011
  isVoidTag,
17996
18012
  isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
17997
18013
  isPreTag: (tag) => tag === "pre",
18014
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
17998
18015
  decodeEntities: void 0,
17999
18016
  isBuiltInComponent: (tag) => {
18000
18017
  if (tag === "Transition" || tag === "transition") {
@@ -18321,12 +18338,17 @@ const stringifyStatic = (children, context, parent) => {
18321
18338
  // will insert / hydrate
18322
18339
  String(currentChunk.length)
18323
18340
  ]);
18341
+ const deleteCount = currentChunk.length - 1;
18324
18342
  if (isParentCached) {
18325
- parent.codegenNode.children.value = createArrayExpression([staticCall]);
18343
+ children.splice(
18344
+ currentIndex - currentChunk.length,
18345
+ currentChunk.length,
18346
+ // @ts-expect-error
18347
+ staticCall
18348
+ );
18326
18349
  } else {
18327
18350
  currentChunk[0].codegenNode.value = staticCall;
18328
18351
  if (currentChunk.length > 1) {
18329
- const deleteCount = currentChunk.length - 1;
18330
18352
  children.splice(currentIndex - currentChunk.length + 1, deleteCount);
18331
18353
  const cacheIndex = context.cached.indexOf(
18332
18354
  currentChunk[currentChunk.length - 1].codegenNode
@@ -18338,9 +18360,9 @@ const stringifyStatic = (children, context, parent) => {
18338
18360
  }
18339
18361
  context.cached.splice(cacheIndex - deleteCount + 1, deleteCount);
18340
18362
  }
18341
- return deleteCount;
18342
18363
  }
18343
18364
  }
18365
+ return deleteCount;
18344
18366
  }
18345
18367
  return 0;
18346
18368
  };
@@ -18371,7 +18393,7 @@ const getCachedNode = (node) => {
18371
18393
  };
18372
18394
  const dataAriaRE = /^(data|aria)-/;
18373
18395
  const isStringifiableAttr = (name, ns) => {
18374
- return (ns === 0 ? isKnownHtmlAttr(name) : ns === 1 ? isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
18396
+ return (ns === 0 ? isKnownHtmlAttr(name) : ns === 1 ? isKnownSvgAttr(name) : ns === 2 ? isKnownMathMLAttr(name) : false) || dataAriaRE.test(name);
18375
18397
  };
18376
18398
  const isNonStringifiable = /* @__PURE__ */ makeMap(
18377
18399
  `caption,thead,tr,th,tbody,td,tfoot,colgroup,col`