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

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.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -711,7 +711,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
711
711
  if (!this._instance) if (this._resolved) this._mountComponent(this._def);
712
712
  else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
713
713
  this._pendingResolve = void 0;
714
- this._resolveDef();
714
+ if (this.isConnected) return this._resolveDef();
715
715
  });
716
716
  else this._resolveDef();
717
717
  }
@@ -747,7 +747,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
747
747
  * resolve inner component definition (handle possible async component)
748
748
  */
749
749
  _resolveDef() {
750
- if (this._pendingResolve) return;
750
+ if (this._pendingResolve) return this._pendingResolve;
751
751
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
752
752
  this._ob = new MutationObserver(this._processMutations.bind(this));
753
753
  this._ob.observe(this, { attributes: true });
@@ -777,6 +777,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
777
777
  this._def = def;
778
778
  resolve(def);
779
779
  });
780
+ return this._pendingResolve;
780
781
  } else resolve(this._def);
781
782
  }
782
783
  _mountComponent(def) {
@@ -815,14 +816,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
815
816
  const { props } = def;
816
817
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
817
818
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
818
- for (const key of declaredPropKeys.map(camelize$1)) Object.defineProperty(this, key, {
819
- get() {
820
- return this._getProp(key);
821
- },
822
- set(val) {
823
- this._setProp(key, val, true, !this._patching);
824
- }
825
- });
819
+ for (const key of declaredPropKeys.map(camelize$1)) {
820
+ if (!!(process.env.NODE_ENV !== "production") && key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
821
+ Object.defineProperty(this, key, {
822
+ get() {
823
+ return this._getProp(key);
824
+ },
825
+ set(val) {
826
+ this._setProp(key, val, true, !this._patching);
827
+ }
828
+ });
829
+ }
826
830
  }
827
831
  _setAttr(key) {
828
832
  if (key.startsWith("data-v-")) return;
@@ -1240,13 +1244,22 @@ function onCompositionEnd(e) {
1240
1244
  }
1241
1245
  }
1242
1246
  const assignKey = Symbol("_assign");
1247
+ const initialValueKey = Symbol("_initialValue");
1243
1248
  const vModelText = {
1244
1249
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
1250
+ if (el.parentNode) {
1251
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
1252
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
1253
+ }
1245
1254
  el[assignKey] = getModelAssigner(vnode);
1246
1255
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
1247
1256
  },
1248
- mounted(el, { value }) {
1249
- el.value = value == null ? "" : value;
1257
+ mounted(el, { value, modifiers: { trim, number } }) {
1258
+ const newValue = value == null ? "" : value;
1259
+ const initialValue = el[initialValueKey];
1260
+ delete el[initialValueKey];
1261
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
1262
+ else el.value = newValue;
1250
1263
  },
1251
1264
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
1252
1265
  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.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -230,7 +230,7 @@ var VueRuntimeDOM = (function(exports) {
230
230
  /**
231
231
  * The full list is needed during SSR to produce the correct initial markup.
232
232
  */
233
- const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
233
+ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
234
234
  /**
235
235
  * Boolean attributes should be included if the value is truthy or ''.
236
236
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -2512,7 +2512,7 @@ var VueRuntimeDOM = (function(exports) {
2512
2512
  function queuePostFlushCb(jobs, id = Infinity) {
2513
2513
  if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2514
2514
  else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2515
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
2515
+ else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2516
2516
  queueFlush();
2517
2517
  }
2518
2518
  function flushPreFlushCbs(instance, seen) {
@@ -2533,7 +2533,7 @@ var VueRuntimeDOM = (function(exports) {
2533
2533
  function flushPostFlushCbs(seen) {
2534
2534
  if (postJobs.length) {
2535
2535
  if (activePostJobs) {
2536
- activePostJobs.push(...postJobs);
2536
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2537
2537
  postJobs.length = 0;
2538
2538
  return;
2539
2539
  }
@@ -3342,49 +3342,16 @@ var VueRuntimeDOM = (function(exports) {
3342
3342
  setup(props, { slots }) {
3343
3343
  const instance = getCurrentInstance();
3344
3344
  const state = useTransitionState();
3345
+ let resumeAfterLeave;
3345
3346
  return () => {
3346
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
3347
- const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3347
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
3348
3348
  if (!child) return;
3349
3349
  const rawProps = /* @__PURE__ */ toRaw(props);
3350
3350
  const { mode } = rawProps;
3351
3351
  checkTransitionMode(mode);
3352
- if (state.isLeaving) return emptyPlaceholder(child);
3353
- const innerChild = getInnerChild$1(child);
3354
- if (!innerChild) return emptyPlaceholder(child);
3355
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
3356
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
3357
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3358
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3359
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
3360
- setTransitionHooks(oldInnerChild, leavingHooks);
3361
- if (mode === "out-in" && innerChild.type !== Comment) {
3362
- state.isLeaving = true;
3363
- leavingHooks.afterLeave = () => {
3364
- state.isLeaving = false;
3365
- if (!(instance.job.flags & 4)) instance.update();
3366
- delete leavingHooks.afterLeave;
3367
- oldInnerChild = void 0;
3368
- };
3369
- return emptyPlaceholder(child);
3370
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3371
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
3372
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3373
- el[leaveCbKey] = () => {
3374
- earlyRemove();
3375
- el[leaveCbKey] = void 0;
3376
- delete enterHooks.delayedLeave;
3377
- oldInnerChild = void 0;
3378
- };
3379
- enterHooks.delayedLeave = () => {
3380
- delayedLeave();
3381
- delete enterHooks.delayedLeave;
3382
- oldInnerChild = void 0;
3383
- };
3384
- };
3385
- else oldInnerChild = void 0;
3386
- } else if (oldInnerChild) oldInnerChild = void 0;
3387
- return child;
3352
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3353
+ if (!(instance.job.flags & 4)) instance.update();
3354
+ }) : NOOP);
3388
3355
  };
