@vue/runtime-dom 3.4.0-alpha.2 → 3.4.0-alpha.4

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 {
@@ -8,8 +8,8 @@ const EMPTY_ARR = Object.freeze([]) ;
8
8
  const NOOP = () => {
9
9
  };
10
10
  const NO = () => false;
11
- const onRE = /^on[^a-z]/;
12
- const isOn = (key) => onRE.test(key);
11
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
12
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
13
13
  const isModelListener = (key) => key.startsWith("onUpdate:");
14
14
  const extend = Object.assign;
15
15
  const remove = (arr, el) => {
@@ -94,7 +94,7 @@ const getGlobalThis = () => {
94
94
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
95
95
  };
96
96
 
97
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
97
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
98
98
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
99
99
 
100
100
  function normalizeStyle(value) {
@@ -1433,6 +1433,18 @@ function propertyToRef(source, key, defaultValue) {
1433
1433
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1434
1434
  }
1435
1435
 
1436
+ const TrackOpTypes = {
1437
+ "GET": "get",
1438
+ "HAS": "has",
1439
+ "ITERATE": "iterate"
1440
+ };
1441
+ const TriggerOpTypes = {
1442
+ "SET": "set",
1443
+ "ADD": "add",
1444
+ "DELETE": "delete",
1445
+ "CLEAR": "clear"
1446
+ };
1447
+
1436
1448
  const stack = [];
1437
1449
  function pushWarningContext(vnode) {
1438
1450
  stack.push(vnode);
@@ -1547,6 +1559,38 @@ function assertNumber(val, type) {
1547
1559
  }
1548
1560
  }
1549
1561
 
1562
+ const ErrorCodes = {
1563
+ "SETUP_FUNCTION": 0,
1564
+ "0": "SETUP_FUNCTION",
1565
+ "RENDER_FUNCTION": 1,
1566
+ "1": "RENDER_FUNCTION",
1567
+ "WATCH_GETTER": 2,
1568
+ "2": "WATCH_GETTER",
1569
+ "WATCH_CALLBACK": 3,
1570
+ "3": "WATCH_CALLBACK",
1571
+ "WATCH_CLEANUP": 4,
1572
+ "4": "WATCH_CLEANUP",
1573
+ "NATIVE_EVENT_HANDLER": 5,
1574
+ "5": "NATIVE_EVENT_HANDLER",
1575
+ "COMPONENT_EVENT_HANDLER": 6,
1576
+ "6": "COMPONENT_EVENT_HANDLER",
1577
+ "VNODE_HOOK": 7,
1578
+ "7": "VNODE_HOOK",
1579
+ "DIRECTIVE_HOOK": 8,
1580
+ "8": "DIRECTIVE_HOOK",
1581
+ "TRANSITION_HOOK": 9,
1582
+ "9": "TRANSITION_HOOK",
1583
+ "APP_ERROR_HANDLER": 10,
1584
+ "10": "APP_ERROR_HANDLER",
1585
+ "APP_WARN_HANDLER": 11,
1586
+ "11": "APP_WARN_HANDLER",
1587
+ "FUNCTION_REF": 12,
1588
+ "12": "FUNCTION_REF",
1589
+ "ASYNC_COMPONENT_LOADER": 13,
1590
+ "13": "ASYNC_COMPONENT_LOADER",
1591
+ "SCHEDULER": 14,
1592
+ "14": "SCHEDULER"
1593
+ };
1550
1594
  const ErrorTypeStrings$1 = {
1551
1595
  ["sp"]: "serverPrefetch hook",
1552
1596
  ["bc"]: "beforeCreate hook",
@@ -2866,7 +2910,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2866
2910
  if (delayEnter) {
2867
2911
  activeBranch.transition.afterLeave = () => {
2868
2912
  if (pendingId === suspense.pendingId) {
2869
- move(pendingBranch, container2, anchor2, 0);
2913
+ move(
2914
+ pendingBranch,
2915
+ container2,
2916
+ next(activeBranch),
2917
+ 0
2918
+ );
2870
2919
  queuePostFlushCb(effects);
2871
2920
  }
2872
2921
  };
@@ -2913,7 +2962,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2913
2962
  }
2914
2963
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
2915
2964
  triggerEvent(vnode2, "onFallback");
2916
- const anchor2 = next(activeBranch);
2917
2965
  const mountFallback = () => {
2918
2966
  if (!suspense.isInFallback) {
2919
2967
  return;
@@ -2922,7 +2970,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2922
2970
  null,
2923
2971
  fallbackVNode,
2924
2972
  container2,
2925
- anchor2,
2973
+ next(activeBranch),
2926
2974
  parentComponent2,
2927
2975
  null,
2928
2976
  // fallback tree will not have suspense context
@@ -5150,18 +5198,6 @@ function createAppAPI(render, hydrate) {
5150
5198
  rootProps = null;
5151
5199
  }
5152
5200
  const context = createAppContext();
5153
- {
5154
- Object.defineProperty(context.config, "unwrapInjectedRef", {
5155
- get() {
5156
- return true;
5157
- },
5158
- set() {
5159
- warn(
5160
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
5161
- );
5162
- }
5163
- });
5164
- }
5165
5201
  const installedPlugins = /* @__PURE__ */ new WeakSet();
5166
5202
  let isMounted = false;
5167
5203
  const app = context.app = {
@@ -8968,9 +9004,9 @@ function initCustomFormatter() {
8968
9004
  return;
8969
9005
  }
8970
9006
  const vueStyle = { style: "color:#3ba776" };
8971
- const numberStyle = { style: "color:#0b1bc9" };
8972
- const stringStyle = { style: "color:#b62e24" };
8973
- const keywordStyle = { style: "color:#9d288c" };
9007
+ const numberStyle = { style: "color:#1677ff" };
9008
+ const stringStyle = { style: "color:#f5222d" };
9009
+ const keywordStyle = { style: "color:#eb2f96" };
8974
9010
  const formatter = {
8975
9011
  header(obj) {
8976
9012
  if (!isObject(obj)) {
@@ -9164,11 +9200,12 @@ function isMemoSame(cached, memo) {
9164
9200
  return true;
9165
9201
  }
9166
9202
 
9167
- const version = "3.4.0-alpha.2";
9203
+ const version = "3.4.0-alpha.4";
9168
9204
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9169
9205
  const ssrUtils = null;
9170
9206
  const resolveFilter = null;
9171
9207
  const compatUtils = null;
9208
+ const DeprecationTypes = null;
9172
9209
 
9173
9210
  const svgNS = "http://www.w3.org/2000/svg";
9174
9211
  const doc = typeof document !== "undefined" ? document : null;
@@ -9777,7 +9814,8 @@ function patchStopImmediatePropagation(e, value) {
9777
9814
  }
9778
9815
  }
9779
9816
 
9780
- const nativeOnRE = /^on[a-z]/;
9817
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
9818
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
9781
9819
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9782
9820
  if (key === "class") {
9783
9821
  patchClass(el, nextValue, isSVG);
@@ -9811,7 +9849,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
9811
9849
  if (key === "innerHTML" || key === "textContent") {
9812
9850
  return true;
9813
9851
  }
9814
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
9852
+ if (key in el && isNativeOn(key) && isFunction(value)) {
9815
9853
  return true;
9816
9854
  }
9817
9855
  return false;
@@ -9828,7 +9866,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
9828
9866
  if (key === "type" && el.tagName === "TEXTAREA") {
9829
9867
  return false;
9830
9868
  }
9831
- if (nativeOnRE.test(key) && isString(value)) {
9869
+ if (key === "width" || key === "height") {
9870
+ const tag = el.tagName;
9871
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
9872
+ }
9873
+ if (isNativeOn(key) && isString(value)) {
9832
9874
  return false;
9833
9875
  }
9834
9876
  return key in el;
@@ -10509,14 +10551,14 @@ const modifierGuards = {
10509
10551
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
10510
10552
  };
10511
10553
  const withModifiers = (fn, modifiers) => {
10512
- return (event, ...args) => {
10554
+ return fn._withMods || (fn._withMods = (event, ...args) => {
10513
10555
  for (let i = 0; i < modifiers.length; i++) {
10514
10556
  const guard = modifierGuards[modifiers[i]];
10515
10557
  if (guard && guard(event, modifiers))
10516
10558
  return;
10517
10559
  }
10518
10560
  return fn(event, ...args);
10519
- };
10561
+ });
10520
10562
  };
10521
10563
  const keyNames = {
10522
10564
  esc: "escape",
@@ -10528,7 +10570,7 @@ const keyNames = {
10528
10570
  delete: "backspace"
10529
10571
  };
10530
10572
  const withKeys = (fn, modifiers) => {
10531
- return (event) => {
10573
+ return fn._withKeys || (fn._withKeys = (event) => {
10532
10574
  if (!("key" in event)) {
10533
10575
  return;
10534
10576
  }
@@ -10536,7 +10578,7 @@ const withKeys = (fn, modifiers) => {
10536
10578
  if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
10537
10579
  return fn(event);
10538
10580
  }
10539
- };
10581
+ });
10540
10582
  };
10541
10583
 
10542
10584
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -10650,4 +10692,4 @@ function normalizeContainer(container) {
10650
10692
  }
10651
10693
  const initDirectivesForSSR = NOOP;
10652
10694
 
10653
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
10695
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };