@vue/shared 3.6.0-rc.5 → 3.6.0-rc.6
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 +41 -20
- package/dist/shared.cjs.prod.js +41 -20
- package/dist/shared.d.ts +235 -235
- package/dist/shared.esm-bundler.js +41 -20
- 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.6
|
|
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);
|
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.6
|
|
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);
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//#region temp/packages/shared/src/makeMap.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Make a map and return a function for checking if a key
|
|
4
|
-
* is in that map.
|
|
5
|
-
* IMPORTANT: all calls of this function must be prefixed with
|
|
6
|
-
* \/\*#\_\_PURE\_\_\*\/
|
|
7
|
-
* So that they can be tree-shaken if necessary.
|
|
8
|
-
*/
|
|
3
|
+
* Make a map and return a function for checking if a key
|
|
4
|
+
* is in that map.
|
|
5
|
+
* IMPORTANT: all calls of this function must be prefixed with
|
|
6
|
+
* \/\*#\_\_PURE\_\_\*\/
|
|
7
|
+
* So that they can be tree-shaken if necessary.
|
|
8
|
+
*/
|
|
9
9
|
export declare function makeMap(str: string): (key: string) => boolean;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region temp/packages/shared/src/general.d.ts
|
|
@@ -15,12 +15,12 @@ export declare const EMPTY_OBJ: {
|
|
|
15
15
|
export declare const EMPTY_ARR: readonly never[];
|
|
16
16
|
export declare const NOOP: () => void;
|
|
17
17
|
/**
|
|
18
|
-
* Always return true.
|
|
19
|
-
*/
|
|
18
|
+
* Always return true.
|
|
19
|
+
*/
|
|
20
20
|
export declare const YES: () => boolean;
|
|
21
21
|
/**
|
|
22
|
-
* Always return false.
|
|
23
|
-
*/
|
|
22
|
+
* Always return false.
|
|
23
|
+
*/
|
|
24
24
|
export declare const NO: () => boolean;
|
|
25
25
|
export declare const isOn: (key: string) => boolean;
|
|
26
26
|
export declare const isNativeOn: (key: string) => boolean;
|
|
@@ -47,40 +47,40 @@ export declare const isReservedProp: (key: string) => boolean;
|
|
|
47
47
|
export declare const isBuiltInTag: (key: string) => boolean;
|
|
48
48
|
export declare const isBuiltInDirective: (key: string) => boolean;
|
|
49
49
|
/**
|
|
50
|
-
* @private
|
|
51
|
-
*/
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
52
|
export declare const camelize: (str: string) => string;
|
|
53
53
|
/**
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
56
|
export declare const hyphenate: (str: string) => string;
|
|
57
57
|
/**
|
|
58
|
-
* @private
|
|
59
|
-
*/
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
60
|
export declare const capitalize: <T extends string>(str: T) => Capitalize<T>;
|
|
61
61
|
/**
|
|
62
|
-
* @private
|
|
63
|
-
*/
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
64
|
export declare const toHandlerKey: <T extends string>(str: T) => T extends "" ? "" : `on${Capitalize<T>}`;
|
|
65
65
|
/**
|
|
66
|
-
* #13070 When v-model and v-model:model directives are used together,
|
|
67
|
-
* they will generate the same modelModifiers prop,
|
|
68
|
-
* so a `$` suffix is added to avoid conflicts.
|
|
69
|
-
* @private
|
|
70
|
-
*/
|
|
66
|
+
* #13070 When v-model and v-model:model directives are used together,
|
|
67
|
+
* they will generate the same modelModifiers prop,
|
|
68
|
+
* so a `$` suffix is added to avoid conflicts.
|
|
69
|
+
* @private
|
|
70
|
+
*/
|
|
71
71
|
export declare const getModifierPropName: (name: string) => string;
|
|
72
72
|
export declare const hasChanged: (value: any, oldValue: any) => boolean;
|
|
73
73
|
export declare const invokeArrayFns: (fns: Function[], ...arg: any[]) => void;
|
|
74
74
|
export declare const def: (obj: object, key: string | symbol, value: any, writable?: boolean) => void;
|
|
75
75
|
/**
|
|
76
|
-
* "123-foo" will be parsed to 123
|
|
77
|
-
* This is used for the .number modifier in v-model
|
|
78
|
-
*/
|
|
76
|
+
* "123-foo" will be parsed to 123
|
|
77
|
+
* This is used for the .number modifier in v-model
|
|
78
|
+
*/
|
|
79
79
|
export declare const looseToNumber: (val: any) => any;
|
|
80
80
|
/**
|
|
81
|
-
* Only concerns number-like strings
|
|
82
|
-
* "123-foo" will be returned as-is
|
|
83
|
-
*/
|
|
81
|
+
* Only concerns number-like strings
|
|
82
|
+
* "123-foo" will be returned as-is
|
|
83
|
+
*/
|
|
84
84
|
export declare const toNumber: (val: any) => any;
|
|
85
85
|
export declare const getGlobalThis: () => any;
|
|
86
86
|
export declare function genPropsAccessExp(name: string): string;
|
|
@@ -89,119 +89,119 @@ export declare function canSetValueDirectly(tagName: string): boolean;
|
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region temp/packages/shared/src/patchFlags.d.ts
|
|
91
91
|
/**
|
|
92
|
-
* Patch flags are optimization hints generated by the compiler.
|
|
93
|
-
* when a block with dynamicChildren is encountered during diff, the algorithm
|
|
94
|
-
* enters "optimized mode". In this mode, we know that the vdom is produced by
|
|
95
|
-
* a render function generated by the compiler, so the algorithm only needs to
|
|
96
|
-
* handle updates explicitly marked by these patch flags.
|
|
97
|
-
*
|
|
98
|
-
* Patch flags can be combined using the | bitwise operator and can be checked
|
|
99
|
-
* using the & operator, e.g.
|
|
100
|
-
*
|
|
101
|
-
* ```js
|
|
102
|
-
* const flag = TEXT | CLASS
|
|
103
|
-
* if (flag & TEXT) { ... }
|
|
104
|
-
* ```
|
|
105
|
-
*
|
|
106
|
-
* Check the `patchElement` function in '../../runtime-core/src/renderer.ts' to see how the
|
|
107
|
-
* flags are handled during diff.
|
|
108
|
-
*/
|
|
92
|
+
* Patch flags are optimization hints generated by the compiler.
|
|
93
|
+
* when a block with dynamicChildren is encountered during diff, the algorithm
|
|
94
|
+
* enters "optimized mode". In this mode, we know that the vdom is produced by
|
|
95
|
+
* a render function generated by the compiler, so the algorithm only needs to
|
|
96
|
+
* handle updates explicitly marked by these patch flags.
|
|
97
|
+
*
|
|
98
|
+
* Patch flags can be combined using the | bitwise operator and can be checked
|
|
99
|
+
* using the & operator, e.g.
|
|
100
|
+
*
|
|
101
|
+
* ```js
|
|
102
|
+
* const flag = TEXT | CLASS
|
|
103
|
+
* if (flag & TEXT) { ... }
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* Check the `patchElement` function in '../../runtime-core/src/renderer.ts' to see how the
|
|
107
|
+
* flags are handled during diff.
|
|
108
|
+
*/
|
|
109
109
|
export declare enum PatchFlags {
|
|
110
110
|
/**
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
* Indicates an element with dynamic textContent (children fast path)
|
|
112
|
+
*/
|
|
113
113
|
TEXT = 1,
|
|
114
114
|
/**
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
* Indicates an element with dynamic class binding.
|
|
116
|
+
*/
|
|
117
117
|
CLASS = 2,
|
|
118
118
|
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
* Indicates an element with dynamic style
|
|
120
|
+
* The compiler pre-compiles static string styles into static objects
|
|
121
|
+
* + detects and hoists inline static objects
|
|
122
|
+
* e.g. `style="color: red"` and `:style="{ color: 'red' }"` both get hoisted
|
|
123
|
+
* as:
|
|
124
|
+
* ```js
|
|
125
|
+
* const style = { color: 'red' }
|
|
126
|
+
* render() { return e('div', { style }) }
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
129
|
STYLE = 4,
|
|
130
130
|
/**
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
* Indicates an element that has non-class/style dynamic props.
|
|
132
|
+
* Can also be on a component that has any dynamic props (includes
|
|
133
|
+
* class/style). when this flag is present, the vnode also has a dynamicProps
|
|
134
|
+
* array that contains the keys of the props that may change so the runtime
|
|
135
|
+
* can diff them faster (without having to worry about removed props)
|
|
136
|
+
*/
|
|
137
137
|
PROPS = 8,
|
|
138
138
|
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
* Indicates an element with props with dynamic keys. When keys change, a full
|
|
140
|
+
* diff is always needed to remove the old key. This flag is mutually
|
|
141
|
+
* exclusive with CLASS, STYLE and PROPS.
|
|
142
|
+
*/
|
|
143
143
|
FULL_PROPS = 16,
|
|
144
144
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
* Indicates an element that requires props hydration
|
|
146
|
+
* (but not necessarily patching)
|
|
147
|
+
* e.g. event listeners & v-bind with prop modifier
|
|
148
|
+
*/
|
|
149
149
|
NEED_HYDRATION = 32,
|
|
150
150
|
/**
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
* Indicates a fragment whose children order doesn't change.
|
|
152
|
+
*/
|
|
153
153
|
STABLE_FRAGMENT = 64,
|
|
154
154
|
/**
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
* Indicates a fragment with keyed or partially keyed children
|
|
156
|
+
*/
|
|
157
157
|
KEYED_FRAGMENT = 128,
|
|
158
158
|
/**
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
* Indicates a fragment with unkeyed children.
|
|
160
|
+
*/
|
|
161
161
|
UNKEYED_FRAGMENT = 256,
|
|
162
162
|
/**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
* Indicates an element that only needs non-props patching, e.g. ref or
|
|
164
|
+
* directives (onVnodeXXX hooks). since every patched vnode checks for refs
|
|
165
|
+
* and onVnodeXXX hooks, it simply marks the vnode so that a parent block
|
|
166
|
+
* will track it.
|
|
167
|
+
*/
|
|
168
168
|
NEED_PATCH = 512,
|
|
169
169
|
/**
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
* Indicates a component with dynamic slots (e.g. slot that references a v-for
|
|
171
|
+
* iterated value, or dynamic slot names).
|
|
172
|
+
* Components with this flag are always force updated.
|
|
173
|
+
*/
|
|
174
174
|
DYNAMIC_SLOTS = 1024,
|
|
175
175
|
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
* Indicates a fragment that was created only because the user has placed
|
|
177
|
+
* comments at the root level of a template. This is a dev-only flag since
|
|
178
|
+
* comments are stripped in production.
|
|
179
|
+
*/
|
|
180
180
|
DEV_ROOT_FRAGMENT = 2048,
|
|
181
181
|
/**
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
* SPECIAL FLAGS -------------------------------------------------------------
|
|
183
|
+
* Special flags are negative integers. They are never matched against using
|
|
184
|
+
* bitwise operators (bitwise matching should only happen in branches where
|
|
185
|
+
* patchFlag > 0), and are mutually exclusive. When checking for a special
|
|
186
|
+
* flag, simply check patchFlag === FLAG.
|
|
187
|
+
*/
|
|
188
188
|
/**
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
* Indicates a cached static vnode. This is also a hint for hydration to skip
|
|
190
|
+
* the entire sub tree since static content never needs to be updated.
|
|
191
|
+
*/
|
|
192
192
|
CACHED = -1,
|
|
193
193
|
/**
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
* A special flag that indicates that the diffing algorithm should bail out
|
|
195
|
+
* of optimized mode. For example, on block fragments created by renderSlot()
|
|
196
|
+
* when encountering non-compiler generated slots (i.e. manually written
|
|
197
|
+
* render functions, which should always be fully diffed)
|
|
198
|
+
* OR manually cloneVNodes
|
|
199
|
+
*/
|
|
200
200
|
BAIL = -2
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
|
-
* dev only flag -> name mapping
|
|
204
|
-
*/
|
|
203
|
+
* dev only flag -> name mapping
|
|
204
|
+
*/
|
|
205
205
|
export declare const PatchFlagNames: Record<PatchFlags, string>;
|
|
206
206
|
//#endregion
|
|
207
207
|
//#region temp/packages/shared/src/shapeFlags.d.ts
|
|
@@ -222,28 +222,28 @@ export declare enum ShapeFlags {
|
|
|
222
222
|
//#region temp/packages/shared/src/slotFlags.d.ts
|
|
223
223
|
export declare enum SlotFlags {
|
|
224
224
|
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
* Stable slots that only reference slot props or context state. The slot
|
|
226
|
+
* can fully capture its own dependencies so when passed down the parent won't
|
|
227
|
+
* need to force the child to update.
|
|
228
|
+
*/
|
|
229
229
|
STABLE = 1,
|
|
230
230
|
/**
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
231
|
+
* Slots that reference scope variables (v-for or an outer slot prop), or
|
|
232
|
+
* has conditional structure (v-if, v-for). The parent will need to force
|
|
233
|
+
* the child to update because the slot does not fully capture its dependencies.
|
|
234
|
+
*/
|
|
235
235
|
DYNAMIC = 2,
|
|
236
236
|
/**
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
* `<slot/>` being forwarded into a child component. Whether the parent needs
|
|
238
|
+
* to update the child is dependent on what kind of slots the parent itself
|
|
239
|
+
* received. This has to be refined at runtime, when the child's vnode
|
|
240
|
+
* is being created (in `normalizeChildren`)
|
|
241
|
+
*/
|
|
242
242
|
FORWARDED = 3
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
245
|
-
* Dev only
|
|
246
|
-
*/
|
|
245
|
+
* Dev only
|
|
246
|
+
*/
|
|
247
247
|
export declare const slotFlagsText: Record<SlotFlags, string>;
|
|
248
248
|
//#endregion
|
|
249
249
|
//#region temp/packages/shared/src/globalsAllowList.d.ts
|
|
@@ -264,77 +264,77 @@ export declare function normalizeProps(props: Record<string, any> | null): Recor
|
|
|
264
264
|
//#endregion
|
|
265
265
|
//#region temp/packages/shared/src/domTagConfig.d.ts
|
|
266
266
|
/**
|
|
267
|
-
* Compiler only.
|
|
268
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
269
|
-
*/
|
|
267
|
+
* Compiler only.
|
|
268
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
269
|
+
*/
|
|
270
270
|
export declare const isHTMLTag: (key: string) => boolean;
|
|
271
271
|
/**
|
|
272
|
-
* Compiler only.
|
|
273
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
274
|
-
*/
|
|
272
|
+
* Compiler only.
|
|
273
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
274
|
+
*/
|
|
275
275
|
export declare const isSVGTag: (key: string) => boolean;
|
|
276
276
|
/**
|
|
277
|
-
* Compiler only.
|
|
278
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
279
|
-
*/
|
|
277
|
+
* Compiler only.
|
|
278
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
279
|
+
*/
|
|
280
280
|
export declare const isMathMLTag: (key: string) => boolean;
|
|
281
281
|
/**
|
|
282
|
-
* Compiler only.
|
|
283
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
284
|
-
*/
|
|
282
|
+
* Compiler only.
|
|
283
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
284
|
+
*/
|
|
285
285
|
export declare const isVoidTag: (key: string) => boolean;
|
|
286
286
|
/**
|
|
287
|
-
* Compiler only.
|
|
288
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
289
|
-
*/
|
|
287
|
+
* Compiler only.
|
|
288
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
289
|
+
*/
|
|
290
290
|
export declare const isFormattingTag: (key: string) => boolean;
|
|
291
291
|
/**
|
|
292
|
-
* Compiler only.
|
|
293
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
294
|
-
*/
|
|
292
|
+
* Compiler only.
|
|
293
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
294
|
+
*/
|
|
295
295
|
export declare const isAlwaysCloseTag: (key: string) => boolean;
|
|
296
296
|
/**
|
|
297
|
-
* Compiler only.
|
|
298
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
299
|
-
*/
|
|
297
|
+
* Compiler only.
|
|
298
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
299
|
+
*/
|
|
300
300
|
export declare const isInlineTag: (key: string) => boolean;
|
|
301
301
|
/**
|
|
302
|
-
* Compiler only.
|
|
303
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
304
|
-
*/
|
|
302
|
+
* Compiler only.
|
|
303
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
304
|
+
*/
|
|
305
305
|
export declare const isBlockTag: (key: string) => boolean;
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region temp/packages/shared/src/domAttrConfig.d.ts
|
|
308
308
|
export declare const isSpecialBooleanAttr: (key: string) => boolean;
|
|
309
309
|
/**
|
|
310
|
-
* The full list is needed during SSR to produce the correct initial markup.
|
|
311
|
-
*/
|
|
310
|
+
* The full list is needed during SSR to produce the correct initial markup.
|
|
311
|
+
*/
|
|
312
312
|
export declare const isBooleanAttr: (key: string) => boolean;
|
|
313
313
|
/**
|
|
314
|
-
* Boolean attributes should be included if the value is truthy or ''.
|
|
315
|
-
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
316
|
-
*/
|
|
314
|
+
* Boolean attributes should be included if the value is truthy or ''.
|
|
315
|
+
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
316
|
+
*/
|
|
317
317
|
export declare function includeBooleanAttr(value: unknown): boolean;
|
|
318
318
|
export declare function isSSRSafeAttrName(name: string): boolean;
|
|
319
319
|
export declare const propsToAttrMap: Record<string, string | undefined>;
|
|
320
320
|
/**
|
|
321
|
-
* Known attributes, this is used for stringification of runtime static nodes
|
|
322
|
-
* so that we don't stringify bindings that cannot be set from HTML.
|
|
323
|
-
* Don't also forget to allow `data-*` and `aria-*`!
|
|
324
|
-
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
325
|
-
*/
|
|
321
|
+
* Known attributes, this is used for stringification of runtime static nodes
|
|
322
|
+
* so that we don't stringify bindings that cannot be set from HTML.
|
|
323
|
+
* Don't also forget to allow `data-*` and `aria-*`!
|
|
324
|
+
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
325
|
+
*/
|
|
326
326
|
export declare const isKnownHtmlAttr: (key: string) => boolean;
|
|
327
327
|
/**
|
|
328
|
-
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
329
|
-
*/
|
|
328
|
+
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
329
|
+
*/
|
|
330
330
|
export declare const isKnownSvgAttr: (key: string) => boolean;
|
|
331
331
|
/**
|
|
332
|
-
* Generated from https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute
|
|
333
|
-
*/
|
|
332
|
+
* Generated from https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute
|
|
333
|
+
*/
|
|
334
334
|
export declare const isKnownMathMLAttr: (key: string) => boolean;
|
|
335
335
|
/**
|
|
336
|
-
* Shared between server-renderer and runtime-core hydration logic
|
|
337
|
-
*/
|
|
336
|
+
* Shared between server-renderer and runtime-core hydration logic
|
|
337
|
+
*/
|
|
338
338
|
export declare function isRenderableAttrValue(value: unknown): boolean;
|
|
339
339
|
export declare function shouldSetAsAttr(tagName: string, key: string): boolean;
|
|
340
340
|
//#endregion
|
|
@@ -358,21 +358,21 @@ export declare function looseIndexOf(arr: any[], val: any): number;
|
|
|
358
358
|
//#endregion
|
|
359
359
|
//#region temp/packages/shared/src/toDisplayString.d.ts
|
|
360
360
|
/**
|
|
361
|
-
* For converting {{ interpolation }} values to displayed strings.
|
|
362
|
-
* @private
|
|
363
|
-
*/
|
|
361
|
+
* For converting {{ interpolation }} values to displayed strings.
|
|
362
|
+
* @private
|
|
363
|
+
*/
|
|
364
364
|
export declare const toDisplayString: (val: unknown) => string;
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region temp/packages/shared/src/typeUtils.d.ts
|
|
367
|
-
export type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
367
|
+
export type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
368
368
|
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
369
|
-
export type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P] };
|
|
369
|
+
export type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P]; };
|
|
370
370
|
export type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
371
371
|
export type IsKeyValues<T, K = string> = IfAny<T, false, T extends object ? (keyof T extends K ? true : false) : false>;
|
|
372
372
|
/**
|
|
373
|
-
* Utility for extracting the parameters from a function overload (for typed emits)
|
|
374
|
-
* https://github.com/microsoft/TypeScript/issues/32164#issuecomment-1146737709
|
|
375
|
-
*/
|
|
373
|
+
* Utility for extracting the parameters from a function overload (for typed emits)
|
|
374
|
+
* https://github.com/microsoft/TypeScript/issues/32164#issuecomment-1146737709
|
|
375
|
+
*/
|
|
376
376
|
export type OverloadParameters<T extends (...args: any[]) => any> = Parameters<OverloadUnion<T>>;
|
|
377
377
|
type OverloadProps<TOverload> = Pick<TOverload, keyof TOverload>;
|
|
378
378
|
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;
|
|
@@ -383,46 +383,46 @@ export declare function getSequence(arr: number[]): number[];
|
|
|
383
383
|
//#endregion
|
|
384
384
|
//#region temp/packages/shared/src/cssVars.d.ts
|
|
385
385
|
/**
|
|
386
|
-
* Normalize CSS var value created by `v-bind` in `<style>` block
|
|
387
|
-
* See https://github.com/vuejs/core/pull/12461#issuecomment-2495804664
|
|
388
|
-
*/
|
|
386
|
+
* Normalize CSS var value created by `v-bind` in `<style>` block
|
|
387
|
+
* See https://github.com/vuejs/core/pull/12461#issuecomment-2495804664
|
|
388
|
+
*/
|
|
389
389
|
export declare function normalizeCssVarValue(value: unknown): string;
|
|
390
390
|
//#endregion
|
|
391
391
|
//#region temp/packages/shared/src/vaporFlags.d.ts
|
|
392
392
|
/**
|
|
393
|
-
* Flags to optimize vapor `createFor` runtime behavior, shared between the
|
|
394
|
-
* compiler and the runtime
|
|
395
|
-
*/
|
|
393
|
+
* Flags to optimize vapor `createFor` runtime behavior, shared between the
|
|
394
|
+
* compiler and the runtime
|
|
395
|
+
*/
|
|
396
396
|
export declare enum VaporVForFlags {
|
|
397
397
|
/**
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
* v-for is the only child of a parent container, so it can take the fast
|
|
399
|
+
* path with textContent = '' when the whole list is emptied
|
|
400
|
+
*/
|
|
401
401
|
FAST_REMOVE = 1,
|
|
402
402
|
/**
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
403
|
+
* v-for used on a component-shaped item. Component items require structural
|
|
404
|
+
* removal before item scope cleanup and cannot use the fast-clear path. This
|
|
405
|
+
* does not guarantee the item block is a VaporComponentInstance: component
|
|
406
|
+
* fallback paths may still return a DOM Node.
|
|
407
|
+
*/
|
|
408
408
|
IS_COMPONENT = 2,
|
|
409
409
|
/**
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
* v-for inside v-once
|
|
411
|
+
*/
|
|
412
412
|
ONCE = 4,
|
|
413
413
|
/**
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
* v-for item block is a single DOM Node.
|
|
415
|
+
*/
|
|
416
416
|
IS_SINGLE_NODE = 8,
|
|
417
417
|
/**
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
418
|
+
* v-for item block is known to be a VaporFragment, so runtime can use
|
|
419
|
+
* fragment-specific insert/remove helpers.
|
|
420
|
+
*/
|
|
421
421
|
IS_FRAGMENT = 16,
|
|
422
422
|
/**
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
* v-for sits on a slot content/fallback root chain and can change slot
|
|
424
|
+
* validity.
|
|
425
|
+
*/
|
|
426
426
|
SLOT_ROOT = 32
|
|
427
427
|
}
|
|
428
428
|
export declare enum VaporBlockShape {
|
|
@@ -431,63 +431,63 @@ export declare enum VaporBlockShape {
|
|
|
431
431
|
MULTI_ROOT = 2
|
|
432
432
|
}
|
|
433
433
|
/**
|
|
434
|
-
* Bit layout for vapor `createIf` flags.
|
|
435
|
-
*
|
|
436
|
-
* - bits 0-1: true branch VaporBlockShape
|
|
437
|
-
* - bits 2-3: false branch VaporBlockShape
|
|
438
|
-
* - bit 4: v-once
|
|
439
|
-
* - bit 5: true branch is static and can skip branch-owned EffectScope
|
|
440
|
-
* - bit 6: false branch is static and can skip branch-owned EffectScope
|
|
441
|
-
* - bit 7: v-if sits on a slot content/fallback root chain
|
|
442
|
-
* - bits 8+: branch index + 1 for keyed dynamic fragments
|
|
443
|
-
*
|
|
444
|
-
* Examples:
|
|
445
|
-
* - v-once, true single-root, no false branch: 1 | ONCE = 17
|
|
446
|
-
* - keyed index 0, true/false single-root: 1 | (1 << 2) | (1 << 8) = 261
|
|
447
|
-
*/
|
|
434
|
+
* Bit layout for vapor `createIf` flags.
|
|
435
|
+
*
|
|
436
|
+
* - bits 0-1: true branch VaporBlockShape
|
|
437
|
+
* - bits 2-3: false branch VaporBlockShape
|
|
438
|
+
* - bit 4: v-once
|
|
439
|
+
* - bit 5: true branch is static and can skip branch-owned EffectScope
|
|
440
|
+
* - bit 6: false branch is static and can skip branch-owned EffectScope
|
|
441
|
+
* - bit 7: v-if sits on a slot content/fallback root chain
|
|
442
|
+
* - bits 8+: branch index + 1 for keyed dynamic fragments
|
|
443
|
+
*
|
|
444
|
+
* Examples:
|
|
445
|
+
* - v-once, true single-root, no false branch: 1 | ONCE = 17
|
|
446
|
+
* - keyed index 0, true/false single-root: 1 | (1 << 2) | (1 << 8) = 261
|
|
447
|
+
*/
|
|
448
448
|
export declare enum VaporIfFlags {
|
|
449
449
|
/**
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
* Documents the packed true/false branch shape bits. Runtime decode shifts
|
|
451
|
+
* to the selected branch first, then masks with 0b11 for one VaporBlockShape.
|
|
452
|
+
*/
|
|
453
453
|
BLOCK_SHAPE = 15,
|
|
454
454
|
/**
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
* Marks a branch that is created once and never updated.
|
|
456
|
+
*/
|
|
457
457
|
ONCE = 16,
|
|
458
458
|
/**
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
459
|
+
* The compiler proved that the true branch only returns static template nodes,
|
|
460
|
+
* so runtime can skip creating a branch-owned EffectScope.
|
|
461
|
+
*/
|
|
462
462
|
TRUE_NO_SCOPE = 32,
|
|
463
463
|
/**
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
464
|
+
* The compiler proved that the false branch only returns static template
|
|
465
|
+
* nodes, so runtime can skip creating a branch-owned EffectScope.
|
|
466
|
+
*/
|
|
467
467
|
FALSE_NO_SCOPE = 64,
|
|
468
468
|
/**
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
469
|
+
* v-if sits on a slot content/fallback root chain and can change slot
|
|
470
|
+
* validity.
|
|
471
|
+
*/
|
|
472
472
|
SLOT_ROOT = 128,
|
|
473
473
|
/**
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
474
|
+
* Shift for keyed branch index. The encoded value is index + 1, so decoded
|
|
475
|
+
* zero means "not keyed" and source index 0 still round-trips.
|
|
476
|
+
*/
|
|
477
477
|
INDEX_SHIFT = 8
|
|
478
478
|
}
|
|
479
479
|
/**
|
|
480
|
-
* Flags used by vapor template factories, shared between the compiler and the
|
|
481
|
-
* runtime.
|
|
482
|
-
*/
|
|
480
|
+
* Flags used by vapor template factories, shared between the compiler and the
|
|
481
|
+
* runtime.
|
|
482
|
+
*/
|
|
483
483
|
export declare enum TemplateFlags {
|
|
484
484
|
ROOT = 1,
|
|
485
485
|
STATIC = 2
|
|
486
486
|
}
|
|
487
487
|
/**
|
|
488
|
-
* Flags used by vapor slot outlets, shared between the compiler and the
|
|
489
|
-
* runtime.
|
|
490
|
-
*/
|
|
488
|
+
* Flags used by vapor slot outlets, shared between the compiler and the
|
|
489
|
+
* runtime.
|
|
490
|
+
*/
|
|
491
491
|
export declare enum VaporSlotFlags {
|
|
492
492
|
NO_SLOTTED = 1,
|
|
493
493
|
ONCE = 2,
|
|
@@ -501,4 +501,4 @@ export declare enum VaporDynamicComponentFlags {
|
|
|
501
501
|
ONCE = 2,
|
|
502
502
|
SLOT_ROOT = 4
|
|
503
503
|
}
|
|
504
|
-
//#endregion
|
|
504
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/shared v3.6.0-rc.
|
|
2
|
+
* @vue/shared v3.6.0-rc.6
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* \/\*#\_\_PURE\_\_\*\/
|
|
12
12
|
* So that they can be tree-shaken if necessary.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
15
15
|
function makeMap(str) {
|
|
16
16
|
const map = Object.create(null);
|
|
17
17
|
for (const key of str.split(",")) map[key] = 1;
|
|
@@ -59,9 +59,9 @@ const toRawType = (value) => {
|
|
|
59
59
|
};
|
|
60
60
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
61
61
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
62
|
-
const isReservedProp =
|
|
63
|
-
const isBuiltInTag =
|
|
64
|
-
const isBuiltInDirective =
|
|
62
|
+
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
63
|
+
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
64
|
+
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
65
65
|
const cacheStringFunction = (fn) => {
|
|
66
66
|
const cache = Object.create(null);
|
|
67
67
|
return ((str) => {
|
|
@@ -255,7 +255,7 @@ const slotFlagsText = {
|
|
|
255
255
|
[2]: "DYNAMIC",
|
|
256
256
|
[3]: "FORWARDED"
|
|
257
257
|
};
|
|
258
|
-
const isGloballyAllowed =
|
|
258
|
+
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");
|
|
259
259
|
/** @deprecated use `isGloballyAllowed` instead */
|
|
260
260
|
const isGloballyWhitelisted = isGloballyAllowed;
|
|
261
261
|
//#endregion
|
|
@@ -368,42 +368,42 @@ const BLOCK_TAGS = "address,article,aside,blockquote,dd,details,dialog,div,dl,dt
|
|
|
368
368
|
* Compiler only.
|
|
369
369
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
370
370
|
*/
|
|
371
|
-
const isHTMLTag =
|
|
371
|
+
const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
|
|
372
372
|
/**
|
|
373
373
|
* Compiler only.
|
|
374
374
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
375
375
|
*/
|
|
376
|
-
const isSVGTag =
|
|
376
|
+
const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
|
|
377
377
|
/**
|
|
378
378
|
* Compiler only.
|
|
379
379
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
380
380
|
*/
|
|
381
|
-
const isMathMLTag =
|
|
381
|
+
const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
382
382
|
/**
|
|
383
383
|
* Compiler only.
|
|
384
384
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
385
385
|
*/
|
|
386
|
-
const isVoidTag =
|
|
386
|
+
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
387
387
|
/**
|
|
388
388
|
* Compiler only.
|
|
389
389
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
390
390
|
*/
|
|
391
|
-
const isFormattingTag =
|
|
391
|
+
const isFormattingTag = /*@__PURE__*/ makeMap(FORMATTING_TAGS);
|
|
392
392
|
/**
|
|
393
393
|
* Compiler only.
|
|
394
394
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
395
395
|
*/
|
|
396
|
-
const isAlwaysCloseTag =
|
|
396
|
+
const isAlwaysCloseTag = /*@__PURE__*/ makeMap(ALWAYS_CLOSE_TAGS);
|
|
397
397
|
/**
|
|
398
398
|
* Compiler only.
|
|
399
399
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
400
400
|
*/
|
|
401
|
-
const isInlineTag =
|
|
401
|
+
const isInlineTag = /*@__PURE__*/ makeMap(INLINE_TAGS);
|
|
402
402
|
/**
|
|
403
403
|
* Compiler only.
|
|
404
404
|
* Do NOT use in runtime code paths unless behind `!!(process.env.NODE_ENV !== 'production')` flag.
|
|
405
405
|
*/
|
|
406
|
-
const isBlockTag =
|
|
406
|
+
const isBlockTag = /*@__PURE__*/ makeMap(BLOCK_TAGS);
|
|
407
407
|
//#endregion
|
|
408
408
|
//#region packages/shared/src/domAttrConfig.ts
|
|
409
409
|
/**
|
|
@@ -418,11 +418,11 @@ const isBlockTag = /* @__PURE__ */ makeMap(BLOCK_TAGS);
|
|
|
418
418
|
* - readonly -> readOnly
|
|
419
419
|
*/
|
|
420
420
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
421
|
-
const isSpecialBooleanAttr =
|
|
421
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
422
422
|
/**
|
|
423
423
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
424
424
|
*/
|
|
425
|
-
const isBooleanAttr =
|
|
425
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
426
426
|
/**
|
|
427
427
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
428
428
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -430,7 +430,7 @@ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,auto
|
|
|
430
430
|
function includeBooleanAttr(value) {
|
|
431
431
|
return !!value || value === "";
|
|
432
432
|
}
|
|
433
|
-
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
|
|
433
|
+
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
|
|
434
434
|
const attrValidationCache = {};
|
|
435
435
|
function isSSRSafeAttrName(name) {
|
|
436
436
|
if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
|
|
@@ -450,15 +450,15 @@ const propsToAttrMap = {
|
|
|
450
450
|
* Don't also forget to allow `data-*` and `aria-*`!
|
|
451
451
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
452
452
|
*/
|
|
453
|
-
const isKnownHtmlAttr =
|
|
453
|
+
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");
|
|
454
454
|
/**
|
|
455
455
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
456
456
|
*/
|
|
457
|
-
const isKnownSvgAttr =
|
|
457
|
+
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");
|
|
458
458
|
/**
|
|
459
459
|
* Generated from https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute
|
|
460
460
|
*/
|
|
461
|
-
const isKnownMathMLAttr =
|
|
461
|
+
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");
|
|
462
462
|
/**
|
|
463
463
|
* Shared between server-renderer and runtime-core hydration logic
|
|
464
464
|
*/
|
|
@@ -543,6 +543,21 @@ function looseCompareArrays(a, b) {
|
|
|
543
543
|
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
544
544
|
return equal;
|
|
545
545
|
}
|
|
546
|
+
function looseCompareCollections(a, b) {
|
|
547
|
+
if (a.size !== b.size) return false;
|
|
548
|
+
const candidates = Array.from(b);
|
|
549
|
+
const matched = new Uint8Array(candidates.length);
|
|
550
|
+
for (const item of a) {
|
|
551
|
+
let index = -1;
|
|
552
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
553
|
+
index = i;
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
if (index < 0) return false;
|
|
557
|
+
matched[index] = 1;
|
|
558
|
+
}
|
|
559
|
+
return true;
|
|
560
|
+
}
|
|
546
561
|
function looseEqual(a, b) {
|
|
547
562
|
if (a === b) return true;
|
|
548
563
|
let aValidType = isDate(a);
|
|
@@ -558,6 +573,12 @@ function looseEqual(a, b) {
|
|
|
558
573
|
bValidType = isObject(b);
|
|
559
574
|
if (aValidType || bValidType) {
|
|
560
575
|
if (!aValidType || !bValidType) return false;
|
|
576
|
+
aValidType = isMap(a);
|
|
577
|
+
bValidType = isMap(b);
|
|
578
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
579
|
+
aValidType = isSet(a);
|
|
580
|
+
bValidType = isSet(b);
|
|
581
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
561
582
|
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
562
583
|
for (const key in a) {
|
|
563
584
|
const aHasKey = a.hasOwnProperty(key);
|