@vue/runtime-dom 3.3.11 → 3.3.13

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.
@@ -402,6 +402,11 @@ function initVShowForSSR() {
402
402
  };
403
403
  }
404
404
 
405
+ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
406
+ function useCssVars(getter) {
407
+ return;
408
+ }
409
+
405
410
  function patchStyle(el, prev, next) {
406
411
  const style = el.style;
407
412
  const isCssString = shared.isString(next);
@@ -420,6 +425,10 @@ function patchStyle(el, prev, next) {
420
425
  const currentDisplay = style.display;
421
426
  if (isCssString) {
422
427
  if (prev !== next) {
428
+ const cssVarText = style[CSS_VAR_TEXT];
429
+ if (cssVarText) {
430
+ next += ";" + cssVarText;
431
+ }
423
432
  style.cssText = next;
424
433
  }
425
434
  } else if (prev) {
@@ -926,10 +935,6 @@ function useCssModule(name = "$style") {
926
935
  }
927
936
  }
928
937
 
929
- function useCssVars(getter) {
930
- return;
931
- }
932
-
933
938
  const positionMap = /* @__PURE__ */ new WeakMap();
934
939
  const newPositionMap = /* @__PURE__ */ new WeakMap();
935
940
  const moveCbKey = Symbol("_moveCb");
@@ -1337,7 +1342,9 @@ const modifierGuards = {
1337
1342
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1338
1343
  };
1339
1344
  const withModifiers = (fn, modifiers) => {
1340
- return fn._withMods || (fn._withMods = (event, ...args) => {
1345
+ const cache = fn._withMods || (fn._withMods = {});
1346
+ const cacheKey = modifiers.join(".");
1347
+ return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
1341
1348
  for (let i = 0; i < modifiers.length; i++) {
1342
1349
  const guard = modifierGuards[modifiers[i]];
1343
1350
  if (guard && guard(event, modifiers))
@@ -1356,7 +1363,9 @@ const keyNames = {
1356
1363
  delete: "backspace"
1357
1364
  };
1358
1365
  const withKeys = (fn, modifiers) => {
1359
- return fn._withKeys || (fn._withKeys = (event) => {
1366
+ const cache = fn._withKeys || (fn._withKeys = {});
1367
+ const cacheKey = modifiers.join(".");
1368
+ return cache[cacheKey] || (cache[cacheKey] = (event) => {
1360
1369
  if (!("key" in event)) {
1361
1370
  return;
1362
1371
  }
@@ -399,6 +399,11 @@ function initVShowForSSR() {
399
399
  };
400
400
  }
401
401
 
402
+ const CSS_VAR_TEXT = Symbol("");
403
+ function useCssVars(getter) {
404
+ return;
405
+ }
406
+
402
407
  function patchStyle(el, prev, next) {
403
408
  const style = el.style;
404
409
  const isCssString = shared.isString(next);
@@ -417,6 +422,10 @@ function patchStyle(el, prev, next) {
417
422
  const currentDisplay = style.display;
418
423
  if (isCssString) {
419
424
  if (prev !== next) {
425
+ const cssVarText = style[CSS_VAR_TEXT];
426
+ if (cssVarText) {
427
+ next += ";" + cssVarText;
428
+ }
420
429
  style.cssText = next;
421
430
  }
422
431
  } else if (prev) {
@@ -887,10 +896,6 @@ function useCssModule(name = "$style") {
887
896
  }
888
897
  }
889
898
 
890
- function useCssVars(getter) {
891
- return;
892
- }
893
-
894
899
  const positionMap = /* @__PURE__ */ new WeakMap();
895
900
  const newPositionMap = /* @__PURE__ */ new WeakMap();
896
901
  const moveCbKey = Symbol("_moveCb");
@@ -1293,7 +1298,9 @@ const modifierGuards = {
1293
1298
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1294
1299
  };
1295
1300
  const withModifiers = (fn, modifiers) => {
1296
- return fn._withMods || (fn._withMods = (event, ...args) => {
1301
+ const cache = fn._withMods || (fn._withMods = {});
1302
+ const cacheKey = modifiers.join(".");
1303
+ return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
1297
1304
  for (let i = 0; i < modifiers.length; i++) {
1298
1305
  const guard = modifierGuards[modifiers[i]];
1299
1306
  if (guard && guard(event, modifiers))
@@ -1312,7 +1319,9 @@ const keyNames = {
1312
1319
  delete: "backspace"
1313
1320
  };
1314
1321
  const withKeys = (fn, modifiers) => {
1315
- return fn._withKeys || (fn._withKeys = (event) => {
1322
+ const cache = fn._withKeys || (fn._withKeys = {});
1323
+ const cacheKey = modifiers.join(".");
1324
+ return cache[cacheKey] || (cache[cacheKey] = (event) => {
1316
1325
  if (!("key" in event)) {
1317
1326
  return;
1318
1327
  }
@@ -103,13 +103,17 @@ export declare const vModelDynamic: ObjectDirective<HTMLInputElement | HTMLSelec
103
103
  * @private
104
104
  */
105
105
  export declare const withModifiers: <T extends (event: Event, ...args: unknown[]) => any>(fn: T & {
106
- _withMods?: T | undefined;
106
+ _withMods?: {
107
+ [key: string]: T;
108
+ } | undefined;
107
109
  }, modifiers: string[]) => T;
108
110
  /**
109
111
  * @private
110
112
  */
111
113
  export declare const withKeys: <T extends (event: KeyboardEvent) => any>(fn: T & {
112
- _withKeys?: T | undefined;
114
+ _withKeys?: {
115
+ [k: string]: T;
116
+ } | undefined;
113
117
  }, modifiers: string[]) => T;
114
118
 
115
119
  declare const vShowOldKey: unique symbol;
@@ -1012,6 +1016,7 @@ export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
1012
1016
  xlinkTitle?: string;
1013
1017
  xlinkType?: string;
1014
1018
  xmlns?: string;
1019
+ xmlnsXlink?: string;
1015
1020
  y1?: Numberish;
1016
1021
  y2?: Numberish;
1017
1022
  y?: Numberish;
@@ -723,17 +723,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
723
723
  }
724
724
  set(target, key, value, receiver) {
725
725
  let oldValue = target[key];
726
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
727
- return false;
728
- }
729
726
  if (!this._shallow) {
727
+ const isOldValueReadonly = isReadonly(oldValue);
730
728
  if (!isShallow(value) && !isReadonly(value)) {
731
729
  oldValue = toRaw(oldValue);
732
730
  value = toRaw(value);
733
731
  }
734
732
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
735
- oldValue.value = value;
736
- return true;
733
+ if (isOldValueReadonly) {
734
+ return false;
735
+ } else {
736
+ oldValue.value = value;
737
+ return true;
738
+ }
737
739
  }
738
740
  }
739
741
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
@@ -2813,7 +2815,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2813
2815
  timeout: typeof timeout === "number" ? timeout : -1,
2814
2816
  activeBranch: null,
2815
2817
  pendingBranch: null,
2816
- isInFallback: true,
2818
+ isInFallback: !isHydrating,
2817
2819
  isHydrating,
2818
2820
  isUnmounted: false,
2819
2821
  effects: [],
@@ -6123,6 +6125,16 @@ function createHydrationFunctions(rendererInternals) {
6123
6125
  if (dirs) {
6124
6126
  invokeDirectiveHook(vnode, null, parentComponent, "created");
6125
6127
  }
6128
+ let needCallTransitionHooks = false;
6129
+ if (isTemplateNode(el)) {
6130
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
6131
+ const content = el.content.firstChild;
6132
+ if (needCallTransitionHooks) {
6133
+ transition.beforeEnter(content);
6134
+ }
6135
+ replaceNode(content, el, parentComponent);
6136
+ vnode.el = el = content;
6137
+ }
6126
6138
  if (props) {
6127
6139
  if (forcePatch || !optimized || patchFlag & (16 | 32)) {
6128
6140
  for (const key in props) {
@@ -6155,16 +6167,6 @@ function createHydrationFunctions(rendererInternals) {
6155
6167
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
6156
6168
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6157
6169
  }
6158
- let needCallTransitionHooks = false;
6159
- if (isTemplateNode(el)) {
6160
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
6161
- const content = el.content.firstChild;
6162
- if (needCallTransitionHooks) {
6163
- transition.beforeEnter(content);
6164
- }
6165
- replaceNode(content, el, parentComponent);
6166
- vnode.el = el = content;
6167
- }
6168
6170
  if (dirs) {
6169
6171
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6170
6172
  }
@@ -9127,7 +9129,7 @@ function isMemoSame(cached, memo) {
9127
9129
  return true;
9128
9130
  }
9129
9131
 
9130
- const version = "3.3.11";
9132
+ const version = "3.3.13";
9131
9133
  const ssrUtils = null;
9132
9134
  const resolveFilter = null;
9133
9135
  const compatUtils = null;
@@ -9522,6 +9524,69 @@ function setDisplay(el, value) {
9522
9524
  el.style.display = value ? el[vShowOldKey] : "none";
9523
9525
  }
9524
9526
 
9527
+ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
9528
+ function useCssVars(getter) {
9529
+ const instance = getCurrentInstance();
9530
+ if (!instance) {
9531
+ warn(`useCssVars is called without current active component instance.`);
9532
+ return;
9533
+ }
9534
+ const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
9535
+ Array.from(
9536
+ document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
9537
+ ).forEach((node) => setVarsOnNode(node, vars));
9538
+ };
9539
+ const setVars = () => {
9540
+ const vars = getter(instance.proxy);
9541
+ setVarsOnVNode(instance.subTree, vars);
9542
+ updateTeleports(vars);
9543
+ };
9544
+ watchPostEffect(setVars);
9545
+ onMounted(() => {
9546
+ const ob = new MutationObserver(setVars);
9547
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
9548
+ onUnmounted(() => ob.disconnect());
9549
+ });
9550
+ }
9551
+ function setVarsOnVNode(vnode, vars) {
9552
+ if (vnode.shapeFlag & 128) {
9553
+ const suspense = vnode.suspense;
9554
+ vnode = suspense.activeBranch;
9555
+ if (suspense.pendingBranch && !suspense.isHydrating) {
9556
+ suspense.effects.push(() => {
9557
+ setVarsOnVNode(suspense.activeBranch, vars);
9558
+ });
9559
+ }
9560
+ }
9561
+ while (vnode.component) {
9562
+ vnode = vnode.component.subTree;
9563
+ }
9564
+ if (vnode.shapeFlag & 1 && vnode.el) {
9565
+ setVarsOnNode(vnode.el, vars);
9566
+ } else if (vnode.type === Fragment) {
9567
+ vnode.children.forEach((c) => setVarsOnVNode(c, vars));
9568
+ } else if (vnode.type === Static) {
9569
+ let { el, anchor } = vnode;
9570
+ while (el) {
9571
+ setVarsOnNode(el, vars);
9572
+ if (el === anchor)
9573
+ break;
9574
+ el = el.nextSibling;
9575
+ }
9576
+ }
9577
+ }
9578
+ function setVarsOnNode(el, vars) {
9579
+ if (el.nodeType === 1) {
9580
+ const style = el.style;
9581
+ let cssText = "";
9582
+ for (const key in vars) {
9583
+ style.setProperty(`--${key}`, vars[key]);
9584
+ cssText += `--${key}: ${vars[key]};`;
9585
+ }
9586
+ style[CSS_VAR_TEXT] = cssText;
9587
+ }
9588
+ }
9589
+
9525
9590
  function patchStyle(el, prev, next) {
9526
9591
  const style = el.style;
9527
9592
  const isCssString = isString(next);
@@ -9540,6 +9605,10 @@ function patchStyle(el, prev, next) {
9540
9605
  const currentDisplay = style.display;
9541
9606
  if (isCssString) {
9542
9607
  if (prev !== next) {
9608
+ const cssVarText = style[CSS_VAR_TEXT];
9609
+ if (cssVarText) {
9610
+ next += ";" + cssVarText;
9611
+ }
9543
9612
  style.cssText = next;
9544
9613
  }
9545
9614
  } else if (prev) {
@@ -10046,65 +10115,6 @@ function useCssModule(name = "$style") {
10046
10115
  }
10047
10116
  }
10048
10117
 
10049
- function useCssVars(getter) {
10050
- const instance = getCurrentInstance();
10051
- if (!instance) {
10052
- warn(`useCssVars is called without current active component instance.`);
10053
- return;
10054
- }
10055
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
10056
- Array.from(
10057
- document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
10058
- ).forEach((node) => setVarsOnNode(node, vars));
10059
- };
10060
- const setVars = () => {
10061
- const vars = getter(instance.proxy);
10062
- setVarsOnVNode(instance.subTree, vars);
10063
- updateTeleports(vars);
10064
- };
10065
- watchPostEffect(setVars);
10066
- onMounted(() => {
10067
- const ob = new MutationObserver(setVars);
10068
- ob.observe(instance.subTree.el.parentNode, { childList: true });
10069
- onUnmounted(() => ob.disconnect());
10070
- });
10071
- }
10072
- function setVarsOnVNode(vnode, vars) {
10073
- if (vnode.shapeFlag & 128) {
10074
- const suspense = vnode.suspense;
10075
- vnode = suspense.activeBranch;
10076
- if (suspense.pendingBranch && !suspense.isHydrating) {
10077
- suspense.effects.push(() => {
10078
- setVarsOnVNode(suspense.activeBranch, vars);
10079
- });
10080
- }
10081
- }
10082
- while (vnode.component) {
10083
- vnode = vnode.component.subTree;
10084
- }
10085
- if (vnode.shapeFlag & 1 && vnode.el) {
10086
- setVarsOnNode(vnode.el, vars);
10087
- } else if (vnode.type === Fragment) {
10088
- vnode.children.forEach((c) => setVarsOnVNode(c, vars));
10089
- } else if (vnode.type === Static) {
10090
- let { el, anchor } = vnode;
10091
- while (el) {
10092
- setVarsOnNode(el, vars);
10093
- if (el === anchor)
10094
- break;
10095
- el = el.nextSibling;
10096
- }
10097
- }
10098
- }
10099
- function setVarsOnNode(el, vars) {
10100
- if (el.nodeType === 1) {
10101
- const style = el.style;
10102
- for (const key in vars) {
10103
- style.setProperty(`--${key}`, vars[key]);
10104
- }
10105
- }
10106
- }
10107
-
10108
10118
  const positionMap = /* @__PURE__ */ new WeakMap();
10109
10119
  const newPositionMap = /* @__PURE__ */ new WeakMap();
10110
10120
  const moveCbKey = Symbol("_moveCb");
@@ -10478,7 +10488,9 @@ const modifierGuards = {
10478
10488
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
10479
10489
  };
10480
10490
  const withModifiers = (fn, modifiers) => {
10481
- return fn._withMods || (fn._withMods = (event, ...args) => {
10491
+ const cache = fn._withMods || (fn._withMods = {});
10492
+ const cacheKey = modifiers.join(".");
10493
+ return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
10482
10494
  for (let i = 0; i < modifiers.length; i++) {
10483
10495
  const guard = modifierGuards[modifiers[i]];
10484
10496
  if (guard && guard(event, modifiers))
@@ -10497,7 +10509,9 @@ const keyNames = {
10497
10509
  delete: "backspace"
10498
10510
  };
10499
10511
  const withKeys = (fn, modifiers) => {
10500
- return fn._withKeys || (fn._withKeys = (event) => {
10512
+ const cache = fn._withKeys || (fn._withKeys = {});
10513
+ const cacheKey = modifiers.join(".");
10514
+ return cache[cacheKey] || (cache[cacheKey] = (event) => {
10501
10515
  if (!("key" in event)) {
10502
10516
  return;
10503
10517
  }