@vue/runtime-dom 3.5.18 → 3.5.19

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.5.18
2
+ * @vue/runtime-dom v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -418,7 +418,7 @@ const vShow = {
418
418
  setDisplay(el, value);
419
419
  }
420
420
  };
421
- if (!!(process.env.NODE_ENV !== "production")) {
421
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {
422
422
  vShow.name = "show";
423
423
  }
424
424
  function setDisplay(el, value) {
@@ -842,10 +842,10 @@ function defineCustomElement(options, extraOptions, _createApp) {
842
842
  VueCustomElement.def = Comp;
843
843
  return VueCustomElement;
844
844
  }
845
- /*! #__NO_SIDE_EFFECTS__ */
846
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
845
+
846
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
847
847
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
848
- };
848
+ });
849
849
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
850
850
  };
851
851
  class VueElement extends BaseClass {
@@ -1706,13 +1706,13 @@ const modifierGuards = {
1706
1706
  const withModifiers = (fn, modifiers) => {
1707
1707
  const cache = fn._withMods || (fn._withMods = {});
1708
1708
  const cacheKey = modifiers.join(".");
1709
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
1709
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
1710
1710
  for (let i = 0; i < modifiers.length; i++) {
1711
1711
  const guard = modifierGuards[modifiers[i]];
1712
1712
  if (guard && guard(event, modifiers)) return;
1713
1713
  }
1714
1714
  return fn(event, ...args);
1715
- });
1715
+ }));
1716
1716
  };
1717
1717
  const keyNames = {
1718
1718
  esc: "escape",
@@ -1726,7 +1726,7 @@ const keyNames = {
1726
1726
  const withKeys = (fn, modifiers) => {
1727
1727
  const cache = fn._withKeys || (fn._withKeys = {});
1728
1728
  const cacheKey = modifiers.join(".");
1729
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
1729
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
1730
1730
  if (!("key" in event)) {
1731
1731
  return;
1732
1732
  }
@@ -1736,7 +1736,7 @@ const withKeys = (fn, modifiers) => {
1736
1736
  )) {
1737
1737
  return fn(event);
1738
1738
  }
1739
- });
1739
+ }));
1740
1740
  };
1741
1741
 
1742
1742
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -1750,13 +1750,13 @@ function ensureHydrationRenderer() {
1750
1750
  enabledHydration = true;
1751
1751
  return renderer;
1752
1752
  }
