@vue/shared 3.6.0-alpha.3 → 3.6.0-alpha.5

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.6.0-alpha.3
2
+ * @vue/shared v3.6.0-alpha.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -86,6 +86,9 @@ const toHandlerKey = cacheStringFunction(
86
86
  return s;
87
87
  }
88
88
  );
89
+ const getModifierPropName = (name) => {
90
+ return `${name === "modelValue" || name === "model-value" ? "model" : name}Modifiers${name === "model" ? "$" : ""}`;
91
+ };
89
92
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
90
93
  const invokeArrayFns = (fns, ...arg) => {
91
94
  for (let i = 0; i < fns.length; i++) {
@@ -407,6 +410,15 @@ function shouldSetAsAttr(tagName, key) {
407
410
  return false;
408
411
  }
409
412
 
413
+ const Namespaces = {
414
+ "HTML": 0,
415
+ "0": "HTML",
416
+ "SVG": 1,
417
+ "1": "SVG",
418
+ "MATH_ML": 2,
419
+ "2": "MATH_ML"
420
+ };
421
+
410
422
  const escapeRE = /["'&<>]/;
411
423
  function escapeHtml(string) {
412
424
  const str = "" + string;
@@ -623,6 +635,7 @@ exports.EMPTY_ARR = EMPTY_ARR;
623
635
  exports.EMPTY_OBJ = EMPTY_OBJ;
624
636
  exports.NO = NO;
625
637
  exports.NOOP = NOOP;
638
+ exports.Namespaces = Namespaces;
626
639
  exports.PatchFlagNames = PatchFlagNames;
627
640
  exports.PatchFlags = PatchFlags;
628
641
  exports.ShapeFlags = ShapeFlags;
@@ -641,6 +654,7 @@ exports.genPropsAccessExp = genPropsAccessExp;
641
654
  exports.generateCodeFrame = generateCodeFrame;
642
655
  exports.getEscapedCssVarName = getEscapedCssVarName;
643
656
  exports.getGlobalThis = getGlobalThis;
657
+ exports.getModifierPropName = getModifierPropName;
644
658
  exports.getSequence = getSequence;
645
659
  exports.hasChanged = hasChanged;
646
660
  exports.hasOwn = hasOwn;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.6.0-alpha.3
2
+ * @vue/shared v3.6.0-alpha.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -86,6 +86,9 @@ const toHandlerKey = cacheStringFunction(
86
86
  return s;
87
87
  }
88
88
  );
89
+ const getModifierPropName = (name) => {
90
+ return `${name === "modelValue" || name === "model-value" ? "model" : name}Modifiers${name === "model" ? "$" : ""}`;
91
+ };
89
92
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
90
93
  const invokeArrayFns = (fns, ...arg) => {
91
94
  for (let i = 0; i < fns.length; i++) {
@@ -407,6 +410,15 @@ function shouldSetAsAttr(tagName, key) {
407
410
  return false;
408
411
  }
409
412
 
413
+ const Namespaces = {
414
+ "HTML": 0,
415
+ "0": "HTML",
416
+ "SVG": 1,
417
+ "1": "SVG",
418
+ "MATH_ML": 2,
419
+ "2": "MATH_ML"
420
+ };
421
+
410
422
  const escapeRE = /["'&<>]/;
411
423
  function escapeHtml(string) {
412
424
  const str = "" + string;
@@ -615,6 +627,7 @@ exports.EMPTY_ARR = EMPTY_ARR;
615
627
  exports.EMPTY_OBJ = EMPTY_OBJ;
616
628
  exports.NO = NO;
617
629
  exports.NOOP = NOOP;
630
+ exports.Namespaces = Namespaces;
618
631
  exports.PatchFlagNames = PatchFlagNames;
619
632
  exports.PatchFlags = PatchFlags;
620
633
  exports.ShapeFlags = ShapeFlags;
@@ -633,6 +646,7 @@ exports.genPropsAccessExp = genPropsAccessExp;
633
646
  exports.generateCodeFrame = generateCodeFrame;
634
647
  exports.getEscapedCssVarName = getEscapedCssVarName;
635
648
  exports.getGlobalThis = getGlobalThis;
649
+ exports.getModifierPropName = getModifierPropName;
636
650
  exports.getSequence = getSequence;
637
651
  exports.hasChanged = hasChanged;
638
652
  exports.hasOwn = hasOwn;
package/dist/shared.d.ts CHANGED
@@ -60,6 +60,13 @@ export declare const capitalize: <T extends string>(str: T) => Capitalize<T>;
60
60
  * @private
61
61
  */
62
62
  export declare const toHandlerKey: <T extends string>(str: T) => T extends '' ? '' : `on${Capitalize<T>}`;
63
+ /**
64
+ * #13070 When v-model and v-model:model directives are used together,
65
+ * they will generate the same modelModifiers prop,
66
+ * so a `$` suffix is added to avoid conflicts.
67
+ * @private
68
+ */
69
+ export declare const getModifierPropName: (name: string) => string;
63
70
  export declare const hasChanged: (value: any, oldValue: any) => boolean;
64
71
  export declare const invokeArrayFns: (fns: Function[], ...arg: any[]) => void;
65
72
  export declare const def: (obj: object, key: string | symbol, value: any, writable?: boolean) => void;
@@ -301,6 +308,13 @@ export declare const isKnownMathMLAttr: (key: string) => boolean;
301
308
  export declare function isRenderableAttrValue(value: unknown): boolean;
302
309
  export declare function shouldSetAsAttr(tagName: string, key: string): boolean;
303
310
 
311
+ export type Namespace = number;
312
+ export declare enum Namespaces {
313
+ HTML = 0,
314
+ SVG = 1,
315
+ MATH_ML = 2
316
+ }
317
+
304
318
  export declare function escapeHtml(string: unknown): string;
305
319
  export declare function escapeHtmlComment(src: string): string;
306
320
  export declare const cssVarNameEscapeSymbolsRE: RegExp;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.6.0-alpha.3
2
+ * @vue/shared v3.6.0-alpha.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -82,6 +82,9 @@ const toHandlerKey = cacheStringFunction(
82
82
  return s;
83
83
  }
84
84
  );
85
+ const getModifierPropName = (name) => {
86
+ return `${name === "modelValue" || name === "model-value" ? "model" : name}Modifiers${name === "model" ? "$" : ""}`;
87
+ };
85
88
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
86
89
  const invokeArrayFns = (fns, ...arg) => {
87
90
  for (let i = 0; i < fns.length; i++) {
@@ -403,6 +406,15 @@ function shouldSetAsAttr(tagName, key) {
403
406
  return false;
404
407
  }
405
408
 
409
+ const Namespaces = {
410
+ "HTML": 0,
411
+ "0": "HTML",
412
+ "SVG": 1,
413
+ "1": "SVG",
414
+ "MATH_ML": 2,
415
+ "2": "MATH_ML"
416
+ };
417
+
406
418
  const escapeRE = /["'&<>]/;
407
419
  function escapeHtml(string) {
408
420
  const str = "" + string;
@@ -615,4 +627,4 @@ function normalizeCssVarValue(value) {
615
627
  return String(value);
616
628
  }
617
629
 
618
- export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, YES, camelize, canSetValueDirectly, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, getSequence, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isBuiltInTag, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isNativeOn, 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, shouldSetAsAttr, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
630
+ export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, Namespaces, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, YES, camelize, canSetValueDirectly, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, getModifierPropName, getSequence, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isBuiltInTag, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isNativeOn, 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, shouldSetAsAttr, 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.6.0-alpha.3",
3
+ "version": "3.6.0-alpha.5",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",