@vue/runtime-dom 3.3.9 → 3.3.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.
@@ -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,11 @@ 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
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
677
+ }
678
+ if (isNativeOn(key) && shared.isString(value)) {
674
679
  return false;
675
680
  }
676
681
  return key in el;
@@ -1330,14 +1335,14 @@ const modifierGuards = {
1330
1335
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1331
1336
  };
1332
1337
  const withModifiers = (fn, modifiers) => {
1333
- return (event, ...args) => {
1338
+ return fn._withMods || (fn._withMods = (event, ...args) => {
1334
1339
  for (let i = 0; i < modifiers.length; i++) {
1335
1340
  const guard = modifierGuards[modifiers[i]];
1336
1341
  if (guard && guard(event, modifiers))
1337
1342
  return;
1338
1343
  }
1339
1344
  return fn(event, ...args);
1340
- };
1345
+ });
1341
1346
  };
1342
1347
  const keyNames = {
1343
1348
  esc: "escape",
@@ -1349,7 +1354,7 @@ const keyNames = {
1349
1354
  delete: "backspace"
1350
1355
  };
1351
1356
  const withKeys = (fn, modifiers) => {
1352
- return (event) => {
1357
+ return fn._withKeys || (fn._withKeys = (event) => {
1353
1358
  if (!("key" in event)) {
1354
1359
  return;
1355
1360
  }
@@ -1357,7 +1362,7 @@ const withKeys = (fn, modifiers) => {
1357
1362
  if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
1358
1363
  return fn(event);
1359
1364
  }
1360
- };
1365
+ });
1361
1366
  };
1362
1367
 
1363
1368
  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,11 @@ 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
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
660
+ }
661
+ if (isNativeOn(key) && shared.isString(value)) {
657
662
  return false;
658
663
  }
659
664
  return key in el;
@@ -1286,14 +1291,14 @@ const modifierGuards = {
1286
1291
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1287
1292
  };
1288
1293
  const withModifiers = (fn, modifiers) => {
1289
- return (event, ...args) => {
1294
+ return fn._withMods || (fn._withMods = (event, ...args) => {
1290
1295
  for (let i = 0; i < modifiers.length; i++) {
1291
1296
  const guard = modifierGuards[modifiers[i]];
1292
1297
  if (guard && guard(event, modifiers))
1293
1298
  return;
1294
1299
  }
1295
1300
  return fn(event, ...args);
1296
- };
1301
+ });
1297
1302
  };
