@vue/shared 3.6.0-rc.14 → 3.6.0-rc.15
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.
- package/dist/shared.cjs.js +31 -27
- package/dist/shared.cjs.prod.js +31 -27
- package/dist/shared.d.ts +7 -0
- package/dist/shared.esm-bundler.js +30 -28
- package/package.json +1 -1
package/dist/shared.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/shared v3.6.0-rc.
|
|
2
|
+
* @vue/shared v3.6.0-rc.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -66,10 +66,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
|
|
|
66
66
|
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
67
67
|
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
68
68
|
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
69
|
+
const STRING_CACHE_MAX_SIZE = 1e4;
|
|
69
70
|
const cacheStringFunction = (fn) => {
|
|
70
|
-
|
|
71
|
+
let cache = Object.create(null);
|
|
72
|
+
let size = 0;
|
|
71
73
|
return ((str) => {
|
|
72
|
-
|
|
74
|
+
const hit = cache[str];
|
|
75
|
+
if (hit !== void 0) return hit;
|
|
76
|
+
if (++size > STRING_CACHE_MAX_SIZE) {
|
|
77
|
+
cache = Object.create(null);
|
|
78
|
+
size = 1;
|
|
79
|
+
}
|
|
80
|
+
return cache[str] = fn(str);
|
|
73
81
|
});
|
|
74
82
|
};
|
|
75
83
|
const camelizeRE = /-(\w)/g;
|
|
@@ -77,22 +85,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
|
77
85
|
/**
|
|
78
86
|
* @private
|
|
79
87
|
*/
|
|
80
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
88
|
+
const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
81
89
|
const hyphenateRE = /\B([A-Z])/g;
|
|
82
90
|
/**
|
|
83
91
|
* @private
|
|
84
92
|
*/
|
|
85
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
93
|
+
const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
86
94
|
/**
|
|
87
95
|
* @private
|
|
88
96
|
*/
|
|
89
|
-
const capitalize = cacheStringFunction((str) => {
|
|
97
|
+
const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
90
98
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
91
99
|
});
|
|
92
100
|
/**
|
|
93
101
|
* @private
|
|
94
102
|
*/
|
|
95
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
103
|
+
const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
96
104
|
return str ? `on${capitalize(str)}` : ``;
|
|
97
105
|
});
|
|
98
106
|
/**
|
|
@@ -398,26 +406,11 @@ const isFormattingTag = /*@__PURE__*/ makeMap(FORMATTING_TAGS);
|
|
|
398
406
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
399
407
|
*/
|
|
400
408
|
const isAlwaysCloseTag = /*@__PURE__*/ makeMap(ALWAYS_CLOSE_TAGS);
|
|
401
|
-
|
|
402
|
-
//#region packages/shared/src/domAttrConfig.ts
|
|
403
|
-
/**
|
|
404
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
405
|
-
* have different names from their corresponding dom properties:
|
|
406
|
-
* - itemscope -> N/A
|
|
407
|
-
* - allowfullscreen -> allowFullscreen
|
|
408
|
-
* - formnovalidate -> formNoValidate
|
|
409
|
-
* - ismap -> isMap
|
|
410
|
-
* - nomodule -> noModule
|
|
411
|
-
* - novalidate -> noValidate
|
|
412
|
-
* - playsinline -> playsInline
|
|
413
|
-
* - readonly -> readOnly
|
|
414
|
-
*/
|
|
415
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
416
|
-
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
409
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
|
|
417
410
|
/**
|
|
418
411
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
419
412
|
*/
|
|
420
|
-
const isBooleanAttr = /*@__PURE__*/ makeMap(
|
|
413
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
421
414
|
/**
|
|
422
415
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
423
416
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -426,12 +419,10 @@ function includeBooleanAttr(value) {
|
|
|
426
419
|
return !!value || value === "";
|
|
427
420
|
}
|
|
428
421
|
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
|
|
429
|
-
const attrValidationCache = {};
|
|
430
422
|
function isSSRSafeAttrName(name) {
|
|
431
|
-
if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
|
|
432
423
|
const isUnsafe = unsafeAttrCharRE.test(name);
|
|
433
424
|
if (isUnsafe) console.error(`unsafe attribute name: ${name}`);
|
|
434
|
-
return
|
|
425
|
+
return !isUnsafe;
|
|
435
426
|
}
|
|
436
427
|
const propsToAttrMap = {
|
|
437
428
|
acceptCharset: "accept-charset",
|
|
@@ -783,6 +774,17 @@ function isVaporBranchStart(data) {
|
|
|
783
774
|
}
|
|
784
775
|
return true;
|
|
785
776
|
}
|
|
777
|
+
/**
|
|
778
|
+
* The data of a comment opening a range only a vapor server render emits:
|
|
779
|
+
* `<!--{-->` around the render of a component, or a v-if branch's.
|
|
780
|
+
*/
|
|
781
|
+
function isVaporRangeStart(data) {
|
|
782
|
+
return data === "{" || isVaporBranchStart(data);
|
|
783
|
+
}
|
|
784
|
+
/** The data of the comment closing the range `open` opens. */
|
|
785
|
+
function rangeCloseOf(open) {
|
|
786
|
+
return open === "(" ? ")" : open === "{" ? "}" : "]";
|
|
787
|
+
}
|
|
786
788
|
function slotNotifiesBoundary(flags) {
|
|
787
789
|
return isForwardedSlot(flags) && !(flags & 2);
|
|
788
790
|
}
|
|
@@ -889,6 +891,7 @@ exports.isSpecialBooleanAttr = isSpecialBooleanAttr;
|
|
|
889
891
|
exports.isString = isString;
|
|
890
892
|
exports.isSymbol = isSymbol;
|
|
891
893
|
exports.isVaporBranchStart = isVaporBranchStart;
|
|
894
|
+
exports.isVaporRangeStart = isVaporRangeStart;
|
|
892
895
|
exports.isVoidTag = isVoidTag;
|
|
893
896
|
exports.looseEqual = looseEqual;
|
|
894
897
|
exports.looseIndexOf = looseIndexOf;
|
|
@@ -901,6 +904,7 @@ exports.normalizeStyle = normalizeStyle;
|
|
|
901
904
|
exports.objectToString = objectToString;
|
|
902
905
|
exports.parseStringStyle = parseStringStyle;
|
|
903
906
|
exports.propsToAttrMap = propsToAttrMap;
|
|
907
|
+
exports.rangeCloseOf = rangeCloseOf;
|
|
904
908
|
exports.remove = remove;
|
|
905
909
|
exports.shouldSetAsAttr = shouldSetAsAttr;
|
|
906
910
|
exports.slotFlagsText = slotFlagsText;
|
package/dist/shared.cjs.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/shared v3.6.0-rc.
|
|
2
|
+
* @vue/shared v3.6.0-rc.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -66,10 +66,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
|
|
|
66
66
|
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
67
67
|
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
68
68
|
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
69
|
+
const STRING_CACHE_MAX_SIZE = 1e4;
|
|
69
70
|
const cacheStringFunction = (fn) => {
|
|
70
|
-
|
|
71
|
+
let cache = Object.create(null);
|
|
72
|
+
let size = 0;
|
|
71
73
|
return ((str) => {
|
|
72
|
-
|
|
74
|
+
const hit = cache[str];
|
|
75
|
+
if (hit !== void 0) return hit;
|
|
76
|
+
if (++size > STRING_CACHE_MAX_SIZE) {
|
|
77
|
+
cache = Object.create(null);
|
|
78
|
+
size = 1;
|
|
79
|
+
}
|
|
80
|
+
return cache[str] = fn(str);
|
|
73
81
|
});
|
|
74
82
|
};
|
|
75
83
|
const camelizeRE = /-(\w)/g;
|
|
@@ -77,22 +85,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
|
77
85
|
/**
|
|
78
86
|
* @private
|
|
79
87
|
*/
|
|
80
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
88
|
+
const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
81
89
|
const hyphenateRE = /\B([A-Z])/g;
|
|
82
90
|
/**
|
|
83
91
|
* @private
|
|
84
92
|
*/
|
|
85
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
93
|
+
const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
86
94
|
/**
|
|
87
95
|
* @private
|
|
88
96
|
*/
|
|
89
|
-
const capitalize = cacheStringFunction((str) => {
|
|
97
|
+
const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
90
98
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
91
99
|
});
|
|
92
100
|
/**
|
|
93
101
|
* @private
|
|
94
102
|
*/
|
|
95
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
103
|
+
const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
96
104
|
return str ? `on${capitalize(str)}` : ``;
|
|
97
105
|
});
|
|
98
106
|
/**
|
|
@@ -398,26 +406,11 @@ const isFormattingTag = /*@__PURE__*/ makeMap(FORMATTING_TAGS);
|
|
|
398
406
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
399
407
|
*/
|
|
400
408
|
const isAlwaysCloseTag = /*@__PURE__*/ makeMap(ALWAYS_CLOSE_TAGS);
|
|
401
|
-
|
|
402
|
-
//#region packages/shared/src/domAttrConfig.ts
|
|
403
|
-
/**
|
|
404
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
405
|
-
* have different names from their corresponding dom properties:
|
|
406
|
-
* - itemscope -> N/A
|
|
407
|
-
* - allowfullscreen -> allowFullscreen
|
|
408
|
-
* - formnovalidate -> formNoValidate
|
|
409
|
-
* - ismap -> isMap
|
|
410
|
-
* - nomodule -> noModule
|
|
411
|
-
* - novalidate -> noValidate
|
|
412
|
-
* - playsinline -> playsInline
|
|
413
|
-
* - readonly -> readOnly
|
|
414
|
-
*/
|
|
415
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
416
|
-
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
409
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
|
|
417
410
|
/**
|
|
418
411
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
419
412
|
*/
|
|
420
|
-
const isBooleanAttr = /*@__PURE__*/ makeMap(
|
|
413
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
421
414
|
/**
|
|
422
415
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
423
416
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -426,12 +419,10 @@ function includeBooleanAttr(value) {
|
|
|
426
419
|
return !!value || value === "";
|
|
427
420
|
}
|
|
428
421
|
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
|
|
429
|
-
const attrValidationCache = {};
|
|
430
422
|
function isSSRSafeAttrName(name) {
|
|
431
|
-
if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
|
|
432
423
|
const isUnsafe = unsafeAttrCharRE.test(name);
|
|
433
424
|
if (isUnsafe) console.error(`unsafe attribute name: ${name}`);
|
|
434
|
-
return
|
|
425
|
+
return !isUnsafe;
|
|
435
426
|
}
|
|
436
427
|
const propsToAttrMap = {
|
|
437
428
|
acceptCharset: "accept-charset",
|
|
@@ -783,6 +774,17 @@ function isVaporBranchStart(data) {
|
|
|
783
774
|
}
|
|
784
775
|
return true;
|
|
785
776
|
}
|
|
777
|
+
/**
|
|
778
|
+
* The data of a comment opening a range only a vapor server render emits:
|
|
779
|
+
* `<!--{-->` around the render of a component, or a v-if branch's.
|
|
780
|
+
*/
|
|
781
|
+
function isVaporRangeStart(data) {
|
|
782
|
+
return data === "{" || isVaporBranchStart(data);
|
|
783
|
+
}
|
|
784
|
+
/** The data of the comment closing the range `open` opens. */
|
|
785
|
+
function rangeCloseOf(open) {
|
|
786
|
+
return open === "(" ? ")" : open === "{" ? "}" : "]";
|
|
787
|
+
}
|
|
786
788
|
function slotNotifiesBoundary(flags) {
|
|
787
789
|
return isForwardedSlot(flags) && !(flags & 2);
|
|
788
790
|
}
|
|
@@ -889,6 +891,7 @@ exports.isSpecialBooleanAttr = isSpecialBooleanAttr;
|
|
|
889
891
|
exports.isString = isString;
|
|
890
892
|
exports.isSymbol = isSymbol;
|
|
891
893
|
exports.isVaporBranchStart = isVaporBranchStart;
|
|
894
|
+
exports.isVaporRangeStart = isVaporRangeStart;
|
|
892
895
|
exports.isVoidTag = isVoidTag;
|
|
893
896
|
exports.looseEqual = looseEqual;
|
|
894
897
|
exports.looseIndexOf = looseIndexOf;
|
|
@@ -901,6 +904,7 @@ exports.normalizeStyle = normalizeStyle;
|
|
|
901
904
|
exports.objectToString = objectToString;
|
|
902
905
|
exports.parseStringStyle = parseStringStyle;
|
|
903
906
|
exports.propsToAttrMap = propsToAttrMap;
|
|
907
|
+
exports.rangeCloseOf = rangeCloseOf;
|
|
904
908
|
exports.remove = remove;
|
|
905
909
|
exports.shouldSetAsAttr = shouldSetAsAttr;
|
|
906
910
|
exports.slotFlagsText = slotFlagsText;
|
package/dist/shared.d.ts
CHANGED
|
@@ -509,6 +509,13 @@ export declare function isForwardedSlot(flags: number): boolean;
|
|
|
509
509
|
* and `<!--]-->` closes it like a fragment.
|
|
510
510
|
*/
|
|
511
511
|
export declare function isVaporBranchStart(data: string): boolean;
|
|
512
|
+
/**
|
|
513
|
+
* The data of a comment opening a range only a vapor server render emits:
|
|
514
|
+
* `<!--{-->` around the render of a component, or a v-if branch's.
|
|
515
|
+
*/
|
|
516
|
+
export declare function isVaporRangeStart(data: string): boolean;
|
|
517
|
+
/** The data of the comment closing the range `open` opens. */
|
|
518
|
+
export declare function rangeCloseOf(open: string): string;
|
|
512
519
|
export declare function slotNotifiesBoundary(flags: number): boolean;
|
|
513
520
|
/**
|
|
514
521
|
* Per-slot-function metadata attached by the compiler as `fn._`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/shared v3.6.0-rc.
|
|
2
|
+
* @vue/shared v3.6.0-rc.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -62,10 +62,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
|
|
|
62
62
|
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
63
63
|
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
64
64
|
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
65
|
+
const STRING_CACHE_MAX_SIZE = 1e4;
|
|
65
66
|
const cacheStringFunction = (fn) => {
|
|
66
|
-
|
|
67
|
+
let cache = Object.create(null);
|
|
68
|
+
let size = 0;
|
|
67
69
|
return ((str) => {
|
|
68
|
-
|
|
70
|
+
const hit = cache[str];
|
|
71
|
+
if (hit !== void 0) return hit;
|
|
72
|
+
if (++size > STRING_CACHE_MAX_SIZE) {
|
|
73
|
+
cache = Object.create(null);
|
|
74
|
+
size = 1;
|
|
75
|
+
}
|
|
76
|
+
return cache[str] = fn(str);
|
|
69
77
|
});
|
|
70
78
|
};
|
|
71
79
|
const camelizeRE = /-(\w)/g;
|
|
@@ -73,22 +81,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
|
73
81
|
/**
|
|
74
82
|
* @private
|
|
75
83
|
*/
|
|
76
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
84
|
+
const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
77
85
|
const hyphenateRE = /\B([A-Z])/g;
|
|
78
86
|
/**
|
|
79
87
|
* @private
|
|
80
88
|
*/
|
|
81
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
89
|
+
const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
82
90
|
/**
|
|
83
91
|
* @private
|
|
84
92
|
*/
|
|
85
|
-
const capitalize = cacheStringFunction((str) => {
|
|
93
|
+
const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
86
94
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
87
95
|
});
|
|
88
96
|
/**
|
|
89
97
|
* @private
|
|
90
98
|
*/
|
|
91
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
99
|
+
const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
92
100
|
return str ? `on${capitalize(str)}` : ``;
|
|
93
101
|
});
|
|
94
102
|
/**
|
|
@@ -394,26 +402,11 @@ const isFormattingTag = /*@__PURE__*/ makeMap(FORMATTING_TAGS);
|
|
|
394
402
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
395
403
|
*/
|
|
396
404
|
const isAlwaysCloseTag = /*@__PURE__*/ makeMap(ALWAYS_CLOSE_TAGS);
|
|
397
|
-
|
|
398
|
-
//#region packages/shared/src/domAttrConfig.ts
|
|
399
|
-
/**
|
|
400
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
401
|
-
* have different names from their corresponding dom properties:
|
|
402
|
-
* - itemscope -> N/A
|
|
403
|
-
* - allowfullscreen -> allowFullscreen
|
|
404
|
-
* - formnovalidate -> formNoValidate
|
|
405
|
-
* - ismap -> isMap
|
|
406
|
-
* - nomodule -> noModule
|
|
407
|
-
* - novalidate -> noValidate
|
|
408
|
-
* - playsinline -> playsInline
|
|
409
|
-
* - readonly -> readOnly
|
|
410
|
-
*/
|
|
411
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
412
|
-
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
405
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
|
|
413
406
|
/**
|
|
414
407
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
415
408
|
*/
|
|
416
|
-
const isBooleanAttr = /*@__PURE__*/ makeMap(
|
|
409
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
417
410
|
/**
|
|
418
411
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
419
412
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -422,12 +415,10 @@ function includeBooleanAttr(value) {
|
|
|
422
415
|
return !!value || value === "";
|
|
423
416
|
}
|
|
424
417
|
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
|
|
425
|
-
const attrValidationCache = {};
|
|
426
418
|
function isSSRSafeAttrName(name) {
|
|
427
|
-
if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
|
|
428
419
|
const isUnsafe = unsafeAttrCharRE.test(name);
|
|
429
420
|
if (isUnsafe) console.error(`unsafe attribute name: ${name}`);
|
|
430
|
-
return
|
|
421
|
+
return !isUnsafe;
|
|
431
422
|
}
|
|
432
423
|
const propsToAttrMap = {
|
|
433
424
|
acceptCharset: "accept-charset",
|
|
@@ -781,6 +772,17 @@ function isVaporBranchStart(data) {
|
|
|
781
772
|
}
|
|
782
773
|
return true;
|
|
783
774
|
}
|
|
775
|
+
/**
|
|
776
|
+
* The data of a comment opening a range only a vapor server render emits:
|
|
777
|
+
* `<!--{-->` around the render of a component, or a v-if branch's.
|
|
778
|
+
*/
|
|
779
|
+
function isVaporRangeStart(data) {
|
|
780
|
+
return data === "{" || isVaporBranchStart(data);
|
|
781
|
+
}
|
|
782
|
+
/** The data of the comment closing the range `open` opens. */
|
|
783
|
+
function rangeCloseOf(open) {
|
|
784
|
+
return open === "(" ? ")" : open === "{" ? "}" : "]";
|
|
785
|
+
}
|
|
784
786
|
function slotNotifiesBoundary(flags) {
|
|
785
787
|
return isForwardedSlot(flags) && !(flags & 2);
|
|
786
788
|
}
|
|
@@ -815,4 +817,4 @@ const VaporSingleRoot = {
|
|
|
815
817
|
"2": "SLOT"
|
|
816
818
|
};
|
|
817
819
|
//#endregion
|
|
818
|
-
export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, Namespaces, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, TemplateFlags, VaporBlockShape, VaporDynamicComponentFlags, VaporIfFlags, VaporSingleRoot, VaporSlotFlags, VaporSlotStability, VaporVForFlags, YES, camelize, canSetValueDirectly, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, getModifierPropName, getSequence, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isAlwaysCloseTag, isArray, isBooleanAttr, isBuiltInDirective, isBuiltInTag, isDate, isFormattingTag, isForwardedSlot, 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, isVaporBranchStart, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeCssVarValue, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, shouldSetAsAttr, slotFlagsText, slotNotifiesBoundary, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
|
|
820
|
+
export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, Namespaces, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, TemplateFlags, VaporBlockShape, VaporDynamicComponentFlags, VaporIfFlags, VaporSingleRoot, VaporSlotFlags, VaporSlotStability, VaporVForFlags, YES, camelize, canSetValueDirectly, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, getModifierPropName, getSequence, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isAlwaysCloseTag, isArray, isBooleanAttr, isBuiltInDirective, isBuiltInTag, isDate, isFormattingTag, isForwardedSlot, 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, isVaporBranchStart, isVaporRangeStart, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeCssVarValue, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, rangeCloseOf, remove, shouldSetAsAttr, slotFlagsText, slotNotifiesBoundary, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
|