@vue/runtime-dom 3.6.0-rc.2 → 3.6.0-rc.4

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/runtime-dom v3.6.0-rc.2
2
+ * @vue/runtime-dom v3.6.0-rc.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -635,7 +635,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
635
635
  if (!this._instance) if (this._resolved) this._mountComponent(this._def);
636
636
  else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
637
637
  this._pendingResolve = void 0;
638
- this._resolveDef();
638
+ if (this.isConnected) return this._resolveDef();
639
639
  });
640
640
  else this._resolveDef();
641
641
  }
@@ -671,7 +671,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
671
671
  * resolve inner component definition (handle possible async component)
672
672
  */
673
673
  _resolveDef() {
674
- if (this._pendingResolve) return;
674
+ if (this._pendingResolve) return this._pendingResolve;
675
675
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
676
676
  this._ob = new MutationObserver(this._processMutations.bind(this));
677
677
  this._ob.observe(this, { attributes: true });
@@ -701,6 +701,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
701
701
  this._def = def;
702
702
  resolve(def);
703
703
  });
704
+ return this._pendingResolve;
704
705
  } else resolve(this._def);
705
706
  }
706
707
  _mountComponent(def) {
@@ -739,14 +740,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
739
740
  const { props } = def;
740
741
  const declaredPropKeys = (0, _vue_shared.isArray)(props) ? props : Object.keys(props || {});
741
742
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
742
- for (const key of declaredPropKeys.map(_vue_shared.camelize)) Object.defineProperty(this, key, {
743
- get() {
744
- return this._getProp(key);
745
- },
746
- set(val) {
747
- this._setProp(key, val, true, !this._patching);
748
- }
749
- });
743
+ for (const key of declaredPropKeys.map(_vue_shared.camelize)) {
744
+ if (key in Object.getPrototypeOf(this)) (0, _vue_runtime_core.warn)(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
745
+ Object.defineProperty(this, key, {
746
+ get() {
747
+ return this._getProp(key);
748
+ },
749
+ set(val) {
750
+ this._setProp(key, val, true, !this._patching);
751
+ }
752
+ });
753
+ }
750
754
  }
751
755
  _setAttr(key) {
752
756
  if (key.startsWith("data-v-")) return;
@@ -1162,13 +1166,22 @@ function onCompositionEnd(e) {
1162
1166
  }
1163
1167
  }
1164
1168
  const assignKey = Symbol("_assign");
1169
+ const initialValueKey = Symbol("_initialValue");
1165
1170
  const vModelText = {
1166
1171
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
1172
+ if (el.parentNode) {
1173
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
1174
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
1175
+ }
1167
1176
  el[assignKey] = getModelAssigner(vnode);
1168
1177
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
1169
1178
  },
1170
- mounted(el, { value }) {
1171
- el.value = value == null ? "" : value;
1179
+ mounted(el, { value, modifiers: { trim, number } }) {
1180
+ const newValue = value == null ? "" : value;
1181
+ const initialValue = el[initialValueKey];
1182
+ delete el[initialValueKey];
1183
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
1184
+ else el.value = newValue;
1172
1185
  },
1173
1186
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
1174
1187
  el[assignKey] = getModelAssigner(vnode);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-rc.2
2
+ * @vue/runtime-dom v3.6.0-rc.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -622,7 +622,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
622
622
  if (!this._instance) if (this._resolved) this._mountComponent(this._def);
623
623
  else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
624
624
  this._pendingResolve = void 0;
625
- this._resolveDef();
625
+ if (this.isConnected) return this._resolveDef();
626
626
  });
627
627
  else this._resolveDef();
628
628
  }
@@ -658,7 +658,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
658
658
  * resolve inner component definition (handle possible async component)
659
659
  */
660
660
  _resolveDef() {
661
- if (this._pendingResolve) return;
661
+ if (this._pendingResolve) return this._pendingResolve;
662
662
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
663
663
  this._ob = new MutationObserver(this._processMutations.bind(this));
664
664
  this._ob.observe(this, { attributes: true });
@@ -687,6 +687,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
687
687
  this._def = def;
688
688
  resolve(def);
689
689
  });
690
+ return this._pendingResolve;
690
691
  } else resolve(this._def);
691
692
  }
692
693
  _mountComponent(def) {
@@ -1105,13 +1106,22 @@ function onCompositionEnd(e) {
1105
1106
  }
1106
1107
  }
