@vue/compat 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.
package/dist/vue.cjs.js CHANGED
@@ -18,8 +18,8 @@ const EMPTY_ARR = Object.freeze([]) ;
18
18
  const NOOP = () => {
19
19
  };
20
20
  const NO = () => false;
21
- const onRE = /^on[^a-z]/;
22
- const isOn = (key) => onRE.test(key);
21
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
22
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
23
23
  const isModelListener = (key) => key.startsWith("onUpdate:");
24
24
  const extend = Object.assign;
25
25
  const remove = (arr, el) => {
@@ -3445,7 +3445,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3445
3445
  if (delayEnter) {
3446
3446
  activeBranch.transition.afterLeave = () => {
3447
3447
  if (pendingId === suspense.pendingId) {
3448
- move(pendingBranch, container2, anchor2, 0);
3448
+ move(
3449
+ pendingBranch,
3450
+ container2,
3451
+ next(activeBranch),
3452
+ 0
3453
+ );
3449
3454
  queuePostFlushCb(effects);
3450
3455
  }
3451
3456
  };
@@ -3492,7 +3497,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3492
3497
  }
3493
3498
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3494
3499
  triggerEvent(vnode2, "onFallback");
3495
- const anchor2 = next(activeBranch);
3496
3500
  const mountFallback = () => {
3497
3501
  if (!suspense.isInFallback) {
3498
3502
  return;
@@ -3501,7 +3505,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3501
3505
  null,
3502
3506
  fallbackVNode,
3503
3507
  container2,
3504
- anchor2,
3508
+ next(activeBranch),
3505
3509
  parentComponent2,
3506
3510
  null,
3507
3511
  // fallback tree will not have suspense context
@@ -6369,7 +6373,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6369
6373
  return vm;
6370
6374
  }
6371
6375
  }
6372
- Vue.version = `2.6.14-compat:${"3.3.9"}`;
6376
+ Vue.version = `2.6.14-compat:${"3.3.10"}`;
6373
6377
  Vue.config = singletonApp.config;
6374
6378
  Vue.use = (p, ...options) => {
6375
6379
  if (p && isFunction(p.install)) {
@@ -10778,9 +10782,9 @@ function initCustomFormatter() {
10778
10782
  return;
10779
10783
  }
10780
10784
  const vueStyle = { style: "color:#3ba776" };
10781
- const numberStyle = { style: "color:#0b1bc9" };
10782
- const stringStyle = { style: "color:#b62e24" };
10783
- const keywordStyle = { style: "color:#9d288c" };
10785
+ const numberStyle = { style: "color:#1677ff" };
10786
+ const stringStyle = { style: "color:#f5222d" };
10787
+ const keywordStyle = { style: "color:#eb2f96" };
10784
10788
  const formatter = {
10785
10789
  header(obj) {
10786
10790
  if (!isObject(obj)) {
@@ -10974,7 +10978,7 @@ function isMemoSame(cached, memo) {
10974
10978
  return true;
10975
10979
  }
10976
10980
 
10977
- const version = "3.3.9";
10981
+ const version = "3.3.10";
10978
10982
  const _ssrUtils = {
10979
10983
  createComponentInstance,
10980
10984
  setupComponent,
@@ -11688,7 +11692,8 @@ function patchStopImmediatePropagation(e, value) {
11688
11692
  }
11689
11693
  }
11690
11694
 
11691
- const nativeOnRE = /^on[a-z]/;
11695
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11696
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11692
11697
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11693
11698
  if (key === "class") {
11694
11699
  patchClass(el, nextValue, isSVG);
@@ -11722,7 +11727,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11722
11727
  if (key === "innerHTML" || key === "textContent") {
11723
11728
  return true;
11724
11729
  }
11725
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11730
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11726
11731
  return true;
11727
11732
  }
11728
11733
  return false;
@@ -11739,7 +11744,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
11739
11744
  if (key === "type" && el.tagName === "TEXTAREA") {
11740
11745
  return false;
11741
11746
  }
11742
- if (nativeOnRE.test(key) && isString(value)) {
11747
+ if (key === "width" || key === "height") {
11748
+ const tag = el.tagName;
11749
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
11750
+ }
11751
+ if (isNativeOn(key) && isString(value)) {
11743
11752
  return false;
11744
11753
  }
11745
11754
  return key in el;
@@ -12408,14 +12417,14 @@ const modifierGuards = {
12408
12417
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12409
12418
  };
12410
12419
  const withModifiers = (fn, modifiers) => {
12411
- return (event, ...args) => {
12420
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12412
12421
  for (let i = 0; i < modifiers.length; i++) {
12413
12422
  const guard = modifierGuards[modifiers[i]];
12414
12423
  if (guard && guard(event, modifiers))
12415
12424
  return;
12416
12425
  }
12417
12426
  return fn(event, ...args);
12418
- };
12427
+ });
12419
12428
  };
12420
12429
  const keyNames = {
12421
12430
  esc: "escape",
@@ -12443,7 +12452,7 @@ const withKeys = (fn, modifiers) => {
12443
12452
  );
12444
12453
  }
12445
12454
  }
12446
- return (event) => {
12455
+ return fn._withKeys || (fn._withKeys = (event) => {
12447
12456
  if (!("key" in event)) {
12448
12457
  return;
12449
12458
  }
@@ -12471,7 +12480,7 @@ const withKeys = (fn, modifiers) => {
12471
12480
  }
12472
12481
  }
12473
12482
  }
12474
- };
12483
+ });
12475
12484
  };
12476
12485
 
12477
12486
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -16957,6 +16966,10 @@ function resolveSetupReference(name, context) {
16957
16966
  `${context.helperString(UNREF)}(${fromMaybeRef})`
16958
16967
  ) : `$setup[${JSON.stringify(fromMaybeRef)}]`;
16959
16968
  }
