@vue/compat 3.6.0-rc.13 → 3.6.0-rc.15
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/README.md +2 -2
- package/dist/vue-compat.d.ts +16 -5
- package/dist/vue.cjs.js +562 -235
- package/dist/vue.cjs.prod.js +463 -188
- package/dist/vue.esm-browser.js +530 -229
- package/dist/vue.esm-browser.prod.js +7 -7
- package/dist/vue.esm-bundler.js +561 -235
- package/dist/vue.global.js +530 -229
- package/dist/vue.global.prod.js +7 -7
- package/dist/vue.runtime.esm-browser.js +530 -229
- package/dist/vue.runtime.esm-browser.prod.js +7 -7
- package/dist/vue.runtime.esm-bundler.js +561 -235
- package/dist/vue.runtime.global.js +530 -229
- package/dist/vue.runtime.global.prod.js +7 -7
- package/package.json +3 -3
package/dist/vue.esm-browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-rc.
|
|
2
|
+
* @vue/compat v3.6.0-rc.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -70,10 +70,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
|
|
|
70
70
|
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
71
71
|
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
72
72
|
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
73
|
+
const STRING_CACHE_MAX_SIZE = 1e4;
|
|
73
74
|
const cacheStringFunction = (fn) => {
|
|
74
|
-
|
|
75
|
+
let cache = Object.create(null);
|
|
76
|
+
let size = 0;
|
|
75
77
|
return ((str) => {
|
|
76
|
-
|
|
78
|
+
const hit = cache[str];
|
|
79
|
+
if (hit !== void 0) return hit;
|
|
80
|
+
if (++size > STRING_CACHE_MAX_SIZE) {
|
|
81
|
+
cache = Object.create(null);
|
|
82
|
+
size = 1;
|
|
83
|
+
}
|
|
84
|
+
return cache[str] = fn(str);
|
|
77
85
|
});
|
|
78
86
|
};
|
|
79
87
|
const camelizeRE = /-(\w)/g;
|
|
@@ -81,22 +89,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
|
81
89
|
/**
|
|
82
90
|
* @private
|
|
83
91
|
*/
|
|
84
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
92
|
+
const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
85
93
|
const hyphenateRE = /\B([A-Z])/g;
|
|
86
94
|
/**
|
|
87
95
|
* @private
|
|
88
96
|
*/
|
|
89
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
97
|
+
const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
90
98
|
/**
|
|
91
99
|
* @private
|
|
92
100
|
*/
|
|
93
|
-
const capitalize = cacheStringFunction((str) => {
|
|
101
|
+
const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
94
102
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
95
103
|
});
|
|
96
104
|
/**
|
|
97
105
|
* @private
|
|
98
106
|
*/
|
|
99
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
107
|
+
const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
100
108
|
return str ? `on${capitalize(str)}` : ``;
|
|
101
109
|
});
|
|
102
110
|
/**
|
|
@@ -300,26 +308,11 @@ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
|
300
308
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
301
309
|
*/
|
|
302
310
|
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
303
|
-
|
|
304
|
-
//#region packages/shared/src/domAttrConfig.ts
|
|
305
|
-
/**
|
|
306
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
307
|
-
* have different names from their corresponding dom properties:
|
|
308
|
-
* - itemscope -> N/A
|
|
309
|
-
* - allowfullscreen -> allowFullscreen
|
|
310
|
-
* - formnovalidate -> formNoValidate
|
|
311
|
-
* - ismap -> isMap
|
|
312
|
-
* - nomodule -> noModule
|
|
313
|
-
* - novalidate -> noValidate
|
|
314
|
-
* - playsinline -> playsInline
|
|
315
|
-
* - readonly -> readOnly
|
|
316
|
-
*/
|
|
317
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
318
|
-
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
311
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
|
|
319
312
|
/**
|
|
320
313
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
321
314
|
*/
|
|
322
|
-
const isBooleanAttr = /*@__PURE__*/ makeMap(
|
|
315
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
323
316
|
/**
|
|
324
317
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
325
318
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -516,39 +509,30 @@ function normalizeCssVarValue(value) {
|
|
|
516
509
|
return String(value);
|
|
517
510
|
}
|
|
518
511
|
//#endregion
|
|
519
|
-
//#region packages/
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
512
|
+
//#region packages/shared/src/vaporFlags.ts
|
|
513
|
+
/**
|
|
514
|
+
* The data of the comment a vapor server render opens the branch of a `v-if`
|
|
515
|
+
* chain with, `<!--[1-->`: the digits are the branch's position in the chain,
|
|
516
|
+
* and `<!--]-->` closes it like a fragment.
|
|
517
|
+
*/
|
|
518
|
+
function isVaporBranchStart(data) {
|
|
519
|
+
if (data.length < 2 || data.charCodeAt(0) !== 91) return false;
|
|
520
|
+
for (let i = 1; i < data.length; i++) {
|
|
521
|
+
const c = data.charCodeAt(i);
|
|
522
|
+
if (c < 48 || c > 57) return false;
|
|
528
523
|
}
|
|
524
|
+
return true;
|
|
529
525
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
if (val && !this._onTrigger) setupFlagsHandler(this);
|
|
537
|
-
this._onTrigger = val;
|
|
538
|
-
}
|
|
539
|
-
});
|
|
526
|
+
/**
|
|
527
|
+
* The data of a comment opening a range only a vapor server render emits:
|
|
528
|
+
* `<!--{-->` around the render of a component, or a v-if branch's.
|
|
529
|
+
*/
|
|
530
|
+
function isVaporRangeStart(data) {
|
|
531
|
+
return data === "{" || isVaporBranchStart(data);
|
|
540
532
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
get() {
|
|
545
|
-
return target._flags;
|
|
546
|
-
},
|
|
547
|
-
set(value) {
|
|
548
|
-
if (!(target._flags & 48) && !!(value & 48)) onTrigger(this);
|
|
549
|
-
target._flags = value;
|
|
550
|
-
}
|
|
551
|
-
});
|
|
533
|
+
/** The data of the comment closing the range `open` opens. */
|
|
534
|
+
function rangeCloseOf(open) {
|
|
535
|
+
return open === "(" ? ")" : open === "{" ? "}" : "]";
|
|
552
536
|
}
|
|
553
537
|
//#endregion
|
|
554
538
|
//#region packages/reactivity/src/warning.ts
|
|
@@ -560,13 +544,7 @@ function warn$2(msg, ...args) {
|
|
|
560
544
|
const notifyBuffer = [];
|
|
561
545
|
let batchDepth = 0;
|
|
562
546
|
let activeSub = void 0;
|
|
563
|
-
|
|
564
|
-
function incRunDepth() {
|
|
565
|
-
++runDepth;
|
|
566
|
-
}
|
|
567
|
-
function decRunDepth() {
|
|
568
|
-
--runDepth;
|
|
569
|
-
}
|
|
547
|
+
const CHECKING = 512;
|
|
570
548
|
let globalVersion = 0;
|
|
571
549
|
let notifyIndex = 0;
|
|
572
550
|
let notifyBufferLength = 0;
|
|
@@ -615,6 +593,7 @@ function unlink(link, sub = link.sub) {
|
|
|
615
593
|
const nextDep = link.nextDep;
|
|
616
594
|
const nextSub = link.nextSub;
|
|
617
595
|
const prevSub = link.prevSub;
|
|
596
|
+
link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
|
|
618
597
|
if (nextDep !== void 0) nextDep.prevDep = prevDep;
|
|
619
598
|
else sub.depsTail = prevDep;
|
|
620
599
|
if (prevDep !== void 0) prevDep.nextDep = nextDep;
|
|
@@ -622,7 +601,7 @@ function unlink(link, sub = link.sub) {
|
|
|
622
601
|
if (nextSub !== void 0) nextSub.prevSub = prevSub;
|
|
623
602
|
else dep.subsTail = prevSub;
|
|
624
603
|
if (prevSub !== void 0) prevSub.nextSub = nextSub;
|
|
625
|
-
else if ((dep.subs = nextSub) === void 0) {
|
|
604
|
+
else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
|
|
626
605
|
let toRemove = dep.deps;
|
|
627
606
|
if (toRemove !== void 0) {
|
|
628
607
|
do
|
|
@@ -640,14 +619,12 @@ function propagate(link) {
|
|
|
640
619
|
const sub = link.sub;
|
|
641
620
|
let flags = sub.flags;
|
|
642
621
|
if (flags & 3) {
|
|
643
|
-
if (!(flags &
|
|
644
|
-
|
|
645
|
-
if (runDepth) sub.flags |= 8;
|
|
646
|
-
} else if (!(flags & 12)) flags = 0;
|
|
622
|
+
if (!(flags & 44)) sub.flags = flags | 32;
|
|
623
|
+
else if (!(flags & 12)) flags = 0;
|
|
647
624
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
648
625
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
649
626
|
sub.flags = flags | 40;
|
|
650
|
-
flags
|
|
627
|
+
flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
|
|
651
628
|
} else flags = 0;
|
|
652
629
|
if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
|
|
653
630
|
if (flags & 1) {
|
|
@@ -683,7 +660,7 @@ function propagate(link) {
|
|
|
683
660
|
function startTracking(sub) {
|
|
684
661
|
++globalVersion;
|
|
685
662
|
sub.depsTail = void 0;
|
|
686
|
-
sub.flags = sub.flags & -
|
|
663
|
+
sub.flags = sub.flags & -569 | 4;
|
|
687
664
|
return setActiveSub(sub);
|
|
688
665
|
}
|
|
689
666
|
function endTracking(sub, prevSub) {
|
|
@@ -691,8 +668,11 @@ function endTracking(sub, prevSub) {
|
|
|
691
668
|
activeSub = prevSub;
|
|
692
669
|
const depsTail = sub.depsTail;
|
|
693
670
|
let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
694
|
-
while (toRemove !== void 0)
|
|
695
|
-
|
|
671
|
+
while (toRemove !== void 0) {
|
|
672
|
+
unlink(toRemove, sub);
|
|
673
|
+
toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
674
|
+
}
|
|
675
|
+
if ((sub.flags &= -5) & 8) markRecursed(sub);
|
|
696
676
|
}
|
|
697
677
|
function flush() {
|
|
698
678
|
let hasError = false;
|
|
@@ -714,45 +694,67 @@ function flush() {
|
|
|
714
694
|
if (hasError) throw error;
|
|
715
695
|
}
|
|
716
696
|
function checkDirty(link, sub) {
|
|
697
|
+
try {
|
|
698
|
+
return walkDirty(link, sub);
|
|
699
|
+
} catch (err) {
|
|
700
|
+
markStale(sub);
|
|
701
|
+
throw err;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function walkDirty(link, sub) {
|
|
705
|
+
const root = sub;
|
|
717
706
|
let stack;
|
|
718
707
|
let checkDepth = 0;
|
|
708
|
+
let staleDepth = 0;
|
|
709
|
+
let staleFloor = 0;
|
|
719
710
|
top: do {
|
|
720
711
|
const dep = link.dep;
|
|
721
712
|
const depFlags = dep.flags;
|
|
722
713
|
let dirty = false;
|
|
723
714
|
if (sub.flags & 16) dirty = true;
|
|
724
715
|
else if ((depFlags & 17) === 17) {
|
|
725
|
-
const subs = dep.subs;
|
|
726
716
|
if (dep.update()) {
|
|
727
|
-
|
|
717
|
+
const subs = dep.subs;
|
|
718
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
728
719
|
dirty = true;
|
|
729
720
|
}
|
|
730
721
|
} else if ((depFlags & 33) === 33) {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
722
|
+
const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
|
|
723
|
+
if (depth < 0) {
|
|
724
|
+
if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
|
|
725
|
+
stack = {
|
|
726
|
+
value: link,
|
|
727
|
+
prev: stack
|
|
728
|
+
};
|
|
729
|
+
link = dep.deps;
|
|
730
|
+
sub = dep;
|
|
731
|
+
++checkDepth;
|
|
732
|
+
continue;
|
|
733
|
+
}
|
|
734
|
+
if (depth < checkDepth) {
|
|
735
|
+
staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
|
|
736
|
+
staleDepth = checkDepth;
|
|
737
|
+
}
|
|
739
738
|
}
|
|
740
739
|
if (!dirty && link.nextDep !== void 0) {
|
|
741
740
|
link = link.nextDep;
|
|
742
741
|
continue;
|
|
743
742
|
}
|
|
744
743
|
while (checkDepth) {
|
|
744
|
+
const stale = checkDepth === staleDepth;
|
|
745
|
+
if (stale && --staleDepth === staleFloor) staleDepth = 0;
|
|
745
746
|
--checkDepth;
|
|
746
747
|
link = stack.value;
|
|
747
748
|
stack = stack.prev;
|
|
748
749
|
if (dirty) {
|
|
749
|
-
const subs = sub.subs;
|
|
750
750
|
if (sub.update()) {
|
|
751
|
-
|
|
751
|
+
const subs = sub.subs;
|
|
752
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
752
753
|
sub = link.sub;
|
|
753
754
|
continue;
|
|
754
755
|
}
|
|
755
|
-
} else sub.flags
|
|
756
|
+
} else if (stale) sub.flags = sub.flags & -545 | 16;
|
|
757
|
+
else sub.flags &= -545;
|
|
756
758
|
sub = link.sub;
|
|
757
759
|
if (link.nextDep !== void 0) {
|
|
758
760
|
link = link.nextDep;
|
|
@@ -760,9 +762,21 @@ function checkDirty(link, sub) {
|
|
|
760
762
|
}
|
|
761
763
|
dirty = false;
|
|
762
764
|
}
|
|
763
|
-
return dirty && !!sub.flags;
|
|
765
|
+
return (dirty || !!(sub.flags & 16)) && !!sub.flags;
|
|
764
766
|
} while (true);
|
|
765
767
|
}
|
|
768
|
+
function checkingDepth(dep, stack, depth) {
|
|
769
|
+
for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
|
|
770
|
+
return -1;
|
|
771
|
+
}
|
|
772
|
+
function markStale(sub) {
|
|
773
|
+
const nodes = [sub];
|
|
774
|
+
do {
|
|
775
|
+
sub = nodes.pop();
|
|
776
|
+
sub.flags = sub.flags & -33 | 16;
|
|
777
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
|
|
778
|
+
} while (nodes.length);
|
|
779
|
+
}
|
|
766
780
|
function shallowPropagate(link) {
|
|
767
781
|
do {
|
|
768
782
|
const sub = link.sub;
|
|
@@ -780,6 +794,71 @@ function isValidLink(checkLink, sub) {
|
|
|
780
794
|
}
|
|
781
795
|
return false;
|
|
782
796
|
}
|
|
797
|
+
function markRecursed(sub) {
|
|
798
|
+
const nodes = [sub];
|
|
799
|
+
do {
|
|
800
|
+
sub = nodes.pop();
|
|
801
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) {
|
|
802
|
+
const dep = link.dep;
|
|
803
|
+
if ((dep.flags & 40) === 32) {
|
|
804
|
+
dep.flags |= 8;
|
|
805
|
+
nodes.push(dep);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
} while (nodes.length);
|
|
809
|
+
}
|
|
810
|
+
//#endregion
|
|
811
|
+
//#region packages/reactivity/src/debug.ts
|
|
812
|
+
const triggered = [];
|
|
813
|
+
function onTrack(sub, debugInfo) {
|
|
814
|
+
if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
|
|
815
|
+
}
|
|
816
|
+
function onTrigger(sub, debugInfo) {
|
|
817
|
+
if (sub.onTrigger) sub.onTrigger(extend({ effect: sub }, debugInfo));
|
|
818
|
+
}
|
|
819
|
+
function startTrigger() {
|
|
820
|
+
triggered.push([]);
|
|
821
|
+
}
|
|
822
|
+
function endTrigger(debugInfo) {
|
|
823
|
+
const subs = triggered.pop();
|
|
824
|
+
if (subs.length) {
|
|
825
|
+
startBatch();
|
|
826
|
+
try {
|
|
827
|
+
for (let i = 0; i < subs.length; i++) {
|
|
828
|
+
const sub = subs[i];
|
|
829
|
+
if (sub.flags & 3) onTrigger(sub, debugInfo);
|
|
830
|
+
}
|
|
831
|
+
} finally {
|
|
832
|
+
endBatch();
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
function setupOnTrigger(target) {
|
|
837
|
+
Object.defineProperty(target.prototype, "onTrigger", {
|
|
838
|
+
get() {
|
|
839
|
+
return this._onTrigger;
|
|
840
|
+
},
|
|
841
|
+
set(val) {
|
|
842
|
+
if (val && !this._onTrigger) setupFlagsHandler(this);
|
|
843
|
+
this._onTrigger = val;
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
function setupFlagsHandler(target) {
|
|
848
|
+
target._flags = target.flags;
|
|
849
|
+
Object.defineProperty(target, "flags", {
|
|
850
|
+
get() {
|
|
851
|
+
return target._flags;
|
|
852
|
+
},
|
|
853
|
+
set(value) {
|
|
854
|
+
if (!(target._flags & 48) && !!(value & 48)) {
|
|
855
|
+
if (triggered.length) triggered[triggered.length - 1].push(this);
|
|
856
|
+
else onTrigger(this);
|
|
857
|
+
}
|
|
858
|
+
target._flags = value;
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
}
|
|
783
862
|
//#endregion
|
|
784
863
|
//#region packages/reactivity/src/dep.ts
|
|
785
864
|
var Dep = class {
|
|
@@ -839,20 +918,12 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
839
918
|
if (!depsMap) return;
|
|
840
919
|
const run = (dep) => {
|
|
841
920
|
if (dep !== void 0 && dep.subs !== void 0) {
|
|
842
|
-
triggerEventInfos.push({
|
|
843
|
-
target,
|
|
844
|
-
type,
|
|
845
|
-
key,
|
|
846
|
-
newValue,
|
|
847
|
-
oldValue,
|
|
848
|
-
oldTarget
|
|
849
|
-
});
|
|
850
921
|
propagate(dep.subs);
|
|
851
922
|
shallowPropagate(dep.subs);
|
|
852
|
-
triggerEventInfos.pop();
|
|
853
923
|
}
|
|
854
924
|
};
|
|
855
925
|
startBatch();
|
|
926
|
+
startTrigger();
|
|
856
927
|
if (type === "clear") depsMap.forEach(run);
|
|
857
928
|
else {
|
|
858
929
|
const targetIsArray = isArray(target);
|
|
@@ -882,6 +953,14 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
882
953
|
}
|
|
883
954
|
}
|
|
884
955
|
}
|
|
956
|
+
endTrigger({
|
|
957
|
+
target,
|
|
958
|
+
type,
|
|
959
|
+
key,
|
|
960
|
+
newValue,
|
|
961
|
+
oldValue,
|
|
962
|
+
oldTarget
|
|
963
|
+
});
|
|
885
964
|
endBatch();
|
|
886
965
|
}
|
|
887
966
|
function getDepFromReactive(object, key) {
|
|
@@ -1096,7 +1175,7 @@ function noTracking(self, method, args = []) {
|
|
|
1096
1175
|
//#endregion
|
|
1097
1176
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
1098
1177
|
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1099
|
-
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1178
|
+
const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1100
1179
|
function hasOwnProperty(key) {
|
|
1101
1180
|
if (!isSymbol(key)) key = String(key);
|
|
1102
1181
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1680,16 +1759,16 @@ var RefImpl = class {
|
|
|
1680
1759
|
this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
|
|
1681
1760
|
const subs = this.subs;
|
|
1682
1761
|
if (subs !== void 0) {
|
|
1683
|
-
|
|
1762
|
+
startTrigger();
|
|
1763
|
+
propagate(subs);
|
|
1764
|
+
endTrigger({
|
|
1684
1765
|
target: this,
|
|
1685
1766
|
type: "set",
|
|
1686
1767
|
key: "value",
|
|
1687
1768
|
newValue,
|
|
1688
1769
|
oldValue
|
|
1689
1770
|
});
|
|
1690
|
-
propagate(subs);
|
|
1691
1771
|
if (!batchDepth) flush();
|
|
1692
|
-
triggerEventInfos.pop();
|
|
1693
1772
|
}
|
|
1694
1773
|
}
|
|
1695
1774
|
}
|
|
@@ -1726,8 +1805,10 @@ var RefImpl = class {
|
|
|
1726
1805
|
function triggerRef(ref) {
|
|
1727
1806
|
const dep = ref.dep;
|
|
1728
1807
|
if (dep !== void 0 && dep.subs !== void 0) {
|
|
1808
|
+
startTrigger();
|
|
1729
1809
|
propagate(dep.subs);
|
|
1730
1810
|
shallowPropagate(dep.subs);
|
|
1811
|
+
endTrigger();
|
|
1731
1812
|
if (!batchDepth) flush();
|
|
1732
1813
|
}
|
|
1733
1814
|
}
|
|
@@ -1918,6 +1999,10 @@ var ReactiveEffect = class {
|
|
|
1918
1999
|
get active() {
|
|
1919
2000
|
return !(this.flags & 1024);
|
|
1920
2001
|
}
|
|
2002
|
+
/** @internal */
|
|
2003
|
+
get running() {
|
|
2004
|
+
return !!(this.flags & 4);
|
|
2005
|
+
}
|
|
1921
2006
|
pause() {
|
|
1922
2007
|
this.flags |= 256;
|
|
1923
2008
|
}
|
|
@@ -1931,11 +2016,9 @@ var ReactiveEffect = class {
|
|
|
1931
2016
|
if (!this.active) return this.fn();
|
|
1932
2017
|
cleanup(this);
|
|
1933
2018
|
const prevSub = startTracking(this);
|
|
1934
|
-
incRunDepth();
|
|
1935
2019
|
try {
|
|
1936
2020
|
return this.fn();
|
|
1937
2021
|
} finally {
|
|
1938
|
-
decRunDepth();
|
|
1939
2022
|
endTracking(this, prevSub);
|
|
1940
2023
|
const flags = this.flags;
|
|
1941
2024
|
if ((flags & 136) === 136) {
|
|
@@ -1958,9 +2041,9 @@ var ReactiveEffect = class {
|
|
|
1958
2041
|
if (flags & 16) return true;
|
|
1959
2042
|
if (flags & 32) {
|
|
1960
2043
|
if (checkDirty(this.deps, this)) {
|
|
1961
|
-
this.
|
|
2044
|
+
if (this.active) this.flags |= 16;
|
|
1962
2045
|
return true;
|
|
1963
|
-
} else this.flags
|
|
2046
|
+
} else this.flags &= -33;
|
|
1964
2047
|
}
|
|
1965
2048
|
return false;
|
|
1966
2049
|
}
|
|
@@ -1972,20 +2055,17 @@ function effect(fn, options) {
|
|
|
1972
2055
|
if (options) {
|
|
1973
2056
|
const { onStop, scheduler } = options;
|
|
1974
2057
|
if (onStop) {
|
|
1975
|
-
options.onStop = void 0;
|
|
1976
2058
|
const stop = e.stop.bind(e);
|
|
1977
2059
|
e.stop = () => {
|
|
1978
2060
|
stop();
|
|
1979
2061
|
onStop();
|
|
1980
2062
|
};
|
|
1981
2063
|
}
|
|
1982
|
-
if (scheduler) {
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
}
|
|
1988
|
-
extend(e, options);
|
|
2064
|
+
if (scheduler) e.notify = () => {
|
|
2065
|
+
if (!(e.flags & 1280)) scheduler();
|
|
2066
|
+
};
|
|
2067
|
+
e.onTrack = options.onTrack;
|
|
2068
|
+
e.onTrigger = options.onTrigger;
|
|
1989
2069
|
}
|
|
1990
2070
|
try {
|
|
1991
2071
|
e.run();
|
|
@@ -2045,8 +2125,10 @@ var EffectScope = class {
|
|
|
2045
2125
|
const flags = this.flags;
|
|
2046
2126
|
if (flags & 256) {
|
|
2047
2127
|
this.flags = flags & -257;
|
|
2048
|
-
|
|
2049
|
-
|
|
2128
|
+
const deps = [];
|
|
2129
|
+
for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
|
|
2130
|
+
for (let i = 0; i < deps.length; i++) {
|
|
2131
|
+
const dep = deps[i];
|
|
2050
2132
|
if ("resume" in dep) dep.resume();
|
|
2051
2133
|
}
|
|
2052
2134
|
}
|
|
@@ -2075,8 +2157,10 @@ var EffectScope = class {
|
|
|
2075
2157
|
while (dep !== void 0) {
|
|
2076
2158
|
const node = dep.dep;
|
|
2077
2159
|
if ("stop" in node) {
|
|
2078
|
-
|
|
2160
|
+
const prev = dep.prevDep;
|
|
2079
2161
|
node.stop();
|
|
2162
|
+
const next = prev !== void 0 ? prev.nextDep : this.deps;
|
|
2163
|
+
dep = next === dep ? dep.nextDep : next;
|
|
2080
2164
|
} else dep = unlink(dep, this);
|
|
2081
2165
|
}
|
|
2082
2166
|
cleanup(this);
|
|
@@ -2117,11 +2201,14 @@ function setCurrentScope(scope) {
|
|
|
2117
2201
|
* @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
|
|
2118
2202
|
*/
|
|
2119
2203
|
function onScopeDispose(fn, failSilently = false) {
|
|
2120
|
-
if (activeEffectScope !== void 0)
|
|
2121
|
-
|
|
2204
|
+
if (activeEffectScope !== void 0) {
|
|
2205
|
+
if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
|
|
2206
|
+
else fn();
|
|
2207
|
+
} else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
|
|
2122
2208
|
}
|
|
2123
2209
|
//#endregion
|
|
2124
2210
|
//#region packages/reactivity/src/computed.ts
|
|
2211
|
+
const FAILED = 64;
|
|
2125
2212
|
/**
|
|
2126
2213
|
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
2127
2214
|
* the main vue package
|
|
@@ -2170,12 +2257,24 @@ var ComputedRefImpl = class {
|
|
|
2170
2257
|
}
|
|
2171
2258
|
get value() {
|
|
2172
2259
|
const flags = this.flags;
|
|
2173
|
-
|
|
2174
|
-
if (this.
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2260
|
+
try {
|
|
2261
|
+
if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
|
|
2262
|
+
if (this.update()) {
|
|
2263
|
+
const subs = this.subs;
|
|
2264
|
+
if (subs !== void 0) shallowPropagate(subs);
|
|
2265
|
+
}
|
|
2266
|
+
} else if (flags & 32) this.flags = flags & -33;
|
|
2267
|
+
} catch (err) {
|
|
2268
|
+
if (activeSub !== void 0) {
|
|
2269
|
+
onTrack(activeSub, {
|
|
2270
|
+
target: this,
|
|
2271
|
+
type: "get",
|
|
2272
|
+
key: "value"
|
|
2273
|
+
});
|
|
2274
|
+
link(this, activeSub);
|
|
2275
|
+
} else if (activeEffectScope !== void 0) link(this, activeEffectScope);
|
|
2276
|
+
throw err;
|
|
2277
|
+
}
|
|
2179
2278
|
if (activeSub !== void 0) {
|
|
2180
2279
|
onTrack(activeSub, {
|
|
2181
2280
|
target: this,
|
|
@@ -2183,7 +2282,18 @@ var ComputedRefImpl = class {
|
|
|
2183
2282
|
key: "value"
|
|
2184
2283
|
});
|
|
2185
2284
|
link(this, activeSub);
|
|
2186
|
-
} else if (activeEffectScope !== void 0)
|
|
2285
|
+
} else if (activeEffectScope !== void 0) {
|
|
2286
|
+
if (activeEffectScope.active) link(this, activeEffectScope);
|
|
2287
|
+
else if (this.subs === void 0) {
|
|
2288
|
+
let dep = this.deps;
|
|
2289
|
+
if (dep !== void 0) {
|
|
2290
|
+
do
|
|
2291
|
+
dep = unlink(dep, this);
|
|
2292
|
+
while (dep !== void 0);
|
|
2293
|
+
this.flags |= 16;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2187
2297
|
return this._value;
|
|
2188
2298
|
}
|
|
2189
2299
|
set value(newValue) {
|
|
@@ -2195,11 +2305,15 @@ var ComputedRefImpl = class {
|
|
|
2195
2305
|
try {
|
|
2196
2306
|
const oldValue = this._value;
|
|
2197
2307
|
const newValue = this.fn(oldValue);
|
|
2198
|
-
if (hasChanged(oldValue, newValue)) {
|
|
2308
|
+
if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
|
|
2199
2309
|
this._value = newValue;
|
|
2310
|
+
this.flags &= -65;
|
|
2200
2311
|
return true;
|
|
2201
2312
|
}
|
|
2202
2313
|
return false;
|
|
2314
|
+
} catch (err) {
|
|
2315
|
+
this.flags |= FAILED;
|
|
2316
|
+
throw err;
|
|
2203
2317
|
} finally {
|
|
2204
2318
|
endTracking(this, prevSub);
|
|
2205
2319
|
}
|
|
@@ -2220,6 +2334,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
2220
2334
|
cRef.onTrack = debugOptions.onTrack;
|
|
2221
2335
|
cRef.onTrigger = debugOptions.onTrigger;
|
|
2222
2336
|
}
|
|
2337
|
+
if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
|
|
2223
2338
|
return cRef;
|
|
2224
2339
|
}
|
|
2225
2340
|
//#endregion
|
|
@@ -2590,7 +2705,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2590
2705
|
if (isFunction(fn)) {
|
|
2591
2706
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
2592
2707
|
if (res && isPromise(res)) res.catch((err) => {
|
|
2593
|
-
handleError(err, instance, type);
|
|
2708
|
+
handleError(err, instance, type, void 0, true);
|
|
2594
2709
|
});
|
|
2595
2710
|
return res;
|
|
2596
2711
|
}
|
|
@@ -2600,7 +2715,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2600
2715
|
return values;
|
|
2601
2716
|
} else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
|
|
2602
2717
|
}
|
|
2603
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
2718
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
2604
2719
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
2605
2720
|
if (instance) {
|
|
2606
2721
|
let cur = instance.parent;
|
|
@@ -2608,7 +2723,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
2608
2723
|
const errorInfo = ErrorTypeStrings$1[type];
|
|
2609
2724
|
while (cur) {
|
|
2610
2725
|
const errorCapturedHooks = cur.ec;
|
|
2611
|
-
if (errorCapturedHooks) {
|
|
2726
|
+
if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
|
|
2612
2727
|
for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
|
|
2613
2728
|
}
|
|
2614
2729
|
cur = cur.parent;
|
|
@@ -2913,7 +3028,11 @@ function reload(id, newComp) {
|
|
|
2913
3028
|
updateComponentDef(record.initialDef, newComp);
|
|
2914
3029
|
const instances = [...record.instances];
|
|
2915
3030
|
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2916
|
-
for (const instance of instances)
|
|
3031
|
+
for (const instance of instances) {
|
|
3032
|
+
if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
3033
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
3034
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
3035
|
+
}
|
|
2917
3036
|
const dirtyInstances = new Set(instances);
|
|
2918
3037
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2919
3038
|
runWithHmrUpdating(() => {
|
|
@@ -2954,7 +3073,25 @@ function reload(id, newComp) {
|
|
|
2954
3073
|
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2955
3074
|
}
|
|
2956
3075
|
parents.forEach((parent) => {
|
|
2957
|
-
|
|
3076
|
+
const children = instances.filter((instance) => instance.parent === parent);
|
|
3077
|
+
const update = () => {
|
|
3078
|
+
if (!parent.scope.active) return;
|
|
3079
|
+
const activeChildren = children.filter((instance) => instance.scope.active);
|
|
3080
|
+
if (!activeChildren.length) return;
|
|
3081
|
+
const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
|
|
3082
|
+
if (pending) {
|
|
3083
|
+
pending.asyncDep.catch(NOOP).then(() => {
|
|
3084
|
+
if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
|
|
3085
|
+
});
|
|
3086
|
+
return;
|
|
3087
|
+
}
|
|
3088
|
+
for (const instance of activeChildren) {
|
|
3089
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
3090
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
3091
|
+
if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
3092
|
+
dirtyInstances.add(instance);
|
|
3093
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
3094
|
+
}
|
|
2958
3095
|
runWithHmrUpdating(() => {
|
|
2959
3096
|
if (parent.vapor) parent.hmrRerender();
|
|
2960
3097
|
else {
|
|
@@ -2965,7 +3102,12 @@ function reload(id, newComp) {
|
|
|
2965
3102
|
}
|
|
2966
3103
|
}
|
|
2967
3104
|
});
|
|
2968
|
-
|
|
3105
|
+
queuePostFlushCb(() => {
|
|
3106
|
+
hmrDirtyComponents.clear();
|
|
3107
|
+
hmrDirtyComponentsMode.clear();
|
|
3108
|
+
});
|
|
3109
|
+
};
|
|
3110
|
+
queueJob(update);
|
|
2969
3111
|
});
|
|
2970
3112
|
}
|
|
2971
3113
|
queuePostFlushCb(() => {
|
|
@@ -3514,11 +3656,28 @@ function withDirectives(vnode, directives) {
|
|
|
3514
3656
|
return vnode;
|
|
3515
3657
|
}
|
|
3516
3658
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
3517
|
-
|
|
3659
|
+
let hookVNode = vnode;
|
|
3660
|
+
if (name === "beforeMount") vnode._mount = vnode;
|
|
3661
|
+
else if (name === "beforeUpdate") {
|
|
3662
|
+
const mount = prevVNode && prevVNode._mount;
|
|
3663
|
+
if (mount) {
|
|
3664
|
+
mount._latest = vnode;
|
|
3665
|
+
vnode._mount = mount;
|
|
3666
|
+
}
|
|
3667
|
+
} else if (name === "mounted") {
|
|
3668
|
+
const latest = vnode._latest;
|
|
3669
|
+
vnode._mount = vnode._latest = void 0;
|
|
3670
|
+
if (latest) {
|
|
3671
|
+
hookVNode = latest;
|
|
3672
|
+
latest._mount = void 0;
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
const bindings = hookVNode.dirs;
|
|
3518
3676
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
3519
3677
|
for (let i = 0; i < bindings.length; i++) {
|
|
3520
|
-
|
|
3678
|
+
let binding = bindings[i];
|
|
3521
3679
|
if (oldBindings) binding.oldValue = oldBindings[i].value;
|
|
3680
|
+
else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
|
|
3522
3681
|
let hook = binding.dir[name];
|
|
3523
3682
|
if (!hook) hook = mapCompatDirectiveHook(name, binding.dir, instance);
|
|
3524
3683
|
if (hook) {
|
|
@@ -3526,7 +3685,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
3526
3685
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3527
3686
|
vnode.el,
|
|
3528
3687
|
binding,
|
|
3529
|
-
|
|
3688
|
+
hookVNode,
|
|
3530
3689
|
prevVNode
|
|
3531
3690
|
]);
|
|
3532
3691
|
setActiveSub(prevSub);
|
|
@@ -3951,7 +4110,15 @@ const BaseTransitionImpl = {
|
|
|
3951
4110
|
const { mode } = rawProps;
|
|
3952
4111
|
checkTransitionMode(mode);
|
|
3953
4112
|
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
3954
|
-
if (!(instance.effect.flags & 1024))
|
|
4113
|
+
if (!(instance.effect.flags & 1024)) {
|
|
4114
|
+
if (instance.effect.running) {
|
|
4115
|
+
const job = () => {
|
|
4116
|
+
if (!(instance.effect.flags & 1024)) instance.update();
|
|
4117
|
+
};
|
|
4118
|
+
job.i = instance;
|
|
4119
|
+
queueJob(job);
|
|
4120
|
+
} else instance.update();
|
|
4121
|
+
}
|
|
3955
4122
|
}) : NOOP);
|
|
3956
4123
|
};
|
|
3957
4124
|
}
|
|
@@ -3982,7 +4149,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
3982
4149
|
}
|
|
3983
4150
|
return leavingVNodesCache;
|
|
3984
4151
|
}
|
|
3985
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
4152
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
3986
4153
|
const key = String(vnode.key);
|
|
3987
4154
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3988
4155
|
const hooks = baseResolveTransitionHooks({
|
|
@@ -4005,9 +4172,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
4005
4172
|
}
|
|
4006
4173
|
},
|
|
4007
4174
|
cloneHooks: (vnode) => {
|
|
4008
|
-
|
|
4009
|
-
if (postClone) postClone(hooks);
|
|
4010
|
-
return hooks;
|
|
4175
|
+
return resolveTransitionHooks(vnode, props, state, instance);
|
|
4011
4176
|
}
|
|
4012
4177
|
}, props, state, instance);
|
|
4013
4178
|
if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
|
|
@@ -4045,7 +4210,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
4045
4210
|
callHook(hook, [el]);
|
|
4046
4211
|
},
|
|
4047
4212
|
enter(el) {
|
|
4048
|
-
if (!isHmrUpdating && isLeaving()) return;
|
|
4213
|
+
if (!isHmrUpdating && isLeaving(el)) return;
|
|
4049
4214
|
let hook = onEnter;
|
|
4050
4215
|
let afterHook = onAfterEnter;
|
|
4051
4216
|
let cancelHook = onEnterCancelled;
|
|
@@ -4089,7 +4254,19 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
4089
4254
|
else done();
|
|
4090
4255
|
},
|
|
4091
4256
|
clone(node) {
|
|
4092
|
-
|
|
4257
|
+
if (!cloneHooks) return hooks;
|
|
4258
|
+
const cloned = cloneHooks(node);
|
|
4259
|
+
cloned.afterLeave = () => {
|
|
4260
|
+
if (hooks.afterLeave) hooks.afterLeave();
|
|
4261
|
+
};
|
|
4262
|
+
cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
4263
|
+
if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
|
|
4264
|
+
else delayedLeave();
|
|
4265
|
+
};
|
|
4266
|
+
cloned.delayedLeave = () => {
|
|
4267
|
+
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
4268
|
+
};
|
|
4269
|
+
return cloned;
|
|
4093
4270
|
}
|
|
4094
4271
|
};
|
|
4095
4272
|
return hooks;
|
|
@@ -4124,10 +4301,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
|
|
|
4124
4301
|
if (state.isLeaving) return emptyPlaceholder(next);
|
|
4125
4302
|
const nextInner = getInnerChild$1(next);
|
|
4126
4303
|
if (!nextInner) return emptyPlaceholder(next);
|
|
4127
|
-
|
|
4128
|
-
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
4129
|
-
enterHooks = hooks;
|
|
4130
|
-
});
|
|
4304
|
+
const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
|
|
4131
4305
|
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
4132
4306
|
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
4133
4307
|
const mode = props.mode;
|
|
@@ -4193,9 +4367,14 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
4193
4367
|
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
4194
4368
|
}
|
|
4195
4369
|
} else if (vnode.shapeFlag & 128) {
|
|
4196
|
-
const
|
|
4197
|
-
|
|
4198
|
-
|
|
4370
|
+
const suspense = vnode.suspense;
|
|
4371
|
+
if (suspense) {
|
|
4372
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
4373
|
+
if (branch) return setTransitionHooks(branch, hooks.clone(branch));
|
|
4374
|
+
} else {
|
|
4375
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4376
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4377
|
+
}
|
|
4199
4378
|
} else {
|
|
4200
4379
|
vnode.transition = hooks;
|
|
4201
4380
|
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
@@ -4413,6 +4592,8 @@ const getContainerType = (container) => {
|
|
|
4413
4592
|
if (isMathMLContainer(container)) return "mathml";
|
|
4414
4593
|
};
|
|
4415
4594
|
const isComment = (node) => node.nodeType === 8;
|
|
4595
|
+
/** The data of a comment opening a range a hydration steps over as one. */
|
|
4596
|
+
const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
|
|
4416
4597
|
function createHydrationFunctions(rendererInternals) {
|
|
4417
4598
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
4418
4599
|
const hydrate = (vnode, container) => {
|
|
@@ -4430,7 +4611,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4430
4611
|
};
|
|
4431
4612
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
4432
4613
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4433
|
-
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
4614
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
|
|
4434
4615
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
4435
4616
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
4436
4617
|
let domType = node.nodeType;
|
|
@@ -4619,16 +4800,17 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4619
4800
|
const container = parentNode(node);
|
|
4620
4801
|
const first = nextSibling(node);
|
|
4621
4802
|
const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4622
|
-
|
|
4803
|
+
const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
|
|
4804
|
+
if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
|
|
4623
4805
|
else {
|
|
4624
4806
|
logMismatchError();
|
|
4625
|
-
insert(vnode.anchor = createComment(
|
|
4807
|
+
insert(vnode.anchor = createComment(close), container, next);
|
|
4626
4808
|
return next;
|
|
4627
4809
|
}
|
|
4628
4810
|
};
|
|
4629
4811
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4630
4812
|
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
4631
|
-
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data
|
|
4813
|
+
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && isRangeStart(node.data) ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
4632
4814
|
logMismatchError();
|
|
4633
4815
|
}
|
|
4634
4816
|
vnode.el = null;
|
|
@@ -4644,18 +4826,18 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4644
4826
|
const container = parentNode(node);
|
|
4645
4827
|
remove(node);
|
|
4646
4828
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4647
|
-
if (parentComponent && parentComponent.vnode) {
|
|
4829
|
+
if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
|
|
4648
4830
|
parentComponent.vnode.el = vnode.el;
|
|
4649
4831
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
4650
4832
|
}
|
|
4651
4833
|
return next;
|
|
4652
4834
|
};
|
|
4653
|
-
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "("
|
|
4835
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
|
|
4654
4836
|
let match = 0;
|
|
4655
4837
|
while (node) {
|
|
4656
4838
|
node = nextSibling(node);
|
|
4657
4839
|
if (node && isComment(node)) {
|
|
4658
|
-
if (node.data === open) match++;
|
|
4840
|
+
if (node.data === open || isVaporInteropEnabled && open === "[" && isVaporBranchStart(node.data)) match++;
|
|
4659
4841
|
if (node.data === close) {
|
|
4660
4842
|
if (match === 0) return nextSibling(node);
|
|
4661
4843
|
else match--;
|
|
@@ -4911,9 +5093,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
4911
5093
|
return teardown;
|
|
4912
5094
|
};
|
|
4913
5095
|
function forEachElement(node, cb) {
|
|
4914
|
-
if (isComment(node) && (node.data
|
|
5096
|
+
if (isComment(node) && isRangeStart(node.data)) {
|
|
4915
5097
|
const open = node.data;
|
|
4916
|
-
const close = open
|
|
5098
|
+
const close = rangeCloseOf(open);
|
|
4917
5099
|
let depth = 1;
|
|
4918
5100
|
let next = node.nextSibling;
|
|
4919
5101
|
while (next) {
|
|
@@ -4922,7 +5104,7 @@ function forEachElement(node, cb) {
|
|
|
4922
5104
|
} else if (isComment(next)) {
|
|
4923
5105
|
if (next.data === close) {
|
|
4924
5106
|
if (--depth === 0) break;
|
|
4925
|
-
} else if (next.data === open) depth++;
|
|
5107
|
+
} else if (close === "]" ? next.data === "[" || isVaporBranchStart(next.data) : next.data === open) depth++;
|
|
4926
5108
|
}
|
|
4927
5109
|
next = next.nextSibling;
|
|
4928
5110
|
}
|
|
@@ -4950,7 +5132,7 @@ function defineAsyncComponent(source) {
|
|
|
4950
5132
|
if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
|
|
4951
5133
|
const onError = (err) => {
|
|
4952
5134
|
setPendingRequest(null);
|
|
4953
|
-
handleError(err, instance, 13, !errorComponent);
|
|
5135
|
+
handleError(err, instance, 13, !errorComponent, true);
|
|
4954
5136
|
};
|
|
4955
5137
|
if (suspensible && instance.suspense || false) return load().then((comp) => {
|
|
4956
5138
|
return () => createInnerComp(comp, instance);
|
|
@@ -5031,10 +5213,12 @@ const useAsyncComponentState = (delay = 200, timeout, onError, instance = curren
|
|
|
5031
5213
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
5032
5214
|
let timeoutTimer;
|
|
5033
5215
|
let delayTimer;
|
|
5034
|
-
if (instance)
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5216
|
+
if (instance) instance.scope.run(() => {
|
|
5217
|
+
onScopeDispose(() => {
|
|
5218
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
5219
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
5220
|
+
});
|
|
5221
|
+
});
|
|
5038
5222
|
if (delay) delayTimer = setTimeout(() => {
|
|
5039
5223
|
if (instance && instance.isUnmounted) return;
|
|
5040
5224
|
delayed.value = false;
|
|
@@ -5069,7 +5253,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
5069
5253
|
}
|
|
5070
5254
|
return;
|
|
5071
5255
|
}
|
|
5072
|
-
if (!el.parentNode
|
|
5256
|
+
if (!el.parentNode) return;
|
|
5257
|
+
if (wasConnected && !el.isConnected) {
|
|
5258
|
+
let current = instance;
|
|
5259
|
+
while (current && !current.isDeactivated) current = current.parent;
|
|
5260
|
+
if (!current) return;
|
|
5261
|
+
}
|
|
5073
5262
|
hydrate();
|
|
5074
5263
|
};
|
|
5075
5264
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -5123,7 +5312,11 @@ const KeepAliveImpl = {
|
|
|
5123
5312
|
activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
|
|
5124
5313
|
};
|
|
5125
5314
|
sharedContext.deactivate = (vnode) => {
|
|
5126
|
-
|
|
5315
|
+
const cached = sharedContext.getCachedComponent(vnode);
|
|
5316
|
+
if (!cached || cached.component !== vnode.component) return false;
|
|
5317
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
|
|
5318
|
+
else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
|
|
5319
|
+
return true;
|
|
5127
5320
|
};
|
|
5128
5321
|
function unmount(vnode) {
|
|
5129
5322
|
resetShapeFlag(vnode);
|
|
@@ -5155,11 +5348,15 @@ const KeepAliveImpl = {
|
|
|
5155
5348
|
let pendingCacheKey = null;
|
|
5156
5349
|
const cacheSubtree = () => {
|
|
5157
5350
|
if (pendingCacheKey != null) {
|
|
5158
|
-
if (isSuspense(keepAliveInstance.subTree.type))
|
|
5159
|
-
const
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5351
|
+
if (isSuspense(keepAliveInstance.subTree.type)) {
|
|
5352
|
+
const cacheInnerChild = () => {
|
|
5353
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
5354
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
5355
|
+
};
|
|
5356
|
+
const suspense = keepAliveInstance.subTree.suspense;
|
|
5357
|
+
if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
|
|
5358
|
+
else cacheInnerChild();
|
|
5359
|
+
} else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
5163
5360
|
}
|
|
5164
5361
|
};
|
|
5165
5362
|
onMounted(cacheSubtree);
|
|
@@ -5269,9 +5466,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
|
|
|
5269
5466
|
}
|
|
5270
5467
|
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
5271
5468
|
const injected = injectHook(type, hook, keepAliveRoot, true);
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
}, target);
|
|
5469
|
+
const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
|
|
5470
|
+
removal.flags = 8;
|
|
5275
5471
|
}
|
|
5276
5472
|
function resetShapeFlag(vnode) {
|
|
5277
5473
|
vnode.shapeFlag &= -257;
|
|
@@ -5693,6 +5889,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
5693
5889
|
ret.props = extend({}, ret.props, { key: branchKey });
|
|
5694
5890
|
ret.key = branchKey;
|
|
5695
5891
|
}
|
|
5892
|
+
if (isBlockTreeEnabled <= 0) {
|
|
5893
|
+
if (!ret.vs.props) ret.vs.props = ret.props;
|
|
5894
|
+
ret.props = ret.key != null ? { key: ret.key } : null;
|
|
5895
|
+
ret.vs.attrs = EMPTY_OBJ;
|
|
5896
|
+
}
|
|
5696
5897
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5697
5898
|
return ret;
|
|
5698
5899
|
}
|
|
@@ -6672,7 +6873,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6672
6873
|
if (options.el) return vm.$mount(options.el);
|
|
6673
6874
|
else return vm;
|
|
6674
6875
|
}
|
|
6675
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
6876
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.15`;
|
|
6676
6877
|
Vue.config = singletonApp.config;
|
|
6677
6878
|
Vue.use = (plugin, ...options) => {
|
|
6678
6879
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -8132,8 +8333,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8132
8333
|
def(el, "__vnode", vnode, true);
|
|
8133
8334
|
def(el, "__vueParentComponent", parentComponent, true);
|
|
8134
8335
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
8135
|
-
if (transition)
|
|
8136
|
-
|
|
8336
|
+
if (transition) {
|
|
8337
|
+
if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
|
|
8338
|
+
performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
|
|
8339
|
+
} else hostInsert(el, container, anchor);
|
|
8137
8340
|
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
8138
8341
|
const isHmr = isHmrUpdating;
|
|
8139
8342
|
queuePostRenderEffect(() => {
|
|
@@ -8398,16 +8601,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8398
8601
|
} else {
|
|
8399
8602
|
let { next, bu, u, parent, vnode } = instance;
|
|
8400
8603
|
{
|
|
8401
|
-
const
|
|
8402
|
-
if (
|
|
8604
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
8605
|
+
if (unresolvedAsyncRoot) {
|
|
8403
8606
|
if (next) {
|
|
8404
8607
|
next.el = vnode.el;
|
|
8405
8608
|
updateComponentPreRender(instance, next, optimized);
|
|
8406
8609
|
}
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
if (
|
|
8410
|
-
|
|
8610
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
8611
|
+
const retry = () => {
|
|
8612
|
+
if (instance.effect.flags & 1024) return;
|
|
8613
|
+
if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
8614
|
+
else instance.update();
|
|
8615
|
+
};
|
|
8616
|
+
retry.flags = 24;
|
|
8617
|
+
queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
8411
8618
|
});
|
|
8412
8619
|
return;
|
|
8413
8620
|
}
|
|
@@ -8431,7 +8638,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8431
8638
|
const prevTree = instance.subTree;
|
|
8432
8639
|
instance.subTree = nextTree;
|
|
8433
8640
|
startMeasure(instance, `patch`);
|
|
8434
|
-
patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
8641
|
+
patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
8435
8642
|
endMeasure(instance, `patch`);
|
|
8436
8643
|
next.el = nextTree.el;
|
|
8437
8644
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
@@ -8635,9 +8842,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8635
8842
|
}
|
|
8636
8843
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8637
8844
|
if (shapeFlag & 256) {
|
|
8638
|
-
if (
|
|
8639
|
-
else parentComponent.ctx.deactivate(vnode);
|
|
8640
|
-
return;
|
|
8845
|
+
if (parentComponent.ctx.deactivate(vnode)) return;
|
|
8641
8846
|
}
|
|
8642
8847
|
if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
|
|
8643
8848
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
@@ -8718,13 +8923,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8718
8923
|
if (effect) {
|
|
8719
8924
|
effect.stop();
|
|
8720
8925
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8721
|
-
} else if (
|
|
8926
|
+
} else if (subTree) {
|
|
8722
8927
|
subTree.transition = instance.vnode.transition;
|
|
8723
8928
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8724
8929
|
}
|
|
8725
8930
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8726
8931
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
8727
|
-
|
|
8932
|
+
const markUnmounted = () => instance.isUnmounted = true;
|
|
8933
|
+
markUnmounted.flags = 8;
|
|
8934
|
+
queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
|
|
8728
8935
|
devtoolsComponentRemoved(instance);
|
|
8729
8936
|
};
|
|
8730
8937
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
@@ -8838,11 +9045,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
8838
9045
|
c2.el && (c2.el.__vnode = c2);
|
|
8839
9046
|
}
|
|
8840
9047
|
}
|
|
8841
|
-
function
|
|
9048
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
8842
9049
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
8843
9050
|
if (subComponent) {
|
|
8844
9051
|
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
8845
|
-
else return
|
|
9052
|
+
else return locateUnresolvedAsyncRoot(subComponent);
|
|
8846
9053
|
}
|
|
8847
9054
|
}
|
|
8848
9055
|
function invalidateMount(hooks) {
|
|
@@ -8912,7 +9119,9 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
|
|
|
8912
9119
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
8913
9120
|
if (anchorVnode.placeholder) return anchorVnode.placeholder;
|
|
8914
9121
|
const instance = anchorVnode.component;
|
|
8915
|
-
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
9122
|
+
if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
9123
|
+
const suspense = anchorVnode.suspense;
|
|
9124
|
+
if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
8916
9125
|
return null;
|
|
8917
9126
|
}
|
|
8918
9127
|
//#endregion
|
|
@@ -8924,17 +9133,22 @@ function withSuspenseEnabled(value) {
|
|
|
8924
9133
|
return value;
|
|
8925
9134
|
}
|
|
8926
9135
|
let suspenseId = 0;
|
|
9136
|
+
const deferredEnterKey = Symbol("_deferredEnter");
|
|
8927
9137
|
const Suspense = /*@__PURE__*/ withSuspenseEnabled({
|
|
8928
9138
|
name: "Suspense",
|
|
8929
9139
|
__isSuspense: true,
|
|
8930
9140
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
8931
9141
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
8932
9142
|
else {
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
n2.
|
|
8937
|
-
|
|
9143
|
+
const suspense = n1.suspense;
|
|
9144
|
+
if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
|
|
9145
|
+
const owner = suspense.parentComponent;
|
|
9146
|
+
if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
|
|
9147
|
+
n2.suspense = suspense;
|
|
9148
|
+
suspense.vnode = n2;
|
|
9149
|
+
n2.el = n1.el;
|
|
9150
|
+
return;
|
|
9151
|
+
}
|
|
8938
9152
|
}
|
|
8939
9153
|
patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
|
|
8940
9154
|
}
|
|
@@ -8946,6 +9160,36 @@ function triggerEvent(vnode, name) {
|
|
|
8946
9160
|
const eventListener = vnode.props && vnode.props[name];
|
|
8947
9161
|
if (isFunction(eventListener)) eventListener();
|
|
8948
9162
|
}
|
|
9163
|
+
function enterDeferred(suspense, branch) {
|
|
9164
|
+
const enters = [];
|
|
9165
|
+
collectDeferredEnters(branch, enters, true);
|
|
9166
|
+
if (isVaporInteropEnabled) {
|
|
9167
|
+
const { parentComponent } = suspense;
|
|
9168
|
+
const vapor = parentComponent && parentComponent.appContext.vapor;
|
|
9169
|
+
if (vapor) vapor.enterDeferred(suspense, enters);
|
|
9170
|
+
}
|
|
9171
|
+
if (enters.length) queuePostFlushCb(enters);
|
|
9172
|
+
}
|
|
9173
|
+
function collectDeferredEnters(vnode, enters, isRoot) {
|
|
9174
|
+
const { el, transition, children, shapeFlag } = vnode;
|
|
9175
|
+
if (shapeFlag & 6) {
|
|
9176
|
+
const subTree = vnode.component.subTree;
|
|
9177
|
+
if (subTree) collectDeferredEnters(subTree, enters, isRoot);
|
|
9178
|
+
return;
|
|
9179
|
+
}
|
|
9180
|
+
if (shapeFlag & 192) return;
|
|
9181
|
+
if (shapeFlag & 1) {
|
|
9182
|
+
if (!isRoot && el && el[deferredEnterKey]) {
|
|
9183
|
+
el[deferredEnterKey] = void 0;
|
|
9184
|
+
if (transition && !transition.persisted) {
|
|
9185
|
+
transition.beforeEnter(el);
|
|
9186
|
+
enters.push(() => transition.enter(el));
|
|
9187
|
+
}
|
|
9188
|
+
}
|
|
9189
|
+
isRoot = false;
|
|
9190
|
+
}
|
|
9191
|
+
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
|
|
9192
|
+
}
|
|
8949
9193
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
8950
9194
|
const { p: patch, o: { createElement } } = rendererInternals;
|
|
8951
9195
|
const hiddenContainer = createElement("div");
|
|
@@ -8985,11 +9229,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
8985
9229
|
suspense.activeBranch = pendingBranch;
|
|
8986
9230
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
8987
9231
|
suspense.deps = 0;
|
|
8988
|
-
|
|
8989
|
-
const effect = suspense.effects[i];
|
|
8990
|
-
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
8991
|
-
}
|
|
8992
|
-
suspense.effects.length = 0;
|
|
9232
|
+
discardEffects(suspense);
|
|
8993
9233
|
suspense.hiddenContainer = createElement("div");
|
|
8994
9234
|
if (isInFallback) {
|
|
8995
9235
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
@@ -9012,14 +9252,14 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9012
9252
|
} else {
|
|
9013
9253
|
triggerEvent(n2, "onPending");
|
|
9014
9254
|
suspense.pendingBranch = newBranch;
|
|
9015
|
-
|
|
9016
|
-
else suspense.pendingId = suspenseId++;
|
|
9255
|
+
suspense.pendingId = suspenseId++;
|
|
9017
9256
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
9018
9257
|
if (suspense.deps <= 0) suspense.resolve();
|
|
9019
9258
|
else {
|
|
9020
|
-
const { timeout
|
|
9021
|
-
if (timeout > 0) setTimeout(() => {
|
|
9022
|
-
|
|
9259
|
+
const { timeout } = suspense;
|
|
9260
|
+
if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
|
|
9261
|
+
suspense.timeoutTimer = void 0;
|
|
9262
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
9023
9263
|
}, timeout);
|
|
9024
9264
|
else if (timeout === 0) suspense.fallback(newFallback);
|
|
9025
9265
|
}
|
|
@@ -9055,6 +9295,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9055
9295
|
deps: 0,
|
|
9056
9296
|
pendingId: suspenseId++,
|
|
9057
9297
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
9298
|
+
timeoutTimer: void 0,
|
|
9058
9299
|
activeBranch: null,
|
|
9059
9300
|
isFallbackMountPending: false,
|
|
9060
9301
|
pendingBranch: null,
|
|
@@ -9072,26 +9313,39 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9072
9313
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
9073
9314
|
let hasUpdatedAnchor = false;
|
|
9074
9315
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
9075
|
-
if (pendingId === suspense.pendingId) {
|
|
9316
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
9317
|
+
enterDeferred(suspense, pendingBranch);
|
|
9076
9318
|
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
9077
9319
|
queuePostFlushCb(effects);
|
|
9078
9320
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
9079
9321
|
}
|
|
9080
9322
|
};
|
|
9081
9323
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
9082
|
-
if (parentNode(activeBranch.el) === container) {
|
|
9324
|
+
if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
|
|
9083
9325
|
anchor = next(activeBranch);
|
|
9084
9326
|
hasUpdatedAnchor = true;
|
|
9085
9327
|
}
|
|
9086
9328
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
9087
9329
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
9088
9330
|
}
|
|
9089
|
-
if (!delayEnter)
|
|
9331
|
+
if (!delayEnter) {
|
|
9332
|
+
enterDeferred(suspense, pendingBranch);
|
|
9333
|
+
move(pendingBranch, container, anchor, 0, parentComponent);
|
|
9334
|
+
}
|
|
9090
9335
|
}
|
|
9336
|
+
clearTimeout(suspense.timeoutTimer);
|
|
9337
|
+
suspense.timeoutTimer = void 0;
|
|
9091
9338
|
suspense.isFallbackMountPending = false;
|
|
9092
9339
|
setActiveBranch(suspense, pendingBranch);
|
|
9093
9340
|
suspense.pendingBranch = null;
|
|
9094
9341
|
suspense.isInFallback = false;
|
|
9342
|
+
let kept = 0;
|
|
9343
|
+
for (let i = 0; i < effects.length; i++) {
|
|
9344
|
+
const effect = effects[i];
|
|
9345
|
+
if (effect.flags & 16) queuePostFlushCb(effect);
|
|
9346
|
+
else effects[kept++] = effect;
|
|
9347
|
+
}
|
|
9348
|
+
effects.length = kept;
|
|
9095
9349
|
let parent = suspense.parent;
|
|
9096
9350
|
let hasUnresolvedAncestor = false;
|
|
9097
9351
|
while (parent) {
|
|
@@ -9114,13 +9368,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9114
9368
|
triggerEvent(vnode, "onResolve");
|
|
9115
9369
|
},
|
|
9116
9370
|
fallback(fallbackVNode) {
|
|
9117
|
-
if (!suspense.pendingBranch) return;
|
|
9371
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) return;
|
|
9118
9372
|
const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
|
|
9119
9373
|
triggerEvent(vnode, "onFallback");
|
|
9120
9374
|
const anchor = next(activeBranch);
|
|
9121
9375
|
const mountFallback = () => {
|
|
9122
9376
|
suspense.isFallbackMountPending = false;
|
|
9123
|
-
if (!suspense.isInFallback) return;
|
|
9377
|
+
if (suspense.isUnmounted || !suspense.isInFallback) return;
|
|
9124
9378
|
const latestFallback = suspense.vnode.ssFallback;
|
|
9125
9379
|
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
9126
9380
|
setActiveBranch(suspense, latestFallback);
|
|
@@ -9144,24 +9398,52 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9144
9398
|
registerDep(instance, onResolve) {
|
|
9145
9399
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
9146
9400
|
if (isInPendingSuspense) suspense.deps++;
|
|
9401
|
+
const render = (setupResult) => {
|
|
9402
|
+
instance.asyncResolved = true;
|
|
9403
|
+
onResolve(setupResult);
|
|
9404
|
+
};
|
|
9147
9405
|
instance.asyncDep.catch((err) => {
|
|
9148
|
-
handleError(err, instance, 0);
|
|
9406
|
+
handleError(err, instance, 0, false, true);
|
|
9407
|
+
return () => null;
|
|
9149
9408
|
}).then((asyncSetupResult) => {
|
|
9150
|
-
if (instance.isUnmounted || suspense.isUnmounted
|
|
9409
|
+
if (instance.isUnmounted || suspense.isUnmounted) return;
|
|
9410
|
+
const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
|
|
9151
9411
|
setCurrentInstance(null, void 0);
|
|
9152
9412
|
if (!instance.scope.active) {
|
|
9153
|
-
if (
|
|
9413
|
+
if (isPendingDep && --suspense.deps === 0) suspense.resolve();
|
|
9154
9414
|
return;
|
|
9155
9415
|
}
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9416
|
+
if (!isPendingDep && suspense.pendingBranch) {
|
|
9417
|
+
const job = () => {
|
|
9418
|
+
if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
|
|
9419
|
+
if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
|
|
9420
|
+
else render(asyncSetupResult);
|
|
9421
|
+
};
|
|
9422
|
+
job.flags = 24;
|
|
9423
|
+
queueEffectWithSuspense(job, void 0, suspense);
|
|
9424
|
+
return;
|
|
9425
|
+
}
|
|
9426
|
+
render(asyncSetupResult);
|
|
9427
|
+
if (isPendingDep && --suspense.deps === 0) suspense.resolve();
|
|
9159
9428
|
});
|
|
9160
9429
|
},
|
|
9161
9430
|
unmount(parentSuspense, doRemove) {
|
|
9162
9431
|
suspense.isUnmounted = true;
|
|
9432
|
+
clearTimeout(suspense.timeoutTimer);
|
|
9433
|
+
suspense.timeoutTimer = void 0;
|
|
9434
|
+
if (parentSuspenseId !== void 0) {
|
|
9435
|
+
const parent = suspense.parent;
|
|
9436
|
+
const pendingId = parentSuspenseId;
|
|
9437
|
+
parentSuspenseId = void 0;
|
|
9438
|
+
queuePostFlushCb(() => {
|
|
9439
|
+
if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
|
|
9440
|
+
});
|
|
9441
|
+
}
|
|
9163
9442
|
if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
|
|
9164
|
-
if (suspense.pendingBranch)
|
|
9443
|
+
if (suspense.pendingBranch) {
|
|
9444
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
9445
|
+
discardEffects(suspense);
|
|
9446
|
+
}
|
|
9165
9447
|
}
|
|
9166
9448
|
};
|
|
9167
9449
|
return suspense;
|
|
@@ -9202,6 +9484,14 @@ function normalizeSuspenseSlot(s) {
|
|
|
9202
9484
|
if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
|
|
9203
9485
|
return s;
|
|
9204
9486
|
}
|
|
9487
|
+
function discardEffects(suspense) {
|
|
9488
|
+
const { effects } = suspense;
|
|
9489
|
+
for (let i = 0; i < effects.length; i++) {
|
|
9490
|
+
const effect = effects[i];
|
|
9491
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
9492
|
+
}
|
|
9493
|
+
effects.length = 0;
|
|
9494
|
+
}
|
|
9205
9495
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
9206
9496
|
if (suspense && suspense.pendingBranch) {
|
|
9207
9497
|
if (isArray(fn)) suspense.effects.push(...fn);
|
|
@@ -9469,7 +9759,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
9469
9759
|
}
|
|
9470
9760
|
function guardReactiveProps(props) {
|
|
9471
9761
|
if (!props) return null;
|
|
9472
|
-
|
|
9762
|
+
if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
|
|
9763
|
+
return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
|
|
9473
9764
|
}
|
|
9474
9765
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
9475
9766
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -9856,7 +10147,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
9856
10147
|
setInSSRSetupState(false);
|
|
9857
10148
|
}
|
|
9858
10149
|
}).catch((e) => {
|
|
9859
|
-
handleError(e, instance, 0);
|
|
10150
|
+
handleError(e, instance, 0, void 0, true);
|
|
10151
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
9860
10152
|
});
|
|
9861
10153
|
else {
|
|
9862
10154
|
instance.asyncDep = setupResult;
|
|
@@ -9929,11 +10221,16 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
9929
10221
|
else warn$1(`Component is missing template or render function: `, Component);
|
|
9930
10222
|
}
|
|
9931
10223
|
}
|
|
10224
|
+
/**
|
|
10225
|
+
* Read through the setup context `attrs` proxy to get the raw attrs object.
|
|
10226
|
+
* @internal
|
|
10227
|
+
*/
|
|
10228
|
+
const rawAttrsKey = Symbol();
|
|
9932
10229
|
const attrsProxyHandlers = {
|
|
9933
10230
|
get(target, key) {
|
|
9934
10231
|
markAttrsAccessed();
|
|
9935
10232
|
track(target, "get", "");
|
|
9936
|
-
return target[key];
|
|
10233
|
+
return key === rawAttrsKey ? target : target[key];
|
|
9937
10234
|
},
|
|
9938
10235
|
set() {
|
|
9939
10236
|
warn$1(`setupContext.attrs is readonly.`);
|
|
@@ -10231,7 +10528,7 @@ function isMemoSame(cached, memo) {
|
|
|
10231
10528
|
}
|
|
10232
10529
|
//#endregion
|
|
10233
10530
|
//#region packages/runtime-core/src/index.ts
|
|
10234
|
-
const version = "3.6.0-rc.
|
|
10531
|
+
const version = "3.6.0-rc.15";
|
|
10235
10532
|
const warn = warn$1;
|
|
10236
10533
|
/**
|
|
10237
10534
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -11102,7 +11399,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
11102
11399
|
}
|
|
11103
11400
|
this._styleAnchors.delete(this._def);
|
|
11104
11401
|
this._applyStyles(newStyles);
|
|
11105
|
-
|
|
11402
|
+
this._instance = null;
|
|
11106
11403
|
this._update();
|
|
11107
11404
|
};
|
|
11108
11405
|
const dispatch = (event, args) => {
|
|
@@ -11717,15 +12014,15 @@ const vModelSelect = {
|
|
|
11717
12014
|
vModelSelectInit(el, value, number);
|
|
11718
12015
|
el[assignKey] = getModelAssigner(vnode);
|
|
11719
12016
|
},
|
|
11720
|
-
mounted(el, { value }) {
|
|
11721
|
-
vModelSetSelected(el, value);
|
|
12017
|
+
mounted(el, { value, modifiers: { number } }) {
|
|
12018
|
+
vModelSetSelected(el, value, number);
|
|
11722
12019
|
},
|
|
11723
12020
|
beforeUpdate(el, { value }, vnode) {
|
|
11724
12021
|
el._modelValue = value;
|
|
11725
12022
|
el[assignKey] = getModelAssigner(vnode);
|
|
11726
12023
|
},
|
|
11727
|
-
updated(el, { value }) {
|
|
11728
|
-
vModelSetSelected(el, value);
|
|
12024
|
+
updated(el, { value, modifiers: { number } }) {
|
|
12025
|
+
vModelSetSelected(el, value, number);
|
|
11729
12026
|
}
|
|
11730
12027
|
};
|
|
11731
12028
|
/**
|
|
@@ -11760,14 +12057,14 @@ function isSameSelectValue(value, assignedValue, multiple) {
|
|
|
11760
12057
|
/**
|
|
11761
12058
|
* @internal
|
|
11762
12059
|
*/
|
|
11763
|
-
const vModelSetSelected = (el, value) => {
|
|
12060
|
+
const vModelSetSelected = (el, value, number = false) => {
|
|
11764
12061
|
el._modelValue = value;
|
|
11765
12062
|
const pending = el._pendingValue;
|
|
11766
12063
|
el._pendingValue = void 0;
|
|
11767
12064
|
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
11768
|
-
setSelected(el, value);
|
|
12065
|
+
setSelected(el, value, number);
|
|
11769
12066
|
};
|
|
11770
|
-
function setSelected(el, value) {
|
|
12067
|
+
function setSelected(el, value, number) {
|
|
11771
12068
|
const isMultiple = el.multiple;
|
|
11772
12069
|
const isArrayValue = isArray(value);
|
|
11773
12070
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -11782,7 +12079,7 @@ function setSelected(el, value) {
|
|
|
11782
12079
|
const optionType = typeof optionValue;
|
|
11783
12080
|
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
11784
12081
|
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
11785
|
-
} else option.selected = value.has(optionValue);
|
|
12082
|
+
} else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
|
|
11786
12083
|
} else if (looseEqual(getValue(option), value)) {
|
|
11787
12084
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
11788
12085
|
return;
|
|
@@ -13986,7 +14283,11 @@ function getLoc(start, end) {
|
|
|
13986
14283
|
};
|
|
13987
14284
|
}
|
|
13988
14285
|
function cloneLoc(loc) {
|
|
13989
|
-
return
|
|
14286
|
+
return {
|
|
14287
|
+
start: extend({}, loc.start),
|
|
14288
|
+
end: extend({}, loc.end),
|
|
14289
|
+
source: loc.source
|
|
14290
|
+
};
|
|
13990
14291
|
}
|
|
13991
14292
|
function setLocEnd(loc, end) {
|
|
13992
14293
|
loc.end = tokenizer.getPos(end);
|