3389
3356
  }
3390
3357
  };
@@ -3526,15 +3493,91 @@ var VueRuntimeDOM = (function(exports) {
3526
3493
  if (shapeFlag & 32 && isFunction(children.default)) return children.default();
3527
3494
  }
3528
3495
  }
3496
+ function resolveTransitionChild(children, renderEmpty = false) {
3497
+ const branches = children && getTransitionRawChildren(children, true);
3498
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
3499
+ }
3500
+ /**
3501
+ * @internal
3502
+ */
3503
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
3504
+ if (state.isLeaving) return emptyPlaceholder(next);
3505
+ const nextInner = getInnerChild$1(next);
3506
+ if (!nextInner) return emptyPlaceholder(next);
3507
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
3508
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
3509
+ enterHooks = hooks;
3510
+ });
3511
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
3512
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3513
+ const mode = props.mode;
3514
+ const previousInner = previous && getInnerChild$1(previous);
3515
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
3516
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
3517
+ 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);
3518
+ }
3519
+ return next;
3520
+ }
3521
+ function forwardDelayedLeave(hooks, source) {
3522
+ const delayedLeave = source && source.delayedLeave;
3523
+ if (!delayedLeave) return;
3524
+ hooks.delayedLeave = () => {
3525
+ if (source.delayedLeave === delayedLeave) delayedLeave();
3526
+ delete hooks.delayedLeave;
3527
+ };
3528
+ }
3529
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
3530
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
3531
+ }
3532
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
3533
+ if (props.mode === "out-in") {
3534
+ state.isLeaving = true;
3535
+ leavingHooks.afterLeave = () => {
3536
+ state.isLeaving = false;
3537
+ resumeAfterLeave();
3538
+ delete leavingHooks.afterLeave;
3539
+ };
3540
+ return true;
3541
+ } else if (props.mode === "in-out" && getEnterHooks) {
3542
+ let delayedLeavingVNode = leavingVNode;
3543
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3544
+ const enterHooks = getEnterHooks();
3545
+ if (!enterHooks) {
3546
+ delayedLeave();
3547
+ return;
3548
+ }
3549
+ const vnode = delayedLeavingVNode;
3550
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3551
+ leavingVNodesCache[String(vnode.key)] = vnode;
3552
+ el[leaveCbKey] = () => {
3553
+ earlyRemove();
3554
+ el[leaveCbKey] = void 0;
3555
+ delete enterHooks.delayedLeave;
3556
+ delayedLeavingVNode = void 0;
3557
+ };
3558
+ enterHooks.delayedLeave = () => {
3559
+ delayedLeave();
3560
+ delete enterHooks.delayedLeave;
3561
+ delayedLeavingVNode = void 0;
3562
+ };
3563
+ };
3564
+ }
3565
+ return false;
3566
+ }
3529
3567
  function setTransitionHooks(vnode, hooks) {
3530
3568
  if (vnode.shapeFlag & 6 && vnode.component) {
3531
3569
  vnode.transition = hooks;
3532
3570
  if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3533
- else setTransitionHooks(vnode.component.subTree, hooks);
3571
+ else {
3572
+ const subTree = vnode.component.subTree;
3573
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
3574
+ }
3534
3575
  } else if (vnode.shapeFlag & 128) {
3535
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3536
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3576
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3577
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3578
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3537
3579
  } else vnode.transition = hooks;
3580
+ return hooks;
3538
3581
  }
3539
3582
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
3540
3583
  let ret = [];
@@ -3886,7 +3929,10 @@ var VueRuntimeDOM = (function(exports) {
3886
3929
  const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
3887
3930
  for (const key in props) {
3888
3931
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
3889
- 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);
3932
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
3933
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
3934
+ patchProp(el, key, null, props[key], namespace, parentComponent);
3935
+ }
3890
3936
  }
