ezh 0.1.6 → 0.2.1
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/lib/2.min.mjs +1 -0
- package/lib/3.min.mjs +1 -0
- package/lib/debugCheck.min.mjs +1 -0
- package/lib/index.d.ts +4 -4
- package/lib/index.min.mjs +1 -0
- package/package.json +5 -7
- package/lib/RbTree.js +0 -727
- package/lib/bundle.min.js +0 -1
- package/lib/debugCheck.d.ts +0 -2
- package/lib/debugCheck.js +0 -69
- package/lib/elements.js +0 -1256
- package/lib/index.js +0 -4
- package/lib/router.js +0 -111
- package/lib/state.js +0 -354
package/lib/2.min.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const __webpack_esm_id__=2;export const __webpack_esm_ids__=[2];export const __webpack_esm_modules__={179:(e,t,i)=>{i.d(t,{O:()=>c,Q:()=>s,R:()=>d,Z:()=>n});class r{ad(){return!this.k}G(e){for(;e.parent?.e;){let t=e.parent,i=t.parent;if(t===i.c){const r=i.d;r?.e?(t.e=!1,r.e=!1,i.e=!0,e=i):(e===t.d&&(e=t,this.y(e),t=e.parent,i=t.parent),t.e=!1,i.e=!0,this.z(i))}else{const r=i.c;!0===r?.e?(t.e=!1,r.e=!1,i.e=!0,e=i):(e===t.c&&(e=t,this.z(e),t=e.parent,i=t.parent),t.e=!1,i.e=!0,this.y(i))}}this.k.e=!1}r(e){const{c:t,d:i,parent:r}=e;if(!t)return r?(r.c===e?r.c=i:r.d=i,i?(i.parent=r,void(i.e=!1)):void(e.e||this.H(r))):(this.k=i,void(i&&(i.parent=void 0,i.e=!1)));if(!i)return r?r.c===e?r.c=t:r.d=t:this.k=t,t.parent=r,void(t.e=!1);let n,c,s=i;if(s.c){do{s=s.c}while(s.c);c=s.d,n=s.parent,n.c===s?n.c=c:n.d=c,c&&(c.parent=n),s.d=i,i.parent=s}else n=s,c=s.d;r?r.c===e?r.c=s:r.d=s:this.k=s,s.parent=r,s.c=t,t.parent=s;const d=s.e;s.e=e.e,c?c.e=!1:d||this.H(n)}H(e){let t,i;for(;;){if(t===e.c){if(i=e.d,i.e){this.y(e),i.e=!1,e.e=!0,i=e.d;continue}if(i.d?.e)return this.y(e),i.e=e.e,e.e=!1,void(i.d.e=!1);if(i.c?.e){i.c.e=!1,this.z(i),i.e=!0,i=e.d;continue}}else{if(i=e.c,i.e){this.z(e),i.e=!1,e.e=!0,i=e.c;continue}if(i.c?.e)return this.z(e),i.e=e.e,e.e=!1,void(i.c.e=!1);if(i.d?.e){i.d.e=!1,this.y(i),i.e=!0,i=e.c;continue}}if(e.e)return e.e=!1,void(i.e=!0);if(i.e=!0,t=e,!t.parent)return;e=t.parent}}y(e){const t=e.d;e.d=t?.c,t?.c&&(t.c.parent=e),t.parent=e.parent,e.parent?e===e.parent.c?e.parent.c=t:e.parent.d=t:this.k=t,t.c=e,e.parent=t}z(e){const t=e.c;e.c=t?.d,t?.d&&(t.d.parent=e),t.parent=e.parent,e.parent?e===e.parent.d?e.parent.d=t:e.parent.c=t:this.k=t,t.d=e,e.parent=t}k}const n=0,c=1,s=2;class d extends r{search(e){return this.I(e)?.value}delete(e){const t=this.I(e);if(t)return this.r(t),t.value}ap(e){let t=this.k;if(t){for(;t.c;)t=t.c;return e&&this.r(t),t.value}}M(e){let t=this.k;if(t){for(;t.d;)t=t.d;return e&&this.r(t),t.value}}_(e,t,i){let r=this.k;if(r){let n;for(;e!==r.key;){if(e<r.key){if(r.c){r=r.c;continue}n={key:e,value:t,e:!0,parent:r,c:void 0,d:void 0},r.c=n}else{if(r.d){r=r.d;continue}n={key:e,value:t,e:!0,parent:r,c:void 0,d:void 0},r.d=n}return void this.G(n)}const c=r.value;return i&&(r.value=t),c}this.k={key:e,value:t,e:!1,parent:void 0,c:void 0,d:void 0}}ae(e,t){let i=0,r=this.k;if(r){const n=[];if(void 0!==t)for(;;){if(t<r.key){if(r.c){n.push(r),r=r.c;continue}}else if(t>r.key){if(r.d){r=r.d;continue}return i}break}else for(;r.c;)n.push(r),r=r.c;let c;for(;;){const t=e(r.key,r.value);if(i++,2&t&&(c??(c=[])).push(r),1&t){i=-i;break}if(r.d)for(r=r.d;r.c;)n.push(r),r=r.c;else if(r=n.pop(),!r)break}if(c){let e=c.length;for(;e>0;)this.r(c[--e])}}return i}P(e,t){let i=0,r=this.k;if(r){const n=[];if(void 0!==t)for(;;){if(t>r.key){if(r.d){n.push(r),r=r.d;continue}}else if(t<r.key){if(r.c){r=r.c;continue}return i}break}else for(;r.d;)n.push(r),r=r.d;let c;for(;;){const t=e(r.key,r.value);if(i++,2&t&&(c??(c=[])).push(r),1&t){i=-i;break}if(r.c)for(r=r.c;r.d;)n.push(r),r=r.d;else if(r=n.pop(),!r)break}if(c){let e=c.length;for(;e>0;)this.r(c[--e])}}return i}I(e){let t=this.k;if(t)for(;e!==t.key;){if(e<t.key){if(t.c){t=t.c;continue}}else if(t.d){t=t.d;continue}return}return t}}}};
|
package/lib/3.min.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const __webpack_esm_id__=3;export const __webpack_esm_ids__=[3];export const __webpack_esm_modules__={707:(r,t,e)=>{e.d(t,{w:()=>v});var n=function(){return n=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var a in t=arguments[e])Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]);return r},n.apply(this,arguments)},a=function(r){return void 0===r&&(r={}),{arrayFormat:r.arrayFormat||"none",booleanFormat:r.booleanFormat||"none",nullFormat:r.nullFormat||"default"}},i=function(r){return encodeURIComponent(r)},o=function(r){return decodeURIComponent(r)},u=function(r,t){var e=a(t);return function(r){var t=r.indexOf("?");return-1===t?r:r.slice(t+1)}(r).split("&").reduce(function(r,t){var n=t.split("="),a=n[0],i=n[1],u=function(r){var t=r.indexOf("["),e=-1!==t;return{hasBrackets:e,name:e?r.slice(0,t):r}}(a),s=u.hasBrackets,c=u.name,l=r[c],f=function(r,t){if(void 0===r)return"empty-true"===t.booleanFormat||null;if("string"===t.booleanFormat){if("true"===r)return!0;if("false"===r)return!1}if("unicode"===t.booleanFormat){if("✓"===o(r))return!0;if("✗"===o(r))return!1}return"string"===t.nullFormat&&"null"===r?null:o(r)}(i,e);return r[c]=void 0===l?s?[f]:f:(Array.isArray(l)?l:[l]).concat(f),r},{})},s=/[^!$'()*+,;|:]/g,c=function(r){return r.replace(s,function(r){return encodeURIComponent(r)})},l={default:c,uri:encodeURI,uriComponent:encodeURIComponent,none:function(r){return r},legacy:encodeURI},f={default:decodeURIComponent,uri:decodeURI,uriComponent:decodeURIComponent,none:function(r){return r},legacy:decodeURIComponent},m=function(r,t,e){var n=l[t]||c;return e?String(r).split("/").map(n).join("/"):n(String(r))},p=function(r){return"("+(r?r.replace(/(^<|>$)/g,""):"[a-zA-Z0-9-_.~%':|=+\\*@$]+")+")"},h=[{name:"url-parameter",pattern:/^:([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(r){return new RegExp(p(r[2]))}},{name:"url-parameter-splat",pattern:/^\*([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/,regex:/([^?]*)/},{name:"url-parameter-matrix",pattern:/^;([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(r){return new RegExp(";"+r[1]+"="+p(r[2]))}},{name:"query-parameter",pattern:/^(?:\?|&)(?::)?([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/},{name:"delimiter",pattern:/^(\/|\?)/,regex:function(r){return new RegExp("\\"+r[0])}},{name:"sub-delimiter",pattern:/^(!|&|-|_|\.|;)/,regex:function(r){return new RegExp(r[0])}},{name:"fragment",pattern:/^([0-9a-zA-Z]+)/,regex:function(r){return new RegExp(r[0])}}],y=function r(t,e){if(void 0===e&&(e=[]),!h.some(function(n){var a=t.match(n.pattern);return!!a&&(e.push({type:n.name,match:a[0],val:a.slice(1,2),otherVal:a.slice(2),regex:n.regex instanceof Function?n.regex(a):n.regex}),a[0].length<t.length&&(e=r(t.substr(a[0].length),e)),!0)}))throw new Error("Could not parse path '"+t+"'");return e},d=function(r){return null!=r},g={urlParamsEncoding:"default"},v=function(){function r(r,t){if(!r)throw new Error("Missing path in Path constructor");this.path=r,this.options=n(n({},g),t),this.tokens=y(r),this.hasUrlParams=this.tokens.filter(function(r){return/^url-parameter/.test(r.type)}).length>0,this.hasSpatParam=this.tokens.filter(function(r){return/splat$/.test(r.type)}).length>0,this.hasMatrixParams=this.tokens.filter(function(r){return/matrix$/.test(r.type)}).length>0,this.hasQueryParams=this.tokens.filter(function(r){return/^query-parameter/.test(r.type)}).length>0,this.spatParams=this.getParams("url-parameter-splat"),this.urlParams=this.getParams(/^url-parameter/),this.queryParams=this.getParams("query-parameter"),this.params=this.urlParams.concat(this.queryParams),this.source=this.tokens.filter(function(r){return void 0!==r.regex}).map(function(r){return r.regex.source}).join("")}return r.createPath=function(t,e){return new r(t,e)},r.prototype.isQueryParam=function(r){return-1!==this.queryParams.indexOf(r)},r.prototype.isSpatParam=function(r){return-1!==this.spatParams.indexOf(r)},r.prototype.test=function(r,t){var e=this,a=n(n({caseSensitive:!1,strictTrailingSlash:!1},this.options),t),i=function(r,t){return t||"\\/"===r?r:r.replace(/\\\/$/,"")+"(?:\\/)?"}(this.source,a.strictTrailingSlash),o=this.urlTest(r,i+(this.hasQueryParams?"(\\?.*$|$)":"$"),a.caseSensitive,a.urlParamsEncoding);if(!o||!this.hasQueryParams)return o;var s=u(r,a.queryParams);return 0===Object.keys(s).filter(function(r){return!e.isQueryParam(r)}).length?(Object.keys(s).forEach(function(r){return o[r]=s[r]}),o):null},r.prototype.partialTest=function(r,t){var e=this,a=n(n({caseSensitive:!1,delimited:!0},this.options),t),i=function(r,t){return t?/(\/)$/.test(r)?r:r+"(\\/|\\?|\\.|;|$)":r}(this.source,a.delimited),o=this.urlTest(r,i,a.caseSensitive,a.urlParamsEncoding);if(!o)return o;if(!this.hasQueryParams)return o;var s=u(r,a.queryParams);return Object.keys(s).filter(function(r){return e.isQueryParam(r)}).forEach(function(r){return function(r,t,e){void 0===e&&(e="");var n=r[t];return r[t]=void 0===n?e:Array.isArray(n)?n.concat(e):[n,e],r}(o,r,s[r])}),o},r.prototype.build=function(r,t){var e=this;void 0===r&&(r={});var o=n(n({ignoreConstraints:!1,ignoreSearch:!1,queryParams:{}},this.options),t),u=Object.keys(r).filter(function(r){return!e.isQueryParam(r)}).reduce(function(t,n){if(!d(r[n]))return t;var a=r[n],i=e.isSpatParam(n);return"boolean"==typeof a?t[n]=a:Array.isArray(a)?t[n]=a.map(function(r){return m(r,o.urlParamsEncoding,i)}):t[n]=m(a,o.urlParamsEncoding,i),t},{});if(this.urlParams.some(function(t){return!d(r[t])})){var s=this.urlParams.filter(function(t){return!d(r[t])});throw new Error("Cannot build path: '"+this.path+"' requires missing parameters { "+s.join(", ")+" }")}if(!o.ignoreConstraints&&!this.tokens.filter(function(r){return/^url-parameter/.test(r.type)&&!/-splat$/.test(r.type)}).every(function(r){return new RegExp("^"+p(r.otherVal[0])+"$").test(u[r.val])}))throw new Error("Some parameters of '"+this.path+"' are of invalid format");var c=this.tokens.filter(function(r){return!1===/^query-parameter/.test(r.type)}).map(function(r){return"url-parameter-matrix"===r.type?";"+r.val+"="+u[r.val[0]]:/^url-parameter/.test(r.type)?u[r.val[0]]:r.match}).join("");if(o.ignoreSearch)return c;var l=function(r,t){var e=a(t);return Object.keys(r).filter(function(t){return void 0!==r[t]}).map(function(t){return function(r,t,e){return null===t?function(r,t){return"hidden"===t.nullFormat?"":"string"===t.nullFormat?r+"=null":r}(r,e):"boolean"==typeof t?function(r,t,e){return"empty-true"===e.booleanFormat&&t?r:r+"="+("unicode"===e.booleanFormat?t?"✓":"✗":t.toString())}(r,t,e):Array.isArray(t)?function(r,t,e){var n=function(r){return"index"===r.arrayFormat?function(r,t){return r+"["+t+"]"}:"brackets"===r.arrayFormat?function(r){return r+"[]"}:function(r){return r}}(e);return t.map(function(t,e){return n(r,e)+"="+i(t)}).join("&")}(r,t,e):r+"="+i(t)}(t,r[t],e)}).filter(Boolean).join("&")}(this.queryParams.filter(function(t){return-1!==Object.keys(r).indexOf(t)}).reduce(function(t,e){return t[e]=r[e],t},{}),o.queryParams);return l?c+"?"+l:c},r.prototype.getParams=function(r){var t=r instanceof RegExp?function(t){return r.test(t.type)}:function(t){return t.type===r};return this.tokens.filter(t).map(function(r){return r.val[0]})},r.prototype.urlTest=function(r,t,e,n){var a=this,i=new RegExp("^"+t,e?"":"i"),o=r.match(i);return o?this.urlParams.length?o.slice(1,this.urlParams.length+1).reduce(function(r,t,e){return r[a.urlParams[e]]=(f[n]||decodeURIComponent)(t),r},{}):{}:null},r}()}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t,i={468:(e,t,i)=>{var r=i(179);const n={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBrailleLabel:"aria-braillelabel",ariaBrailleRoleDescription:"aria-brailleroledescription",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",alignmentBaseline:"alignment-baseline",annotationXml:"annotation-xml",baselineShift:"baseline-shift",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",style:"style",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",unicodeBidi:"unicode-bidi",vectorEffect:"vector-effect",wordSpacing:"word-spacing",writingMode:"writing-mode"},s={},a=[];Object.freeze(s),Object.freeze(a);const o=()=>!1,l=[],h=new Set,c=new r.R,d=new r.R,f=[],u=[],p={id:"",index:0,firstElement:null,attachTo:o,move:o,detachFrom:o,update:o,refresh:o,release:o,version:1,markChanged:o,watchMountChange:o};let m="";const b=new r.R,g=new Map;let v=p,w=1,x=(e,t)=>document.createElement(e);const y={svg:(e,t)=>(t.a4(),document.createElementNS("http://www.w3.org/2000/svg",e)),math:(e,t)=>(t.a4(),document.createElementNS("http://www.w3.org/1998/Math/MathML",e)),foreignObject:(e,t)=>"foreignObject"!==e?document.createElement(e):(t.a4(),document.createElementNS("http://www.w3.org/2000/svg",e))},k=(e,t)=>{const i=["",t];for(;e.constructor!==T;)i.push(e.id),e=e.parent;return i.reverse().join(",")},C=()=>{let e;for(;e=b.ap(!0);){const{id:t,newChildren:i,parent:r}=e;i&&(r&&B(r)?(e.refresh(i),r.currentBefore=void 0):e.version&&c._(t,e))}w++;for(const{parent:e,element:t}of l){if(t.parent!==e&&!d.ad()&&B(e)){const i=!t.parent,n=k(e,t.id);d.ae((e,t)=>e.startsWith(n)?(t.z(t.a0,i),r.Q):r.O,n)}t.parent||t.release()}l.length=0},E=(e,t=[],i=0)=>{let r=e[i];for(;;){if(r&&void 0!==r.id)t.push(r);else if(null!=r)switch(typeof r){case"object":E(r,t);break;case"function":r=r();continue;case"boolean":case"number":case"bigint":r=""+r;default:t.push(new O("",r))}if(!(++i<e.length))break;r=e[i]}return t},S=(e,t,i)=>{let r;const n=e.length;let s=t,a=0;for(;a<n;){const t=e[a];if(t!==s[a]){if(a===s.length)return s;const e=s[a];if(!e||void 0===e.id){s=E(s,s.slice(0,a),a);continue}if(r!==s)break}r||t.parent===i||(r=e),a++}return a===s.length?r:s===t?E(s,e.slice(0,a),a):s},B=e=>{let t=e;do{if(t.parent===t)return!0;t=t.parent}while(t);return!1},j=(e,t,i,r)=>{let n,s,a;if(t!==e&&e.length){const o=[];let l;for(s=t.length,n=1e7;--s>=0;)if(a=t[s],a.parent===i){const e=s-a.index;e===n?(l.C++,a.index=s):(l={from:a.index,to:s,C:1},n=e,a.index=-o.push(l))}else 1e7!==n&&(n=1e7);const h=[];for(s=e.length-1;s>=0;)a=e[s],a.index<0?(l=o[-a.index-1],h.push(l),s-=l.C):(a.detachFrom(i),s--);let c,d,f=0;for(s=t.length-1;s>=0;)if(a=t[s],a.parent!==i)a.index=s--,a.attachTo(i);else{if(l=o[-a.index-1],d=l.C,c=h[f],a.index=s,!r){if(c===l){f++,s-=l.C,i.currentBefore=void 0;continue}if(c.from>l.from){n=f;do{d-=c.C,c=h[++n]}while(c.from>l.from&&d>0);if(d>0){s-=l.C,i.currentBefore=void 0,f=n;continue}}}n=s-l.C;do{a.move()}while(--s>n&&(a=t[s]))}}else for(s=t.length-1;s>=0;s--)a=t[s],a.index=s,i!==a.parent&&a.attachTo(i);i.currentBefore=void 0};class O{constructor(e,t){this.id=e,this.index=0,this.ab=t}id;parent;index;firstElement;attachTo(e){this.firstElement||(this.firstElement=document.createTextNode(this.ab));const{parent:t,firstElement:i,index:r}=this;this.id&&(t?(l.push({parent:t,element:this}),i.remove()):h.delete(this)),this.parent=e;let n=e.currentBefore;void 0===n&&(n=e.findNextSiblingElement(r)),e.element.insertBefore(i,n),e.currentBefore=i}move(){const{parent:e,index:t,firstElement:i}=this;let r=e.currentBefore;void 0===r&&(r=e.findNextSiblingElement(t)),e.element.insertBefore(i,r),e.currentBefore=i}detachFrom(e){this.parent===e&&(this.firstElement.remove(),this.parent=void 0,this.id&&l.push({parent:e,element:this}))}update(e){return this.ab!==e&&(this.ab=e,this.firstElement&&(this.firstElement.nodeValue=e)),!1}refresh(){}release(e){this.parent===e&&(e&&this.firstElement.remove(),g.delete(this.id))}ab}class _{constructor(e,t,i){this.id=e,this.index=0,this.newChildren=this.d=i?E(t):t||a}id;parent;index;newChildren;currentBefore;get element(){return this.parent.element}get firstElement(){const{d:e}=this;for(let t=0;t<e.length;t++){const i=e[t].firstElement;if(i)return i}return null}attachTo(e){const{parent:t,d:i,newChildren:r}=this;if(t){l.push({parent:t,element:this});for(let e=i.length-1;e>=0;e--)i[e].detachFrom(this)}else h.delete(this);this.parent=e;const n=r||i;for(let e=n.length-1;e>=0;e--){const t=n[e];t.index=e,t.attachTo(this)}e.currentBefore=this.currentBefore,this.currentBefore=void 0,this.d=n,this.newChildren=void 0}move(){const{d:e,newChildren:t}=this;if(t)j(e,t,this,!0),this.d=t,this.newChildren=void 0;else{for(let t=e.length-1;t>=0;t--)e[t].move();this.currentBefore=void 0}}detachFrom(e){if(this.parent===e){const{d:t}=this;for(const e of t)e.detachFrom(this);this.parent=void 0,l.push({parent:e,element:this})}}update(e,t){if(t){const e=S(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){j(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(this.parent===e){if(e){const{d:e}=this;for(const t of e)t.detachFrom(this)}g.delete(this.id)}}findNextSiblingElement(e){const t=this.newChildren||this.d;let i,r=e+1,n=t[r];for(;n;){if(i=n.firstElement,i)return i;n=t[++r]}return i=this.parent.currentBefore,void 0!==i?i:this.parent.findNextSiblingElement(this.index)}d}class ${constructor(e,t,i,r,n,o){if(this.id=e,this.index=0,this.firstElement=this.element=x(t,this),this.newChildren=this.d=o?E(r):r||a,i){if(this.n=s,this.s=-1,"select"===t){const e=this.element,t=i,r=t.value;if(r){t.value=void 0;const i=this.refresh;this.refresh=n=>{if(j(this.d,n,this),this.d=n,this.newChildren=void 0,Array.isArray(r)){const t=r,[i,n,s]=t;e.value=s;const a=t[3]=e=>i[n]=e.target.value;e.addEventListener("change",a)}else e.value=r;t.value=r,this.refresh=i}}}this.update(i),this.s=n??0}else this.n=i,this.s=0}id;element;parent;newChildren;index;currentBefore;firstElement;attachTo(e){const{parent:t,element:i,newChildren:r,index:n}=this;t?(l.push({parent:t,element:this}),i.remove()):h.delete(this),this.parent=e,r&&this.refresh(r);let s=e.currentBefore;void 0===s&&(s=e.findNextSiblingElement(n)),e.element.insertBefore(i,s),e.currentBefore=i}move(){const{parent:e,newChildren:t,index:i,element:r}=this;t&&this.refresh(t);let n=e.currentBefore;void 0===n&&(n=e.findNextSiblingElement(i)),e.element.insertBefore(r,n),e.currentBefore=r}detachFrom(e){this.parent===e&&(this.element.remove(),this.parent=void 0,l.push({parent:e,element:this}))}update(e,t){const{element:i,n:r,s:a}=this;if(r&&a){this.n=e;let t=a;for(const a in e){const o=e[a],l=r[a];if(o!==l)if(null!=o)switch(typeof o){case"string":{const e=n[a];e?i.setAttribute(e,o):i[a]=o;break}case"number":case"boolean":case"function":i[a]=o;break;default:if(Array.isArray(o)){const[e,t,r]=o;if(l){const[n,s,h,c]=l;if(h!==r&&i[a]!==r&&(i[a]=r),n===e&&s===t)o[3]=c;else{const r=o[3]=i=>e[t]=i.target[a];i.removeEventListener("change",c),i.addEventListener("change",r)}}else{i[a]=r;const n=o[3]=i=>e[t]=i.target[a];i.addEventListener("change",n)}break}if("style"===a){if(!l){const t=i.style,r={};let n=0;for(const e in o){const i=o[e];r[e]=i,n++,t[e]=i}e[a]=r,r.j=n;break}const t=i.style,r={};let n=0,s=l.j;for(const e in o){const i=o[e];r[e]=i,e in l&&s--,n++,i!==l[a]&&(t[e]=i)}if(e[a]=r,r.j=n,s)for(const e in l)if(!(e in o)&&(t[e]=null,! --s))break;break}i[a]=o}else switch(typeof l){case"string":{const e=n[a];e?this.element.removeAttribute(e):this.element[a]=o;break}case"object":l?Array.isArray(l)?i.removeEventListener("change",l[3]):l===s&&(i[a]=o):i[a]=o;break;default:i[a]=o}if(! --t)break}}if(t){const e=S(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){j(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(this.parent===e){e&&this.element.remove();const{d:t}=this;for(const e of t)e.release(this);g.delete(this.id)}}findNextSiblingElement(e){const t=this.newChildren||this.d;let i,r=e+1,n=t[r];for(;n;){if(i=n.firstElement,i)return i;n=t[++r]}return null}a4(){this.update=this.aO}aO(e,t){const{element:i,n:r,s}=this;if(r&&s){this.n=e;let t=s;for(const s in e){const a=e[s],o=r[s];if(a!==o)if(null!=a)switch(typeof a){case"string":i.setAttribute(n[s]??s,a);break;case"number":case"boolean":i.setAttribute(n[s]??s,""+a);break;case"function":i[s]=a;break;default:if("style"===s){if(!o){const t=i.style,r={};let n=0;for(const e in a){const i=a[e];r[e]=i,n++,t[e]=i}e[s]=r,r.j=n;break}const t=i.style,r={};let n=0,l=o.j;for(const e in a){const i=a[e];r[e]=i,e in o&&l--,n++,i!==o[s]&&(t[e]=i)}if(e[s]=r,r.j=n,l)for(const e in o)if(!(e in a)&&(t[e]=null,! --l))break;break}i[s]=a}else switch(typeof o){case"string":case"number":case"boolean":i.removeAttribute(n[s]??s);break;default:i[s]=a}if(! --t)break}}if(t){const e=S(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}n;d;s}class A{constructor(e,t,i,r,n,s){this.id=e,this.index=0,this.version=1,this.aB=t,this.n=i,this.newChildren=this.d=s?E(r):r||a,this.s=n??0}id;parent;newChildren;index;version;get firstElement(){return this.i?.firstElement||null}attachTo(e){const{parent:t,newChildren:i,i:r}=this;this.parent=e,i?this.refresh(i):r&&(r.index=this.index,r.attachTo(e)),t?l.push({parent:t,element:this}):h.delete(this)}move(){const{newChildren:e,i:t}=this;e?this.refresh(e):t&&(t.index=this.index,t.move())}detachFrom(e){this.parent===e&&(this.i?.detachFrom(e),this.parent=void 0,l.push({parent:e,element:this}))}update(e,t){const{n:i,d:r,s:n}=this;if(this.n=e,t){const e=S(r,t,this.parent);if(e)return this.newChildren=e,!0}if(!this.newChildren&&n){let t=n;for(const n in i){if(i[n]!==e[n])return this.newChildren=r,!0;if(! --t)break}}return!1}refresh(e){const{id:t,parent:i,i:n,index:a}=this,o=v;v=this;let l=this.aB(this.n||s,e);if(l!==n)switch(typeof l){case"boolean":case"number":case"bigint":l=""+l;case"string":l=new O("",l),this.i=l,l.index=a,l.attachTo(i),n?.detachFrom(i);break;default:l?(this.i=l,l.index=a,l.attachTo(i),n?.detachFrom(i),c.ad()||c.ae((e,i)=>e.startsWith(t)?i.parent&&B(i.parent)?(b._(e,i),r.Q):r.Z:r.O,t)):(this.i=void 0,n?.detachFrom(i))}else n&&(n.parent!==i?(n.index=a,n.attachTo(i)):n.index!==a&&(n.index=a,n.move()));this.d=e,this.newChildren=void 0,v=o}release(e){this.parent===e&&(this.i?.release(e),this.parent=void 0,this.newChildren&&c.delete(this.id),g.delete(this.id))}markChanged(){return!this.newChildren&&(this.newChildren=this.d,!0)}watchMountChange(e,t,i){const r=k(this.parent,this.id);d._(r+e,{z:t,a0:i},!0)}aB;n;d;s;i}class T{constructor(e,t){this.id=e,this.element=t,this.parent=this}id;element;parent;currentBefore;findNextSiblingElement(e){return null}render(e){this.ac||(this.ac=new A(this.id,e,null,a),g.set(this.id,this.ac),this.ac.attachTo(this),w++)}ac}let M=(e,t)=>{const i=e[t];if(i){for(const[e,t]of i){const i=g.get(e);i?.version===t&&i.markChanged()&&(b.ad()&&queueMicrotask(C),b._(e,i))}i.clear()}};const N=()=>{m=u.pop()};var R;!function(e){e.render=(e,t)=>{const i=(f.length||"")+"|",r=new T(i,e);f.push(r),r.render(t)},e.$=(e,t,i,r,n,s)=>{const a=`${v.id}${e}${m}`;let o=g.get(a);return o?((i||r)&&o.update(i,r)&&b._(a,o),o):(o=new $(a,t,i,r,n,s),g.set(a,o),o)},e.$c=(e,t,i,r,n,s)=>{const a=`${v.id}${e}${m}`;let o=g.get(a);return o?((i||r)&&o.update(i,r)&&b._(a,o),o):(o=new A(a,t,i,r,n,s),g.set(a,o),o)},e.$f=(e,t,i)=>{const r=`${v.id}${e}${m}`;let n=g.get(r);return n?(t&&n.update(null,t)&&b._(r,n),n):(n=new _(r,t,i),g.set(r,n),n)},e.$k=e=>(u.push(m),m=`${m||"{"}${e}}`,N),e.$n=e=>{const t=x;return x=y[e],()=>{x=t}},e.$s=(e,t)=>(e(),t),e.$t=(e,t,i)=>{const r=`${v.id}${e}${m}`;let n=g.get(r);return n?(i&&n.update(t),n):(n=new O(r,t),g.set(n.id,n),n)}}(R||(R={}));const F=Symbol(),L=Array.prototype,z=(e,t)=>{if(v.id){let i=e[t];i||(i=new Map,e[t]=i),i.set(v.id,v.version)}};let P=(e,t)=>{P=M,P(e,t)};const I=new WeakMap,D=e=>function(...t){const i=this.length;let r,n,s;switch(e){case L.push:r=i,n=r+t.length,s=i;break;case L.unshift:r=0,n=t.length,s=i;break;case L.fill:r=t[1],void 0===r||r<=-i?r=0:r<0&&(r=i+r),n=t[2],void 0===n||n>i?n=i:n<=-i?n=0:n<0&&(n=i+n),s=n;break;case L.sort:case L.reverse:r=n=0,s=i;break;case L.pop:r=n=i-1,s=i;break;case L.shift:r=n=0,s=i;break;default:r=t[0],r<0&&(r=i+r),n=t.length>2?t.length-2:0,s=t[1],void 0===s&&(s=i-r),s=s>0?s!==n?i:r+n:n?i:r,n+=r}const a=e.bind(this)(...t),o=this[F];let l;for(let e=r;e<n;e++){switch(l=this[e],typeof l){case"object":if(l){for(;e<n;)l=this[e],l&&!l[F]&&(this[e]=H(l)),e++;break}case"undefined":continue}break}return i!==this.length&&P(o,"length"),P(o,Symbol.iterator),a},V={push:D(L.push),unshift:D(L.unshift),fill:D(L.fill),sort:D(L.sort),reverse:D(L.reverse),pop:D(L.pop),shift:D(L.shift),splice:D(L.splice)},W={get(e,t){if(t!==F){let i=e[t];if(i&&i===L[t]){const r=V[t];if(r)return r.bind(e);i=i.bind(e)}return z(e[F],"length"!==t?Symbol.iterator:t),i}return e},set(e,t,i){if(t!==F){if(e[t]===i)return!0;const r=e[F];return i&&"object"==typeof i&&(i=H(i)),e[t]=i,"length"===t&&P(r,t),P(r,Symbol.iterator),!0}return((e,t)=>{const i=t.length,r=e.length;let n;for(let r=0;r<i;r++){let s=t[r];if(s&&"object"==typeof s){do{s=t[r],n=e[r],s?n?n!==s&&(n[F]=s):e[r]=H(s):e[r]=s}while(++r<i);break}if(null!=s){do{e[r]=t[r]}while(++r<i);break}e[r]=s}const s=e[F];r!==i&&(r>i&&(e.length=i),P(s,"length")),P(s,Symbol.iterator)})(e,i),!0},has:(e,t)=>(z(e[F],isNaN(parseInt(t))?t:Symbol.iterator),t in e),deleteProperty:(e,t)=>(isNaN(parseInt(t))||(t=Symbol.iterator),void 0!==e[t]&&P(e[F],t),delete e[t])},q={get(e,t){if(t!==F){const i=e[t];return"id"!==t&&z(e[F],t),i}return e},set(e,t,i,r){if(t!==F){if(e[t]===i)return!0;const r=e[F];return i&&"object"==typeof i&&(i=H(i)),e[t]=i,P(r,t),!0}return((e,t,i)=>{const r={...e};let n;for(const s in i){delete r[s];const a=i[s];a&&"object"==typeof a&&(n=e[s],n)?n[F]=a:e[s]!==a&&(t[s]=a)}for(const e in r)delete t[e]})(e,r,i),!0},has:(e,t)=>(z(e[F],t),t in e),deleteProperty:(e,t)=>(void 0!==e[t]&&P(e[F],t),delete e[t])},H=e=>{let t;if(Array.isArray(e)){t=[];const i=e.length;for(let r=0;r<i;r++){let n=e[r];if(n&&"object"==typeof n){do{t[r]=(n=e[r])&&H(n)}while(++r<i);break}if(null!=n){do{t[r]=e[r]}while(++r<i);break}t[r]=n}e=new Proxy(t,W)}else{t={};for(const i in e){const r=e[i];t[i]=r&&"object"==typeof r?H(r):r}e=new Proxy(t,q)}return t[F]={},e},Q=(e,t)=>{const i=new Error(e),r=i.stack;if(r){const e=r.indexOf("\n");let n=e;for(let e=0;e<t;e++)n=r.indexOf("\n",n+1);i.stack=r.substring(0,e)+r.substring(n)}return i},K=(e,t)=>{const{get:i,set:r}=e;e.get=function(e){const r=i.bind(this)(e);if(r)return v.id&&(r.f<w?r.f=w:t()),r.data},e.set=function(e,t){const i={f:w,data:t};return r.bind(this)(e,i)}},X=M;let Z=!1;const G=(e,t)=>{if(v.id)throw Q("Models should not be modified while rendering",3);Z=!0,X(e,t),Z=!1};(()=>{M=G,K(g,()=>{throw Q('This element already exists, "key" prop is required when it is in a loop',5)}),K(I,()=>{throw Q('The "useState" function can only be called once in the com function',4)});const e=g.get;g.get=function(t){if(!Z&&!v.id)throw Q("All the elements must be in a closure that passed to h.render()",3);return e.bind(this)(t)}})()}},r={};function n(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return i[e](s,s.exports,n),s.exports}n.m=i,e=[],n.O=(t,i,r,s)=>{if(!i){var a=1/0;for(c=0;c<e.length;c++){for(var[i,r,s]=e[c],o=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(n.O).every(e=>n.O[e](i[l]))?i.splice(l--,1):(o=!1,s<a&&(a=s));if(o){e.splice(c--,1);var h=r();void 0!==h&&(t=h)}}return t}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[i,r,s]},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{n as __webpack_require__};t={0:0},n.C=e=>{var i,r,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:o}=e,l=0;for(i in a)n.o(a,i)&&(n.m[i]=a[i]);for(o&&o(n);l<s.length;l++)r=s[l],n.o(t,r)&&t[r]&&t[r][0](),t[s[l]]=0;n.O()},n.O.j=e=>0===t[e];import*as s from"./2.min.mjs";n.C(s);var a=n.O(void 0,[2],()=>n(468));a=n.O(a);
|
package/lib/index.d.ts
CHANGED
|
@@ -482,9 +482,9 @@ export type RouteLinkProp<ParamT extends object> = {
|
|
|
482
482
|
children?: ChildElement[] | ChildElement;
|
|
483
483
|
};
|
|
484
484
|
export interface INameSpaceChecker {
|
|
485
|
-
|
|
485
|
+
a4(): void;
|
|
486
486
|
}
|
|
487
|
-
declare const
|
|
487
|
+
declare const av: Record<string, (w: string, K: INameSpaceChecker) => Element>;
|
|
488
488
|
export declare const addComReader: (readerRecord: ReaderRecord, key: string | symbol | number) => void;
|
|
489
489
|
export declare let refreshComReaders: (readerRecord: ReaderRecord, key: string | symbol | number) => void;
|
|
490
490
|
export declare const configGC: (waitIntervals: number, interval?: number) => boolean;
|
|
@@ -495,7 +495,7 @@ export declare namespace $ezh {
|
|
|
495
495
|
const $c: <P extends object>(id: string, entry: Com<P>, props: P | null, children?: ChildElement[], check?: number, mutableChild?: 1) => IEzElement;
|
|
496
496
|
const $f: (id: string, children?: ChildElement[], mutableChild?: 1) => IEzElement;
|
|
497
497
|
const $k: (key: string | number) => (() => void);
|
|
498
|
-
const $n: (ns: keyof typeof
|
|
498
|
+
const $n: (ns: keyof typeof av) => (() => void);
|
|
499
499
|
const $s: (cb: () => void, element: IEzElement) => IEzElement;
|
|
500
500
|
const $t: (id: string, text: string, mayChange?: 1) => IEzElement;
|
|
501
501
|
namespace JSX {
|
|
@@ -517,7 +517,7 @@ export declare const bindData: <T extends State<T>, K extends keyof T>(data: T,
|
|
|
517
517
|
K,
|
|
518
518
|
T[K]
|
|
519
519
|
];
|
|
520
|
-
export declare const useState: <T extends State<T>>(initial: T
|
|
520
|
+
export declare const useState: <T extends State<T>>(initial: T, hook?: (ver: number, state: T) => void) => T;
|
|
521
521
|
export declare const navigate: (to: string, replace?: true) => void;
|
|
522
522
|
export declare const route: <ParamT extends object>(com: Com<ParamT>, path: string, needAuth?: boolean) => IRoute<ParamT>;
|
|
523
523
|
export declare const Router: Com<RouterProp>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t,i={441:(e,t,i)=>{i.d(t,{ye:()=>D,N_:()=>fe,Wt:()=>ue,Ix:()=>ce,On:()=>P,er:()=>ee,te:()=>z,oo:()=>se,LU:()=>F,wE:()=>he,J0:()=>te});var r=i(179);const n={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBrailleLabel:"aria-braillelabel",ariaBrailleRoleDescription:"aria-brailleroledescription",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",alignmentBaseline:"alignment-baseline",annotationXml:"annotation-xml",baselineShift:"baseline-shift",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",style:"style",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",unicodeBidi:"unicode-bidi",vectorEffect:"vector-effect",wordSpacing:"word-spacing",writingMode:"writing-mode"},s={},a=[];Object.freeze(s),Object.freeze(a);const o=()=>!1,l=[],h=new Set,c=new r.R,d=new r.R,f=[],u=[],p={id:"",index:0,firstElement:null,attachTo:o,move:o,detachFrom:o,update:o,refresh:o,release:o,version:1,markChanged:o,watchMountChange:o};let m,b="",v=2e4,w=0,g=0;const y=new r.R,k=new Map;let x=p,C=(e,t)=>document.createElement(e);const E={svg:(e,t)=>(t.a4(),document.createElementNS("http://www.w3.org/2000/svg",e)),math:(e,t)=>(t.a4(),document.createElementNS("http://www.w3.org/1998/Math/MathML",e)),foreignObject:(e,t)=>"foreignObject"!==e?document.createElement(e):(t.a4(),document.createElementNS("http://www.w3.org/2000/svg",e))},S=()=>{if(++g>=w){for(const e of h)if(h.delete(e),e.id)e.release();else if(--g<w){h.add(e);break}}else h.add(Object.create(p));m&&(m=setTimeout(S,v))},$=(e,t)=>{const i=["",t];for(;e.constructor!==L;)i.push(e.id),e=e.parent;return i.reverse().join(",")},B=()=>{let e;for(;e=y.ap(!0);){const{id:t,newChildren:i,parent:r}=e;i&&(r&&O(r)?(e.refresh(i),r.currentBefore=void 0):e.version&&c._(t,e))}for(const{parent:e,element:t}of l){if(t.parent!==e&&!d.ad()&&O(e)){const i=!t.parent,n=$(e,t.id);d.ae((e,t)=>e.startsWith(n)?(t.z(t.a0,i),r.Q):r.O,n)}t.parent||(w?h.add(t):t.release())}l.length=0},j=(e,t=[],i=0)=>{let r=e[i];for(;;){if(r&&void 0!==r.id)t.push(r);else if(null!=r)switch(typeof r){case"object":j(r,t);break;case"function":r=r();continue;case"boolean":case"number":case"bigint":r=""+r;default:t.push(new N("",r))}if(!(++i<e.length))break;r=e[i]}return t},_=(e,t,i)=>{let r;const n=e.length;let s=t,a=0;for(;a<n;){const t=e[a];if(t!==s[a]){if(a===s.length)return s;const e=s[a];if(!e||void 0===e.id){s=j(s,s.slice(0,a),a);continue}if(r!==s)break}r||t.parent===i||(r=e),a++}return a===s.length?r:s===t?j(s,e.slice(0,a),a):s},O=e=>{let t=e;do{if(t.parent===t)return!0;t=t.parent}while(t);return!1},A=(e,t,i,r)=>{let n,s,a;if(t!==e&&e.length){const o=[];let l;for(s=t.length,n=1e7;--s>=0;)if(a=t[s],a.parent===i){const e=s-a.index;e===n?(l.C++,a.index=s):(l={from:a.index,to:s,C:1},n=e,a.index=-o.push(l))}else 1e7!==n&&(n=1e7);const h=[];for(s=e.length-1;s>=0;)a=e[s],a.index<0?(l=o[-a.index-1],h.push(l),s-=l.C):(a.detachFrom(i),s--);let c,d,f=0;for(s=t.length-1;s>=0;)if(a=t[s],a.parent!==i)a.index=s--,a.attachTo(i);else{if(l=o[-a.index-1],d=l.C,c=h[f],a.index=s,!r){if(c===l){f++,s-=l.C,i.currentBefore=void 0;continue}if(c.from>l.from){n=f;do{d-=c.C,c=h[++n]}while(c.from>l.from&&d>0);if(d>0){s-=l.C,i.currentBefore=void 0,f=n;continue}}}n=s-l.C;do{a.move()}while(--s>n&&(a=t[s]))}}else for(s=t.length-1;s>=0;s--)a=t[s],a.index=s,i!==a.parent&&a.attachTo(i);i.currentBefore=void 0};class N{constructor(e,t){this.id=e,this.index=0,this.ab=t}id;parent;index;firstElement;attachTo(e){this.firstElement||(this.firstElement=document.createTextNode(this.ab));const{parent:t,firstElement:i,index:r}=this;this.id&&(t?(l.push({parent:t,element:this}),i.remove()):h.delete(this)),this.parent=e;let n=e.currentBefore;void 0===n&&(n=e.findNextSiblingElement(r)),e.element.insertBefore(i,n),e.currentBefore=i}move(){const{parent:e,index:t,firstElement:i}=this;let r=e.currentBefore;void 0===r&&(r=e.findNextSiblingElement(t)),e.element.insertBefore(i,r),e.currentBefore=i}detachFrom(e){this.parent===e&&(this.firstElement.remove(),this.parent=void 0,this.id&&l.push({parent:e,element:this}))}update(e){return this.ab!==e&&(this.ab=e,this.firstElement&&(this.firstElement.nodeValue=e)),!1}refresh(){}release(e){this.parent===e&&(e&&this.firstElement.remove(),k.delete(this.id))}ab}class R{constructor(e,t,i){this.id=e,this.index=0,this.newChildren=this.d=i?j(t):t||a}id;parent;index;newChildren;currentBefore;get element(){return this.parent.element}get firstElement(){const{d:e}=this;for(let t=0;t<e.length;t++){const i=e[t].firstElement;if(i)return i}return null}attachTo(e){const{parent:t,d:i,newChildren:r}=this;if(t){l.push({parent:t,element:this});for(let e=i.length-1;e>=0;e--)i[e].detachFrom(this)}else h.delete(this);this.parent=e;const n=r||i;for(let e=n.length-1;e>=0;e--){const t=n[e];t.index=e,t.attachTo(this)}e.currentBefore=this.currentBefore,this.currentBefore=void 0,this.d=n,this.newChildren=void 0}move(){const{d:e,newChildren:t}=this;if(t)A(e,t,this,!0),this.d=t,this.newChildren=void 0;else{for(let t=e.length-1;t>=0;t--)e[t].move();this.currentBefore=void 0}}detachFrom(e){if(this.parent===e){const{d:t}=this;for(const e of t)e.detachFrom(this);this.parent=void 0,l.push({parent:e,element:this})}}update(e,t){if(t){const e=_(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){A(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(this.parent===e){if(e){const{d:e}=this;for(const t of e)t.detachFrom(this)}k.delete(this.id)}}findNextSiblingElement(e){const t=this.newChildren||this.d;let i,r=e+1,n=t[r];for(;n;){if(i=n.firstElement,i)return i;n=t[++r]}return i=this.parent.currentBefore,void 0!==i?i:this.parent.findNextSiblingElement(this.index)}d}class M{constructor(e,t,i,r,n,o){if(this.id=e,this.index=0,this.firstElement=this.element=C(t,this),this.newChildren=this.d=o?j(r):r||a,i){if(this.n=s,this.s=-1,"select"===t){const e=this.element,t=i,r=t.value;if(r){t.value=void 0;const i=this.refresh;this.refresh=n=>{if(A(this.d,n,this),this.d=n,this.newChildren=void 0,Array.isArray(r)){const t=r,[i,n,s]=t;e.value=s;const a=t[3]=e=>i[n]=e.target.value;e.addEventListener("change",a)}else e.value=r;t.value=r,this.refresh=i}}}this.update(i),this.s=n??0}else this.n=i,this.s=0}id;element;parent;newChildren;index;currentBefore;firstElement;attachTo(e){const{parent:t,element:i,newChildren:r,index:n}=this;t?(l.push({parent:t,element:this}),i.remove()):h.delete(this),this.parent=e,r&&this.refresh(r);let s=e.currentBefore;void 0===s&&(s=e.findNextSiblingElement(n)),e.element.insertBefore(i,s),e.currentBefore=i}move(){const{parent:e,newChildren:t,index:i,element:r}=this;t&&this.refresh(t);let n=e.currentBefore;void 0===n&&(n=e.findNextSiblingElement(i)),e.element.insertBefore(r,n),e.currentBefore=r}detachFrom(e){this.parent===e&&(this.element.remove(),this.parent=void 0,l.push({parent:e,element:this}))}update(e,t){const{element:i,n:r,s:a}=this;if(r&&a){this.n=e;let t=a;for(const a in e){const o=e[a],l=r[a];if(o!==l)if(null!=o)switch(typeof o){case"string":{const e=n[a];e?i.setAttribute(e,o):i[a]=o;break}case"number":case"boolean":case"function":i[a]=o;break;default:if(Array.isArray(o)){const[e,t,r]=o;if(l){const[n,s,h,c]=l;if(h!==r&&i[a]!==r&&(i[a]=r),n===e&&s===t)o[3]=c;else{const r=o[3]=i=>e[t]=i.target[a];i.removeEventListener("change",c),i.addEventListener("change",r)}}else{i[a]=r;const n=o[3]=i=>e[t]=i.target[a];i.addEventListener("change",n)}break}if("style"===a){if(!l){const t=i.style,r={};let n=0;for(const e in o){const i=o[e];r[e]=i,n++,t[e]=i}e[a]=r,r.j=n;break}const t=i.style,r={};let n=0,s=l.j;for(const e in o){const i=o[e];r[e]=i,e in l&&s--,n++,i!==l[a]&&(t[e]=i)}if(e[a]=r,r.j=n,s)for(const e in l)if(!(e in o)&&(t[e]=null,! --s))break;break}i[a]=o}else switch(typeof l){case"string":{const e=n[a];e?this.element.removeAttribute(e):this.element[a]=o;break}case"object":l?Array.isArray(l)?i.removeEventListener("change",l[3]):l===s&&(i[a]=o):i[a]=o;break;default:i[a]=o}if(! --t)break}}if(t){const e=_(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){A(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(this.parent===e){e&&this.element.remove();const{d:t}=this;for(const e of t)e.release(this);k.delete(this.id)}}findNextSiblingElement(e){const t=this.newChildren||this.d;let i,r=e+1,n=t[r];for(;n;){if(i=n.firstElement,i)return i;n=t[++r]}return null}a4(){this.update=this.aO}aO(e,t){const{element:i,n:r,s}=this;if(r&&s){this.n=e;let t=s;for(const s in e){const a=e[s],o=r[s];if(a!==o)if(null!=a)switch(typeof a){case"string":i.setAttribute(n[s]??s,a);break;case"number":case"boolean":i.setAttribute(n[s]??s,""+a);break;case"function":i[s]=a;break;default:if("style"===s){if(!o){const t=i.style,r={};let n=0;for(const e in a){const i=a[e];r[e]=i,n++,t[e]=i}e[s]=r,r.j=n;break}const t=i.style,r={};let n=0,l=o.j;for(const e in a){const i=a[e];r[e]=i,e in o&&l--,n++,i!==o[s]&&(t[e]=i)}if(e[s]=r,r.j=n,l)for(const e in o)if(!(e in a)&&(t[e]=null,! --l))break;break}i[s]=a}else switch(typeof o){case"string":case"number":case"boolean":i.removeAttribute(n[s]??s);break;default:i[s]=a}if(! --t)break}}if(t){const e=_(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}n;d;s}class T{constructor(e,t,i,r,n,s){this.id=e,this.index=0,this.version=1,this.aB=t,this.n=i,this.newChildren=this.d=s?j(r):r||a,this.s=n??0}id;parent;newChildren;index;version;get firstElement(){return this.i?.firstElement||null}attachTo(e){const{parent:t,newChildren:i,i:r}=this;this.parent=e,i?this.refresh(i):r&&(r.index=this.index,r.attachTo(e)),t?l.push({parent:t,element:this}):h.delete(this)}move(){const{newChildren:e,i:t}=this;e?this.refresh(e):t&&(t.index=this.index,t.move())}detachFrom(e){this.parent===e&&(this.i?.detachFrom(e),this.parent=void 0,l.push({parent:e,element:this}))}update(e,t){const{n:i,d:r,s:n}=this;if(this.n=e,t){const e=_(r,t,this.parent);if(e)return this.newChildren=e,!0}if(!this.newChildren&&n){let t=n;for(const n in i){if(i[n]!==e[n])return this.newChildren=r,!0;if(! --t)break}}return!1}refresh(e){const{id:t,parent:i,i:n,index:a}=this,o=x;x=this;let l=this.aB(this.n||s,e);if(l!==n)switch(typeof l){case"boolean":case"number":case"bigint":l=""+l;case"string":l=new N("",l),this.i=l,l.index=a,l.attachTo(i),n?.detachFrom(i);break;default:l?(this.i=l,l.index=a,l.attachTo(i),n?.detachFrom(i),c.ad()||c.ae((e,i)=>e.startsWith(t)?i.parent&&O(i.parent)?(y._(e,i),r.Q):r.Z:r.O,t)):(this.i=void 0,n?.detachFrom(i))}else n&&(n.parent!==i?(n.index=a,n.attachTo(i)):n.index!==a&&(n.index=a,n.move()));this.d=e,this.newChildren=void 0,x=o}release(e){this.parent===e&&(this.i?.release(e),this.parent=void 0,this.newChildren&&c.delete(this.id),k.delete(this.id))}markChanged(){return!this.newChildren&&(this.newChildren=this.d,!0)}watchMountChange(e,t,i){const r=$(this.parent,this.id);d._(r+e,{z:t,a0:i},!0)}aB;n;d;s;i}class L{constructor(e,t){this.id=e,this.element=t,this.parent=this}id;element;parent;currentBefore;findNextSiblingElement(e){return null}render(e){this.ac||(this.ac=new T(this.id,e,null,a),k.set(this.id,this.ac),this.ac.attachTo(this))}ac}const P=(e,t)=>{if(x.id){let i=e[t];i||(i=new Map,e[t]=i),i.set(x.id,x.version)}};let F=(e,t)=>{const i=e[t];if(i){for(const[e,t]of i){const i=k.get(e);i?.version===t&&i.markChanged()&&(y.ad()&&queueMicrotask(B),y._(e,i))}i.clear()}};const z=(e,t=2e4)=>{if(e>=0&&t>=1e3){if(v=t,w&&clearTimeout(m),e)m=setTimeout(S,v);else if(m){m=void 0;for(let e=0;e<w;e++)S()}return w=e,!0}return!1},I=()=>{b=u.pop()};var D;!function(e){e.render=(e,t)=>{const i=(f.length||"")+"|",r=new L(i,e);f.push(r),r.render(t)},e.$=(e,t,i,r,n,s)=>{const a=`${x.id}${e}${b}`;let o=k.get(a);return o?((i||r)&&o.update(i,r)&&y._(a,o),o):(o=new M(a,t,i,r,n,s),k.set(a,o),o)},e.$c=(e,t,i,r,n,s)=>{const a=`${x.id}${e}${b}`;let o=k.get(a);return o?((i||r)&&o.update(i,r)&&y._(a,o),o):(o=new T(a,t,i,r,n,s),k.set(a,o),o)},e.$f=(e,t,i)=>{const r=`${x.id}${e}${b}`;let n=k.get(r);return n?(t&&n.update(null,t)&&y._(r,n),n):(n=new R(r,t,i),k.set(r,n),n)},e.$k=e=>(u.push(b),b=`${b||"{"}${e}}`,I),e.$n=e=>{const t=C;return C=E[e],()=>{C=t}},e.$s=(e,t)=>(e(),t),e.$t=(e,t,i)=>{const r=`${x.id}${e}${b}`;let n=k.get(r);return n?(i&&n.update(t),n):(n=new N(r,t),k.set(n.id,n),n)}}(D||(D={}));const W=Symbol(),V=Array.prototype,U=P;let q=(e,t)=>{q=F,q(e,t)},H=!1;const J=new WeakMap,Q=e=>function(...t){const i=this.length;let r,n,s;switch(e){case V.push:r=i,n=r+t.length,s=i;break;case V.unshift:r=0,n=t.length,s=i;break;case V.fill:r=t[1],void 0===r||r<=-i?r=0:r<0&&(r=i+r),n=t[2],void 0===n||n>i?n=i:n<=-i?n=0:n<0&&(n=i+n),s=n;break;case V.sort:case V.reverse:r=n=0,s=i;break;case V.pop:r=n=i-1,s=i;break;case V.shift:r=n=0,s=i;break;default:r=t[0],r<0&&(r=i+r),n=t.length>2?t.length-2:0,s=t[1],void 0===s&&(s=i-r),s=s>0?s!==n?i:r+n:n?i:r,n+=r}const a=e.bind(this)(...t),o=this[W];let l;for(let e=r;e<n;e++){switch(l=this[e],typeof l){case"object":if(l){for(;e<n;)l=this[e],l&&!l[W]&&(this[e]=X(l)),e++;break}case"undefined":continue}break}return i!==this.length&&q(o,"length"),q(o,Symbol.iterator),a},Z={push:Q(V.push),unshift:Q(V.unshift),fill:Q(V.fill),sort:Q(V.sort),reverse:Q(V.reverse),pop:Q(V.pop),shift:Q(V.shift),splice:Q(V.splice)},G={get(e,t){if(t!==W){let i=e[t];if(i&&i===V[t]){const r=Z[t];if(r)return r.bind(e);i=i.bind(e)}return U(e[W],"length"!==t?Symbol.iterator:t),i}return e},set(e,t,i){if(t!==W){if(e[t]===i)return!0;const r=e[W];return i&&"object"==typeof i&&(i=X(i)),e[t]=i,"length"===t&&q(r,t),q(r,Symbol.iterator),!0}return((e,t)=>{const i=t.length,r=e.length;let n;for(let r=0;r<i;r++){let s=t[r];if(s&&"object"==typeof s){do{s=t[r],n=e[r],s?n?n!==s&&(n[W]=s):e[r]=X(s):e[r]=s}while(++r<i);break}if(null!=s){do{e[r]=t[r]}while(++r<i);break}e[r]=s}const s=e[W];r!==i&&(r>i&&(e.length=i),q(s,"length")),q(s,Symbol.iterator)})(e,i),!0},has:(e,t)=>(U(e[W],isNaN(parseInt(t))?t:Symbol.iterator),t in e),deleteProperty:(e,t)=>(isNaN(parseInt(t))||(t=Symbol.iterator),void 0!==e[t]&&q(e[W],t),delete e[t])},K={get(e,t){if(t!==W){const i=e[t];return"id"!==t&&U(e[W],t),i}return e},set(e,t,i,r){if(t!==W){if(e[t]===i)return!0;const r=e[W];return i&&"object"==typeof i&&(i=X(i)),e[t]=i,q(r,t),!0}return((e,t,i)=>{const r={...e};let n;for(const s in i){delete r[s];const a=i[s];a&&"object"==typeof a&&(n=e[s],n)?n[W]=a:e[s]!==a&&(t[s]=a)}for(const e in r)delete t[e]})(e,r,i),!0},has:(e,t)=>(U(e[W],t),t in e),deleteProperty:(e,t)=>(void 0!==e[t]&&q(e[W],t),delete e[t])},X=e=>{let t;if(Array.isArray(e)){t=[];const i=e.length;for(let r=0;r<i;r++){let n=e[r];if(n&&"object"==typeof n){do{t[r]=(n=e[r])&&X(n)}while(++r<i);break}if(null!=n){do{t[r]=e[r]}while(++r<i);break}t[r]=n}e=new Proxy(t,G)}else{t={};for(const i in e){const r=e[i];t[i]=r&&"object"==typeof r?X(r):r}e=new Proxy(t,K)}return t[W]={},e},Y=(e,t)=>{t?(e.ver=0,e.hook(0,e.state)):e.com.watchMountChange("s",Y,e)},ee=(e,t)=>[e,t,e[t]],te=(e,t)=>{const i=x;if(i.id){let r=J.get(i);if(r){const{state:e,hook:t}=r;return t&&(r.ver||i.watchMountChange("s",Y,r),H=!0,t(++r.ver,e),H=!1),e}const n=X(e);return r={com:i,state:n,ver:1,hook:t},J.set(i,r),t&&(i.watchMountChange("s",Y,r),H=!0,t(1,n),H=!1),n}return X(e)};var ie=i(707);let re=0;const ne=te({ver:0});window.addEventListener("popstate",()=>{ne.ver=++re});const se=(e,t)=>{const{pathname:i,search:r,hash:n}=window.location;e!==`${i}${r}${n}`&&(t?window.history.replaceState(void 0,"",e):window.history.pushState(void 0,"",e),queueMicrotask(()=>{ne.ver=++re}))},ae="ezhEZH";class oe{constructor(e,t,i){this.com=e,this.b=ie.w.createPath(t+ae),this.needAuth=i}com;needAuth;parseParam(e){const t=this.b.test(e);if(t)return delete t[ae],t}buildUrl(e){throw new Error("WildcardRoute does not support buildUrl")}b}class le{constructor(e,t,i){this.com=e,this.b=ie.w.createPath(t),this.needAuth=i}com;needAuth;parseParam(e){return this.b.test(e)}buildUrl(e){return this.b.build(e)}b}const he=(e,t,i=!0)=>t.endsWith("*")?new oe(e,t,i):new le(e,t,i),ce=({routes:e,notFound:t,checkAuth:i})=>{re=ne.ver;const{pathname:r,search:n,hash:s}=window.location,a=`${r}${n}${s}`,{$s:o,$k:l,$c:h}=D;for(const t in e){const r=e[t],n=r.parseParam(a);if(n){if(i&&r.needAuth){const e=i(a);if(e)return void se(e)}return o(l(t),h("_",r.com,n,void 0,-1))}}return t?o(l("404"),h("_",t,{})):void 0},de=(e,t,i)=>{e.preventDefault();const{pathname:r,search:n,hash:s}=window.location;t!==`${r}${n}${s}`&&(i?window.history.replaceState(void 0,"",t):window.history.pushState(void 0,"",t),ne.ver=++re)},fe=(e,t)=>{const{href:i,className:r,style:n,title:s,replace:a}=e,o=i?e=>de(e,i,a):void 0;return D.$("_","a",{className:r,style:n,title:s,href:i,onclick:o},t,-1,1)},ue=(e,t)=>{const{route:i,params:r,className:n,style:s,title:a,replace:o}=e,l=i.buildUrl(r);return D.$("_","a",{className:n,style:s,title:a,href:l,onclick:e=>de(e,l,o)},t,-1,1)}}},r={};function n(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return i[e](s,s.exports,n),s.exports}n.m=i,e=[],n.O=(t,i,r,s)=>{if(!i){var a=1/0;for(c=0;c<e.length;c++){for(var[i,r,s]=e[c],o=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(n.O).every(e=>n.O[e](i[l]))?i.splice(l--,1):(o=!1,s<a&&(a=s));if(o){e.splice(c--,1);var h=r();void 0!==h&&(t=h)}}return t}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[i,r,s]},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{n as __webpack_require__};t={1:0},n.C=e=>{var i,r,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:o}=e,l=0;for(i in a)n.o(a,i)&&(n.m[i]=a[i]);for(o&&o(n);l<s.length;l++)r=s[l],n.o(t,r)&&t[r]&&t[r][0](),t[s[l]]=0;n.O()},n.O.j=e=>0===t[e];import*as s from"./3.min.mjs";n.C(s);import*as a from"./2.min.mjs";n.C(a);var o=n.O(void 0,[3,2],()=>n(441));const l=(o=n.O(o)).ye,h=o.N_,c=o.Wt,d=o.Ix,f=o.On,u=o.er,p=o.te,m=o.oo,b=o.LU,v=o.wE,w=o.J0;export{l as $ezh,h as Link,c as RouteLink,d as Router,f as addComReader,u as bindData,p as configGC,m as navigate,b as refreshComReaders,v as route,w as useState};
|
package/package.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ezh",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "webpack serve"
|
|
6
6
|
},
|
|
7
7
|
"files": [
|
|
8
8
|
"./lib/*"
|
|
9
9
|
],
|
|
10
|
-
"module": "./lib/index.
|
|
10
|
+
"module": "./lib/index.min.mjs",
|
|
11
11
|
"typings": "./lib/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"default": "./lib/index.
|
|
14
|
+
"default": "./lib/index.min.mjs",
|
|
15
15
|
"types": "./lib/index.d.ts"
|
|
16
16
|
},
|
|
17
17
|
"./debug-check": {
|
|
18
|
-
"default": "./lib/debugCheck.
|
|
19
|
-
"types": "./lib/debugCheck.d.ts"
|
|
18
|
+
"default": "./lib/debugCheck.min.mjs"
|
|
20
19
|
}
|
|
21
20
|
},
|
|
22
21
|
"keywords": [
|
|
@@ -27,7 +26,6 @@
|
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"@eslint/eslintrc": "^3.2.0",
|
|
29
28
|
"@eslint/js": "^9.19.0",
|
|
30
|
-
"@types/jest": "^29.5.1",
|
|
31
29
|
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
|
32
30
|
"@typescript-eslint/parser": "^8.25.0",
|
|
33
31
|
"css-loader": "^7.1.2",
|
|
@@ -35,7 +33,7 @@
|
|
|
35
33
|
"eslint": "^9.21.0",
|
|
36
34
|
"eslint-plugin-import": "^2.31.0",
|
|
37
35
|
"ezh-trans": "^0.2.0",
|
|
38
|
-
"globals": "^
|
|
36
|
+
"globals": "^16.5.0",
|
|
39
37
|
"log-class": "^1.0.2",
|
|
40
38
|
"minify-ts": "^1.2.4",
|
|
41
39
|
"sass": "^1.86.0",
|