@vue/compat 3.4.0-beta.2 → 3.4.0-beta.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.
@@ -176,7 +176,7 @@ function normalizeProps(props) {
176
176
 
177
177
  const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
178
178
  const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
179
- const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
179
+ const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
180
180
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
181
181
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
182
182
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
@@ -1899,8 +1899,10 @@ function checkRecursiveUpdates(seen, fn) {
1899
1899
  if (count > RECURSION_LIMIT) {
1900
1900
  const instance = fn.ownerInstance;
1901
1901
  const componentName = instance && getComponentName(instance.type);
1902
- warn(
1903
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`
1902
+ handleError(
1903
+ `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
1904
+ null,
1905
+ 10
1904
1906
  );
1905
1907
  return true;
1906
1908
  } else {
@@ -3098,6 +3100,8 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3098
3100
  return false;
3099
3101
  }
3100
3102
  function updateHOCHostEl({ vnode, parent }, el) {
3103
+ if (!el)
3104
+ return;
3101
3105
  while (parent) {
3102
3106
  const root = parent.subTree;
3103
3107
  if (root.suspense && root.suspense.activeBranch === vnode) {
@@ -5851,24 +5855,30 @@ function useModel(props, name) {
5851
5855
  warn(`useModel() called with prop "${name}" which is not declared.`);
5852
5856
  return ref();
5853
5857
  }
5854
- let localValue;
5855
- watchSyncEffect(() => {
5856
- localValue = props[name];
5857
- });
5858
- return customRef((track, trigger) => ({
5859
- get() {
5860
- track();
5861
- return localValue;
5862
- },
5863
- set(value) {
5864
- const rawProps = i.vnode.props;
5865
- if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5866
- localValue = value;
5858
+ return customRef((track, trigger) => {
5859
+ let localValue;
5860
+ watchSyncEffect(() => {
5861
+ const propValue = props[name];
5862
+ if (hasChanged(localValue, propValue)) {
5863
+ localValue = propValue;
5867
5864
  trigger();
5868
5865
  }
5869
- i.emit(`update:${name}`, value);
5870
- }
5871
- }));
5866
+ });
5867
+ return {
5868
+ get() {
5869
+ track();
5870
+ return localValue;
5871
+ },
5872
+ set(value) {
5873
+ const rawProps = i.vnode.props;
5874
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5875
+ localValue = value;
5876
+ trigger();
5877
+ }
5878
+ i.emit(`update:${name}`, value);
5879
+ }
5880
+ };
5881
+ });
5872
5882
  }
5873
5883
  function getContext() {
5874
5884
  const i = getCurrentInstance();
@@ -6444,7 +6454,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6444
6454
  return vm;
6445
6455
  }
6446
6456
  }
6447
- Vue.version = `2.6.14-compat:${"3.4.0-beta.2"}`;
6457
+ Vue.version = `2.6.14-compat:${"3.4.0-beta.4"}`;
6448
6458
  Vue.config = singletonApp.config;
6449
6459
  Vue.use = (p, ...options) => {
6450
6460
  if (p && isFunction(p.install)) {
@@ -8185,7 +8195,7 @@ function propHasMismatch(el, key, clientValue) {
8185
8195
  let actual;
8186
8196
  let expected;
8187
8197
  if (key === "class") {
8188
- actual = el.className;
8198
+ actual = el.getAttribute("class");
8189
8199
  expected = normalizeClass(clientValue);
8190
8200
  if (actual !== expected) {
8191
8201
  mismatchType = mismatchKey = `class`;
@@ -11232,7 +11242,7 @@ function isMemoSame(cached, memo) {
11232
11242
  return true;
11233
11243
  }
11234
11244
 
11235
- const version = "3.4.0-beta.2";
11245
+ const version = "3.4.0-beta.4";
11236
11246
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11237
11247
  const _ssrUtils = {
11238
11248
  createComponentInstance,
@@ -11689,6 +11699,69 @@ function initVShowForSSR() {
11689
11699
  };
11690
11700
  }
11691
11701
 
11702
+ const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
11703
+ function useCssVars(getter) {
11704
+ const instance = getCurrentInstance();
11705
+ if (!instance) {
11706
+ !!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`);
11707
+ return;
11708
+ }
11709
+ const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11710
+ Array.from(
11711
+ document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11712
+ ).forEach((node) => setVarsOnNode(node, vars));
11713
+ };
11714
+ const setVars = () => {
11715
+ const vars = getter(instance.proxy);
11716
+ setVarsOnVNode(instance.subTree, vars);
11717
+ updateTeleports(vars);
11718
+ };
11719
+ watchPostEffect(setVars);
11720
+ onMounted(() => {
11721
+ const ob = new MutationObserver(setVars);
11722
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
11723
+ onUnmounted(() => ob.disconnect());
11724
+ });
11725
+ }
11726
+ function setVarsOnVNode(vnode, vars) {
11727
+ if (vnode.shapeFlag & 128) {
11728
+ const suspense = vnode.suspense;
11729
+ vnode = suspense.activeBranch;
11730
+ if (suspense.pendingBranch && !suspense.isHydrating) {
11731
+ suspense.effects.push(() => {
11732
+ setVarsOnVNode(suspense.activeBranch, vars);
11733
+ });
11734
+ }
11735
+ }
11736
+ while (vnode.component) {
11737
+ vnode = vnode.component.subTree;
11738
+ }
11739
+ if (vnode.shapeFlag & 1 && vnode.el) {
11740
+ setVarsOnNode(vnode.el, vars);
11741
+ } else if (vnode.type === Fragment) {
11742
+ vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11743
+ } else if (vnode.type === Static) {
11744
+ let { el, anchor } = vnode;
11745
+ while (el) {
11746
+ setVarsOnNode(el, vars);
11747
+ if (el === anchor)
11748
+ break;
11749
+ el = el.nextSibling;
11750
+ }
11751
+ }
11752
+ }
11753
+ function setVarsOnNode(el, vars) {
11754
+ if (el.nodeType === 1) {
11755
+ const style = el.style;
11756
+ let cssText = "";
11757
+ for (const key in vars) {
11758
+ style.setProperty(`--${key}`, vars[key]);
11759
+ cssText += `--${key}: ${vars[key]};`;
11760
+ }
11761
+ style[CSS_VAR_TEXT] = cssText;
11762
+ }
11763
+ }
11764
+
11692
11765
  function patchStyle(el, prev, next) {
11693
11766
  const style = el.style;
11694
11767
  const isCssString = isString(next);
@@ -11707,6 +11780,10 @@ function patchStyle(el, prev, next) {
11707
11780
  const currentDisplay = style.display;
11708
11781
  if (isCssString) {
11709
11782
  if (prev !== next) {
11783
+ const cssVarText = style[CSS_VAR_TEXT];
11784
+ if (cssVarText) {
11785
+ next += ";" + cssVarText;
11786
+ }
11710
11787
  style.cssText = next;
11711
11788
  }
11712
11789
  } else if (prev) {
@@ -12257,65 +12334,6 @@ function useCssModule(name = "$style") {
12257
12334
  }
12258
12335
  }
12259
12336
 
12260
- function useCssVars(getter) {
12261
- const instance = getCurrentInstance();
12262
- if (!instance) {
12263
- !!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`);
12264
- return;
12265
- }
12266
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
12267
- Array.from(
12268
- document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
12269
- ).forEach((node) => setVarsOnNode(node, vars));
12270
- };
12271
- const setVars = () => {
12272
- const vars = getter(instance.proxy);
12273
- setVarsOnVNode(instance.subTree, vars);
12274
- updateTeleports(vars);
12275
- };
12276
- watchPostEffect(setVars);
12277
- onMounted(() => {
12278
- const ob = new MutationObserver(setVars);
12279
- ob.observe(instance.subTree.el.parentNode, { childList: true });
12280
- onUnmounted(() => ob.disconnect());
12281
- });
12282
- }
12283
- function setVarsOnVNode(vnode, vars) {
12284
- if (vnode.shapeFlag & 128) {
12285
- const suspense = vnode.suspense;
12286
- vnode = suspense.activeBranch;
12287
- if (suspense.pendingBranch && !suspense.isHydrating) {
12288
- suspense.effects.push(() => {
12289
- setVarsOnVNode(suspense.activeBranch, vars);
12290
- });
12291
- }
12292
- }
12293
- while (vnode.component) {
12294
- vnode = vnode.component.subTree;
12295
- }
12296
- if (vnode.shapeFlag & 1 && vnode.el) {
12297
- setVarsOnNode(vnode.el, vars);
12298
- } else if (vnode.type === Fragment) {
12299
- vnode.children.forEach((c) => setVarsOnVNode(c, vars));
12300
- } else if (vnode.type === Static) {
12301
- let { el, anchor } = vnode;
12302
- while (el) {
12303
- setVarsOnNode(el, vars);
12304
- if (el === anchor)
12305
- break;
12306
- el = el.nextSibling;
12307
- }
12308
- }
12309
- }
12310
- function setVarsOnNode(el, vars) {
12311
- if (el.nodeType === 1) {
12312
- const style = el.style;
12313
- for (const key in vars) {
12314
- style.setProperty(`--${key}`, vars[key]);
12315
- }
12316
- }
12317
- }
12318
-
12319
12337
  const positionMap = /* @__PURE__ */ new WeakMap();
12320
12338
  const newPositionMap = /* @__PURE__ */ new WeakMap();
12321
12339
  const moveCbKey = Symbol("_moveCb");
@@ -12732,7 +12750,9 @@ const modifierGuards = {
12732
12750
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12733
12751
  };
12734
12752
  const withModifiers = (fn, modifiers) => {
12735
- return fn._withMods || (fn._withMods = (event, ...args) => {
12753
+ const cache = fn._withMods || (fn._withMods = {});
12754
+ const cacheKey = modifiers.join(".");
12755
+ return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12736
12756
  for (let i = 0; i < modifiers.length; i++) {
12737
12757
  const guard = modifierGuards[modifiers[i]];
12738
12758
  if (guard && guard(event, modifiers))
@@ -12767,7 +12787,9 @@ const withKeys = (fn, modifiers) => {
12767
12787
  );
12768
12788
  }
12769
12789
  }
12770
- return fn._withKeys || (fn._withKeys = (event) => {
12790
+ const cache = fn._withKeys || (fn._withKeys = {});
12791
+ const cacheKey = modifiers.join(".");
12792
+ return cache[cacheKey] || (cache[cacheKey] = (event) => {
12771
12793
  if (!("key" in event)) {
12772
12794
  return;
12773
12795
  }
@@ -179,7 +179,7 @@ var Vue = (function () {
179
179
 
180
180
  const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
181
181
  const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
182
- const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
182
+ const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
183
183
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
184
184
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
185
185
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
@@ -1896,8 +1896,10 @@ var Vue = (function () {
1896
1896
  if (count > RECURSION_LIMIT) {
1897
1897
  const instance = fn.ownerInstance;
1898
1898
  const componentName = instance && getComponentName(instance.type);
1899
- warn(
1900
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`
1899
+ handleError(
1900
+ `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
1901
+ null,
1902
+ 10
1901
1903
  );
1902
1904
  return true;
1903
1905
  } else {
@@ -3092,6 +3094,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3092
3094
  return false;
3093
3095
  }
3094
3096
  function updateHOCHostEl({ vnode, parent }, el) {
3097
+ if (!el)
3098
+ return;
3095
3099
  while (parent) {
3096
3100
  const root = parent.subTree;
3097
3101
  if (root.suspense && root.suspense.activeBranch === vnode) {
@@ -5816,24 +5820,30 @@ If this is a native custom element, make sure to exclude it from component resol
5816
5820
  warn(`useModel() called with prop "${name}" which is not declared.`);
5817
5821
  return ref();
5818
5822
  }
5819
- let localValue;
5820
- watchSyncEffect(() => {
5821
- localValue = props[name];
5822
- });
5823
- return customRef((track, trigger) => ({
5824
- get() {
5825
- track();
5826
- return localValue;
5827
- },
5828
- set(value) {
5829
- const rawProps = i.vnode.props;
5830
- if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5831
- localValue = value;
5823
+ return customRef((track, trigger) => {
5824
+ let localValue;
5825
+ watchSyncEffect(() => {
5826
+ const propValue = props[name];
5827
+ if (hasChanged(localValue, propValue)) {
5828
+ localValue = propValue;
5832
5829
  trigger();
5833
5830
  }
5834
- i.emit(`update:${name}`, value);
5835
- }
5836
- }));
5831
+ });
5832
+ return {
5833
+ get() {
5834
+ track();
5835
+ return localValue;
5836
+ },
5837
+ set(value) {
5838
+ const rawProps = i.vnode.props;
5839
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5840
+ localValue = value;
5841
+ trigger();
5842
+ }
5843
+ i.emit(`update:${name}`, value);
5844
+ }
5845
+ };
5846
+ });
5837
5847
  }
5838
5848
  function getContext() {
5839
5849
  const i = getCurrentInstance();
@@ -6407,7 +6417,7 @@ If this is a native custom element, make sure to exclude it from component resol
6407
6417
  return vm;
6408
6418
  }
6409
6419
  }
6410
- Vue.version = `2.6.14-compat:${"3.4.0-beta.2"}`;
6420
+ Vue.version = `2.6.14-compat:${"3.4.0-beta.4"}`;
6411
6421
  Vue.config = singletonApp.config;
6412
6422
  Vue.use = (p, ...options) => {
6413
6423
  if (p && isFunction(p.install)) {
@@ -8135,7 +8145,7 @@ Server rendered element contains fewer child nodes than client vdom.`
8135
8145
  let actual;
8136
8146
  let expected;
8137
8147
  if (key === "class") {
8138
- actual = el.className;
8148
+ actual = el.getAttribute("class");
8139
8149
  expected = normalizeClass(clientValue);
8140
8150
  if (actual !== expected) {
8141
8151
  mismatchType = mismatchKey = `class`;
@@ -11105,7 +11115,7 @@ Component that was made reactive: `,
11105
11115
  return true;
11106
11116
  }
11107
11117
 
11108
- const version = "3.4.0-beta.2";
11118
+ const version = "3.4.0-beta.4";
11109
11119
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11110
11120
  const ssrUtils = null;
11111
11121
  const resolveFilter = resolveFilter$1 ;
@@ -11547,6 +11557,69 @@ Component that was made reactive: `,
11547
11557
  el.style.display = value ? el[vShowOldKey] : "none";
11548
11558
  }
11549
11559
 
11560
+ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
11561
+ function useCssVars(getter) {
11562
+ const instance = getCurrentInstance();
11563
+ if (!instance) {
11564
+ warn(`useCssVars is called without current active component instance.`);
11565
+ return;
11566
+ }
11567
+ const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11568
+ Array.from(
11569
+ document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11570
+ ).forEach((node) => setVarsOnNode(node, vars));
11571
+ };
11572
+ const setVars = () => {
11573
+ const vars = getter(instance.proxy);
11574
+ setVarsOnVNode(instance.subTree, vars);
11575
+ updateTeleports(vars);
11576
+ };
11577
+ watchPostEffect(setVars);
11578
+ onMounted(() => {
11579
+ const ob = new MutationObserver(setVars);
11580
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
11581
+ onUnmounted(() => ob.disconnect());
11582
+ });
11583
+ }
11584
+ function setVarsOnVNode(vnode, vars) {
11585
+ if (vnode.shapeFlag & 128) {
11586
+ const suspense = vnode.suspense;
11587
+ vnode = suspense.activeBranch;
11588
+ if (suspense.pendingBranch && !suspense.isHydrating) {
11589
+ suspense.effects.push(() => {
11590
+ setVarsOnVNode(suspense.activeBranch, vars);
11591
+ });
11592
+ }
11593
+ }
11594
+ while (vnode.component) {
11595
+ vnode = vnode.component.subTree;
11596
+ }
11597
+ if (vnode.shapeFlag & 1 && vnode.el) {
11598
+ setVarsOnNode(vnode.el, vars);
11599
+ } else if (vnode.type === Fragment) {
11600
+ vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11601
+ } else if (vnode.type === Static) {
11602
+ let { el, anchor } = vnode;
11603
+ while (el) {
11604
+ setVarsOnNode(el, vars);
11605
+ if (el === anchor)
11606
+ break;
11607
+ el = el.nextSibling;
11608
+ }
11609
+ }
11610
+ }
11611
+ function setVarsOnNode(el, vars) {
11612
+ if (el.nodeType === 1) {
11613
+ const style = el.style;
11614
+ let cssText = "";
11615
+ for (const key in vars) {
11616
+ style.setProperty(`--${key}`, vars[key]);
11617
+ cssText += `--${key}: ${vars[key]};`;
11618
+ }
11619
+ style[CSS_VAR_TEXT] = cssText;
11620
+ }
11621
+ }
11622
+
11550
11623
  function patchStyle(el, prev, next) {
11551
11624
  const style = el.style;
11552
11625
  const isCssString = isString(next);
@@ -11565,6 +11638,10 @@ Component that was made reactive: `,
11565
11638
  const currentDisplay = style.display;
11566
11639
  if (isCssString) {
11567
11640
  if (prev !== next) {
11641
+ const cssVarText = style[CSS_VAR_TEXT];
11642
+ if (cssVarText) {
11643
+ next += ";" + cssVarText;
11644
+ }
11568
11645
  style.cssText = next;
11569
11646
  }
11570
11647
  } else if (prev) {
@@ -12103,65 +12180,6 @@ Component that was made reactive: `,
12103
12180
  }
12104
12181
  }
12105
12182
 
12106
- function useCssVars(getter) {
12107
- const instance = getCurrentInstance();
12108
- if (!instance) {
12109
- warn(`useCssVars is called without current active component instance.`);
12110
- return;
12111
- }
12112
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
12113
- Array.from(
12114
- document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
12115
- ).forEach((node) => setVarsOnNode(node, vars));
12116
- };
12117
- const setVars = () => {
12118
- const vars = getter(instance.proxy);
12119
- setVarsOnVNode(instance.subTree, vars);
12120
- updateTeleports(vars);
12121
- };
12122
- watchPostEffect(setVars);
12123
- onMounted(() => {
12124
- const ob = new MutationObserver(setVars);
12125
- ob.observe(instance.subTree.el.parentNode, { childList: true });
12126
- onUnmounted(() => ob.disconnect());
12127
- });
12128
- }
12129
- function setVarsOnVNode(vnode, vars) {
12130
- if (vnode.shapeFlag & 128) {
12131
- const suspense = vnode.suspense;
12132
- vnode = suspense.activeBranch;
12133
- if (suspense.pendingBranch && !suspense.isHydrating) {
12134
- suspense.effects.push(() => {
12135
- setVarsOnVNode(suspense.activeBranch, vars);
12136
- });
12137
- }
12138
- }
12139
- while (vnode.component) {
12140
- vnode = vnode.component.subTree;
12141
- }
12142
- if (vnode.shapeFlag & 1 && vnode.el) {
12143
- setVarsOnNode(vnode.el, vars);
12144
- } else if (vnode.type === Fragment) {
12145
- vnode.children.forEach((c) => setVarsOnVNode(c, vars));
12146
- } else if (vnode.type === Static) {
12147
- let { el, anchor } = vnode;
12148
- while (el) {
12149
- setVarsOnNode(el, vars);
12150
- if (el === anchor)
12151
- break;
12152
- el = el.nextSibling;
12153
- }
12154
- }
12155
- }
12156
- function setVarsOnNode(el, vars) {
12157
- if (el.nodeType === 1) {
12158
- const style = el.style;
12159
- for (const key in vars) {
12160
- style.setProperty(`--${key}`, vars[key]);
12161
- }
12162
- }
12163
- }
12164
-
12165
12183
  const positionMap = /* @__PURE__ */ new WeakMap();
12166
12184
  const newPositionMap = /* @__PURE__ */ new WeakMap();
12167
12185
  const moveCbKey = Symbol("_moveCb");
@@ -12544,7 +12562,9 @@ Component that was made reactive: `,
12544
12562
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12545
12563
  };
12546
12564
  const withModifiers = (fn, modifiers) => {
12547
- return fn._withMods || (fn._withMods = (event, ...args) => {
12565
+ const cache = fn._withMods || (fn._withMods = {});
12566
+ const cacheKey = modifiers.join(".");
12567
+ return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12548
12568
  for (let i = 0; i < modifiers.length; i++) {
12549
12569
  const guard = modifierGuards[modifiers[i]];
12550
12570
  if (guard && guard(event, modifiers))
@@ -12579,7 +12599,9 @@ Component that was made reactive: `,
12579
12599
  );
12580
12600
  }
12581
12601
  }
12582
- return fn._withKeys || (fn._withKeys = (event) => {
12602
+ const cache = fn._withKeys || (fn._withKeys = {});
12603
+ const cacheKey = modifiers.join(".");
12604
+ return cache[cacheKey] || (cache[cacheKey] = (event) => {
12583
12605
  if (!("key" in event)) {
12584
12606
  return;
12585
12607
  }