@vue/shared 3.6.0-rc.5 → 3.6.0-rc.7
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 +68 -29
- package/dist/shared.cjs.prod.js +68 -29
- package/dist/shared.d.ts +255 -240
- package/dist/shared.esm-bundler.js +65 -30
- 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.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -15,7 +15,7 @@ Object.defineProperties(exports, {
|
|
|
15
15
|
* \/\*#\_\_PURE\_\_\*\/
|
|
16
16
|
* So that they can be tree-shaken if necessary.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
19
19
|
function makeMap(str) {
|
|
20
20
|
const map = Object.create(null);
|
|
21
21
|
for (const key of str.split(",")) map[key] = 1;
|
|
@@ -63,9 +63,9 @@ const toRawType = (value) => {
|
|
|
63
63
|
};
|
|
64
64
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
65
65
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
66
|
-
const isReservedProp =
|
|
67
|
-
const isBuiltInTag =
|
|
68
|
-
const isBuiltInDirective =
|
|
66
|
+
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
67
|
+
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
68
|
+
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
69
69
|
const cacheStringFunction = (fn) => {
|
|
70
70
|
const cache = Object.create(null);
|
|
71
71
|
return ((str) => {
|
|
@@ -259,7 +259,7 @@ const slotFlagsText = {
|
|
|
259
259
|
[2]: "DYNAMIC",
|
|
260
260
|
[3]: "FORWARDED"
|
|
261
261
|
};
|
|
262
|
-
const isGloballyAllowed =
|
|
262
|
+
const isGloballyAllowed = /*@__PURE__*/ makeMap("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");
|
|
263
263
|
/** @deprecated use `isGloballyAllowed` instead */
|
|
264
264
|
const isGloballyWhitelisted = isGloballyAllowed;
|
|
265
265
|
//#endregion
|
|
@@ -372,42 +372,42 @@ const BLOCK_TAGS = "address,article,aside,blockquote,dd,details,dialog,div,dl,dt
|
|
|
372
372
|
* Compiler only.
|
|
373
373
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
374
374
|
*/
|
|
375
|
-
const isHTMLTag =
|
|
375
|
+
const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
|
|
376
376
|
/**
|
|
377
377
|
* Compiler only.
|
|
378
378
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
379
379
|
*/
|
|
380
|
-
const isSVGTag =
|
|
380
|
+
const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
381
381
|
/**
|
|
382
382
|
* Compiler only.
|
|
383
383
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
384
384
|
*/
|
|
385
|
-
const isMathMLTag =
|
|
385
|
+
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
386
386
|
/**
|
|
387
387
|
* Compiler only.
|
|
388
388
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
389
389
|
*/
|
|
390
|
-
const isVoidTag =
|
|
390
|
+
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
391
391
|
/**
|
|
392
392
|
* Compiler only.
|
|
393
393
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
394
394
|
*/
|
|
395
|
-
const isFormattingTag =
|
|
395
|
+
const isFormattingTag = /*@__PURE__*/ makeMap(FORMATTING_TAGS);
|
|
396
396
|
/**
|
|
397
397
|
* Compiler only.
|
|
398
398
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
399
399
|
*/
|
|
400
|
-
const isAlwaysCloseTag =
|
|
400
|
+
const isAlwaysCloseTag = /*@__PURE__*/ makeMap(ALWAYS_CLOSE_TAGS);
|
|
401
401
|
/**
|
|
402
402
|
* Compiler only.
|
|
403
403
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
404
404
|
*/
|
|
405
|
-
const isInlineTag =
|
|
405
|
+
const isInlineTag = /*@__PURE__*/ makeMap(INLINE_TAGS);
|
|
406
406
|
/**
|
|
407
407
|
* Compiler only.
|
|
408
408
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
409
409
|
*/
|
|
410
|
-
const isBlockTag =
|
|
410
|
+
const isBlockTag = /*@__PURE__*/ makeMap(BLOCK_TAGS);
|
|
411
411
|
//#endregion
|
|
412
412
|
//#region packages/shared/src/domAttrConfig.ts
|
|
413
413
|
/**
|
|
@@ -422,11 +422,11 @@ const isBlockTag = /* @__PURE__ */ makeMap(BLOCK_TAGS);
|
|
|
422
422
|
* - readonly -> readOnly
|
|
423
423
|
*/
|
|
424
424
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
425
|
-
const isSpecialBooleanAttr =
|
|
425
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
426
426
|
/**
|
|
427
427
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
428
428
|
*/
|
|
429
|
-
const isBooleanAttr =
|
|
429
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
430
430
|
/**
|
|
431
431
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
432
432
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -434,7 +434,7 @@ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,auto
|
|
|
434
434
|
function includeBooleanAttr(value) {
|
|
435
435
|
return !!value || value === "";
|
|
436
436
|
}
|
|
437
|
-
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
|
|
437
|
+
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
|
|
438
438
|
const attrValidationCache = {};
|
|
439
439
|
function isSSRSafeAttrName(name) {
|
|
440
440
|
if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
|
|
@@ -454,15 +454,15 @@ const propsToAttrMap = {
|
|
|
454
454
|
* Don't also forget to allow `data-*` and `aria-*`!
|
|
455
455
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
456
456
|
*/
|
|
457
|
-
const isKnownHtmlAttr =
|
|
457
|
+
const isKnownHtmlAttr = /*@__PURE__*/ makeMap("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");
|
|
458
458
|
/**
|
|
459
459
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
460
460
|
*/
|
|
461
|
-
const isKnownSvgAttr =
|
|
461
|
+
const isKnownSvgAttr = /*@__PURE__*/ makeMap("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");
|
|
462
462
|
/**
|
|
463
463
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute
|
|
464
464
|
*/
|
|
465
|
-
const isKnownMathMLAttr =
|
|
465
|
+
const isKnownMathMLAttr = /*@__PURE__*/ makeMap("accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns");
|
|
466
466
|
/**
|
|
467
467
|
* Shared between server-renderer and runtime-core hydration logic
|
|
468
468
|
*/
|
|
@@ -547,6 +547,21 @@ function looseCompareArrays(a, b) {
|
|
|
547
547
|
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
548
548
|
return equal;
|
|
549
549
|
}
|
|
550
|
+
function looseCompareCollections(a, b) {
|
|
551
|
+
if (a.size !== b.size) return false;
|
|
552
|
+
const candidates = Array.from(b);
|
|
553
|
+
const matched = new Uint8Array(candidates.length);
|
|
554
|
+
for (const item of a) {
|
|
555
|
+
let index = -1;
|
|
556
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
557
|
+
index = i;
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
if (index < 0) return false;
|
|
561
|
+
matched[index] = 1;
|
|
562
|
+
}
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
550
565
|
function looseEqual(a, b) {
|
|
551
566
|
if (a === b) return true;
|
|
552
567
|
let aValidType = isDate(a);
|
|
@@ -562,6 +577,12 @@ function looseEqual(a, b) {
|
|
|
562
577
|
bValidType = isObject(b);
|
|
563
578
|
if (aValidType || bValidType) {
|
|
564
579
|
if (!aValidType || !bValidType) return false;
|
|
580
|
+
aValidType = isMap(a);
|
|
581
|
+
bValidType = isMap(b);
|
|
582
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
583
|
+
aValidType = isSet(a);
|
|
584
|
+
bValidType = isSet(b);
|
|
585
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
565
586
|
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
566
587
|
for (const key in a) {
|
|
567
588
|
const aHasKey = a.hasOwnProperty(key);
|
|
@@ -675,7 +696,9 @@ const VaporVForFlags = {
|
|
|
675
696
|
"IS_FRAGMENT": 16,
|
|
676
697
|
"16": "IS_FRAGMENT",
|
|
677
698
|
"SLOT_ROOT": 32,
|
|
678
|
-
"32": "SLOT_ROOT"
|
|
699
|
+
"32": "SLOT_ROOT",
|
|
700
|
+
"WRAPPED_ROWS": 64,
|
|
701
|
+
"64": "WRAPPED_ROWS"
|
|
679
702
|
};
|
|
680
703
|
const VaporBlockShape = {
|
|
681
704
|
"EMPTY": 0,
|
|
@@ -733,14 +756,26 @@ const VaporSlotFlags = {
|
|
|
733
756
|
"1": "NO_SLOTTED",
|
|
734
757
|
"ONCE": 2,
|
|
735
758
|
"2": "ONCE",
|
|
736
|
-
"
|
|
737
|
-
"4": "
|
|
738
|
-
"
|
|
739
|
-
"8": "
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
759
|
+
"FORWARDED": 4,
|
|
760
|
+
"4": "FORWARDED",
|
|
761
|
+
"SHARED_FALLBACK": 8,
|
|
762
|
+
"8": "SHARED_FALLBACK"
|
|
763
|
+
};
|
|
764
|
+
function isForwardedSlot(flags) {
|
|
765
|
+
return !!(flags & 12);
|
|
766
|
+
}
|
|
767
|
+
function slotInheritsFallback(flags) {
|
|
768
|
+
return isForwardedSlot(flags) && !(flags & 8);
|
|
769
|
+
}
|
|
770
|
+
function slotNotifiesBoundary(flags) {
|
|
771
|
+
return isForwardedSlot(flags) && !(flags & 2);
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Per-slot-function metadata attached by the compiler as `fn._`.
|
|
775
|
+
*/
|
|
776
|
+
const VaporSlotStability = {
|
|
777
|
+
"NON_STABLE": 1,
|
|
778
|
+
"1": "NON_STABLE"
|
|
744
779
|
};
|
|
745
780
|
const VaporDynamicComponentFlags = {
|
|
746
781
|
"SINGLE_ROOT": 1,
|
|
@@ -765,6 +800,7 @@ exports.VaporBlockShape = VaporBlockShape;
|
|
|
765
800
|
exports.VaporDynamicComponentFlags = VaporDynamicComponentFlags;
|
|
766
801
|
exports.VaporIfFlags = VaporIfFlags;
|
|
767
802
|
exports.VaporSlotFlags = VaporSlotFlags;
|
|
803
|
+
exports.VaporSlotStability = VaporSlotStability;
|
|
768
804
|
exports.VaporVForFlags = VaporVForFlags;
|
|
769
805
|
exports.YES = YES;
|
|
770
806
|
exports.camelize = camelize;
|
|
@@ -795,6 +831,7 @@ exports.isBuiltInDirective = isBuiltInDirective;
|
|
|
795
831
|
exports.isBuiltInTag = isBuiltInTag;
|
|
796
832
|
exports.isDate = isDate;
|
|
797
833
|
exports.isFormattingTag = isFormattingTag;
|
|
834
|
+
exports.isForwardedSlot = isForwardedSlot;
|
|
798
835
|
exports.isFunction = isFunction;
|
|
799
836
|
exports.isGloballyAllowed = isGloballyAllowed;
|
|
800
837
|
exports.isGloballyWhitelisted = isGloballyWhitelisted;
|
|
@@ -836,6 +873,8 @@ exports.propsToAttrMap = propsToAttrMap;
|
|
|
836
873
|
exports.remove = remove;
|
|
837
874
|
exports.shouldSetAsAttr = shouldSetAsAttr;
|
|
838
875
|
exports.slotFlagsText = slotFlagsText;
|
|
876
|
+
exports.slotInheritsFallback = slotInheritsFallback;
|
|
877
|
+
exports.slotNotifiesBoundary = slotNotifiesBoundary;
|
|
839
878
|
exports.stringifyStyle = stringifyStyle;
|
|
840
879
|
exports.toDisplayString = toDisplayString;
|
|
841
880
|
exports.toHandlerKey = toHandlerKey;
|
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.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -15,7 +15,7 @@ Object.defineProperties(exports, {
|
|
|
15
15
|
* \/\*#\_\_PURE\_\_\*\/
|
|
16
16
|
* So that they can be tree-shaken if necessary.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
19
19
|
function makeMap(str) {
|
|
20
20
|
const map = Object.create(null);
|
|
21
21
|
for (const key of str.split(",")) map[key] = 1;
|
|
@@ -63,9 +63,9 @@ const toRawType = (value) => {
|
|
|
63
63
|
};
|
|
64
64
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
65
65
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
66
|
-
const isReservedProp =
|
|
67
|
-
const isBuiltInTag =
|
|
68
|
-
const isBuiltInDirective =
|
|
66
|
+
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
67
|
+
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
68
|
+
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
69
69
|
const cacheStringFunction = (fn) => {
|
|
70
70
|
const cache = Object.create(null);
|
|
71
71
|
return ((str) => {
|
|
@@ -259,7 +259,7 @@ const slotFlagsText = {
|
|
|
259
259
|
[2]: "DYNAMIC",
|
|
260
260
|
[3]: "FORWARDED"
|
|
261
261
|
};
|
|
262
|
-
const isGloballyAllowed =
|
|
262
|
+
const isGloballyAllowed = /*@__PURE__*/ makeMap("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");
|
|
263
263
|
/** @deprecated use `isGloballyAllowed` instead */
|
|
264
264
|
const isGloballyWhitelisted = isGloballyAllowed;
|
|
265
265
|
//#endregion
|
|
@@ -372,42 +372,42 @@ const BLOCK_TAGS = "address,article,aside,blockquote,dd,details,dialog,div,dl,dt
|
|
|
372
372
|
* Compiler only.
|
|
373
373
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
374
374
|
*/
|
|
375
|
-
const isHTMLTag =
|
|
375
|
+
const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
|
|
376
376
|
/**
|
|
377
377
|
* Compiler only.
|
|
378
378
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
379
379
|
*/
|
|
380
|
-
const isSVGTag =
|
|
380
|
+
const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
381
381
|
/**
|
|
382
382
|
* Compiler only.
|
|
383
383
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
384
384
|
*/
|
|
385
|
-
const isMathMLTag =
|
|
385
|
+
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
386
386
|
/**
|
|
387
387
|
* Compiler only.
|
|
388
388
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
389
389
|
*/
|
|
390
|
-
const isVoidTag =
|
|
390
|
+
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
391
391
|
/**
|
|
392
392
|
* Compiler only.
|
|
393
393
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
394
394
|
*/
|
|
395
|
-
const isFormattingTag =
|
|
395
|
+
const isFormattingTag = /*@__PURE__*/ makeMap(FORMATTING_TAGS);
|
|
396
396
|
/**
|
|
397
397
|
* Compiler only.
|
|
398
398
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
399
399
|
*/
|
|
400
|
-
const isAlwaysCloseTag =
|
|
400
|
+
const isAlwaysCloseTag = /*@__PURE__*/ makeMap(ALWAYS_CLOSE_TAGS);
|
|
401
401
|
/**
|
|
402
402
|
* Compiler only.
|
|
403
403
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
404
404
|
*/
|
|
405
|
-
const isInlineTag =
|
|
405
|
+
const isInlineTag = /*@__PURE__*/ makeMap(INLINE_TAGS);
|
|
406
406
|
/**
|
|
407
407
|
* Compiler only.
|
|
408
408
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
409
409
|
*/
|
|
410
|
-
const isBlockTag =
|
|
410
|
+
const isBlockTag = /*@__PURE__*/ makeMap(BLOCK_TAGS);
|
|
411
411
|
//#endregion
|
|
412
412
|
//#region packages/shared/src/domAttrConfig.ts
|
|
413
413
|
/**
|
|
@@ -422,11 +422,11 @@ const isBlockTag = /* @__PURE__ */ makeMap(BLOCK_TAGS);
|
|
|
422
422
|
* - readonly -> readOnly
|
|
423
423
|
*/
|
|
424
424
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
425
|
-
const isSpecialBooleanAttr =
|
|
425
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
426
426
|
/**
|
|
427
427
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
428
428
|
*/
|
|
429
|
-
const isBooleanAttr =
|
|
429
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
430
430
|
/**
|
|
431
431
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
432
432
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -434,7 +434,7 @@ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,auto
|
|
|
434
434
|
function includeBooleanAttr(value) {
|
|
435
435
|
return !!value || value === "";
|
|
436
436
|
}
|
|
437
|
-
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
|
|
437
|
+
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
|
|
438
438
|
const attrValidationCache = {};
|
|
439
439
|
function isSSRSafeAttrName(name) {
|
|
440
440
|
if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
|
|
@@ -454,15 +454,15 @@ const propsToAttrMap = {
|
|
|
454
454
|
* Don't also forget to allow `data-*` and `aria-*`!
|
|
455
455
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
456
456
|
*/
|
|
457
|
-
const isKnownHtmlAttr =
|
|
457
|
+
const isKnownHtmlAttr = /*@__PURE__*/ makeMap("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");
|
|
458
458
|
/**
|
|
459
459
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
460
460
|
*/
|
|
461
|
-
const isKnownSvgAttr =
|
|
461
|
+
const isKnownSvgAttr = /*@__PURE__*/ makeMap("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");
|
|
462
462
|
/**
|
|
463
463
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute
|
|
464
464
|
*/
|
|
465
|
-
const isKnownMathMLAttr =
|
|
465
|
+
const isKnownMathMLAttr = /*@__PURE__*/ makeMap("accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns");
|
|
466
466
|
/**
|
|
467
467
|
* Shared between server-renderer and runtime-core hydration logic
|
|
468
468
|
*/
|
|
@@ -547,6 +547,21 @@ function looseCompareArrays(a, b) {
|
|
|
547
547
|
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
548
548
|
return equal;
|
|
549
549
|
}
|
|
550
|
+
function looseCompareCollections(a, b) {
|
|
551
|
+
if (a.size !== b.size) return false;
|
|
552
|
+
const candidates = Array.from(b);
|
|
553
|
+
const matched = new Uint8Array(candidates.length);
|
|
554
|
+
for (const item of a) {
|
|
555
|
+
let index = -1;
|
|
556
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
557
|
+
index = i;
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
if (index < 0) return false;
|
|
561
|
+
matched[index] = 1;
|
|
562
|
+
}
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
550
565
|
function looseEqual(a, b) {
|
|
551
566
|
if (a === b) return true;
|
|
552
567
|
let aValidType = isDate(a);
|
|
@@ -562,6 +577,12 @@ function looseEqual(a, b) {
|
|
|
562
577
|
bValidType = isObject(b);
|
|
563
578
|
if (aValidType || bValidType) {
|
|
564
579
|
if (!aValidType || !bValidType) return false;
|
|
580
|
+
aValidType = isMap(a);
|
|
581
|
+
bValidType = isMap(b);
|
|
582
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
583
|
+
aValidType = isSet(a);
|
|
584
|
+
bValidType = isSet(b);
|
|
585
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
565
586
|
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
566
587
|
for (const key in a) {
|
|
567
588
|
const aHasKey = a.hasOwnProperty(key);
|
|
@@ -675,7 +696,9 @@ const VaporVForFlags = {
|
|
|
675
696
|
"IS_FRAGMENT": 16,
|
|
676
697
|
"16": "IS_FRAGMENT",
|
|
677
698
|
"SLOT_ROOT": 32,
|
|
678
|
-
"32": "SLOT_ROOT"
|
|
699
|
+
"32": "SLOT_ROOT",
|
|
700
|
+
"WRAPPED_ROWS": 64,
|
|
701
|
+
"64": "WRAPPED_ROWS"
|
|
679
702
|
};
|
|
680
703
|
const VaporBlockShape = {
|
|
681
704
|
"EMPTY": 0,
|
|
@@ -733,14 +756,26 @@ const VaporSlotFlags = {
|
|
|
733
756
|
"1": "NO_SLOTTED",
|
|
734
757
|
"ONCE": 2,
|
|
735
758
|
"2": "ONCE",
|
|
736
|
-
"
|
|
737
|
-
"4": "
|
|
738
|
-
"
|
|
739
|
-
"8": "
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
759
|
+
"FORWARDED": 4,
|
|
760
|
+
"4": "FORWARDED",
|
|
761
|
+
"SHARED_FALLBACK": 8,
|
|
762
|
+
"8": "SHARED_FALLBACK"
|
|
763
|
+
};
|
|
764
|
+
function isForwardedSlot(flags) {
|
|
765
|
+
return !!(flags & 12);
|
|
766
|
+
}
|
|
767
|
+
function slotInheritsFallback(flags) {
|
|
768
|
+
return isForwardedSlot(flags) && !(flags & 8);
|
|
769
|
+
}
|
|
770
|
+
function slotNotifiesBoundary(flags) {
|
|
771
|
+
return isForwardedSlot(flags) && !(flags & 2);
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Per-slot-function metadata attached by the compiler as `fn._`.
|
|
775
|
+
*/
|
|
776
|
+
const VaporSlotStability = {
|
|
777
|
+
"NON_STABLE": 1,
|
|
778
|
+
"1": "NON_STABLE"
|
|
744
779
|
};
|
|
745
780
|
const VaporDynamicComponentFlags = {
|
|
746
781
|
"SINGLE_ROOT": 1,
|
|
@@ -765,6 +800,7 @@ exports.VaporBlockShape = VaporBlockShape;
|
|
|
765
800
|
exports.VaporDynamicComponentFlags = VaporDynamicComponentFlags;
|
|
766
801
|
exports.VaporIfFlags = VaporIfFlags;
|
|
767
802
|
exports.VaporSlotFlags = VaporSlotFlags;
|
|
803
|
+
exports.VaporSlotStability = VaporSlotStability;
|
|
768
804
|
exports.VaporVForFlags = VaporVForFlags;
|
|
769
805
|
exports.YES = YES;
|
|
770
806
|
exports.camelize = camelize;
|
|
@@ -795,6 +831,7 @@ exports.isBuiltInDirective = isBuiltInDirective;
|
|
|
795
831
|
exports.isBuiltInTag = isBuiltInTag;
|
|
796
832
|
exports.isDate = isDate;
|
|
797
833
|
exports.isFormattingTag = isFormattingTag;
|
|
834
|
+
exports.isForwardedSlot = isForwardedSlot;
|
|
798
835
|
exports.isFunction = isFunction;
|
|
799
836
|
exports.isGloballyAllowed = isGloballyAllowed;
|
|
800
837
|
exports.isGloballyWhitelisted = isGloballyWhitelisted;
|
|
@@ -836,6 +873,8 @@ exports.propsToAttrMap = propsToAttrMap;
|
|
|
836
873
|
exports.remove = remove;
|
|
837
874
|
exports.shouldSetAsAttr = shouldSetAsAttr;
|
|
838
875
|
exports.slotFlagsText = slotFlagsText;
|
|
876
|
+
exports.slotInheritsFallback = slotInheritsFallback;
|
|
877
|
+
exports.slotNotifiesBoundary = slotNotifiesBoundary;
|
|
839
878
|
exports.stringifyStyle = stringifyStyle;
|
|
840
879
|
exports.toDisplayString = toDisplayString;
|
|
841
880
|
exports.toHandlerKey = toHandlerKey;
|