@vue/runtime-dom 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.
@@ -619,7 +619,8 @@ function patchStopImmediatePropagation(e, value) {
619
619
  }
620
620
  }
621
621
 
622
- const nativeOnRE = /^on[a-z]/;
622
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
623
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
623
624
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
624
625
  if (key === "class") {
625
626
  patchClass(el, nextValue, isSVG);
@@ -653,7 +654,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
653
654
  if (key === "innerHTML" || key === "textContent") {
654
655
  return true;
655
656
  }
656
- if (key in el && nativeOnRE.test(key) && shared.isFunction(value)) {
657
+ if (key in el && isNativeOn(key) && shared.isFunction(value)) {
657
658
  return true;
658
659
  }
659
660
  return false;
@@ -670,7 +671,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
670
671
  if (key === "type" && el.tagName === "TEXTAREA") {
671
672
  return false;
672
673
  }
673
- if (nativeOnRE.test(key) && shared.isString(value)) {
674
+ if (key === "width" || key === "height") {
675
+ const tag = el.tagName;
676
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
677
+ return false;
678
+ }
679
+ }
680
+ if (isNativeOn(key) && shared.isString(value)) {
674
681
  return false;
675
682
  }
676
683
  return key in el;
@@ -1330,14 +1337,14 @@ const modifierGuards = {
1330
1337
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1331
1338
  };
1332
1339
  const withModifiers = (fn, modifiers) => {
1333
- return (event, ...args) => {
1340
+ return fn._withMods || (fn._withMods = (event, ...args) => {
1334
1341
  for (let i = 0; i < modifiers.length; i++) {
1335
1342
  const guard = modifierGuards[modifiers[i]];
1336
1343
  if (guard && guard(event, modifiers))
1337
1344
  return;
1338
1345
  }
1339
1346
  return fn(event, ...args);
1340
- };
1347
+ });
1341
1348
  };
1342
1349
  const keyNames = {
1343
1350
  esc: "escape",
@@ -1349,7 +1356,7 @@ const keyNames = {
1349
1356
  delete: "backspace"
1350
1357
  };
1351
1358
  const withKeys = (fn, modifiers) => {
1352
- return (event) => {
1359
+ return fn._withKeys || (fn._withKeys = (event) => {
1353
1360
  if (!("key" in event)) {
1354
1361
  return;
1355
1362
  }
@@ -1357,7 +1364,7 @@ const withKeys = (fn, modifiers) => {
1357
1364
  if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
1358
1365
  return fn(event);
1359
1366
  }
1360
- };
1367
+ });
1361
1368
  };
1362
1369
 
1363
1370
  const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps);
@@ -602,7 +602,8 @@ function patchStopImmediatePropagation(e, value) {
602
602
  }
603
603
  }
604
604
 
605
- const nativeOnRE = /^on[a-z]/;
605
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
606
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
606
607
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
607
608
  if (key === "class") {
608
609
  patchClass(el, nextValue, isSVG);
@@ -636,7 +637,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
636
637
  if (key === "innerHTML" || key === "textContent") {
637
638
  return true;
638
639
  }
639
- if (key in el && nativeOnRE.test(key) && shared.isFunction(value)) {
640
+ if (key in el && isNativeOn(key) && shared.isFunction(value)) {
640
641
  return true;
641
642
  }
642
643
  return false;
@@ -653,7 +654,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
653
654
  if (key === "type" && el.tagName === "TEXTAREA") {
654
655
  return false;
655
656
  }
656
- if (nativeOnRE.test(key) && shared.isString(value)) {
657
+ if (key === "width" || key === "height") {
658
+ const tag = el.tagName;
659
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
660
+ return false;
661
+ }
662
+ }
663
+ if (isNativeOn(key) && shared.isString(value)) {
657
664
  return false;
658
665
  }
659
666
  return key in el;
@@ -1286,14 +1293,14 @@ const modifierGuards = {
1286
1293
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1287
1294
  };
1288
1295
  const withModifiers = (fn, modifiers) => {
1289
- return (event, ...args) => {
1296
+ return fn._withMods || (fn._withMods = (event, ...args) => {
1290
1297
  for (let i = 0; i < modifiers.length; i++) {
1291
1298
  const guard = modifierGuards[modifiers[i]];
1292
1299
  if (guard && guard(event, modifiers))
1293
1300
  return;
1294
1301
  }
1295
1302
  return fn(event, ...args);
1296
- };
1303
+ });
1297
1304
  };
1298
1305
  const keyNames = {
1299
1306
  esc: "escape",
@@ -1305,7 +1312,7 @@ const keyNames = {
1305
1312
  delete: "backspace"
1306
1313
  };
1307
1314
  const withKeys = (fn, modifiers) => {
1308
- return (event) => {
1315
+ return fn._withKeys || (fn._withKeys = (event) => {
1309
1316
  if (!("key" in event)) {
1310
1317
  return;
1311
1318
  }
@@ -1313,7 +1320,7 @@ const withKeys = (fn, modifiers) => {
1313
1320
  if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
1314
1321
  return fn(event);
1315
1322
  }
1316
- };
1323
+ });
1317
1324
  };
1318
1325
 
1319
1326
  const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps);
@@ -102,11 +102,15 @@ export declare const vModelDynamic: ObjectDirective<HTMLInputElement | HTMLSelec
102
102
  /**
103
103
  * @private
104
104
  */
105
- export declare const withModifiers: (fn: Function, modifiers: string[]) => (event: Event, ...args: unknown[]) => any;
105
+ export declare const withModifiers: <T extends (event: Event, ...args: unknown[]) => any>(fn: T & {
106
+ _withMods?: T | undefined;
107
+ }, modifiers: string[]) => T;
106
108
  /**
107
109
  * @private
108
110
  */
109
- export declare const withKeys: (fn: Function, modifiers: string[]) => (event: KeyboardEvent) => any;
111
+ export declare const withKeys: <T extends (event: KeyboardEvent) => any>(fn: T & {
112
+ _withKeys?: T | undefined;
113
+ }, modifiers: string[]) => T;
110
114
 
111
115
  declare const vShowOldKey: unique symbol;
112
116
  interface VShowElement extends HTMLElement {
@@ -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);