vue 3.3.9 → 3.3.11

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.
@@ -12,8 +12,8 @@ const EMPTY_ARR = Object.freeze([]) ;
12
12
  const NOOP = () => {
13
13
  };
14
14
  const NO = () => false;
15
- const onRE = /^on[^a-z]/;
16
- const isOn = (key) => onRE.test(key);
15
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
16
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
17
17
  const isModelListener = (key) => key.startsWith("onUpdate:");
18
18
  const extend = Object.assign;
19
19
  const remove = (arr, el) => {
@@ -235,20 +235,29 @@ const replacer = (_key, val) => {
235
235
  return replacer(_key, val.value);
236
236
  } else if (isMap(val)) {
237
237
  return {
238
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
239
- entries[`${key} =>`] = val2;
240
- return entries;
241
- }, {})
238
+ [`Map(${val.size})`]: [...val.entries()].reduce(
239
+ (entries, [key, val2], i) => {
240
+ entries[stringifySymbol(key, i) + " =>"] = val2;
241
+ return entries;
242
+ },
243
+ {}
244
+ )
242
245
  };
243
246
  } else if (isSet(val)) {
244
247
  return {
245
- [`Set(${val.size})`]: [...val.values()]
248
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
246
249
  };
250
+ } else if (isSymbol(val)) {
251
+ return stringifySymbol(val);
247
252
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
248
253
  return String(val);
249
254
  }
250
255
  return val;
251
256
  };
257
+ const stringifySymbol = (v, i = "") => {
258
+ var _a;
259
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
260
+ };
252
261
 
253
262
  function warn$1(msg, ...args) {
254
263
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -672,8 +681,13 @@ class BaseReactiveHandler {
672
681
  return isReadonly2;
673
682
  } else if (key === "__v_isShallow") {
674
683
  return shallow;
675
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
676
- return target;
684
+ } else if (key === "__v_raw") {
685
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
686
+ // this means the reciever is a user proxy of the reactive proxy
687
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
688
+ return target;
689
+ }
690
+ return;
677
691
  }
678
692
  const targetIsArray = isArray(target);
679
693
  if (!isReadonly2) {
@@ -1684,13 +1698,16 @@ function queuePostFlushCb(cb) {
1684
1698
  }
1685
1699
  queueFlush();
1686
1700
  }
1687
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1701
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1688
1702
  {
1689
1703
  seen = seen || /* @__PURE__ */ new Map();
1690
1704
  }
1691
1705
  for (; i < queue.length; i++) {
1692
1706
  const cb = queue[i];
1693
1707
  if (cb && cb.pre) {
1708
+ if (instance && cb.id !== instance.uid) {
1709
+ continue;
1710
+ }
1694
1711
  if (checkRecursiveUpdates(seen, cb)) {
1695
1712
  continue;
1696
1713
  }
@@ -2830,7 +2847,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2830
2847
  if (delayEnter) {
2831
2848
  activeBranch.transition.afterLeave = () => {
2832
2849
  if (pendingId === suspense.pendingId) {
2833
- move(pendingBranch, container2, anchor2, 0);
2850
+ move(
2851
+ pendingBranch,
2852
+ container2,
2853
+ next(activeBranch),
2854
+ 0
2855
+ );
2834
2856
  queuePostFlushCb(effects);
2835
2857
  }
2836
2858
  };
@@ -7232,7 +7254,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7232
7254
  updateProps(instance, nextVNode.props, prevProps, optimized);
7233
7255
  updateSlots(instance, nextVNode.children, optimized);
7234
7256
  pauseTracking();
7235
- flushPreFlushCbs();
7257
+ flushPreFlushCbs(instance);
7236
7258
  resetTracking();
7237
7259
  };
7238
7260
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
@@ -8909,9 +8931,9 @@ function initCustomFormatter() {
8909
8931
  return;
8910
8932
  }
8911
8933
  const vueStyle = { style: "color:#3ba776" };
8912
- const numberStyle = { style: "color:#0b1bc9" };
8913
- const stringStyle = { style: "color:#b62e24" };
8914
- const keywordStyle = { style: "color:#9d288c" };
8934
+ const numberStyle = { style: "color:#1677ff" };
8935
+ const stringStyle = { style: "color:#f5222d" };
8936
+ const keywordStyle = { style: "color:#eb2f96" };
8915
8937
  const formatter = {
8916
8938
  header(obj) {
8917
8939
  if (!isObject(obj)) {
@@ -9105,7 +9127,7 @@ function isMemoSame(cached, memo) {
9105
9127
  return true;
9106
9128
  }
9107
9129
 
9108
- const version = "3.3.9";
9130
+ const version = "3.3.11";
9109
9131
  const ssrUtils = null;
9110
9132
  const resolveFilter = null;
9111
9133
  const compatUtils = null;
@@ -9717,7 +9739,8 @@ function patchStopImmediatePropagation(e, value) {
9717
9739
  }
9718
9740
  }
9719
9741
 
9720
- const nativeOnRE = /^on[a-z]/;
9742
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
9743
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
9721
9744
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9722
9745
  if (key === "class") {
9723
9746
  patchClass(el, nextValue, isSVG);
@@ -9751,7 +9774,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
9751
9774
  if (key === "innerHTML" || key === "textContent") {
9752
9775
  return true;
9753
9776
  }
9754
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
9777
+ if (key in el && isNativeOn(key) && isFunction(value)) {
9755
9778
  return true;
9756
9779
  }
9757
9780
  return false;
@@ -9768,7 +9791,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
9768
9791
  if (key === "type" && el.tagName === "TEXTAREA") {
9769
9792
  return false;
9770
9793
  }
9771
- if (nativeOnRE.test(key) && isString(value)) {
9794
+ if (key === "width" || key === "height") {
9795
+ const tag = el.tagName;
9796
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
9797
+ return false;
9798
+ }
9799
+ }
9800
+ if (isNativeOn(key) && isString(value)) {
9772
9801
  return false;
9773
9802
  }
9774
9803
  return key in el;
@@ -10449,14 +10478,14 @@ const modifierGuards = {
10449
10478
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
10450
10479
  };
10451
10480
  const withModifiers = (fn, modifiers) => {
10452
- return (event, ...args) => {
10481
+ return fn._withMods || (fn._withMods = (event, ...args) => {
10453
10482
  for (let i = 0; i < modifiers.length; i++) {
10454
10483
  const guard = modifierGuards[modifiers[i]];
10455
10484
  if (guard && guard(event, modifiers))
10456
10485
  return;
10457
10486
  }
10458
10487
  return fn(event, ...args);
10459
- };
10488
+ });
10460
10489
  };
10461
10490
  const keyNames = {
10462
10491
  esc: "escape",
@@ -10468,7 +10497,7 @@ const keyNames = {
10468
10497
  delete: "backspace"
10469
10498
  };
10470
10499
  const withKeys = (fn, modifiers) => {
10471
- return (event) => {
10500
+ return fn._withKeys || (fn._withKeys = (event) => {
10472
10501
  if (!("key" in event)) {
10473
10502
  return;
10474
10503
  }
@@ -10476,7 +10505,7 @@ const withKeys = (fn, modifiers) => {
10476
10505
  if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
10477
10506
  return fn(event);
10478
10507
  }
10479
- };
10508
+ });
10480
10509
  };
10481
10510
 
10482
10511
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);