1107
1108
  const assignKey = Symbol("_assign");
1109
+ const initialValueKey = Symbol("_initialValue");
1108
1110
  const vModelText = {
1109
1111
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
1112
+ if (el.parentNode) {
1113
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
1114
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
1115
+ }
1110
1116
  el[assignKey] = getModelAssigner(vnode);
1111
1117
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
1112
1118
  },
1113
- mounted(el, { value }) {
1114
- el.value = value == null ? "" : value;
1119
+ mounted(el, { value, modifiers: { trim, number } }) {
1120
+ const newValue = value == null ? "" : value;
1121
+ const initialValue = el[initialValueKey];
1122
+ delete el[initialValueKey];
1123
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
1124
+ else el.value = newValue;
1115
1125
  },
1116
1126
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
1117
1127
  el[assignKey] = getModelAssigner(vnode);
@@ -87,8 +87,10 @@ type VOnDirective = Directive<any, any, VOnModifiers>;
87
87
  //#region temp/packages/runtime-dom/src/directives/vModel.d.ts
88
88
  type AssignerFn = (value: any) => void;
89
89
  declare const assignKey: unique symbol;
90
+ declare const initialValueKey: unique symbol;
90
91
  type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & {
91
92
  [assignKey]: AssignerFn;
93
+ [initialValueKey]?: string;
92
94
  _assigning?: boolean;
93
95
  }, any, Modifiers>;
94
96
  export declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, "trim" | "number" | "lazy">;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-rc.2
2
+ * @vue/runtime-dom v3.6.0-rc.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -228,7 +228,7 @@ const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
228
228
  /**
229
229
  * The full list is needed during SSR to produce the correct initial markup.
230
230
  */
231
- const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
231
+ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
232
232
  /**
233
233
  * Boolean attributes should be included if the value is truthy or ''.
234
234
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -2510,7 +2510,7 @@ function queueFlush() {
2510
2510
  function queuePostFlushCb(jobs, id = Infinity) {
2511
2511
  if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2512
2512
  else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2513
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
2513
+ else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2514
2514
  queueFlush();
2515
2515
  }
2516
2516
  function flushPreFlushCbs(instance, seen) {
@@ -2531,7 +2531,7 @@ function flushPreFlushCbs(instance, seen) {
2531
2531
  function flushPostFlushCbs(seen) {
2532
2532
  if (postJobs.length) {
2533
2533
  if (activePostJobs) {
2534
- activePostJobs.push(...postJobs);
2534
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2535
2535
  postJobs.length = 0;
2536
2536
  return;
2537
2537
  }
@@ -3344,49 +3344,16 @@ const BaseTransitionImpl = {
3344
3344
  setup(props, { slots }) {
3345
3345
  const instance = getCurrentInstance();
3346
3346
  const state = useTransitionState();
3347
+ let resumeAfterLeave;
3347
3348
  return () => {
3348
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
3349
- const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3349
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
3350
3350
  if (!child) return;
3351
3351
  const rawProps = /* @__PURE__ */ toRaw(props);
3352
3352
  const { mode } = rawProps;
3353
3353
  checkTransitionMode(mode);
3354
- if (state.isLeaving) return emptyPlaceholder(child);
3355
- const innerChild = getInnerChild$1(child);
3356
- if (!innerChild) return emptyPlaceholder(child);
3357
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
3358
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
3359
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3360
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3361
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
3362
- setTransitionHooks(oldInnerChild, leavingHooks);
3363
- if (mode === "out-in" && innerChild.type !== Comment) {
3364
- state.isLeaving = true;
3365
- leavingHooks.afterLeave = () => {
3366
- state.isLeaving = false;
3367
- if (!(instance.job.flags & 4)) instance.update();
3368
- delete leavingHooks.afterLeave;
3369
- oldInnerChild = void 0;
3370
- };
3371
- return emptyPlaceholder(child);
3372
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3373
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
3374
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3375
- el[leaveCbKey] = () => {
3376
- earlyRemove();
3377
- el[leaveCbKey] = void 0;
3378
- delete enterHooks.delayedLeave;
3379
- oldInnerChild = void 0;
3380
- };
3381
- enterHooks.delayedLeave = () => {
3382
- delayedLeave();
3383
- delete enterHooks.delayedLeave;
3384
- oldInnerChild = void 0;
3385
- };
3386
- };
3387
- else oldInnerChild = void 0;
3388
- } else if (oldInnerChild) oldInnerChild = void 0;
3389
- return child;
3354
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3355
+ if (!(instance.job.flags & 4)) instance.update();
3356
+ }) : NOOP);
3390
3357
  };
