solely 0.2.3 → 0.2.4
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/README.md +1209 -1168
- package/dist/router/router-view.cjs +1 -1
- package/dist/router/router-view.d.ts +2 -1
- package/dist/router/router-view.js +1 -1
- package/dist/runtime/component/base-element.cjs +1 -1
- package/dist/runtime/component/base-element.js +1 -1
- package/dist/runtime/renderer/renderIR.cjs +1 -1
- package/dist/runtime/renderer/renderIR.js +1 -1
- package/package.json +2 -2
- package/dist/router/routes copy.d.ts +0 -6
- package/dist/shared/gen-function copy.d.ts +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=Object.defineProperty,
|
|
1
|
+
"use strict";var t=Object.defineProperty,i=(i,s,e)=>((i,s,e)=>s in i?t(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e)(i,"symbol"!=typeof s?s+"":s,e);Object.defineProperties(exports,{t:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./core.cjs"),e=require("../runtime/component/base-element.cjs"),n=require("../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;const r=new Map;let h=class extends e.default{constructor(){super(...arguments),i(this,"unsubscribe"),i(this,"level",0),i(this,"currentElement",null),i(this,"currentTagName",null),i(this,"routerAttrs",new Set),i(this,"prevPropKeys",new Set),i(this,"scheduled",!1),i(this,"latestLoadId",0),i(this,"abortController",null),i(this,"router",null)}async mounted(){this.detectLevel(),this.router=await s.routerReady,this.unsubscribe=this.router.listen(()=>{this.scheduleLoad()}),this.loadRoute(this.router.getCurrentRoute())}unmounted(){var t;null==(t=this.unsubscribe)||t.call(this)}scheduleLoad(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.loadRoute(this.router.getCurrentRoute())}))}detectLevel(){let t=0,i=this.parentElement;for(;i;)i instanceof h&&t++,i=i.parentElement;this.level=t}async loadRoute(t){this.abortController&&(this.abortController.abort(),this.abortController=null);const i=++this.latestLoadId,s=null==t?void 0:t.matched[this.level];if(!s)return void this.handleEmptyRoute();const{config:e}=s;let n=e.tagName;if(!n&&"function"==typeof e.component){this.clear(),this.renderLoading(),this.abortController=new AbortController;const t=this.abortController.signal;try{const s=await e.component();if(t.aborted||i!==this.latestLoadId)return;n="string"==typeof s?s:s.tagName}catch(h){if(t.aborted||i!==this.latestLoadId)return;return this.renderError(`Load Error: ${h}`),this.currentElement=null,void(this.currentTagName=null)}finally{this.abortController&&!t.aborted&&(this.abortController=null)}}if(i!==this.latestLoadId)return;if(!n)return void this.clear();if(!e.forceReload&&this.currentElement&&this.currentTagName===n.toLowerCase())return void this.syncState(this.currentElement,null==t?void 0:t.params,(null==t?void 0:t.query)||{},e.props);this.clear();const r=this.getOrCreateComponent(n,e);this.syncState(r,null==t?void 0:t.params,(null==t?void 0:t.query)||{},e.props),this.appendChild(r),this.currentElement=r,this.currentTagName=n.toLowerCase()}getOrCreateComponent(t,i){const s=`${this.level}-${t.toLowerCase()}`;if(i.keepAlive&&r.has(s))return r.get(s);const e=document.createElement(t);return i.keepAlive&&r.set(s,e),e}syncState(t,i,s,e={}){const n=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=new Map;Object.entries(i).forEach(([t,i])=>r.set(n(t),String(i))),Object.entries(s).forEach(([t,i])=>r.set(`query-${n(t)}`,String(i))),this.routerAttrs.forEach(i=>{r.has(i)||(t.removeAttribute(i),this.routerAttrs.delete(i))}),r.forEach((i,s)=>{t.getAttribute(s)!==i&&t.setAttribute(s,i),this.routerAttrs.add(s)});const h=new Set(Object.keys(e));this.prevPropKeys.forEach(i=>{h.has(i)||(t[i]=void 0)}),Object.entries(e).forEach(([i,s])=>{t[i]!==s&&(t[i]=s)}),this.prevPropKeys=h}handleEmptyRoute(){this.clear(),0===this.level&&this.renderError("404 Not Found")}renderLoading(){this.textContent="";const t=document.createElement("div");t.style.cssText="padding:20px; color:#999;",t.textContent="Loading...",this.appendChild(t)}renderError(t){this.textContent="";const i=document.createElement("div");i.style.cssText="padding:20px; color:#ff4d4f;",i.textContent=String(t),this.appendChild(i)}clear(){this.currentElement&&this.contains(this.currentElement)&&this.removeChild(this.currentElement),this.innerHTML="",this.currentElement=null,this.currentTagName=null,this.routerAttrs.clear(),this.prevPropKeys.clear()}};h=((t,i)=>{for(var s,e=i,n=t.length-1;n>=0;n--)(s=t[n])&&(e=s(e)||e);return e})([n.CustomElement({tagName:"router-view"})],h);const o=h;exports.default=o;
|
|
@@ -8,8 +8,9 @@ declare class RouterView extends BaseElement {
|
|
|
8
8
|
private routerAttrs;
|
|
9
9
|
private prevPropKeys;
|
|
10
10
|
private scheduled;
|
|
11
|
-
private cache;
|
|
12
11
|
private latestLoadId;
|
|
12
|
+
private abortController;
|
|
13
|
+
private router;
|
|
13
14
|
mounted(): Promise<void>;
|
|
14
15
|
unmounted(): void;
|
|
15
16
|
private scheduleLoad;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=Object.defineProperty,i=(i,s,e)=>((i,s,e)=>s in i?t(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e)(i,"symbol"!=typeof s?s+"":s,e);import{routerReady as s}from"./core.js";import e from"../runtime/component/base-element.js";import{CustomElement as n}from"../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;
|
|
1
|
+
var t=Object.defineProperty,i=(i,s,e)=>((i,s,e)=>s in i?t(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e)(i,"symbol"!=typeof s?s+"":s,e);import{routerReady as s}from"./core.js";import e from"../runtime/component/base-element.js";import{CustomElement as n}from"../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;const r=new Map;let o=class extends e{constructor(){super(...arguments),i(this,"unsubscribe"),i(this,"level",0),i(this,"currentElement",null),i(this,"currentTagName",null),i(this,"routerAttrs",new Set),i(this,"prevPropKeys",new Set),i(this,"scheduled",!1),i(this,"latestLoadId",0),i(this,"abortController",null),i(this,"router",null)}async mounted(){this.detectLevel(),this.router=await s,this.unsubscribe=this.router.listen(()=>{this.scheduleLoad()}),this.loadRoute(this.router.getCurrentRoute())}unmounted(){var t;null==(t=this.unsubscribe)||t.call(this)}scheduleLoad(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.loadRoute(this.router.getCurrentRoute())}))}detectLevel(){let t=0,i=this.parentElement;for(;i;)i instanceof o&&t++,i=i.parentElement;this.level=t}async loadRoute(t){this.abortController&&(this.abortController.abort(),this.abortController=null);const i=++this.latestLoadId,s=null==t?void 0:t.matched[this.level];if(!s)return void this.handleEmptyRoute();const{config:e}=s;let n=e.tagName;if(!n&&"function"==typeof e.component){this.clear(),this.renderLoading(),this.abortController=new AbortController;const t=this.abortController.signal;try{const s=await e.component();if(t.aborted||i!==this.latestLoadId)return;n="string"==typeof s?s:s.tagName}catch(o){if(t.aborted||i!==this.latestLoadId)return;return this.renderError(`Load Error: ${o}`),this.currentElement=null,void(this.currentTagName=null)}finally{this.abortController&&!t.aborted&&(this.abortController=null)}}if(i!==this.latestLoadId)return;if(!n)return void this.clear();if(!e.forceReload&&this.currentElement&&this.currentTagName===n.toLowerCase())return void this.syncState(this.currentElement,null==t?void 0:t.params,(null==t?void 0:t.query)||{},e.props);this.clear();const r=this.getOrCreateComponent(n,e);this.syncState(r,null==t?void 0:t.params,(null==t?void 0:t.query)||{},e.props),this.appendChild(r),this.currentElement=r,this.currentTagName=n.toLowerCase()}getOrCreateComponent(t,i){const s=`${this.level}-${t.toLowerCase()}`;if(i.keepAlive&&r.has(s))return r.get(s);const e=document.createElement(t);return i.keepAlive&&r.set(s,e),e}syncState(t,i,s,e={}){const n=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=new Map;Object.entries(i).forEach(([t,i])=>r.set(n(t),String(i))),Object.entries(s).forEach(([t,i])=>r.set(`query-${n(t)}`,String(i))),this.routerAttrs.forEach(i=>{r.has(i)||(t.removeAttribute(i),this.routerAttrs.delete(i))}),r.forEach((i,s)=>{t.getAttribute(s)!==i&&t.setAttribute(s,i),this.routerAttrs.add(s)});const o=new Set(Object.keys(e));this.prevPropKeys.forEach(i=>{o.has(i)||(t[i]=void 0)}),Object.entries(e).forEach(([i,s])=>{t[i]!==s&&(t[i]=s)}),this.prevPropKeys=o}handleEmptyRoute(){this.clear(),0===this.level&&this.renderError("404 Not Found")}renderLoading(){this.textContent="";const t=document.createElement("div");t.style.cssText="padding:20px; color:#999;",t.textContent="Loading...",this.appendChild(t)}renderError(t){this.textContent="";const i=document.createElement("div");i.style.cssText="padding:20px; color:#ff4d4f;",i.textContent=String(t),this.appendChild(i)}clear(){this.currentElement&&this.contains(this.currentElement)&&this.removeChild(this.currentElement),this.innerHTML="",this.currentElement=null,this.currentTagName=null,this.routerAttrs.clear(),this.prevPropKeys.clear()}};o=((t,i)=>{for(var s,e=i,n=t.length-1;n>=0;n--)(s=t[n])&&(e=s(e)||e);return e})([n({tagName:"router-view"})],o);const h=o;export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t,e,s,i,n,h,a,o,r,c,u,l,d,f,b,p,v,
|
|
1
|
+
"use strict";var t,e,s,i,n,h,a,o,r,c,u,l,d,f,b,p,m,v,k,w,y,M,W=Object.defineProperty,g=t=>{throw TypeError(t)},S=(t,e,s)=>e.has(t)||g("Cannot "+s),C=(t,e,s)=>(S(t,e,"read from private field"),s?s.call(t):e.get(t)),$=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),j=(t,e,s,i)=>(S(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),A=(t,e,s)=>(S(t,e,"access private method"),s);Object.defineProperties(exports,{t:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const q=require("../../shared/is-object.cjs"),N=require("../../shared/env.cjs"),E=require("../reactivity/observe.cjs"),x=require("../renderer/renderIR.cjs"),O=Symbol.for("solely.manifest"),R=class extends HTMLElement{constructor(f={}){var p;super(),$(this,d),$(this,t),$(this,e),$(this,s),$(this,i),$(this,n),$(this,h),$(this,a,!1),$(this,o,!1),$(this,r,!1),$(this,c,!1),$(this,u,!1),$(this,l,!1);const v=this.constructor;j(this,t,v[O]||{tagName:"base-element"});const k=C(this,t);j(this,n,(null==(p=k.shadowDOM)?void 0:p.use)?this.attachShadow({mode:k.shadowDOM.mode||"open"}):this),A(this,d,b).call(this,f),A(this,d,m).call(this,k),queueMicrotask(()=>A(this,d,M).call(this))}static get observedAttributes(){const t=this[O];return(null==t?void 0:t.propMap)?Array.from(t.propMap.keys()):[]}get $data(){return C(this,i)}set $data(t){var e;q.isObject(t)||(t={}),null==(e=C(this,h))||e.call(this),A(this,d,b).call(this,t),A(this,d,k).call(this)}refresh(){A(this,d,k).call(this)}connectedCallback(){var i;j(this,u,!0);const h=this.constructor.upgradeProps;let a;a=Array.isArray(h)?h.includes("$data")?h:[...h,"$data"]:["$data"],A(this,d,f).call(this,a),A(this,d,M).call(this);const o=C(this,t);if((o.className||o.tagName||"").split(" ").forEach(t=>t&&this.classList.add(t)),A(this,d,y).call(this),o.propMap&&q.isObject(this.$data))for(const[t,e]of o.propMap){const s=e.name;if(this.hasAttribute(t)){const i=this.getAttribute(t),n=A(this,d,v).call(this,i,e.default,e.type);this.$data[s]=n}else"default"in e&&(this.$data[s]=e.default)}C(this,s)&&!C(this,e)&&j(this,e,x.createRender(C(this,s),C(this,n),this)),C(this,l)&&(j(this,l,!1),A(this,d,k).call(this)),this.mounted(),null==(i=this.onInit)||i.call(this)}disconnectedCallback(){j(this,u,!1),this.unmounted()}attributeChangedCallback(e,s,i){var n;if(s===i||!q.isObject(this.$data))return;const h=null==(n=C(this,t).propMap)?void 0:n.get(e);if(!h)return;const a=h.name,o=this.$data[a],c=A(this,d,v).call(this,i,h.default??o,h.type);this.$data[a]=c,j(this,r,!0),this.attributeChanged(e,o,c)}emit(t,e,s){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e,...s}))}onInit(){}created(){}mounted(){}beforeUpdate(){}updated(){}unmounted(){}attributeChanged(t,e,s){}beforeAttributesUpdate(){}afterAttributesUpdate(){}};var U;t=new WeakMap,e=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,h=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,c=new WeakMap,u=new WeakMap,l=new WeakMap,d=new WeakSet,f=function(t){for(const e of t)if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this[e]=t}},b=function(e){const{proxy:s,dispose:n}=E.observe(e,e=>{var s,i;if("set"===e.type){const{key:n,newValue:h}=e,a=C(this,t),o=String(n),r=(null==(s=a.propMap)?void 0:s.get(o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()))||Array.from((null==(i=a.propMap)?void 0:i.values())||[]).find(t=>t.name===o);(null==r?void 0:r.reflect)&&A(this,d,p).call(this,r,h)}this.emit("change",{source:"state",...e}),A(this,d,k).call(this)});j(this,i,s),j(this,h,n)},p=function(t,e){const s=t.name.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if("boolean"===t.type)e?this.setAttribute(s,""):this.removeAttribute(s);else{const t="object"==typeof e?JSON.stringify(e):String(e);this.setAttribute(s,t)}},m=function(t){t.ir&&j(this,s,t.ir)},v=function(t,e,s){if(null===t)return"boolean"===s?e??!1:e;switch(s){case"boolean":return!0;case"number":{const s=Number(t);return isNaN(s)?e:s}case"object":try{return JSON.parse(t)}catch{return e}default:return t}},k=function(){C(this,u)?!C(this,o)&&C(this,e)&&(j(this,o,!0),queueMicrotask(()=>{j(this,o,!1),A(this,d,w).call(this)})):j(this,l,!0)},w=function(){!C(this,a)&&C(this,u)&&(j(this,a,!0),C(this,r)&&this.beforeAttributesUpdate(),this.beforeUpdate(),C(this,e).update(),this.updated(),C(this,r)&&(this.afterAttributesUpdate(),j(this,r,!1)),j(this,a,!1))},y=function(){const e=C(this,t);if(!e.styles)return;const s=C(this,n);if(e.sheet&&s instanceof ShadowRoot&&"adoptedStyleSheets"in s)return void(s.adoptedStyleSheets.includes(e.sheet)||(s.adoptedStyleSheets=[...s.adoptedStyleSheets,e.sheet]));const i=s instanceof ShadowRoot?s:document.head,h=`solely-style-${e.tagName}`;if(!i.querySelector(`#${h}`)){const t=document.createElement("style");t.id=h,t.textContent=e.styles,i.appendChild(t)}},M=function(){C(this,c)||(j(this,c,!0),this.created())},((t,e,s)=>{e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(R,"symbol"!=typeof(U="upgradeProps")?U+"":U,undefined),(()=>{if(N.IS_DEV){const t=customElements.define,e=new WeakSet;customElements.define=function(s,i,n){if(R.isPrototypeOf(i)&&!e.has(i)){e.add(i);const t=i.prototype,s=["connectedCallback","disconnectedCallback","attributeChangedCallback"];for(const e of s)t[e],R.prototype[e]}return t.call(this,s,i,n)}}})();let z=R;exports.default=z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,s,e,i,n,h,o,
|
|
1
|
+
var t,s,e,i,n,h,a,o,r,c,u,l,d,f,p,b,m,k,v,w,y,M,W=Object.defineProperty,g=t=>{throw TypeError(t)},C=(t,s,e)=>s.has(t)||g("Cannot "+e),S=(t,s,e)=>(C(t,s,"read from private field"),e?e.call(t):s.get(t)),$=(t,s,e)=>s.has(t)?g("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),j=(t,s,e,i)=>(C(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e),A=(t,s,e)=>(C(t,s,"access private method"),e);import{isObject as N}from"../../shared/is-object.js";import{IS_DEV as E}from"../../shared/env.js";import{observe as x}from"../reactivity/observe.js";import{createRender as O}from"../renderer/renderIR.js";const R=Symbol.for("solely.manifest"),U=class extends HTMLElement{constructor(f={}){var b;super(),$(this,d),$(this,t),$(this,s),$(this,e),$(this,i),$(this,n),$(this,h),$(this,a,!1),$(this,o,!1),$(this,r,!1),$(this,c,!1),$(this,u,!1),$(this,l,!1);const k=this.constructor;j(this,t,k[R]||{tagName:"base-element"});const v=S(this,t);j(this,n,(null==(b=v.shadowDOM)?void 0:b.use)?this.attachShadow({mode:v.shadowDOM.mode||"open"}):this),A(this,d,p).call(this,f),A(this,d,m).call(this,v),queueMicrotask(()=>A(this,d,M).call(this))}static get observedAttributes(){const t=this[R];return(null==t?void 0:t.propMap)?Array.from(t.propMap.keys()):[]}get $data(){return S(this,i)}set $data(t){var s;N(t)||(t={}),null==(s=S(this,h))||s.call(this),A(this,d,p).call(this,t),A(this,d,v).call(this)}refresh(){A(this,d,v).call(this)}connectedCallback(){var i;j(this,u,!0);const h=this.constructor.upgradeProps;let a;a=Array.isArray(h)?h.includes("$data")?h:[...h,"$data"]:["$data"],A(this,d,f).call(this,a),A(this,d,M).call(this);const o=S(this,t);if((o.className||o.tagName||"").split(" ").forEach(t=>t&&this.classList.add(t)),A(this,d,y).call(this),o.propMap&&N(this.$data))for(const[t,s]of o.propMap){const e=s.name;if(this.hasAttribute(t)){const i=this.getAttribute(t),n=A(this,d,k).call(this,i,s.default,s.type);this.$data[e]=n}else"default"in s&&(this.$data[e]=s.default)}S(this,e)&&!S(this,s)&&j(this,s,O(S(this,e),S(this,n),this)),S(this,l)&&(j(this,l,!1),A(this,d,v).call(this)),this.mounted(),null==(i=this.onInit)||i.call(this)}disconnectedCallback(){j(this,u,!1),this.unmounted()}attributeChangedCallback(s,e,i){var n;if(e===i||!N(this.$data))return;const h=null==(n=S(this,t).propMap)?void 0:n.get(s);if(!h)return;const a=h.name,o=this.$data[a],c=A(this,d,k).call(this,i,h.default??o,h.type);this.$data[a]=c,j(this,r,!0),this.attributeChanged(s,o,c)}emit(t,s,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:s,...e}))}onInit(){}created(){}mounted(){}beforeUpdate(){}updated(){}unmounted(){}attributeChanged(t,s,e){}beforeAttributesUpdate(){}afterAttributesUpdate(){}};var q;t=new WeakMap,s=new WeakMap,e=new WeakMap,i=new WeakMap,n=new WeakMap,h=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,c=new WeakMap,u=new WeakMap,l=new WeakMap,d=new WeakSet,f=function(t){for(const s of t)if(this.hasOwnProperty(s)){const t=this[s];delete this[s],this[s]=t}},p=function(s){const{proxy:e,dispose:n}=x(s,s=>{var e,i;if("set"===s.type){const{key:n,newValue:h}=s,a=S(this,t),o=String(n),r=(null==(e=a.propMap)?void 0:e.get(o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()))||Array.from((null==(i=a.propMap)?void 0:i.values())||[]).find(t=>t.name===o);(null==r?void 0:r.reflect)&&A(this,d,b).call(this,r,h)}this.emit("change",{source:"state",...s}),A(this,d,v).call(this)});j(this,i,e),j(this,h,n)},b=function(t,s){const e=t.name.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if("boolean"===t.type)s?this.setAttribute(e,""):this.removeAttribute(e);else{const t="object"==typeof s?JSON.stringify(s):String(s);this.setAttribute(e,t)}},m=function(t){t.ir&&j(this,e,t.ir)},k=function(t,s,e){if(null===t)return"boolean"===e?s??!1:s;switch(e){case"boolean":return!0;case"number":{const e=Number(t);return isNaN(e)?s:e}case"object":try{return JSON.parse(t)}catch{return s}default:return t}},v=function(){S(this,u)?!S(this,o)&&S(this,s)&&(j(this,o,!0),queueMicrotask(()=>{j(this,o,!1),A(this,d,w).call(this)})):j(this,l,!0)},w=function(){!S(this,a)&&S(this,u)&&(j(this,a,!0),S(this,r)&&this.beforeAttributesUpdate(),this.beforeUpdate(),S(this,s).update(),this.updated(),S(this,r)&&(this.afterAttributesUpdate(),j(this,r,!1)),j(this,a,!1))},y=function(){const s=S(this,t);if(!s.styles)return;const e=S(this,n);if(s.sheet&&e instanceof ShadowRoot&&"adoptedStyleSheets"in e)return void(e.adoptedStyleSheets.includes(s.sheet)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s.sheet]));const i=e instanceof ShadowRoot?e:document.head,h=`solely-style-${s.tagName}`;if(!i.querySelector(`#${h}`)){const t=document.createElement("style");t.id=h,t.textContent=s.styles,i.appendChild(t)}},M=function(){S(this,c)||(j(this,c,!0),this.created())},((t,s,e)=>{s in t?W(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e})(U,"symbol"!=typeof(q="upgradeProps")?q+"":q,undefined),(()=>{if(E){const t=customElements.define,s=new WeakSet;customElements.define=function(e,i,n){if(U.isPrototypeOf(i)&&!s.has(i)){s.add(i);const t=i.prototype,e=["connectedCallback","disconnectedCallback","attributeChangedCallback"];for(const s of e)t[s],U.prototype[s]}return t.call(this,e,i,n)}}})();let z=U;export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=Object.defineProperty,e=(e,s,o)=>((e,s,o)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o)(e,"symbol"!=typeof s?s+"":s,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../types/ast.cjs"),o=require("../../shared/templateError.cjs"),n=Symbol("solely.irCtx"),
|
|
1
|
+
"use strict";var t=Object.defineProperty,e=(e,s,o)=>((e,s,o)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o)(e,"symbol"!=typeof s?s+"":s,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../types/ast.cjs"),o=require("../../shared/templateError.cjs"),n=require("../../shared/env.cjs"),i=Symbol("solely.irCtx"),r=Symbol("solely.irEvents"),c=Symbol("solely.prevClassObj"),l=Symbol("solely.prevStyleObj"),a={xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},h={readonly:"readOnly",for:"htmlFor",tabindex:"tabIndex",contenteditable:"contentEditable",maxlength:"maxLength"},u=new Set(["data-","aria-","role","form"]),f=new Set(["value","selectedIndex"]);function d(t,e){var s;const o=null==(s=e.a)?void 0:s.find(t=>"class"===t.k&&!t.d);(null==o?void 0:o.v)&&t.setAttribute("class",o.v)}function m(t,e){var s;if(!t.style)return;const o=null==(s=e.a)?void 0:s.find(t=>"style"===t.k&&!t.d),n=o?b(o.v):{};for(const i in n){const e=n[i];i.startsWith("--")?t.style.setProperty(i,e):t.style[i]=e}}const p=t=>!(!t||0===t.length||/\s/.test(t)&&(n.IS_DEV,1));function b(t){const e={},s=[[t]];for(;s.length;){const[t,o]=s.pop();if(t){if("string"==typeof t){const s=/([^:;]+)\s*:\s*([^;]*\(.*?\)[^;]*|[^;]+)/g;let o;for(;null!==(o=s.exec(t));){const t=o[1].trim(),s=o[2].trim();t&&s&&(e[t]=s)}continue}if(Array.isArray(t))for(let e=t.length-1;e>=0;e--)s.push([t[e]]);else if("object"==typeof t)for(const n in t){const i=t[n];if(null==i)continue;const r=o?`${o}-${n}`:n;"object"!=typeof i||Array.isArray(i)?e[r]=String(i):s.push([i,r])}}}return e}function y(t,e,s){const o=null==s?"":String(s),n=e.indexOf(":");if(n>0){const s=e.slice(0,n),i=a[s];if(i)return void(t.getAttributeNS(i,e)!==o&&t.setAttributeNS(i,e,o))}t.getAttribute(e)!==o&&t.setAttribute(e,o)}function v(t,e,s){const o=h[e]||e;if(e.startsWith("data-")||e.startsWith("aria-")||u.has(e))return void y(t,e,s);const n=t,i=n.tagName;if(null!=s){if("src"===o||"href"===o){const e=String(s);if(n[o]===e||t.getAttribute(o)===e)return}if("value"!==o||"INPUT"!==i&&"TEXTAREA"!==i||n.value!==s)if("boolean"!=typeof s)(t instanceof SVGElement||void 0!==n.ownerSVGElement)&&!h[e]?y(t,e,s):n[o]!==s&&(n[o]=s);else{if(n[o]===s)return;n[o]=s}}else if("boolean"==typeof n[o])!1!==n[o]&&(n[o]=!1);else{const s=n[o];""!==s&&void 0!==s&&(n[o]=""),t.hasAttribute(e)&&t.removeAttribute(e)}}class w{constructor(t,s,o={}){e(this,"nodeMap",new Map),e(this,"marker",!1),e(this,"staticSubtreeCache",new Map),this.ir=t,this.container=s,this.scope=o}evalIR(t,e,s){var n;const i=this.ir.fns[t-1];try{return i?i.apply(this.scope,e):""}catch(r){return o.showTemplateError(r.message||r.toString(),(null==(n=this.ir.m)?void 0:n.src)||"",s,this.scope.tagName),""}}createElement(t,e){const s=t.g;return e instanceof SVGElement||"svg"===s?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)}createText(t,e){const s=t.d?this.evalIR(t.f,[e],t.o):t.x||"";return document.createTextNode(s)}createComment(t,e){const s=t.d?this.evalIR(t.f,[e],t.o):t.x||"";return document.createComment(s)}applyAttrs(t,e,s,o=!1){const n=[],a=t;let h;a[i]||(a[i]={loops:null}),a[i].loops=s,a[r]||(a[r]=Object.create(null));let u,d=!1,m=!1;for(const c of e){const{k:e,f:l,d:p,v:b}=c;if(":class"===e){h=this.evalIR(l,[s],c.o),d=!0;continue}if(":style"===e){u=this.evalIR(l,[s],c.o),m=!0;continue}if("class"===e||"style"===e)continue;const w=e[0];if("@"===w){const s=e.slice(1),n=c.r??"user";let h=a[r][s];if(h||(h=a[r][s]={model:[],user:[]},t.addEventListener(s,t=>{for(const e of h.model)e(t);for(const e of h.user)e(t)})),!o){const t=t=>this.evalIR(l,[t,a[i].loops],c.o);h[n].push(t)}continue}if("mounted"===e){o||requestAnimationFrame(()=>this.evalIR(l,[t,s],c.o));continue}if("updated"===e){o&&requestAnimationFrame(()=>this.evalIR(l,[t,s],c.o));continue}if("ref"===e&&b){this.scope.$refs=this.scope.$refs||{},this.scope.$refs[b]=t;continue}const S=p?this.evalIR(l,[s],c.o):b??"";if(":"===w){const s=e.slice(1);"SELECT"===t.tagName&&f.has(s)?n.push(()=>v(t,s,S)):v(t,s,S)}else o||y(t,e,String(S))}return d&&((t,e)=>{const s=t,o=s[c],n=function(t){const e={},s=[t];for(;s.length;){const t=s.pop();if(t)if("string"==typeof t){const s=t.split(" ");for(let t=0;t<s.length;t++){const o=s[t].trim();o&&(e[o]=!0)}}else if(Array.isArray(t))for(let e=t.length-1;e>=0;e--)s.push(t[e]);else if("object"==typeof t)for(const s in t)t[s]&&(e[s]=!0)}return e}(e),i={};for(const c in n)p(c)&&(i[c]=n[c]);if(!o){for(const e in i)t.classList.add(e);return void(s[c]=i)}let r=!1;for(const c in o)i[c]||(t.classList.remove(c),r=!0);for(const c in i)o[c]||(t.classList.add(c),r=!0);r&&(s[c]=i)})(t,h),m&&((t,e)=>{const s=t,o=b(e),n=s[l];if(!n){for(const e in o){const s=o[e];e.startsWith("--")?t.style.setProperty(e,s):t.style[e]=s}return void(s[l]=o)}let i=!1;for(const r in n)r in o||(r.startsWith("--")?t.style.removeProperty(r):t.style[r]="",i=!0);for(const r in o){const e=o[r];e!==n[r]&&(r.startsWith("--")?t.style.setProperty(r,e):t.style[r]=e,i=!0)}i&&(s[l]=o)})(t,u),n}updateNode(t,e,s){const o=e.d?this.evalIR(e.f,[s],e.o):e.x||"";e.d&&t.textContent!==o&&(t.textContent=o)}createStaticSubtree(t,e,o){var n;switch(t.t){case s.ASTType.Element:{const s=this.createElement(t,e);d(s,t),m(s,t);const i=this.applyAttrs(s,t.a??[],o);return null==(n=t.c)||n.forEach(t=>{const e=this.createStaticSubtree(t,s,o);s.appendChild(e)}),i.forEach(t=>t()),s}case s.ASTType.Text:return this.createText(t,o);case s.ASTType.Comment:return this.createComment(t,o);default:return document.createComment("unknown")}}handleStaticSubtree(t,e,s,o){const n=this.staticSubtreeCache.get(e);if(n){const t=n.cloneNode(!0);return s.appendChild(t),t}const i=this.createStaticSubtree(t,s,o);return s.appendChild(i),this.staticSubtreeCache.set(e,i.cloneNode(!0)),i}irToNode(t,e,o,n,i){var r,c,l,a;const h=o+"-"+e,u=this.nodeMap.get(h);let f;if(1!==t.s)if(u){f=u.node,u.marker=this.marker;let e=[];t.d&&(t.t===s.ASTType.Element?e=this.applyAttrs(f,t.a??[],i,!0):this.updateNode(f,t,i)),null==(r=t.c)||r.forEach((t,e)=>{this.irToNode(t,e,h,f,i)}),e.forEach(t=>t())}else switch(t.t){case s.ASTType.Element:f=this.createElement(t,n),d(f,t),m(f,t);const e=this.applyAttrs(f,t.a??[],i);n.appendChild(f),this.nodeMap.set(h,{irNode:t,node:f,loops:i,marker:this.marker}),null==(c=t.c)||c.forEach((t,e)=>{this.irToNode(t,e,h,f,i)}),e.forEach(t=>t());break;case s.ASTType.Text:f=this.createText(t,i),n.appendChild(f),this.nodeMap.set(h,{irNode:t,node:f,loops:i,marker:this.marker});break;case s.ASTType.Comment:f=this.createComment(t,i),n.appendChild(f),this.nodeMap.set(h,{irNode:t,node:f,loops:i,marker:this.marker});break;case s.ASTType.For:{const e=`${h}-end`;let o=null==(l=this.nodeMap.get(e))?void 0:l.node;o?this.nodeMap.get(e).marker=this.marker:(o=document.createComment(`for:${h}`),n.appendChild(o),this.nodeMap.set(e,{irNode:{t:s.ASTType.Comment},node:o,loops:i,marker:this.marker}));const r=this.evalIR(t.f,[i],t.o)||[],c=document.createDocumentFragment();r.forEach((e,s)=>{var o;const n=[...i,{itmVal:e,idxVal:s}];null==(o=t.c)||o.forEach((t,e)=>{this.irToNode(t,e,`${h}-for-${s}`,c,n)})}),o.parentNode.insertBefore(c,o);break}case s.ASTType.Conditional:{const e=`${h}-end`;let s=null==(a=this.nodeMap.get(e))?void 0:a.node;s?this.nodeMap.get(e).marker=this.marker:(s=document.createComment(`if:${h}`),n.appendChild(s),this.nodeMap.set(e,{irNode:{},node:s,loops:i,marker:this.marker}));for(let o=0;o<(t.b||[]).length;o++){const e=t.b[o];if(null===e.f||this.evalIR(e.f,[i],e.o)){const t=document.createDocumentFragment();e.c.forEach((e,s)=>{this.irToNode(e,s,`${h}-if-${o}`,t,i)}),s.parentNode.insertBefore(t,s);break}}break}}else u?(u.marker=this.marker,f=u.node):(f=this.handleStaticSubtree(t,h,n,i),this.nodeMap.set(h,{irNode:t,node:f,loops:i,marker:this.marker}))}cleanupOldNodes(){for(const[t,e]of this.nodeMap.entries())if(e.marker!==this.marker){const{irNode:s,node:o,loops:n}=e;if(s.a){const t=s.a.find(t=>"unmounted"===t.k);t&&requestAnimationFrame(()=>{this.evalIR(t.f,[o,n],t.o)});const e=s.a.find(t=>"ref"===t.k);e&&e.v&&delete this.scope.$refs[e.v]}null==o||o.remove(),this.nodeMap.delete(t)}}mount(){this.marker=!this.marker,this.ir.n.forEach((t,e)=>{this.irToNode(t,e,"root",this.container,[])}),this.cleanupOldNodes()}update(){this.marker=!this.marker,this.ir.n.forEach((t,e)=>{this.irToNode(t,e,"root",this.container,[])}),this.cleanupOldNodes()}destroy(){this.container.innerHTML="",this.nodeMap.clear(),this.staticSubtreeCache.clear()}}exports.IRRenderer=w,exports.createRender=(t,e,s={})=>{const o=new w(t,e,s);return o.mount(),{update:()=>o.update(),destroy:()=>o.destroy()}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=(e,s,o)=>((e,s,o)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o)(e,"symbol"!=typeof s?s+"":s,o);import{ASTType as s}from"../../types/ast.js";import{showTemplateError as o}from"../../shared/templateError.js";const
|
|
1
|
+
var t=Object.defineProperty,e=(e,s,o)=>((e,s,o)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o)(e,"symbol"!=typeof s?s+"":s,o);import{ASTType as s}from"../../types/ast.js";import{showTemplateError as o}from"../../shared/templateError.js";import{IS_DEV as n}from"../../shared/env.js";const i=Symbol("solely.irCtx"),r=Symbol("solely.irEvents"),c=Symbol("solely.prevClassObj"),l=Symbol("solely.prevStyleObj"),h={xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},a={readonly:"readOnly",for:"htmlFor",tabindex:"tabIndex",contenteditable:"contentEditable",maxlength:"maxLength"},f=new Set(["data-","aria-","role","form"]),u=new Set(["value","selectedIndex"]);function d(t,e){var s;const o=null==(s=e.a)?void 0:s.find(t=>"class"===t.k&&!t.d);(null==o?void 0:o.v)&&t.setAttribute("class",o.v)}function m(t,e){var s;if(!t.style)return;const o=null==(s=e.a)?void 0:s.find(t=>"style"===t.k&&!t.d),n=o?y(o.v):{};for(const i in n){const e=n[i];i.startsWith("--")?t.style.setProperty(i,e):t.style[i]=e}}const p=t=>!(!t||0===t.length||/\s/.test(t));function y(t){const e={},s=[[t]];for(;s.length;){const[t,o]=s.pop();if(t){if("string"==typeof t){const s=/([^:;]+)\s*:\s*([^;]*\(.*?\)[^;]*|[^;]+)/g;let o;for(;null!==(o=s.exec(t));){const t=o[1].trim(),s=o[2].trim();t&&s&&(e[t]=s)}continue}if(Array.isArray(t))for(let e=t.length-1;e>=0;e--)s.push([t[e]]);else if("object"==typeof t)for(const n in t){const i=t[n];if(null==i)continue;const r=o?`${o}-${n}`:n;"object"!=typeof i||Array.isArray(i)?e[r]=String(i):s.push([i,r])}}}return e}function b(t,e,s){const o=null==s?"":String(s),n=e.indexOf(":");if(n>0){const s=e.slice(0,n),i=h[s];if(i)return void(t.getAttributeNS(i,e)!==o&&t.setAttributeNS(i,e,o))}t.getAttribute(e)!==o&&t.setAttribute(e,o)}function v(t,e,s){const o=a[e]||e;if(e.startsWith("data-")||e.startsWith("aria-")||f.has(e))return void b(t,e,s);const n=t,i=n.tagName;if(null!=s){if("src"===o||"href"===o){const e=String(s);if(n[o]===e||t.getAttribute(o)===e)return}if("value"!==o||"INPUT"!==i&&"TEXTAREA"!==i||n.value!==s)if("boolean"!=typeof s)(t instanceof SVGElement||void 0!==n.ownerSVGElement)&&!a[e]?b(t,e,s):n[o]!==s&&(n[o]=s);else{if(n[o]===s)return;n[o]=s}}else if("boolean"==typeof n[o])!1!==n[o]&&(n[o]=!1);else{const s=n[o];""!==s&&void 0!==s&&(n[o]=""),t.hasAttribute(e)&&t.removeAttribute(e)}}class w{constructor(t,s,o={}){e(this,"nodeMap",new Map),e(this,"marker",!1),e(this,"staticSubtreeCache",new Map),this.ir=t,this.container=s,this.scope=o}evalIR(t,e,s){var n;const i=this.ir.fns[t-1];try{return i?i.apply(this.scope,e):""}catch(r){return o(r.message||r.toString(),(null==(n=this.ir.m)?void 0:n.src)||"",s,this.scope.tagName),""}}createElement(t,e){const s=t.g;return e instanceof SVGElement||"svg"===s?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)}createText(t,e){const s=t.d?this.evalIR(t.f,[e],t.o):t.x||"";return document.createTextNode(s)}createComment(t,e){const s=t.d?this.evalIR(t.f,[e],t.o):t.x||"";return document.createComment(s)}applyAttrs(t,e,s,o=!1){const n=[],h=t;let a;h[i]||(h[i]={loops:null}),h[i].loops=s,h[r]||(h[r]=Object.create(null));let f,d=!1,m=!1;for(const c of e){const{k:e,f:l,d:p,v:y}=c;if(":class"===e){a=this.evalIR(l,[s],c.o),d=!0;continue}if(":style"===e){f=this.evalIR(l,[s],c.o),m=!0;continue}if("class"===e||"style"===e)continue;const w=e[0];if("@"===w){const s=e.slice(1),n=c.r??"user";let a=h[r][s];if(a||(a=h[r][s]={model:[],user:[]},t.addEventListener(s,t=>{for(const e of a.model)e(t);for(const e of a.user)e(t)})),!o){const t=t=>this.evalIR(l,[t,h[i].loops],c.o);a[n].push(t)}continue}if("mounted"===e){o||requestAnimationFrame(()=>this.evalIR(l,[t,s],c.o));continue}if("updated"===e){o&&requestAnimationFrame(()=>this.evalIR(l,[t,s],c.o));continue}if("ref"===e&&y){this.scope.$refs=this.scope.$refs||{},this.scope.$refs[y]=t;continue}const S=p?this.evalIR(l,[s],c.o):y??"";if(":"===w){const s=e.slice(1);"SELECT"===t.tagName&&u.has(s)?n.push(()=>v(t,s,S)):v(t,s,S)}else o||b(t,e,String(S))}return d&&((t,e)=>{const s=t,o=s[c],n=function(t){const e={},s=[t];for(;s.length;){const t=s.pop();if(t)if("string"==typeof t){const s=t.split(" ");for(let t=0;t<s.length;t++){const o=s[t].trim();o&&(e[o]=!0)}}else if(Array.isArray(t))for(let e=t.length-1;e>=0;e--)s.push(t[e]);else if("object"==typeof t)for(const s in t)t[s]&&(e[s]=!0)}return e}(e),i={};for(const c in n)p(c)&&(i[c]=n[c]);if(!o){for(const e in i)t.classList.add(e);return void(s[c]=i)}let r=!1;for(const c in o)i[c]||(t.classList.remove(c),r=!0);for(const c in i)o[c]||(t.classList.add(c),r=!0);r&&(s[c]=i)})(t,a),m&&((t,e)=>{const s=t,o=y(e),n=s[l];if(!n){for(const e in o){const s=o[e];e.startsWith("--")?t.style.setProperty(e,s):t.style[e]=s}return void(s[l]=o)}let i=!1;for(const r in n)r in o||(r.startsWith("--")?t.style.removeProperty(r):t.style[r]="",i=!0);for(const r in o){const e=o[r];e!==n[r]&&(r.startsWith("--")?t.style.setProperty(r,e):t.style[r]=e,i=!0)}i&&(s[l]=o)})(t,f),n}updateNode(t,e,s){const o=e.d?this.evalIR(e.f,[s],e.o):e.x||"";e.d&&t.textContent!==o&&(t.textContent=o)}createStaticSubtree(t,e,o){var n;switch(t.t){case s.Element:{const s=this.createElement(t,e);d(s,t),m(s,t);const i=this.applyAttrs(s,t.a??[],o);return null==(n=t.c)||n.forEach(t=>{const e=this.createStaticSubtree(t,s,o);s.appendChild(e)}),i.forEach(t=>t()),s}case s.Text:return this.createText(t,o);case s.Comment:return this.createComment(t,o);default:return document.createComment("unknown")}}handleStaticSubtree(t,e,s,o){const n=this.staticSubtreeCache.get(e);if(n){const t=n.cloneNode(!0);return s.appendChild(t),t}const i=this.createStaticSubtree(t,s,o);return s.appendChild(i),this.staticSubtreeCache.set(e,i.cloneNode(!0)),i}irToNode(t,e,o,n,i){var r,c,l,h;const a=o+"-"+e,f=this.nodeMap.get(a);let u;if(1!==t.s)if(f){u=f.node,f.marker=this.marker;let e=[];t.d&&(t.t===s.Element?e=this.applyAttrs(u,t.a??[],i,!0):this.updateNode(u,t,i)),null==(r=t.c)||r.forEach((t,e)=>{this.irToNode(t,e,a,u,i)}),e.forEach(t=>t())}else switch(t.t){case s.Element:u=this.createElement(t,n),d(u,t),m(u,t);const e=this.applyAttrs(u,t.a??[],i);n.appendChild(u),this.nodeMap.set(a,{irNode:t,node:u,loops:i,marker:this.marker}),null==(c=t.c)||c.forEach((t,e)=>{this.irToNode(t,e,a,u,i)}),e.forEach(t=>t());break;case s.Text:u=this.createText(t,i),n.appendChild(u),this.nodeMap.set(a,{irNode:t,node:u,loops:i,marker:this.marker});break;case s.Comment:u=this.createComment(t,i),n.appendChild(u),this.nodeMap.set(a,{irNode:t,node:u,loops:i,marker:this.marker});break;case s.For:{const e=`${a}-end`;let o=null==(l=this.nodeMap.get(e))?void 0:l.node;o?this.nodeMap.get(e).marker=this.marker:(o=document.createComment(`for:${a}`),n.appendChild(o),this.nodeMap.set(e,{irNode:{t:s.Comment},node:o,loops:i,marker:this.marker}));const r=this.evalIR(t.f,[i],t.o)||[],c=document.createDocumentFragment();r.forEach((e,s)=>{var o;const n=[...i,{itmVal:e,idxVal:s}];null==(o=t.c)||o.forEach((t,e)=>{this.irToNode(t,e,`${a}-for-${s}`,c,n)})}),o.parentNode.insertBefore(c,o);break}case s.Conditional:{const e=`${a}-end`;let s=null==(h=this.nodeMap.get(e))?void 0:h.node;s?this.nodeMap.get(e).marker=this.marker:(s=document.createComment(`if:${a}`),n.appendChild(s),this.nodeMap.set(e,{irNode:{},node:s,loops:i,marker:this.marker}));for(let o=0;o<(t.b||[]).length;o++){const e=t.b[o];if(null===e.f||this.evalIR(e.f,[i],e.o)){const t=document.createDocumentFragment();e.c.forEach((e,s)=>{this.irToNode(e,s,`${a}-if-${o}`,t,i)}),s.parentNode.insertBefore(t,s);break}}break}}else f?(f.marker=this.marker,u=f.node):(u=this.handleStaticSubtree(t,a,n,i),this.nodeMap.set(a,{irNode:t,node:u,loops:i,marker:this.marker}))}cleanupOldNodes(){for(const[t,e]of this.nodeMap.entries())if(e.marker!==this.marker){const{irNode:s,node:o,loops:n}=e;if(s.a){const t=s.a.find(t=>"unmounted"===t.k);t&&requestAnimationFrame(()=>{this.evalIR(t.f,[o,n],t.o)});const e=s.a.find(t=>"ref"===t.k);e&&e.v&&delete this.scope.$refs[e.v]}null==o||o.remove(),this.nodeMap.delete(t)}}mount(){this.marker=!this.marker,this.ir.n.forEach((t,e)=>{this.irToNode(t,e,"root",this.container,[])}),this.cleanupOldNodes()}update(){this.marker=!this.marker,this.ir.n.forEach((t,e)=>{this.irToNode(t,e,"root",this.container,[])}),this.cleanupOldNodes()}destroy(){this.container.innerHTML="",this.nodeMap.clear(),this.staticSubtreeCache.clear()}}const S=(t,e,s={})=>{const o=new w(t,e,s);return o.mount(),{update:()=>o.update(),destroy:()=>o.destroy()}};export{w as IRRenderer,S as createRender};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solely",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"description": "A lightweight TypeScript framework for building web components with compile-time optimizations",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"license": "MIT",
|
|
172
172
|
"repository": {
|
|
173
173
|
"type": "git",
|
|
174
|
-
"url": "
|
|
174
|
+
"url": "https://github.com/solelyjs/solely.git"
|
|
175
175
|
},
|
|
176
176
|
"bugs": {
|
|
177
177
|
"url": "https://github.com/solelyjs/solely/issues"
|