@vue/runtime-dom 3.5.17 → 3.5.18

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.17
2
+ * @vue/runtime-dom v3.5.18
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.17
2
+ * @vue/runtime-dom v3.5.18
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -181,7 +181,7 @@ export declare function useCssModule(name?: string): Record<string, string>;
181
181
  * Runtime helper for SFC's CSS variable injection feature.
182
182
  * @private
183
183
  */
184
- export declare function useCssVars(getter: (ctx: any) => Record<string, string>): void;
184
+ export declare function useCssVars(getter: (ctx: any) => Record<string, unknown>): void;
185
185
 
186
186
  export interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesHyphen<string | number> {
187
187
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.17
2
+ * @vue/runtime-dom v3.5.18
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -311,6 +311,24 @@ const stringifySymbol = (v, i = "") => {
311
311
  );
312
312
  };
313
313
 
314
+ function normalizeCssVarValue(value) {
315
+ if (value == null) {
316
+ return "initial";
317
+ }
318
+ if (typeof value === "string") {
319
+ return value === "" ? " " : value;
320
+ }
321
+ if (typeof value !== "number" || !Number.isFinite(value)) {
322
+ {
323
+ console.warn(
324
+ "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",
325
+ value
326
+ );
327
+ }
328
+ }
329
+ return String(value);
330
+ }
331
+
314
332
  function warn$2(msg, ...args) {
315
333
  console.warn(`[Vue warn] ${msg}`, ...args);
316
334
  }
@@ -4378,10 +4396,8 @@ function resolveCssVars(instance, vnode, expectedMap) {
4378
4396
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4379
4397
  const cssVars = instance.getCssVars();
4380
4398
  for (const key in cssVars) {
4381
- expectedMap.set(
4382
- `--${getEscapedCssVarName(key)}`,
4383
- String(cssVars[key])
4384
- );
4399
+ const value = normalizeCssVarValue(cssVars[key]);
4400
+ expectedMap.set(`--${getEscapedCssVarName(key)}`, value);
4385
4401
  }
4386
4402
  }