3391
3358
  }
3392
3359
  };
@@ -3528,15 +3495,91 @@ function getInnerChild$1(vnode) {
3528
3495
  if (shapeFlag & 32 && isFunction(children.default)) return children.default();
3529
3496
  }
3530
3497
  }
3498
+ function resolveTransitionChild(children, renderEmpty = false) {
3499
+ const branches = children && getTransitionRawChildren(children, true);
3500
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
3501
+ }
3502
+ /**
3503
+ * @internal
3504
+ */
3505
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
3506
+ if (state.isLeaving) return emptyPlaceholder(next);
3507
+ const nextInner = getInnerChild$1(next);
3508
+ if (!nextInner) return emptyPlaceholder(next);
3509
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
3510
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
3511
+ enterHooks = hooks;
3512
+ });
3513
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
3514
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3515
+ const mode = props.mode;
3516
+ const previousInner = previous && getInnerChild$1(previous);
3517
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
3518
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
3519
+ if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
3520
+ }
3521
+ return next;
3522
+ }
3523
+ function forwardDelayedLeave(hooks, source) {
3524
+ const delayedLeave = source && source.delayedLeave;
3525
+ if (!delayedLeave) return;
3526
+ hooks.delayedLeave = () => {
3527
+ if (source.delayedLeave === delayedLeave) delayedLeave();
3528
+ delete hooks.delayedLeave;
3529
+ };
3530
+ }
3531
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
3532
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
3533
+ }
3534
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
3535
+ if (props.mode === "out-in") {
3536
+ state.isLeaving = true;
3537
+ leavingHooks.afterLeave = () => {
3538
+ state.isLeaving = false;
3539
+ resumeAfterLeave();
3540
+ delete leavingHooks.afterLeave;
3541
+ };
3542
+ return true;
3543
+ } else if (props.mode === "in-out" && getEnterHooks) {
3544
+ let delayedLeavingVNode = leavingVNode;
3545
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3546
+ const enterHooks = getEnterHooks();
3547
+ if (!enterHooks) {
3548
+ delayedLeave();
3549
+ return;
3550
+ }
3551
+ const vnode = delayedLeavingVNode;
3552
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3553
+ leavingVNodesCache[String(vnode.key)] = vnode;
3554
+ el[leaveCbKey] = () => {
3555
+ earlyRemove();
3556
+ el[leaveCbKey] = void 0;
3557
+ delete enterHooks.delayedLeave;
3558
+ delayedLeavingVNode = void 0;
3559
+ };
3560
+ enterHooks.delayedLeave = () => {
3561
+ delayedLeave();
3562
+ delete enterHooks.delayedLeave;
3563
+ delayedLeavingVNode = void 0;
3564
+ };
3565
+ };
3566
+ }
3567
+ return false;
3568
+ }
3531
3569
  function setTransitionHooks(vnode, hooks) {
3532
3570
  if (vnode.shapeFlag & 6 && vnode.component) {
3533
3571
  vnode.transition = hooks;
3534
3572
  if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3535
- else setTransitionHooks(vnode.component.subTree, hooks);
3573
+ else {
3574
+ const subTree = vnode.component.subTree;
3575
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
3576
+ }
3536
3577
  } else if (vnode.shapeFlag & 128) {
3537
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3538
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3578
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3579
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3580
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3539
3581
  } else vnode.transition = hooks;
3582
+ return hooks;
3540
3583
  }
3541
3584
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
3542
3585
  let ret = [];
@@ -3888,7 +3931,10 @@ function createHydrationFunctions(rendererInternals) {
3888
3931
  const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
3889
3932
  for (const key in props) {
3890
3933
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
3891
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
3934
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
3935
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
3936
+ patchProp(el, key, null, props[key], namespace, parentComponent);
3937
+ }
3892
3938
  }
3893
3939
  }
3894
3940
  let vnodeHooks;
