vue 3.5.40 → 3.5.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.40
2
+ * vue v3.5.41
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -197,7 +197,7 @@ var Vue = (function (exports) {
197
197
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
198
198
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
199
199
  const isBooleanAttr = /* @__PURE__ */ makeMap(
200
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
200
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
201
201
  );
202
202
  function includeBooleanAttr(value) {
203
203
  return !!value || value === "";
@@ -2600,7 +2600,9 @@ var Vue = (function (exports) {
2600
2600
  cb.flags |= 1;
2601
2601
  }
2602
2602
  } else {
2603
- pendingPostFlushCbs.push(...cb);
2603
+ for (let i = 0; i < cb.length; i++) {
2604
+ pendingPostFlushCbs.push(cb[i]);
2605
+ }
2604
2606
  }
2605
2607
  queueFlush();
2606
2608
  }
@@ -2636,7 +2638,9 @@ var Vue = (function (exports) {
2636
2638
  );
2637
2639
  pendingPostFlushCbs.length = 0;
2638
2640
  if (activePostFlushCbs) {
2639
- activePostFlushCbs.push(...deduped);
2641
+ for (let i = 0; i < deduped.length; i++) {
2642
+ activePostFlushCbs.push(deduped[i]);
2643
+ }
2640
2644
  return;
2641
2645
  }
2642
2646
  activePostFlushCbs = deduped;
@@ -3897,7 +3901,11 @@ var Vue = (function (exports) {
3897
3901
  function setTransitionHooks(vnode, hooks) {
3898
3902
  if (vnode.shapeFlag & 6 && vnode.component) {
3899
3903
  vnode.transition = hooks;
3900
- setTransitionHooks(vnode.component.subTree, hooks);
3904
+ const subTree = vnode.component.subTree;
3905
+ setTransitionHooks(
3906
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
3907
+ hooks
3908
+ );
3901
3909
  } else if (vnode.shapeFlag & 128) {
3902
3910
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3903
3911
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4437,6 +4445,9 @@ Server rendered element contains more child nodes than client vdom.`
4437
4445
  }
4438
4446
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4439
4447
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4448
+ if (isUnchangedResourceProp(el, key, props[key])) {
4449
+ continue;
4450
+ }
4440
4451
  patchProp(el, key, null, props[key], namespace, parentComponent);
4441
4452
  }
4442
4453
  }
@@ -4619,6 +4630,13 @@ Server rendered element contains fewer child nodes than client vdom.`
4619
4630
  };
4620
4631
  return [hydrate, hydrateNode];
4621
4632
  }
4633
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
4634
+ function isUnchangedResourceProp(el, key, clientValue) {
4635
+ if (!resourceProps.has(key)) {
4636
+ return false;
4637
+ }
4638
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4639
+ }
4622
4640
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4623
4641
  let mismatchType;
4624
4642
  let mismatchKey;
@@ -4656,7 +4674,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4656
4674
  mismatchKey = "style";
4657
4675
  }
4658
4676
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
4659
- if (isBooleanAttr(key)) {
4677
+ if (key === "hidden") {
4678
+ actual = normalizeHiddenValue(el.getAttribute(key));
4679
+ expected = normalizeHiddenValue(clientValue);
4680
+ } else if (isBooleanAttr(key)) {
4660
4681
  actual = el.hasAttribute(key);
4661
4682
  expected = includeBooleanAttr(clientValue);
4662
4683
  } else if (clientValue == null) {
@@ -4692,6 +4713,15 @@ Server rendered element contains fewer child nodes than client vdom.`
4692
4713
  }
4693
4714
  return false;
4694
4715
  }
4716
+ function normalizeHiddenValue(value) {
4717
+ if (!isRenderableAttrValue(value)) {
4718
+ return false;
4719
+ }
4720
+ if (isString(value)) {
4721
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
4722
+ }
4723
+ return includeBooleanAttr(value) ? "" : false;
4724
+ }
4695
4725
  function toClassSet(str) {
4696
4726
  return new Set(str.trim().split(/\s+/));
4697
4727
  }
@@ -5505,7 +5535,8 @@ If this is a native custom element, make sure to exclude it from component resol
5505
5535
  return slots;
5506
5536
  }
5507
5537
 
5508
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5538
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5539
+ if (props == null) props = {};
5509
5540
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5510
5541
  const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
5511
5542
  const hasProps = Object.keys(slotProps).length > 0;
@@ -6926,12 +6957,13 @@ If you want to remount the same app, move your app creation logic into a factory
6926
6957
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
6927
6958
  }
6928
6959
  if (vnode.transition) {
6929
- if (!isElementRoot(root)) {
6960
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
6961
+ if (!isElementRoot(child)) {
6930
6962
  warn$1(
6931
6963
  `Component inside <Transition> renders non-element root node that cannot be animated.`
6932
6964
  );
6933
6965
  }
6934
- setTransitionHooks(root, vnode.transition);
6966
+ setTransitionHooks(child, vnode.transition);
6935
6967
  }
6936
6968
  if (setRoot) {
6937
6969
  setRoot(root);
@@ -9579,7 +9611,9 @@ If you want to remount the same app, move your app creation logic into a factory
9579
9611
  let hasUnresolvedAncestor = false;
9580
9612
  while (parent) {
9581
9613
  if (parent.pendingBranch) {
9582
- parent.effects.push(...effects);
9614
+ for (let i = 0; i < effects.length; i++) {
9615
+ parent.effects.push(effects[i]);
9616
+ }
9583
9617
  hasUnresolvedAncestor = true;
9584
9618
  break;
9585
9619
  }
@@ -9944,6 +9978,14 @@ If you want to remount the same app, move your app creation logic into a factory
9944
9978
  if (vnode.key !== vnode.key) {
9945
9979
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
9946
9980
  }
9981
+ if (props && vnode.shapeFlag & 1) {
9982
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
9983
+ if (overwritingProp && hasContentChildren(vnode.children)) {
9984
+ warn$1(
9985
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
9986
+ );
9987
+ }
9988
+ }
9947
9989
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
9948
9990
  !isBlockNode && // has current parent block
9949
9991
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -9957,6 +9999,11 @@ If you want to remount the same app, move your app creation logic into a factory
9957
9999
  }
9958
10000
  return vnode;
9959
10001
  }
10002
+ function hasContentChildren(children) {
10003
+ if (isString(children)) return children !== "";
10004
+ if (isArray(children)) return children.length > 0;
10005
+ return false;
10006
+ }
9960
10007
  const createVNode = createVNodeWithArgsTransform ;
9961
10008
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
9962
10009
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -10393,7 +10440,12 @@ Component that was made reactive: `,
10393
10440
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
10394
10441
  if (isSSR) {
10395
10442
  return setupResult.then((resolvedResult) => {
10396
- handleSetupResult(instance, resolvedResult, isSSR);
10443
+ setInSSRSetupState(true);
10444
+ try {
10445
+ handleSetupResult(instance, resolvedResult, isSSR);
10446
+ } finally {
10447
+ setInSSRSetupState(false);
10448
+ }
10397
10449
  }).catch((e) => {
10398
10450
  handleError(e, instance, 0);
10399
10451
  });
@@ -10857,7 +10909,7 @@ Component that was made reactive: `,
10857
10909
  return true;
10858
10910
  }
10859
10911
 
10860
- const version = "3.5.40";
10912
+ const version = "3.5.41";
10861
10913
  const warn = warn$1 ;
10862
10914
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10863
10915
  const devtools = devtools$1 ;
@@ -11808,7 +11860,9 @@ Expected function or array of functions, received type ${typeof value}.`
11808
11860
  if (parent && parent._pendingResolve) {
11809
11861
  this._pendingResolve = parent._pendingResolve.then(() => {
11810
11862
  this._pendingResolve = void 0;
11811
- this._resolveDef();
11863
+ if (this.isConnected) {
11864
+ return this._resolveDef();
11865
+ }
11812
11866
  });
11813
11867
  } else {
11814
11868
  this._resolveDef();
@@ -11858,7 +11912,7 @@ Expected function or array of functions, received type ${typeof value}.`
11858
11912
  */
11859
11913
  _resolveDef() {
11860
11914
  if (this._pendingResolve) {
11861
- return;
11915
+ return this._pendingResolve;
11862
11916
  }
11863
11917
  for (let i = 0; i < this.attributes.length; i++) {
11864
11918
  this._setAttr(this.attributes[i].name);
@@ -11898,6 +11952,7 @@ Expected function or array of functions, received type ${typeof value}.`
11898
11952
  def.configureApp = this._def.configureApp;
11899
11953
  resolve(this._def = def, true);
11900
11954
  });
11955
+ return this._pendingResolve;
11901
11956
  } else {
11902
11957
  resolve(this._def);
11903
11958
  }
@@ -11935,6 +11990,11 @@ Expected function or array of functions, received type ${typeof value}.`
11935
11990
  }
11936
11991
  }
11937
11992
  for (const key of declaredPropKeys.map(camelize)) {
11993
+ if (key in Object.getPrototypeOf(this)) {
11994
+ warn(
11995
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
11996
+ );
11997
+ }
11938
11998
  Object.defineProperty(this, key, {
11939
11999
  get() {
11940
12000
  return this._getProp(key);
@@ -12407,6 +12467,7 @@ Expected function or array of functions, received type ${typeof value}.`
12407
12467
  }
12408
12468
  }
12409
12469
  const assignKey = /* @__PURE__ */ Symbol("_assign");
12470
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
12410
12471
  function castValue(value, trim, number) {
12411
12472
  if (trim) value = value.trim();
12412
12473
  if (number) value = looseToNumber(value);
@@ -12414,6 +12475,13 @@ Expected function or array of functions, received type ${typeof value}.`
12414
12475
  }
12415
12476
  const vModelText = {
12416
12477
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
12478
+ if (el.parentNode) {
12479
+ if (el.type === "text") {
12480
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
12481
+ } else if (el.type === "textarea") {
12482
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
12483
+ }
12484
+ }
12417
12485
  el[assignKey] = getModelAssigner(vnode);
12418
12486
  const castToNumber = number || vnode.props && vnode.props.type === "number";
12419
12487
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -12432,8 +12500,15 @@ Expected function or array of functions, received type ${typeof value}.`
12432
12500
  }
12433
12501
  },
12434
12502
  // set value on mounted so it's after min/max for type="range"
12435
- mounted(el, { value }) {
12436
- el.value = value == null ? "" : value;
12503
+ mounted(el, { value, modifiers: { trim, number } }) {
12504
+ const newValue = value == null ? "" : value;
12505
+ const initialValue = el[initialValueKey];
12506
+ delete el[initialValueKey];
12507
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
12508
+ el[assignKey](castValue(el.value, trim, number));
12509
+ } else {
12510
+ el.value = newValue;
12511
+ }
12437
12512
  },
12438
12513
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
12439
12514
  el[assignKey] = getModelAssigner(vnode);