4387
4403
  if (vnode === root && instance.parent) {
@@ -4570,16 +4586,19 @@ function defineAsyncComponent(source) {
4570
4586
  __asyncLoader: load,
4571
4587
  __asyncHydrate(el, instance, hydrate) {
4572
4588
  let patched = false;
4573
- const doHydrate = hydrateStrategy ? () => {
4574
- const performHydrate = () => {
4575
- if (patched) {
4589
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
4590
+ const performHydrate = () => {
4591
+ if (patched) {
4592
+ {
4576
4593
  warn$1(
4577
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
4594
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
4578
4595
  );
4579
- return;
4580
4596
  }
4581
- hydrate();
4582
- };
4597
+ return;
4598
+ }
4599
+ hydrate();
4600
+ };
4601
+ const doHydrate = hydrateStrategy ? () => {
4583
4602
  const teardown = hydrateStrategy(
4584
4603
  performHydrate,
4585
4604
  (cb) => forEachElement(el, cb)
@@ -4587,8 +4606,7 @@ function defineAsyncComponent(source) {
4587
4606
  if (teardown) {
4588
4607
  (instance.bum || (instance.bum = [])).push(teardown);
4589
4608
  }
4590
- (instance.u || (instance.u = [])).push(() => patched = true);
4591
- } : hydrate;
4609
+ } : performHydrate;
4592
4610
  if (resolvedComp) {
4593
4611
  doHydrate();
4594
4612
  } else {
@@ -5467,15 +5485,15 @@ function withDefaults(props, defaults) {
5467
5485
  return null;
5468
5486
  }
5469
5487
  function useSlots() {
5470
- return getContext().slots;
5488
+ return getContext("useSlots").slots;
5471
5489
  }
5472
5490
  function useAttrs() {
5473
- return getContext().attrs;
5491
+ return getContext("useAttrs").attrs;
5474
5492
  }
5475
- function getContext() {
5493
+ function getContext(calledFunctionName) {
5476
5494
  const i = getCurrentInstance();
5477
5495
  if (!i) {
5478
- warn$1(`useContext() called without active instance.`);
5496
+ warn$1(`${calledFunctionName}() called without active instance.`);
5479
5497
  }
5480
5498
  return i.setupContext || (i.setupContext = createSetupContext(i));
5481
5499
  }
@@ -5726,7 +5744,8 @@ function applyOptions(instance) {
5726
5744
  expose.forEach((key) => {
5727
5745
  Object.defineProperty(exposed, key, {
5728
5746
  get: () => publicThis[key],
5729
- set: (val) => publicThis[key] = val
5747
+ set: (val) => publicThis[key] = val,
5748
+ enumerable: true
5730
5749
  });
5731
5750
  });
5732
5751
  } else if (!instance.exposed) {
@@ -6176,7 +6195,7 @@ function provide(key, value) {
6176
6195
  }
6177
6196
  }
6178
6197
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
6179
- const instance = currentInstance || currentRenderingInstance;
6198
+ const instance = getCurrentInstance();
6180
6199
  if (instance || currentApp) {
6181
6200
  let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
6182
6201
  if (provides && key in provides) {
@@ -6191,7 +6210,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
6191
6210
  }
6192
6211
  }
6193
6212
  function hasInjectionContext() {
6194
- return !!(currentInstance || currentRenderingInstance || currentApp);
6213
+ return !!(getCurrentInstance() || currentApp);
6195
6214
  }
6196
6215
 
6197
6216
  const internalObjectProto = {};
@@ -6605,7 +6624,7 @@ function isBoolean(...args) {
6605
6624
  return args.some((elem) => elem.toLowerCase() === "boolean");
6606
6625
  }
6607
6626
 
6608
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
6627
+ const isInternalKey = (key) => key === "_" || key === "__" || key === "_ctx" || key === "$stable";
6609
6628
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6610
6629
  const normalizeSlot = (key, rawSlot, ctx) => {
6611
6630
  if (rawSlot._n) {
@@ -7347,6 +7366,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7347
7366
  if (!initialVNode.el) {
7348
7367
  const placeholder = instance.subTree = createVNode(Comment);
7349
7368
  processCommentNode(null, placeholder, container, anchor);
7369
+ initialVNode.placeholder = placeholder.el;
7350
7370
  }
7351
7371
  } else {
7352
7372
  setupRenderEffect(
@@ -7848,7 +7868,11 @@ function baseCreateRenderer(options, createHydrationFns) {
7848
7868
  for (i = toBePatched - 1; i >= 0; i--) {
7849
7869
  const nextIndex = s2 + i;
7850
7870
  const nextChild = c2[nextIndex];
7851
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
7871
+ const anchorVNode = c2[nextIndex + 1];
7872
+ const anchor = nextIndex + 1 < l2 ? (
7873
+ // #13559, fallback to el placeholder for unresolved async component
7874
+ anchorVNode.el || anchorVNode.placeholder
7875
+ ) : parentAnchor;
7852
7876
  if (newIndexToOldIndexMap[i] === 0) {
7853
7877
  patch(
7854
7878
  null,
@@ -9741,6 +9765,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
9741
9765
  suspense: vnode.suspense,
9742
9766
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
9743
9767
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
9768
+ placeholder: vnode.placeholder,
9744
9769
  el: vnode.el,
9745
9770
  anchor: vnode.anchor,
9746
9771
  ctx: vnode.ctx,
@@ -10532,7 +10557,7 @@ function isMemoSame(cached, memo) {
10532
10557
  return true;
10533
10558
  }
10534
10559
 
10535
- const version = "3.5.17";
10560
+ const version = "3.5.18";
10536
10561
  const warn = warn$1 ;
10537
10562
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10538
10563
  const devtools = devtools$1 ;
@@ -11045,8 +11070,9 @@ function setVarsOnNode(el, vars) {
11045
11070
  const style = el.style;
11046
11071
  let cssText = "";
11047
11072
  for (const key in vars) {
11048
- style.setProperty(`--${key}`, vars[key]);
11049
- cssText += `--${key}: ${vars[key]};`;
11073
+ const value = normalizeCssVarValue(vars[key]);
11074
+ style.setProperty(`--${key}`, value);
11075
+ cssText += `--${key}: ${value};`;
11050
11076
  }
11051
11077
  style[CSS_VAR_TEXT] = cssText;
11052
11078
  }