@@ -3997,6 +4043,16 @@ const isTemplateNode = (node) => {
3997
4043
  /**
3998
4044
  * Dev only
3999
4045
  */
4046
+ const resourceProps = /* @__PURE__ */ new Set([
4047
+ "src",
4048
+ "srcset",
4049
+ "href",
4050
+ "poster"
4051
+ ]);
4052
+ function isUnchangedResourceProp(el, key, clientValue) {
4053
+ if (!resourceProps.has(key)) return false;
4054
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4055
+ }
4000
4056
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4001
4057
  let mismatchType;
4002
4058
  let mismatchKey;
@@ -4037,7 +4093,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
4037
4093
  function getAttributeMismatch(el, key, clientValue) {
4038
4094
  let actual;
4039
4095
  let expected;
4040
- if (isBooleanAttr(key)) {
4096
+ if (key === "hidden") {
4097
+ actual = normalizeHiddenValue(el.getAttribute(key));
4098
+ expected = normalizeHiddenValue(clientValue);
4099
+ } else if (isBooleanAttr(key)) {
4041
4100
  actual = el.hasAttribute(key);
4042
4101
  expected = includeBooleanAttr(clientValue);
4043
4102
  } else if (clientValue == null) {
@@ -4065,6 +4124,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
4065
4124
  }
4066
4125
  return false;
4067
4126
  }
4127
+ function normalizeHiddenValue(value) {
4128
+ if (!isRenderableAttrValue(value)) return false;
4129
+ if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
4130
+ return includeBooleanAttr(value) ? "" : false;
4131
+ }
4068
4132
  function toClassSet(str) {
4069
4133
  return new Set(str.trim().split(/\s+/));
4070
4134
  }
@@ -4725,7 +4789,8 @@ function createSlots(slots, dynamicSlots) {
4725
4789
  * Compiler runtime helper for rendering `<slot/>`
4726
4790
  * @private
4727
4791
  */
4728
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
4792
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4793
+ if (props == null) props = {};
4729
4794
  let slot = slots[name];
4730
4795
  if (fallback) fallback.__vdom = true;
4731
4796
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
@@ -5778,8 +5843,9 @@ function renderComponentRoot(instance) {
5778
5843
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
5779
5844
  }
5780
5845
  if (vnode.transition) {
5781
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
5782
- setTransitionHooks(root, vnode.transition);
5846
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
5847
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
5848
+ setTransitionHooks(child, vnode.transition);
5783
5849
  }
5784
5850
  if (setRoot) setRoot(root);
5785
5851
  else result = root;
@@ -5839,9 +5905,10 @@ function filterSingleRoot(children, recurse = true) {
5839
5905
  }
5840
5906
  return singleRoot;
5841
5907
  }
5908
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
5842
5909
  const getFunctionalFallthrough = (attrs) => {
5843
5910
  let res;
5844
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
5911
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
5845
5912
  return res;
5846
5913
  };
5847
5914
  const filterModelListeners = (attrs, props) => {
@@ -7326,6 +7393,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7326
7393
  suspense.activeBranch = pendingBranch;
7327
7394
  } else unmount(pendingBranch, parentComponent, suspense);
7328
7395
  suspense.deps = 0;
7396
+ for (let i = 0; i < suspense.effects.length; i++) {
7397
+ const effect = suspense.effects[i];
7398
+ if (effect.flags & 8) queuePostFlushCb(effect);
7399
+ }
7329
7400
  suspense.effects.length = 0;
7330
7401
  suspense.hiddenContainer = createElement("div");
7331
7402
  if (isInFallback) {
@@ -7433,7 +7504,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7433
7504
  let hasUnresolvedAncestor = false;
7434
7505
  while (parent) {
7435
7506
  if (parent.pendingBranch) {
7436
- parent.effects.push(...effects);
7507
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
7437
7508
  hasUnresolvedAncestor = true;
7438
7509
  break;
7439
7510
  }
@@ -7703,9 +7774,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
7703
7774
  if (shapeFlag & 128) type.normalize(vnode);
7704
7775
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
7705
7776
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
7777
+ if (props && vnode.shapeFlag & 1) {
7778
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
7779
+ if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
7780
+ }
7706
7781
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
7707
7782
  return vnode;
7708
7783
  }
7784
+ /**
7785
+ * dev only
7786
+ * Whether children would actually render something. Empty text and empty
7787
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
7788
+ * for `v-html` / `v-text`.
7789
+ */
7790
+ function hasContentChildren(children) {
7791
+ if (isString(children)) return children !== "";
7792
+ if (isArray(children)) return children.length > 0;
7793
+ return false;
7794
+ }
7709
7795
  const createVNode = createVNodeWithArgsTransform;
7710
7796
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
7711
7797
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -8094,7 +8180,12 @@ function setupStatefulComponent(instance, isSSR) {
8094
8180
  };
8095
8181
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
8096
8182
  if (isSSR) return setupResult.then((resolvedResult) => {
8097
- handleSetupResult(instance, resolvedResult, isSSR);
8183
+ setInSSRSetupState(true);
8184
+ try {
8185
+ handleSetupResult(instance, resolvedResult, isSSR);
8186
+ } finally {
8187
+ setInSSRSetupState(false);
8188
+ }
8098
8189
  }).catch((e) => {
8099
8190
  handleError(e, instance, 0);
8100
8191
  });
@@ -8465,7 +8556,7 @@ function isMemoSame(cached, memo) {
8465
8556
  }
8466
8557
  //#endregion
8467
8558
  //#region packages/runtime-core/src/index.ts
8468
- const version = "3.6.0-rc.2";
8559
+ const version = "3.6.0-rc.4";
8469
8560
  const warn = warn$1;
8470
8561
  /**
8471
8562
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9186,7 +9277,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9186
9277
  if (!this._instance) if (this._resolved) this._mountComponent(this._def);
9187
9278
  else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
9188
9279
  this._pendingResolve = void 0;
9189
- this._resolveDef();
9280
+ if (this.isConnected) return this._resolveDef();
9190
9281
  });
9191
9282
  else this._resolveDef();
9192
9283
  }
@@ -9222,7 +9313,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9222
9313
  * resolve inner component definition (handle possible async component)
9223
9314
  */
9224
9315
  _resolveDef() {
9225
- if (this._pendingResolve) return;
9316
+ if (this._pendingResolve) return this._pendingResolve;
9226
9317
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
9227
9318
  this._ob = new MutationObserver(this._processMutations.bind(this));
9228
9319
  this._ob.observe(this, { attributes: true });
@@ -9252,6 +9343,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9252
9343
  this._def = def;
9253
9344
  resolve(def);
9254
9345
  });
9346
+ return this._pendingResolve;
9255
9347
  } else resolve(this._def);
9256
9348
  }
