@vue/compat 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
  }
@@ -3307,7 +3324,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3307
3324
  if (delayEnter) {
3308
3325
  activeBranch.transition.afterLeave = () => {
3309
3326
  if (pendingId === suspense.pendingId) {
3310
- move(pendingBranch, container2, anchor2, 0);
3327
+ move(
3328
+ pendingBranch,
3329
+ container2,
3330
+ next(activeBranch),
3331
+ 0
3332
+ );
3311
3333
  queuePostFlushCb(effects);
3312
3334
  }
3313
3335
  };
@@ -6204,7 +6226,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6204
6226
  return vm;
6205
6227
  }
6206
6228
  }
6207
- Vue.version = `2.6.14-compat:${"3.3.9"}`;
6229
+ Vue.version = `2.6.14-compat:${"3.3.11"}`;
6208
6230
  Vue.config = singletonApp.config;
6209
6231
  Vue.use = (p, ...options) => {
6210
6232
  if (p && isFunction(p.install)) {
@@ -8842,7 +8864,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8842
8864
  updateProps(instance, nextVNode.props, prevProps, optimized);
8843
8865
  updateSlots(instance, nextVNode.children, optimized);
8844
8866
  pauseTracking();
8845
- flushPreFlushCbs();
8867
+ flushPreFlushCbs(instance);
8846
8868
  resetTracking();
8847
8869
  };
8848
8870
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
@@ -10601,9 +10623,9 @@ function initCustomFormatter() {
10601
10623
  return;
10602
10624
  }
10603
10625
  const vueStyle = { style: "color:#3ba776" };
10604
- const numberStyle = { style: "color:#0b1bc9" };
10605
- const stringStyle = { style: "color:#b62e24" };
10606
- const keywordStyle = { style: "color:#9d288c" };
10626
+ const numberStyle = { style: "color:#1677ff" };
10627
+ const stringStyle = { style: "color:#f5222d" };
10628
+ const keywordStyle = { style: "color:#eb2f96" };
10607
10629
  const formatter = {
10608
10630
  header(obj) {
10609
10631
  if (!isObject(obj)) {
@@ -10797,7 +10819,7 @@ function isMemoSame(cached, memo) {
10797
10819
  return true;
10798
10820
  }
10799
10821
 
10800
- const version = "3.3.9";
10822
+ const version = "3.3.11";
10801
10823
  const ssrUtils = null;
10802
10824
  const resolveFilter = resolveFilter$1 ;
10803
10825
  const _compatUtils = {
@@ -11496,7 +11518,8 @@ function patchStopImmediatePropagation(e, value) {
11496
11518
  }
11497
11519
  }
11498
11520
 
11499
- const nativeOnRE = /^on[a-z]/;
11521
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11522
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11500
11523
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11501
11524
  if (key === "class") {
11502
11525
  patchClass(el, nextValue, isSVG);
@@ -11530,7 +11553,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11530
11553
  if (key === "innerHTML" || key === "textContent") {
11531
11554
  return true;
11532
11555
  }
11533
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11556
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11534
11557
  return true;
11535
11558
  }
11536
11559
  return false;
@@ -11547,7 +11570,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
11547
11570
  if (key === "type" && el.tagName === "TEXTAREA") {
11548
11571
  return false;
11549
11572
  }
11550
- if (nativeOnRE.test(key) && isString(value)) {
11573
+ if (key === "width" || key === "height") {
11574
+ const tag = el.tagName;
11575
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
11576
+ return false;
11577
+ }
11578
+ }
11579
+ if (isNativeOn(key) && isString(value)) {
11551
11580
  return false;
11552
11581
  }
11553
11582
  return key in el;
@@ -12237,14 +12266,14 @@ const modifierGuards = {
12237
12266
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12238
12267
  };
12239
12268
  const withModifiers = (fn, modifiers) => {
12240
- return (event, ...args) => {
12269
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12241
12270
  for (let i = 0; i < modifiers.length; i++) {
12242
12271
  const guard = modifierGuards[modifiers[i]];
12243
12272
  if (guard && guard(event, modifiers))
12244
12273
  return;
12245
12274
  }
12246
12275
  return fn(event, ...args);
12247
- };
12276
+ });
12248
12277
  };
12249
12278
  const keyNames = {
12250
12279
  esc: "escape",
@@ -12272,7 +12301,7 @@ const withKeys = (fn, modifiers) => {
12272
12301
  );
12273
12302
  }
12274
12303
  }
12275
- return (event) => {
12304
+ return fn._withKeys || (fn._withKeys = (event) => {
12276
12305
  if (!("key" in event)) {
12277
12306
  return;
12278
12307
  }
@@ -12300,7 +12329,7 @@ const withKeys = (fn, modifiers) => {
12300
12329
  }
12301
12330
  }
12302
12331
  }
12303
- };
12332
+ });
12304
12333
  };
12305
12334
 
12306
12335
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);