16969
+ const fromProps = checkType("props");
16970
+ if (fromProps) {
16971
+ return `${context.helperString(UNREF)}(${context.inline ? "__props" : "$props"}[${JSON.stringify(fromProps)}])`;
16972
+ }
16960
16973
  }
16961
16974
  function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
16962
16975
  const { tag, loc: elementLoc, children } = node;
@@ -16997,6 +17010,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
16997
17010
  if (isEventHandler && isReservedProp(name)) {
16998
17011
  hasVnodeHook = true;
16999
17012
  }
17013
+ if (isEventHandler && value.type === 14) {
17014
+ value = value.arguments[0];
17015
+ }
17000
17016
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
17001
17017
  return;
17002
17018
  }
@@ -18,8 +18,8 @@ const EMPTY_ARR = [];
18
18
  const NOOP = () => {
19
19
  };
20
20
  const NO = () => false;
21
- const onRE = /^on[^a-z]/;
22
- const isOn = (key) => onRE.test(key);
21
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
22
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
23
23
  const isModelListener = (key) => key.startsWith("onUpdate:");
24
24
  const extend = Object.assign;
25
25
  const remove = (arr, el) => {
@@ -2508,7 +2508,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2508
2508
  if (delayEnter) {
2509
2509
  activeBranch.transition.afterLeave = () => {
2510
2510
  if (pendingId === suspense.pendingId) {
2511
- move(pendingBranch, container2, anchor2, 0);
2511
+ move(
2512
+ pendingBranch,
2513
+ container2,
2514
+ next(activeBranch),
2515
+ 0
2516
+ );
2512
2517
  queuePostFlushCb(effects);
2513
2518
  }
2514
2519
  };
@@ -2555,7 +2560,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2555
2560
  }
2556
2561
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
2557
2562
  triggerEvent(vnode2, "onFallback");
2558
- const anchor2 = next(activeBranch);
2559
2563
  const mountFallback = () => {
2560
2564
  if (!suspense.isInFallback) {
2561
2565
  return;
@@ -2564,7 +2568,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2564
2568
  null,
2565
2569
  fallbackVNode,
2566
2570
  container2,
2567
- anchor2,
2571
+ next(activeBranch),
2568
2572
  parentComponent2,
2569
2573
  null,
2570
2574
  // fallback tree will not have suspense context
@@ -5087,7 +5091,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5087
5091
  return vm;
5088
5092
  }
5089
5093
  }
5090
- Vue.version = `2.6.14-compat:${"3.3.9"}`;
5094
+ Vue.version = `2.6.14-compat:${"3.3.10"}`;
5091
5095
  Vue.config = singletonApp.config;
5092
5096
  Vue.use = (p, ...options) => {
5093
5097
  if (p && isFunction(p.install)) {
@@ -8816,7 +8820,7 @@ function isMemoSame(cached, memo) {
8816
8820
  return true;
8817
8821
  }
8818
8822
 
8819
- const version = "3.3.9";
8823
+ const version = "3.3.10";
8820
8824
  const _ssrUtils = {
8821
8825
  createComponentInstance,
8822
8826
  setupComponent,
@@ -9508,7 +9512,8 @@ function patchStopImmediatePropagation(e, value) {
9508
9512
  }
9509
9513
  }
9510
9514
 
9511
- const nativeOnRE = /^on[a-z]/;
9515
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
9516
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
9512
9517
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9513
9518
  if (key === "class") {
9514
9519
  patchClass(el, nextValue, isSVG);
@@ -9542,7 +9547,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
9542
9547
  if (key === "innerHTML" || key === "textContent") {
9543
9548
  return true;
9544
9549
  }
9545
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
9550
+ if (key in el && isNativeOn(key) && isFunction(value)) {
9546
9551
  return true;
9547
9552
  }
9548
9553
  return false;
@@ -9559,7 +9564,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
9559
9564
  if (key === "type" && el.tagName === "TEXTAREA") {
9560
9565
  return false;
9561
9566
  }
9562
- if (nativeOnRE.test(key) && isString(value)) {
9567
+ if (key === "width" || key === "height") {
9568
+ const tag = el.tagName;
9569
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
9570
+ }
9571
+ if (isNativeOn(key) && isString(value)) {
9563
9572
  return false;
9564
9573
  }
9565
9574
  return key in el;
@@ -10201,14 +10210,14 @@ const modifierGuards = {
10201
10210
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
10202
10211
  };
10203
10212
  const withModifiers = (fn, modifiers) => {
10204
- return (event, ...args) => {
10213
+ return fn._withMods || (fn._withMods = (event, ...args) => {
10205
10214
  for (let i = 0; i < modifiers.length; i++) {
10206
10215
  const guard = modifierGuards[modifiers[i]];
10207
10216
  if (guard && guard(event, modifiers))
10208
10217
  return;
10209
10218
  }
10210
10219
  return fn(event, ...args);
10211
- };
10220
+ });
10212
10221
  };
10213
10222
  const keyNames = {
10214
10223
  esc: "escape",
@@ -10230,7 +10239,7 @@ const withKeys = (fn, modifiers) => {
10230
10239
  }
10231
10240
  }
10232
10241
  }
10233
- return (event) => {
10242
+ return fn._withKeys || (fn._withKeys = (event) => {
10234
10243
  if (!("key" in event)) {
10235
10244
  return;
10236
10245
  }
@@ -10258,7 +10267,7 @@ const withKeys = (fn, modifiers) => {
10258
10267
  }
10259
10268
  }
10260
10269
  }
10261
- };
10270
+ });
10262
10271
  };
10263
10272
 
10264
10273
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -14522,6 +14531,10 @@ function resolveSetupReference(name, context) {
14522
14531
  `${context.helperString(UNREF)}(${fromMaybeRef})`
14523
14532
  ) : `$setup[${JSON.stringify(fromMaybeRef)}]`;
14524
14533
  }