9257
9349
  _mountComponent(def) {
@@ -9290,14 +9382,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
9290
9382
  const { props } = def;
9291
9383
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9292
9384
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
9293
- for (const key of declaredPropKeys.map(camelize)) Object.defineProperty(this, key, {
9294
- get() {
9295
- return this._getProp(key);
9296
- },
9297
- set(val) {
9298
- this._setProp(key, val, true, !this._patching);
9299
- }
9300
- });
9385
+ for (const key of declaredPropKeys.map(camelize)) {
9386
+ if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
9387
+ Object.defineProperty(this, key, {
9388
+ get() {
9389
+ return this._getProp(key);
9390
+ },
9391
+ set(val) {
9392
+ this._setProp(key, val, true, !this._patching);
9393
+ }
9394
+ });
9395
+ }
9301
9396
  }
9302
9397
  _setAttr(key) {
9303
9398
  if (key.startsWith("data-v-")) return;
@@ -9713,13 +9808,22 @@ function onCompositionEnd(e) {
9713
9808
  }
9714
9809
  }
9715
9810
  const assignKey = Symbol("_assign");
9811
+ const initialValueKey = Symbol("_initialValue");
9716
9812
  const vModelText = {
9717
9813
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
9814
+ if (el.parentNode) {
9815
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
9816
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
9817
+ }
9718
9818
  el[assignKey] = getModelAssigner(vnode);
9719
9819
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
9720
9820
  },
9721
- mounted(el, { value }) {
9722
- el.value = value == null ? "" : value;
9821
+ mounted(el, { value, modifiers: { trim, number } }) {
9822
+ const newValue = value == null ? "" : value;
9823
+ const initialValue = el[initialValueKey];
9824
+ delete el[initialValueKey];
9825
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
9826
+ else el.value = newValue;
9723
9827
  },
9724
9828
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
9725
9829
  el[assignKey] = getModelAssigner(vnode);