1298
1303
  const keyNames = {
1299
1304
  esc: "escape",
@@ -1305,7 +1310,7 @@ const keyNames = {
1305
1310
  delete: "backspace"
1306
1311
  };
1307
1312
  const withKeys = (fn, modifiers) => {
1308
- return (event) => {
1313
+ return fn._withKeys || (fn._withKeys = (event) => {
1309
1314
  if (!("key" in event)) {
1310
1315
  return;
1311
1316
  }
@@ -1313,7 +1318,7 @@ const withKeys = (fn, modifiers) => {
1313
1318
  if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
1314
1319
  return fn(event);
1315
1320
  }
1316
- };
1321
+ });
1317
1322
  };
1318
1323
 
1319
1324
  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) => {
@@ -2830,7 +2830,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2830
2830
  if (delayEnter) {
2831
2831
  activeBranch.transition.afterLeave = () => {
2832
2832
  if (pendingId === suspense.pendingId) {
2833
- move(pendingBranch, container2, anchor2, 0);
2833
+ move(
2834
+ pendingBranch,
2835
+ container2,
2836
+ next(activeBranch),
2837
+ 0
2838
+ );
2834
2839
  queuePostFlushCb(effects);
2835
2840
  }
2836
2841
  };
@@ -2877,7 +2882,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2877
2882
  }
2878
2883
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
2879
2884
  triggerEvent(vnode2, "onFallback");
2880
- const anchor2 = next(activeBranch);
2881
2885
  const mountFallback = () => {
2882
2886
  if (!suspense.isInFallback) {
2883
2887
  return;
@@ -2886,7 +2890,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2886
2890
  null,
2887
2891
  fallbackVNode,
2888
2892
  container2,
2889
- anchor2,
2893
+ next(activeBranch),
2890
2894
  parentComponent2,
2891
2895
  null,
2892
2896
  // fallback tree will not have suspense context
@@ -8909,9 +8913,9 @@ function initCustomFormatter() {
8909
8913
  return;
8910
8914
  }
8911
8915
  const vueStyle = { style: "color:#3ba776" };
8912
- const numberStyle = { style: "color:#0b1bc9" };
8913
- const stringStyle = { style: "color:#b62e24" };
8914
- const keywordStyle = { style: "color:#9d288c" };
8916
+ const numberStyle = { style: "color:#1677ff" };
8917
+ const stringStyle = { style: "color:#f5222d" };
8918
+ const keywordStyle = { style: "color:#eb2f96" };
8915
8919
  const formatter = {
8916
8920
  header(obj) {
8917
8921
  if (!isObject(obj)) {
@@ -9105,7 +9109,7 @@ function isMemoSame(cached, memo) {
9105
9109
  return true;
9106
9110
  }
9107
9111
 
9108
- const version = "3.3.9";
9112
+ const version = "3.3.10";
9109
9113
  const ssrUtils = null;
9110
9114
  const resolveFilter = null;
9111
9115
  const compatUtils = null;
@@ -9717,7 +9721,8 @@ function patchStopImmediatePropagation(e, value) {
9717
9721
  }
9718
9722
  }
9719
9723
 
9720
- const nativeOnRE = /^on[a-z]/;
9724
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
9725
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
9721
9726
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9722
9727
  if (key === "class") {
9723
9728
  patchClass(el, nextValue, isSVG);
@@ -9751,7 +9756,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
9751
9756
  if (key === "innerHTML" || key === "textContent") {
9752
9757
  return true;
9753
9758
  }
9754
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
9759
+ if (key in el && isNativeOn(key) && isFunction(value)) {
9755
9760
  return true;
9756
9761
  }
9757
9762
  return false;
@@ -9768,7 +9773,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
9768
9773
  if (key === "type" && el.tagName === "TEXTAREA") {
9769
9774
  return false;
9770
9775
  }
9771
- if (nativeOnRE.test(key) && isString(value)) {
9776
+ if (key === "width" || key === "height") {
9777
+ const tag = el.tagName;
9778
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
9779
+ }
9780
+ if (isNativeOn(key) && isString(value)) {
9772
9781
  return false;
9773
9782
  }
9774
9783
  return key in el;
@@ -10449,14 +10458,14 @@ const modifierGuards = {
10449
10458
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
10450
10459
  };
10451
10460
  const withModifiers = (fn, modifiers) => {
10452
- return (event, ...args) => {
10461
+ return fn._withMods || (fn._withMods = (event, ...args) => {
10453
10462
  for (let i = 0; i < modifiers.length; i++) {
10454
10463
  const guard = modifierGuards[modifiers[i]];
10455
10464
  if (guard && guard(event, modifiers))
10456
10465
  return;
10457
10466
  }
10458
10467
  return fn(event, ...args);
10459
- };
10468
+ });
10460
10469
  };
10461
10470
  const keyNames = {
10462
10471
  esc: "escape",
@@ -10468,7 +10477,7 @@ const keyNames = {
10468
10477
  delete: "backspace"
10469
10478
  };
10470
10479
  const withKeys = (fn, modifiers) => {
10471
- return (event) => {
10480
+ return fn._withKeys || (fn._withKeys = (event) => {
10472
10481
  if (!("key" in event)) {
10473
10482
  return;
10474
10483
  }
@@ -10476,7 +10485,7 @@ const withKeys = (fn, modifiers) => {
10476
10485
  if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
10477
10486
  return fn(event);
10478
10487
  }
10479
- };
10488
+ });
10480
10489
  };
10481
10490
 
10482
10491
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);