@vue/runtime-dom 3.4.8 → 3.4.10

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.4.8
2
+ * @vue/runtime-dom v3.4.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2676,6 +2676,10 @@ If this is a native custom element, make sure to exclude it from component resol
2676
2676
  rendererInternals
2677
2677
  );
2678
2678
  } else {
2679
+ if (parentSuspense && parentSuspense.deps > 0) {
2680
+ n2.suspense = n1.suspense;
2681
+ return;
2682
+ }
2679
2683
  patchSuspense(
2680
2684
  n1,
2681
2685
  n2,
@@ -4743,58 +4747,6 @@ If this is a native custom element, make sure to exclude it from component resol
4743
4747
  function useAttrs() {
4744
4748
  return getContext().attrs;
4745
4749
  }
4746
- function useModel(props, name, options = EMPTY_OBJ) {
4747
- const i = getCurrentInstance();
4748
- if (!i) {
4749
- warn$1(`useModel() called without active instance.`);
4750
- return ref();
4751
- }
4752
- if (!i.propsOptions[0][name]) {
4753
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
4754
- return ref();
4755
- }
4756
- const camelizedName = camelize(name);
4757
- const hyphenatedName = hyphenate(name);
4758
- const res = customRef((track, trigger) => {
4759
- let localValue;
4760
- watchSyncEffect(() => {
4761
- const propValue = props[name];
4762
- if (hasChanged(localValue, propValue)) {
4763
- localValue = propValue;
4764
- trigger();
4765
- }
4766
- });
4767
- return {
4768
- get() {
4769
- track();
4770
- return options.get ? options.get(localValue) : localValue;
4771
- },
4772
- set(value) {
4773
- const rawProps = i.vnode.props;
4774
- if (!(rawProps && // check if parent has passed v-model
4775
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
4776
- localValue = value;
4777
- trigger();
4778
- }
4779
- i.emit(`update:${name}`, options.set ? options.set(value) : value);
4780
- }
4781
- };
4782
- });
4783
- const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
4784
- res[Symbol.iterator] = () => {
4785
- let i2 = 0;
4786
- return {
4787
- next() {
4788
- if (i2 < 2) {
4789
- return { value: i2++ ? props[modifierKey] || {} : res, done: false };
4790
- } else {
4791
- return { done: true };
4792
- }
4793
- }
4794
- };
4795
- };
4796
- return res;
4797
- }
4798
4750
  function getContext() {
4799
4751
  const i = getCurrentInstance();
4800
4752
  if (!i) {
@@ -6581,8 +6533,13 @@ Server rendered element contains fewer child nodes than client vdom.`
6581
6533
  actual = el.hasAttribute(key);
6582
6534
  expected = includeBooleanAttr(clientValue);
6583
6535
  } else {
6584
- actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
6585
- expected = clientValue == null ? "" : String(clientValue);
6536
+ if (el.hasAttribute(key)) {
6537
+ actual = el.getAttribute(key);
6538
+ } else {
6539
+ const serverValue = el[key];
6540
+ actual = isObject(serverValue) || serverValue == null ? "" : String(serverValue);
6541
+ }
6542
+ expected = isObject(clientValue) || clientValue == null ? "" : String(clientValue);
6586
6543
  }
6587
6544
  if (actual !== expected) {
6588
6545
  mismatchType = `attribute`;
@@ -6591,15 +6548,15 @@ Server rendered element contains fewer child nodes than client vdom.`
6591
6548
  }
6592
6549
  if (mismatchType) {
6593
6550
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
6594
- warn$1(
6595
- `Hydration ${mismatchType} mismatch on`,
6596
- el,
6597
- `
6551
+ const preSegment = `Hydration ${mismatchType} mismatch on`;
6552
+ const postSegment = `
6598
6553
  - rendered on server: ${format(actual)}
6599
6554
  - expected on client: ${format(expected)}
6600
6555
  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
6601
- You should fix the source of the mismatch.`
6602
- );
6556
+ You should fix the source of the mismatch.`;
6557
+ {
6558
+ warn$1(preSegment, el, postSegment);
6559
+ }
6603
6560
  return true;
6604
6561
  }
6605
6562
  return false;
@@ -9255,6 +9212,59 @@ Component that was made reactive: `,
9255
9212
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9256
9213
  };
9257
9214
 
9215
+ function useModel(props, name, options = EMPTY_OBJ) {
9216
+ const i = getCurrentInstance();
9217
+ if (!i) {
9218
+ warn$1(`useModel() called without active instance.`);
9219
+ return ref();
9220
+ }
9221
+ if (!i.propsOptions[0][name]) {
9222
+ warn$1(`useModel() called with prop "${name}" which is not declared.`);
9223
+ return ref();
9224
+ }
9225
+ const camelizedName = camelize(name);
9226
+ const hyphenatedName = hyphenate(name);
9227
+ const res = customRef((track, trigger) => {
9228
+ let localValue;
9229
+ watchSyncEffect(() => {
9230
+ const propValue = props[name];
9231
+ if (hasChanged(localValue, propValue)) {
9232
+ localValue = propValue;
9233
+ trigger();
9234
+ }
9235
+ });
9236
+ return {
9237
+ get() {
9238
+ track();
9239
+ return options.get ? options.get(localValue) : localValue;
9240
+ },
9241
+ set(value) {
9242
+ const rawProps = i.vnode.props;
9243
+ if (!(rawProps && // check if parent has passed v-model
9244
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
9245
+ localValue = value;
9246
+ trigger();
9247
+ }
9248
+ i.emit(`update:${name}`, options.set ? options.set(value) : value);
9249
+ }
9250
+ };
9251
+ });
9252
+ const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
9253
+ res[Symbol.iterator] = () => {
9254
+ let i2 = 0;
9255
+ return {
9256
+ next() {
9257
+ if (i2 < 2) {
9258
+ return { value: i2++ ? props[modifierKey] || {} : res, done: false };
9259
+ } else {
9260
+ return { done: true };
9261
+ }
9262
+ }
9263
+ };
9264
+ };
9265
+ return res;
9266
+ }
9267
+
9258
9268
  function h(type, propsOrChildren, children) {
9259
9269
  const l = arguments.length;
9260
9270
  if (l === 2) {
@@ -9477,7 +9487,7 @@ Component that was made reactive: `,
9477
9487
  return true;
9478
9488
  }
9479
9489
 
9480
- const version = "3.4.8";
9490
+ const version = "3.4.10";
9481
9491
  const warn = warn$1 ;
9482
9492
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9483
9493
  const devtools = devtools$1 ;
@@ -9946,6 +9956,7 @@ Component that was made reactive: `,
9946
9956
 
9947
9957
  function patchStyle(el, prev, next) {
9948
9958
  const style = el.style;
9959
+ const currentDisplay = style.display;
9949
9960
  const isCssString = isString(next);
9950
9961
  if (next && !isCssString) {
9951
9962
  if (prev && !isString(prev)) {
@@ -9959,7 +9970,6 @@ Component that was made reactive: `,
9959
9970
  setStyle(style, key, next[key]);
9960
9971
  }
9961
9972
  } else {
9962
- const currentDisplay = style.display;
9963
9973
  if (isCssString) {
9964
9974
  if (prev !== next) {
9965
9975
  const cssVarText = style[CSS_VAR_TEXT];
@@ -9971,9 +9981,9 @@ Component that was made reactive: `,
9971
9981
  } else if (prev) {
9972
9982
  el.removeAttribute("style");
9973
9983
  }
9974
- if (vShowOldKey in el) {
9975
- style.display = currentDisplay;
9976
- }
9984
+ }
9985
+ if (vShowOldKey in el) {
9986
+ style.display = currentDisplay;
9977
9987
  }
9978
9988
  }
9979
9989
  const semicolonRE = /[^\\];\s*$/;