@vue/shared 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/shared v3.5.17
2
+ * @vue/shared v3.5.18
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -520,6 +520,24 @@ const stringifySymbol = (v, i = "") => {
520
520
  );
521
521
  };
522
522
 
523
+ function normalizeCssVarValue(value) {
524
+ if (value == null) {
525
+ return "initial";
526
+ }
527
+ if (typeof value === "string") {
528
+ return value === "" ? " " : value;
529
+ }
530
+ if (typeof value !== "number" || !Number.isFinite(value)) {
531
+ {
532
+ console.warn(
533
+ "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",
534
+ value
535
+ );
536
+ }
537
+ }
538
+ return String(value);
539
+ }
540
+
523
541
  exports.EMPTY_ARR = EMPTY_ARR;
524
542
  exports.EMPTY_OBJ = EMPTY_OBJ;
525
543
  exports.NO = NO;
@@ -579,6 +597,7 @@ exports.looseIndexOf = looseIndexOf;
579
597
  exports.looseToNumber = looseToNumber;
580
598
  exports.makeMap = makeMap;
581
599
  exports.normalizeClass = normalizeClass;
600
+ exports.normalizeCssVarValue = normalizeCssVarValue;
582
601
  exports.normalizeProps = normalizeProps;
583
602
  exports.normalizeStyle = normalizeStyle;
584
603
  exports.objectToString = objectToString;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.5.17
2
+ * @vue/shared v3.5.18
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -520,6 +520,16 @@ const stringifySymbol = (v, i = "") => {
520
520
  );
521
521
  };
522
522
 
523
+ function normalizeCssVarValue(value) {
524
+ if (value == null) {
525
+ return "initial";
526
+ }
527
+ if (typeof value === "string") {
528
+ return value === "" ? " " : value;
529
+ }
530
+ return String(value);
531
+ }
532
+
523
533
  exports.EMPTY_ARR = EMPTY_ARR;
524
534
  exports.EMPTY_OBJ = EMPTY_OBJ;
525
535
  exports.NO = NO;
@@ -579,6 +589,7 @@ exports.looseIndexOf = looseIndexOf;
579
589
  exports.looseToNumber = looseToNumber;
580
590
  exports.makeMap = makeMap;
581
591
  exports.normalizeClass = normalizeClass;
592
+ exports.normalizeCssVarValue = normalizeCssVarValue;
582
593
  exports.normalizeProps = normalizeProps;
583
594
  exports.normalizeStyle = normalizeStyle;
584
595
  exports.objectToString = objectToString;
package/dist/shared.d.ts CHANGED
@@ -326,4 +326,10 @@ type OverloadProps<TOverload> = Pick<TOverload, keyof TOverload>;
326
326
  type OverloadUnionRecursive<TOverload, TPartialOverload = unknown> = TOverload extends (...args: infer TArgs) => infer TReturn ? TPartialOverload extends TOverload ? never : OverloadUnionRecursive<TPartialOverload & TOverload, TPartialOverload & ((...args: TArgs) => TReturn) & OverloadProps<TOverload>> | ((...args: TArgs) => TReturn) : never;
327
327
  type OverloadUnion<TOverload extends (...args: any[]) => any> = Exclude<OverloadUnionRecursive<(() => never) & TOverload>, TOverload extends () => never ? never : () => never>;
328
328
 
329
+ /**
330
+ * Normalize CSS var value created by `v-bind` in `<style>` block
331
+ * See https://github.com/vuejs/core/pull/12461#issuecomment-2495804664
332
+ */
333
+ export declare function normalizeCssVarValue(value: unknown): string;
334
+
329
335
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.5.17
2
+ * @vue/shared v3.5.18
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -516,4 +516,22 @@ const stringifySymbol = (v, i = "") => {
516
516
  );
517
517
  };
518
518
 
519
- export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
519
+ function normalizeCssVarValue(value) {
520
+ if (value == null) {
521
+ return "initial";
522
+ }
523
+ if (typeof value === "string") {
524
+ return value === "" ? " " : value;
525
+ }
526
+ if (typeof value !== "number" || !Number.isFinite(value)) {
527
+ if (!!(process.env.NODE_ENV !== "production")) {
528
+ console.warn(
529
+ "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",
530
+ value
531
+ );
532
+ }
533
+ }
534
+ return String(value);
535
+ }
536
+
537
+ export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeCssVarValue, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/shared",
3
- "version": "3.5.17",
3
+ "version": "3.5.18",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",