14534
+ const fromProps = checkType("props");
14535
+ if (fromProps) {
14536
+ return `${context.helperString(UNREF)}(${context.inline ? "__props" : "$props"}[${JSON.stringify(fromProps)}])`;
14537
+ }
14525
14538
  }
14526
14539
  function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
14527
14540
  const { tag, loc: elementLoc, children } = node;
@@ -14562,6 +14575,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14562
14575
  if (isEventHandler && isReservedProp(name)) {
14563
14576
  hasVnodeHook = true;
14564
14577
  }
14578
+ if (isEventHandler && value.type === 14) {
14579
+ value = value.arguments[0];
14580
+ }
14565
14581
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
14566
14582
  return;
14567
14583
  }
@@ -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) => {
@@ -3372,7 +3372,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3372
3372
  if (delayEnter) {
3373
3373
  activeBranch.transition.afterLeave = () => {
3374
3374
  if (pendingId === suspense.pendingId) {
3375
- move(pendingBranch, container2, anchor2, 0);
3375
+ move(
3376
+ pendingBranch,
3377
+ container2,
3378
+ next(activeBranch),
3379
+ 0
3380
+ );
3376
3381
  queuePostFlushCb(effects);
3377
3382
  }
3378
3383
  };
@@ -3419,7 +3424,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3419
3424
  }
3420
3425
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3421
3426
  triggerEvent(vnode2, "onFallback");
3422
- const anchor2 = next(activeBranch);
3423
3427
  const mountFallback = () => {
3424
3428
  if (!suspense.isInFallback) {
3425
3429
  return;
@@ -3428,7 +3432,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3428
3432
  null,
3429
3433
  fallbackVNode,
3430
3434
  container2,
3431
- anchor2,
3435
+ next(activeBranch),
3432
3436
  parentComponent2,
3433
3437
  null,
3434
3438
  // fallback tree will not have suspense context
@@ -6269,7 +6273,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6269
6273
  return vm;
6270
6274
  }
6271
6275
  }
6272
- Vue.version = `2.6.14-compat:${"3.3.9"}`;
6276
+ Vue.version = `2.6.14-compat:${"3.3.10"}`;
6273
6277
  Vue.config = singletonApp.config;
6274
6278
  Vue.use = (p, ...options) => {
6275
6279
  if (p && isFunction(p.install)) {
@@ -10666,9 +10670,9 @@ function initCustomFormatter() {
10666
10670
  return;
10667
10671
  }
10668
10672
  const vueStyle = { style: "color:#3ba776" };
10669
- const numberStyle = { style: "color:#0b1bc9" };
10670
- const stringStyle = { style: "color:#b62e24" };
10671
- const keywordStyle = { style: "color:#9d288c" };
10673
+ const numberStyle = { style: "color:#1677ff" };
10674
+ const stringStyle = { style: "color:#f5222d" };
10675
+ const keywordStyle = { style: "color:#eb2f96" };
10672
10676
  const formatter = {
10673
10677
  header(obj) {
10674
10678
  if (!isObject(obj)) {
@@ -10862,7 +10866,7 @@ function isMemoSame(cached, memo) {
10862
10866
  return true;
10863
10867
  }
10864
10868
 
10865
- const version = "3.3.9";
10869
+ const version = "3.3.10";
10866
10870
  const ssrUtils = null;
10867
10871
  const resolveFilter = resolveFilter$1 ;
10868
10872
  const _compatUtils = {
@@ -11561,7 +11565,8 @@ function patchStopImmediatePropagation(e, value) {
11561
11565
  }
11562
11566
  }
11563
11567
 
11564
- const nativeOnRE = /^on[a-z]/;
11568
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11569
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11565
11570
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11566
11571
  if (key === "class") {
11567
11572
  patchClass(el, nextValue, isSVG);
@@ -11595,7 +11600,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11595
11600
  if (key === "innerHTML" || key === "textContent") {
11596
11601
  return true;
11597
11602
  }
11598
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11603
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11599
11604
  return true;
11600
11605
  }
11601
11606
  return false;
@@ -11612,7 +11617,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
11612
11617
  if (key === "type" && el.tagName === "TEXTAREA") {
11613
11618
  return false;
11614
11619
  }
11615
- if (nativeOnRE.test(key) && isString(value)) {
11620
+ if (key === "width" || key === "height") {
11621
+ const tag = el.tagName;
11622
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
11623
+ }
11624
+ if (isNativeOn(key) && isString(value)) {
11616
11625
  return false;
11617
11626
  }
11618
11627
  return key in el;
@@ -12302,14 +12311,14 @@ const modifierGuards = {
12302
12311
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12303
12312
  };
12304
12313
  const withModifiers = (fn, modifiers) => {
12305
- return (event, ...args) => {
12314
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12306
12315
  for (let i = 0; i < modifiers.length; i++) {
12307
12316
  const guard = modifierGuards[modifiers[i]];
12308
12317
  if (guard && guard(event, modifiers))
12309
12318
  return;
12310
12319
  }
12311
12320
  return fn(event, ...args);
12312
- };
12321
+ });
12313
12322
  };
12314
12323
  const keyNames = {
12315
12324
  esc: "escape",
@@ -12337,7 +12346,7 @@ const withKeys = (fn, modifiers) => {
12337
12346
  );
12338
12347
  }
12339
12348
  }
12340
- return (event) => {
12349
+ return fn._withKeys || (fn._withKeys = (event) => {
12341
12350
  if (!("key" in event)) {
12342
12351
  return;
12343
12352
  }
@@ -12365,7 +12374,7 @@ const withKeys = (fn, modifiers) => {
12365
12374
  }
12366
12375
  }
12367
12376
  }
12368
- };
12377
+ });
12369
12378
  };
12370
12379
 
12371
12380
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -16188,6 +16197,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
16188
16197
  if (isEventHandler && isReservedProp(name)) {
16189
16198
  hasVnodeHook = true;
16190
16199
  }
16200
+ if (isEventHandler && value.type === 14) {
16201
+ value = value.arguments[0];
16202
+ }
16191
16203
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
16192
16204
  return;
16193
16205
  }