1753
- const render = (...args) => {
1753
+ const render = ((...args) => {
1754
1754
  ensureRenderer().render(...args);
1755
- };
1756
- const hydrate = (...args) => {
1755
+ });
1756
+ const hydrate = ((...args) => {
1757
1757
  ensureHydrationRenderer().hydrate(...args);
1758
- };
1759
- const createApp = (...args) => {
1758
+ });
1759
+ const createApp = ((...args) => {
1760
1760
  const app = ensureRenderer().createApp(...args);
1761
1761
  if (!!(process.env.NODE_ENV !== "production")) {
1762
1762
  injectNativeTagCheck(app);
@@ -1781,8 +1781,8 @@ const createApp = (...args) => {
1781
1781
  return proxy;
1782
1782
  };
1783
1783
  return app;
1784
- };
1785
- const createSSRApp = (...args) => {
1784
+ });
1785
+ const createSSRApp = ((...args) => {
1786
1786
  const app = ensureHydrationRenderer().createApp(...args);
1787
1787
  if (!!(process.env.NODE_ENV !== "production")) {
1788
1788
  injectNativeTagCheck(app);
@@ -1796,7 +1796,7 @@ const createSSRApp = (...args) => {
1796
1796
  }
1797
1797
  };
1798
1798
  return app;
1799
- };
1799
+ });
1800
1800
  function resolveRootNamespace(container) {
1801
1801
  if (container instanceof SVGElement) {
1802
1802
  return "svg";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.18
2
+ * @vue/runtime-dom v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -59,10 +59,10 @@ var VueRuntimeDOM = (function (exports) {
59
59
  );
60
60
  const cacheStringFunction = (fn) => {
61
61
  const cache = /* @__PURE__ */ Object.create(null);
62
- return (str) => {
62
+ return ((str) => {
63
63
  const hit = cache[str];
64
64
  return hit || (cache[str] = fn(str));
65
- };
65
+ });
66
66
  };
67
67
  const camelizeRE = /-(\w)/g;
68
68
  const camelize = cacheStringFunction(
@@ -1295,7 +1295,13 @@ var VueRuntimeDOM = (function (exports) {
1295
1295
  }
1296
1296
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1297
1297
  if (isOldValueReadonly) {
1298
- return false;
1298
+ {
1299
+ warn$2(
1300
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
1301
+ target[key]
1302
+ );
1303
+ }
1304
+ return true;
1299
1305
  } else {
1300
1306
  oldValue.value = value;
1301
1307
  return true;
@@ -2662,7 +2668,9 @@ var VueRuntimeDOM = (function (exports) {
2662
2668
  }
2663
2669
  instance.renderCache = [];
2664
2670
  isHmrUpdating = true;
2665
- instance.update();
2671
+ if (!(instance.job.flags & 8)) {
2672
+ instance.update();
2673
+ }
2666
2674
  isHmrUpdating = false;
2667
2675
  });
2668
2676
  }
@@ -3723,7 +3731,7 @@ var VueRuntimeDOM = (function (exports) {
3723
3731
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3724
3732
  const setupState = owner.setupState;
3725
3733
  const rawSetupState = toRaw(setupState);
3726
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3734
+ const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
3727
3735
  {
3728
3736
  if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
3729
3737
  warn$1(
@@ -3736,6 +3744,9 @@ var VueRuntimeDOM = (function (exports) {
3736
3744
  }
3737
3745
  return hasOwn(rawSetupState, key);
3738
3746
  };
3747
+ const canSetRef = (ref2) => {
3748
+ return !knownTemplateRefs.has(ref2);
3749
+ };
3739
3750
  if (oldRef != null && oldRef !== ref) {
3740
3751
  if (isString(oldRef)) {
3741
3752
  refs[oldRef] = null;
@@ -3743,7 +3754,11 @@ var VueRuntimeDOM = (function (exports) {
3743
3754
  setupState[oldRef] = null;
3744
3755
  }
3745
3756
  } else if (isRef(oldRef)) {
3746
- oldRef.value = null;
3757
+ if (canSetRef(oldRef)) {
3758
+ oldRef.value = null;
3759
+ }
3760
+ const oldRawRefAtom = oldRawRef;
3761
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
3747
3762
  }
3748
3763
  }
3749
3764
  if (isFunction(ref)) {
@@ -3754,7 +3769,7 @@ var VueRuntimeDOM = (function (exports) {
3754
3769
  if (_isString || _isRef) {
3755
3770
  const doSet = () => {
3756
3771
  if (rawRef.f) {
3757
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
3772
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
3758
3773
  if (isUnmount) {
3759
3774
  isArray(existing) && remove(existing, refValue);
3760
3775
  } else {
@@ -3765,8 +3780,11 @@ var VueRuntimeDOM = (function (exports) {
3765
3780
  setupState[ref] = refs[ref];
3766
3781
  }
3767
3782
  } else {
3768
- ref.value = [refValue];
3769
- if (rawRef.k) refs[rawRef.k] = ref.value;
3783
+ const newVal = [refValue];
3784
+ if (canSetRef(ref)) {
3785
+ ref.value = newVal;
3786
+ }
3787
+ if (rawRef.k) refs[rawRef.k] = newVal;
3770
3788
  }
3771
3789
  } else if (!existing.includes(refValue)) {
3772
3790
  existing.push(refValue);
@@ -3778,7 +3796,9 @@ var VueRuntimeDOM = (function (exports) {
3778
3796
  setupState[ref] = value;
3779
3797
  }
3780
3798
  } else if (_isRef) {
3781
- ref.value = value;
3799
+ if (canSetRef(ref)) {
3800
+ ref.value = value;
3801
+ }
3782
3802
  if (rawRef.k) refs[rawRef.k] = value;
3783
3803
  } else {
3784
3804
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -5341,10 +5361,10 @@ If this is a native custom element, make sure to exclude it from component resol
5341
5361
  return true;
5342
5362
  },
5343
5363
  has({
5344
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
5364
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
5345
5365
  }, key) {
5346
- let normalizedProps;
5347
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
5366
+ let normalizedProps, cssModules;
5367
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
5348
5368
  },
5349
5369
  defineProperty(target, key, descriptor) {
5350
5370
  if (descriptor.get != null) {
@@ -6618,7 +6638,7 @@ If you want to remount the same app, move your app creation logic into a factory
6618
6638
  return args.some((elem) => elem.toLowerCase() === "boolean");
6619
6639
  }
6620
6640
 
6621
- const isInternalKey = (key) => key === "_" || key === "__" || key === "_ctx" || key === "$stable";
6641
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
6622
6642
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6623
6643
  const normalizeSlot = (key, rawSlot, ctx) => {
6624
6644
  if (rawSlot._n) {
@@ -6672,8 +6692,6 @@ If you want to remount the same app, move your app creation logic into a factory
6672
6692
  const initSlots = (instance, children, optimized) => {
6673
6693
  const slots = instance.slots = createInternalObject();
6674
6694
  if (instance.vnode.shapeFlag & 32) {
6675
- const cacheIndexes = children.__;
6676
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
6677
6695
  const type = children._;
6678
6696
  if (type) {
6679
6697
  assignSlots(slots, children, optimized);
@@ -6734,12 +6752,10 @@ If you want to remount the same app, move your app creation logic into a factory
6734
6752
  if (instance.appContext.config.performance && isSupported()) {
6735
6753
  const startTag = `vue-${type}-${instance.uid}`;
6736
6754
  const endTag = startTag + `:end`;
6755
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
6737
6756
  perf.mark(endTag);
6738
- perf.measure(
6739
- `<${formatComponentName(instance, instance.type)}> ${type}`,
6740
- startTag,
6741
- endTag
6742
- );
6757
+ perf.measure(measureName, startTag, endTag);
6758
+ perf.clearMeasures(measureName);
6743
6759
  perf.clearMarks(startTag);
6744
6760
  perf.clearMarks(endTag);
6745
6761
  }
@@ -7931,6 +7947,12 @@ If you want to remount the same app, move your app creation logic into a factory
7931
7947
  }
7932
7948
  };
7933
7949
  const performLeave = () => {
7950
+ if (el._isLeaving) {
7951
+ el[leaveCbKey](
7952
+ true
7953
+ /* cancelled */
7954
+ );
7955
+ }
7934
7956
  leave(el, () => {
7935
7957
  remove2();
7936
7958
  afterLeave && afterLeave();
@@ -8076,27 +8098,12 @@ If you want to remount the same app, move your app creation logic into a factory
8076
8098
  if (instance.type.__hmrId) {
8077
8099
  unregisterHMR(instance);
8078
8100
  }
8079
- const {
8080
- bum,
8081
- scope,
8082
- job,
8083
- subTree,
8084
- um,
8085
- m,
8086
- a,
8087
- parent,
8088
- slots: { __: slotCacheKeys }
8089
- } = instance;
8101
+ const { bum, scope, job, subTree, um, m, a } = instance;
8090
8102
  invalidateMount(m);
8091
8103
  invalidateMount(a);
8092
8104
  if (bum) {
8093
8105
  invokeArrayFns(bum);
8094
8106
  }
8095
- if (parent && isArray(slotCacheKeys)) {
8096
- slotCacheKeys.forEach((v) => {
8097
- parent.renderCache[v] = void 0;
8098
- });
8099
- }
8100
8107
  scope.stop();
8101
8108
  if (job) {
8102
8109
  job.flags |= 8;
@@ -8108,12 +8115,6 @@ If you want to remount the same app, move your app creation logic into a factory
8108
8115
  queuePostRenderEffect(() => {
8109
8116
  instance.isUnmounted = true;
8110
8117
  }, parentSuspense);
8111
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8112
- parentSuspense.deps--;
8113
- if (parentSuspense.deps === 0) {
8114
- parentSuspense.resolve();
8115
- }
8116
- }
8117
8118
  {
8118
8119
  devtoolsComponentRemoved(instance);
8119
8120
  }
@@ -8214,7 +8215,8 @@ If you want to remount the same app, move your app creation logic into a factory
8214
8215
  if (!shallow && c2.patchFlag !== -2)
8215
8216
  traverseStaticChildren(c1, c2);
8216
8217
  }
8217
- if (c2.type === Text) {
8218
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8219
+ c2.patchFlag !== -1) {
8218
8220
  c2.el = c1.el;
8219
8221
  }
8220
8222
  if (c2.type === Comment && !c2.el) {
@@ -10509,7 +10511,7 @@ Component that was made reactive: `,
10509
10511
  return true;
10510
10512
  }
10511
10513
 
10512
- const version = "3.5.18";
10514
+ const version = "3.5.19";
10513
10515
  const warn = warn$1 ;
10514
10516
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10515
10517
  const devtools = devtools$1 ;
@@ -11347,10 +11349,10 @@ Expected function or array of functions, received type ${typeof value}.`
11347
11349
  VueCustomElement.def = Comp;
11348
11350
  return VueCustomElement;
11349
11351
  }
11350
- /*! #__NO_SIDE_EFFECTS__ */
11351
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11352
+
11353
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11352
11354
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
11353
- };
11355
+ });
11354
11356
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11355
11357
  };
11356
11358
  class VueElement extends BaseClass {
@@ -12165,13 +12167,13 @@ Expected function or array of functions, received type ${typeof value}.`
12165
12167
  const withModifiers = (fn, modifiers) => {
12166
12168
  const cache = fn._withMods || (fn._withMods = {});
12167
12169
  const cacheKey = modifiers.join(".");
12168
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12170
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
12169
12171
  for (let i = 0; i < modifiers.length; i++) {
12170
12172
  const guard = modifierGuards[modifiers[i]];
12171
12173
  if (guard && guard(event, modifiers)) return;
12172
12174
  }
12173
12175
  return fn(event, ...args);
12174
- });
12176
+ }));
12175
12177
  };
12176
12178
  const keyNames = {
12177
12179
  esc: "escape",
@@ -12185,7 +12187,7 @@ Expected function or array of functions, received type ${typeof value}.`
12185
12187
  const withKeys = (fn, modifiers) => {
12186
12188
  const cache = fn._withKeys || (fn._withKeys = {});
12187
12189
  const cacheKey = modifiers.join(".");
12188
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
12190
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
12189
12191
  if (!("key" in event)) {
12190
12192
  return;
12191
12193
  }
@@ -12195,7 +12197,7 @@ Expected function or array of functions, received type ${typeof value}.`
12195
12197
  )) {
12196
12198
  return fn(event);
12197
12199
  }
12198
- });
12200
+ }));
12199
12201
  };
12200
12202
 
12201
12203
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12209,13 +12211,13 @@ Expected function or array of functions, received type ${typeof value}.`
12209
12211
  enabledHydration = true;
12210
12212
  return renderer;
12211
12213
  }
12212
- const render = (...args) => {
12214
+ const render = ((...args) => {
12213
12215
  ensureRenderer().render(...args);
12214
- };
12215
- const hydrate = (...args) => {
12216
+ });
12217
+ const hydrate = ((...args) => {
12216
12218
  ensureHydrationRenderer().hydrate(...args);
12217
- };
12218
- const createApp = (...args) => {
12219
+ });
12220
+ const createApp = ((...args) => {
12219
12221
  const app = ensureRenderer().createApp(...args);
12220
12222
  {
12221
12223
  injectNativeTagCheck(app);
@@ -12240,8 +12242,8 @@ Expected function or array of functions, received type ${typeof value}.`
12240
12242
  return proxy;
12241
12243
  };
12242
12244
  return app;
12243
- };
12244
- const createSSRApp = (...args) => {
12245
+ });
12246
+ const createSSRApp = ((...args) => {
12245
12247
  const app = ensureHydrationRenderer().createApp(...args);
12246
12248
  {
12247
12249
  injectNativeTagCheck(app);
@@ -12255,7 +12257,7 @@ Expected function or array of functions, received type ${typeof value}.`
12255
12257
  }
12256
12258
  };
12257
12259
  return app;
12258
- };
12260
+ });
12259
12261
  function resolveRootNamespace(container) {
12260
12262
  if (container instanceof SVGElement) {
12261
12263
  return "svg";