3891
3937
  }
3892
3938
  let vnodeHooks;
@@ -3995,6 +4041,16 @@ var VueRuntimeDOM = (function(exports) {
3995
4041
  /**
3996
4042
  * Dev only
3997
4043
  */
4044
+ const resourceProps = /* @__PURE__ */ new Set([
4045
+ "src",
4046
+ "srcset",
4047
+ "href",
4048
+ "poster"
4049
+ ]);
4050
+ function isUnchangedResourceProp(el, key, clientValue) {
4051
+ if (!resourceProps.has(key)) return false;
4052
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4053
+ }
3998
4054
  function propHasMismatch(el, key, clientValue, vnode, instance) {
3999
4055
  let mismatchType;
4000
4056
  let mismatchKey;
@@ -4035,7 +4091,10 @@ var VueRuntimeDOM = (function(exports) {
4035
4091
  function getAttributeMismatch(el, key, clientValue) {
4036
4092
  let actual;
4037
4093
  let expected;
4038
- if (isBooleanAttr(key)) {
4094
+ if (key === "hidden") {
4095
+ actual = normalizeHiddenValue(el.getAttribute(key));
4096
+ expected = normalizeHiddenValue(clientValue);
4097
+ } else if (isBooleanAttr(key)) {
4039
4098
  actual = el.hasAttribute(key);
4040
4099
  expected = includeBooleanAttr(clientValue);
4041
4100
  } else if (clientValue == null) {
@@ -4063,6 +4122,11 @@ var VueRuntimeDOM = (function(exports) {
4063
4122
  }
4064
4123
  return false;
4065
4124
  }
4125
+ function normalizeHiddenValue(value) {
4126
+ if (!isRenderableAttrValue(value)) return false;
4127
+ if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
4128
+ return includeBooleanAttr(value) ? "" : false;
4129
+ }
4066
4130
  function toClassSet(str) {
4067
4131
  return new Set(str.trim().split(/\s+/));
4068
4132
  }
@@ -4723,7 +4787,8 @@ var VueRuntimeDOM = (function(exports) {
4723
4787
  * Compiler runtime helper for rendering `<slot/>`
4724
4788
  * @private
4725
4789
  */
4726
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
4790
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4791
+ if (props == null) props = {};
4727
4792
  let slot = slots[name];
4728
4793
  if (fallback) fallback.__vdom = true;
4729
4794
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
@@ -5776,8 +5841,9 @@ var VueRuntimeDOM = (function(exports) {
5776
5841
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
5777
5842
  }
5778
5843
  if (vnode.transition) {
5779
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
5780
- setTransitionHooks(root, vnode.transition);
5844
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
5845
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
5846
+ setTransitionHooks(child, vnode.transition);
5781
5847
  }
5782
5848
  if (setRoot) setRoot(root);
5783
5849
  else result = root;
@@ -5837,9 +5903,10 @@ var VueRuntimeDOM = (function(exports) {
5837
5903
  }
5838
5904
  return singleRoot;
5839
5905
  }
5906
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
5840
5907
  const getFunctionalFallthrough = (attrs) => {
5841
5908
  let res;
5842
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
5909
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
5843
5910
  return res;
5844
5911
  };
5845
5912
  const filterModelListeners = (attrs, props) => {
@@ -7324,6 +7391,10 @@ var VueRuntimeDOM = (function(exports) {
7324
7391
  suspense.activeBranch = pendingBranch;
7325
7392
  } else unmount(pendingBranch, parentComponent, suspense);
7326
7393
  suspense.deps = 0;
7394
+ for (let i = 0; i < suspense.effects.length; i++) {
7395
+ const effect = suspense.effects[i];
7396
+ if (effect.flags & 8) queuePostFlushCb(effect);
7397
+ }
7327
7398
  suspense.effects.length = 0;
7328
7399
  suspense.hiddenContainer = createElement("div");
7329
7400
  if (isInFallback) {
@@ -7431,7 +7502,7 @@ var VueRuntimeDOM = (function(exports) {
7431
7502
  let hasUnresolvedAncestor = false;
7432
7503
  while (parent) {
7433
7504
  if (parent.pendingBranch) {
7434
- parent.effects.push(...effects);
7505
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
7435
7506
  hasUnresolvedAncestor = true;
7436
7507
  break;
7437
7508
  }
@@ -7701,9 +7772,24 @@ var VueRuntimeDOM = (function(exports) {
7701
7772
  if (shapeFlag & 128) type.normalize(vnode);
7702
7773
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
7703
7774
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
7775
+ if (props && vnode.shapeFlag & 1) {
7776
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
7777
+ 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.`);
7778
+ }
7704
7779
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
7705
7780
  return vnode;
7706
7781
  }
7782
+ /**
7783
+ * dev only
7784
+ * Whether children would actually render something. Empty text and empty
7785
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
7786
+ * for `v-html` / `v-text`.
7787
+ */
7788
+ function hasContentChildren(children) {
7789
+ if (isString(children)) return children !== "";
7790
+ if (isArray(children)) return children.length > 0;
7791
+ return false;
7792
+ }
7707
7793
  const createVNode = createVNodeWithArgsTransform;
7708
7794
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
7709
7795
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -8092,7 +8178,12 @@ var VueRuntimeDOM = (function(exports) {
8092
8178
  };
8093
8179
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
8094
8180
  if (isSSR) return setupResult.then((resolvedResult) => {
8095
- handleSetupResult(instance, resolvedResult, isSSR);
8181
+ setInSSRSetupState(true);
8182
+ try {
8183
+ handleSetupResult(instance, resolvedResult, isSSR);
8184
+ } finally {
8185
+ setInSSRSetupState(false);
8186
+ }
8096
8187
  }).catch((e) => {
8097
8188
  handleError(e, instance, 0);
8098
8189
  });
@@ -8463,7 +8554,7 @@ var VueRuntimeDOM = (function(exports) {
8463
8554
  }
8464
8555
  //#endregion
8465
8556
  //#region packages/runtime-core/src/index.ts
8466
- const version = "3.6.0-rc.2";
8557
+ const version = "3.6.0-rc.3";
8467
8558
  const warn = warn$1;
8468
8559
  /**
8469
8560
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9184,7 +9275,7 @@ var VueRuntimeDOM = (function(exports) {
9184
9275
  if (!this._instance) if (this._resolved) this._mountComponent(this._def);
9185
9276
  else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
9186
9277
  this._pendingResolve = void 0;
9187
- this._resolveDef();
9278
+ if (this.isConnected) return this._resolveDef();
9188
9279
  });
9189
9280
  else this._resolveDef();
9190
9281
  }
@@ -9220,7 +9311,7 @@ var VueRuntimeDOM = (function(exports) {
9220
9311
  * resolve inner component definition (handle possible async component)
9221
9312
  */
9222
9313
  _resolveDef() {
9223
- if (this._pendingResolve) return;
9314
+ if (this._pendingResolve) return this._pendingResolve;
9224
9315
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
9225
9316
  this._ob = new MutationObserver(this._processMutations.bind(this));
9226
9317
  this._ob.observe(this, { attributes: true });
@@ -9250,6 +9341,7 @@ var VueRuntimeDOM = (function(exports) {
9250
9341
  this._def = def;
9251
9342
  resolve(def);
9252
9343
  });
9344
+ return this._pendingResolve;
9253
9345
  } else resolve(this._def);
9254
9346
  }
9255
9347
  _mountComponent(def) {
@@ -9288,14 +9380,17 @@ var VueRuntimeDOM = (function(exports) {
9288
9380
  const { props } = def;
9289
9381
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9290
9382
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
9291
- for (const key of declaredPropKeys.map(camelize)) Object.defineProperty(this, key, {
9292
- get() {
9293
- return this._getProp(key);
9294
- },
9295
- set(val) {
9296
- this._setProp(key, val, true, !this._patching);
9297
- }
9298
- });
9383
+ for (const key of declaredPropKeys.map(camelize)) {
9384
+ if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
9385
+ Object.defineProperty(this, key, {
9386
+ get() {
9387
+ return this._getProp(key);
9388
+ },
9389
+ set(val) {
9390
+ this._setProp(key, val, true, !this._patching);
9391
+ }
9392
+ });
9393
+ }
9299
9394
  }
9300
9395
  _setAttr(key) {
9301
9396
  if (key.startsWith("data-v-")) return;
@@ -9695,13 +9790,22 @@ var VueRuntimeDOM = (function(exports) {
9695
9790
  }
9696
9791
  }
9697
9792
  const assignKey = Symbol("_assign");
9793
+ const initialValueKey = Symbol("_initialValue");
9698
9794
  const vModelText = {
9699
9795
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
9796
+ if (el.parentNode) {
9797
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
9798
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
9799
+ }
9700
9800
  el[assignKey] = getModelAssigner(vnode);
9701
9801
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
9702
9802
  },
9703
- mounted(el, { value }) {
9704
- el.value = value == null ? "" : value;
9803
+ mounted(el, { value, modifiers: { trim, number } }) {
9804
+ const newValue = value == null ? "" : value;
9805
+ const initialValue = el[initialValueKey];
9806
+ delete el[initialValueKey];
9807
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
9808
+ else el.value = newValue;
9705
9809
  },
9706
9810
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
9707
9811
  el[assignKey] = getModelAssigner(vnode);