solely 0.5.3 → 0.5.5

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.
Files changed (61) hide show
  1. package/dist/components/commands/drawer/index.cjs +1 -1
  2. package/dist/components/commands/drawer/index.js +1 -1
  3. package/dist/components/commands/drawer/types.d.ts +2 -0
  4. package/dist/components/commands/index.cjs +1 -1
  5. package/dist/components/commands/index.d.ts +2 -2
  6. package/dist/components/commands/index.js +1 -1
  7. package/dist/components/commands/message/index.cjs +1 -1
  8. package/dist/components/commands/message/index.js +1 -1
  9. package/dist/components/commands/message/types.d.ts +2 -0
  10. package/dist/components/commands/modal/index.cjs +1 -1
  11. package/dist/components/commands/modal/index.js +1 -1
  12. package/dist/components/commands/modal/types.d.ts +2 -0
  13. package/dist/components/commands/popconfirm/index.cjs +1 -1
  14. package/dist/components/commands/popconfirm/index.d.ts +3 -4
  15. package/dist/components/commands/popconfirm/index.js +1 -1
  16. package/dist/components/commands/popconfirm/types.d.ts +10 -0
  17. package/dist/components/commands/tooltip/index.cjs +1 -1
  18. package/dist/components/commands/tooltip/index.d.ts +13 -0
  19. package/dist/components/commands/tooltip/index.js +1 -1
  20. package/dist/components/commands/tooltip/types.d.ts +2 -0
  21. package/dist/components/commands/utils.cjs +1 -1
  22. package/dist/components/commands/utils.d.ts +6 -0
  23. package/dist/components/commands/utils.js +1 -1
  24. package/dist/components/elements/button/index.cjs +1 -1
  25. package/dist/components/elements/button/index.js +1 -1
  26. package/dist/components/elements/card/index.cjs +1 -1
  27. package/dist/components/elements/card/index.js +1 -1
  28. package/dist/components/elements/card/types.d.ts +1 -1
  29. package/dist/components/elements/input/index.cjs +1 -1
  30. package/dist/components/elements/input/index.js +1 -1
  31. package/dist/components/elements/pagination/index.cjs +1 -1
  32. package/dist/components/elements/pagination/index.js +1 -1
  33. package/dist/components/elements/pagination/types.d.ts +1 -1
  34. package/dist/components/elements/steps/index.cjs +1 -1
  35. package/dist/components/elements/steps/index.js +1 -1
  36. package/dist/components/elements/steps/types.d.ts +1 -1
  37. package/dist/components/elements/table/index.cjs +1 -1
  38. package/dist/components/elements/table/index.js +1 -1
  39. package/dist/components/elements/table/types.d.ts +1 -1
  40. package/dist/components/elements/tabs/index.cjs +1 -1
  41. package/dist/components/elements/tabs/index.js +1 -1
  42. package/dist/components/elements/tabs/types.d.ts +1 -1
  43. package/dist/components/index.cjs +1 -1
  44. package/dist/components/index.js +1 -1
  45. package/dist/router/core.cjs +1 -1
  46. package/dist/router/core.d.ts +1 -0
  47. package/dist/router/core.js +1 -1
  48. package/dist/router/router-link.cjs +1 -1
  49. package/dist/router/router-link.d.ts +5 -0
  50. package/dist/router/router-link.js +1 -1
  51. package/dist/runtime/component/base-element.cjs +1 -1
  52. package/dist/runtime/component/base-element.js +1 -1
  53. package/dist/runtime/reactivity/observe.cjs +1 -1
  54. package/dist/runtime/reactivity/observe.js +1 -1
  55. package/dist/runtime/reactivity/watch.cjs +1 -1
  56. package/dist/runtime/reactivity/watch.js +1 -1
  57. package/dist/shared/env.cjs +1 -1
  58. package/dist/shared/env.js +1 -1
  59. package/dist/shared/url.cjs +1 -1
  60. package/dist/shared/url.js +1 -1
  61. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";var t,e,s,i,a,r,n,o,h,l,c,u,d,p,f,b,m,y,v,w,g,S,M,O,$,k,j,W,C,N,A,E=Object.defineProperty,P=t=>{throw TypeError(t)},L=(t,e,s)=>e.has(t)||P("Cannot "+s),D=(t,e,s)=>(L(t,e,"read from private field"),s?s.call(t):e.get(t)),q=(t,e,s)=>e.has(t)?P("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),U=(t,e,s,i)=>(L(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),_=(t,e,s)=>(L(t,e,"access private method"),s);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("../../shared/is-object.cjs"),T=require("../../shared/env.cjs"),x=require("../../shared/case-convert.cjs"),I=require("../reactivity/observe.cjs"),V=require("../renderer/renderIR.cjs"),H=Symbol.for("solely.manifest"),J=class extends HTMLElement{constructor(m={}){var y,w;super(),q(this,v),((t,e,s)=>{e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(this,"symbol"!=typeof(w="$refs")?w+"":w,{}),q(this,t),q(this,e),q(this,s),q(this,i),q(this,a),q(this,r),q(this,n,!1),q(this,o,!1),q(this,h,!1),q(this,l,!1),q(this,c,!1),q(this,u,!1),q(this,d,!1),q(this,p,new Set),q(this,f,!1),q(this,b,!1);const S=this.constructor;U(this,t,S[H]||{tagName:"base-element"});const O=D(this,t);U(this,a,(null==(y=O.shadowDOM)?void 0:y.use)?this.attachShadow({mode:O.shadowDOM.mode||"open"}):this),_(this,v,g).call(this,m),_(this,v,M).call(this,O),queueMicrotask(()=>_(this,v,A).call(this))}static get observedAttributes(){const t=this[H];return(null==t?void 0:t.attributeMap)?Array.from(t.attributeMap.keys()):[]}get $data(){return D(this,i)}set $data(t){var e;R.isObject(t)||(t={}),t!==D(this,i)&&(null==(e=D(this,r))||e.call(this),_(this,v,g).call(this,t),_(this,v,$).call(this),_(this,v,j).call(this))}refresh(){_(this,v,j).call(this)}connectedCallback(){if(D(this,f))throw this.remove(),new Error(`[Solely] <${this.tagName.toLowerCase()}> has been disposed and cannot be reconnected.`);U(this,c,!0);const i=D(this,t);if(_(this,v,A).call(this),(i.className||i.tagName||"").split(" ").forEach(t=>t&&this.classList.add(t)),_(this,v,C).call(this),i.attributeMap&&R.isObject(this.$data)){_(this,v,$).call(this);for(const[t,e]of i.attributeMap){const s=e.name;if(this.hasAttribute(t)){const i=this.getAttribute(t),a=_(this,v,k).call(this,i,e.default,e.type);this.$data[s]=a}else"default"in e&&void 0===this.$data[s]&&(this.$data[s]=e.default,"boolean"===e.type&&!0===e.default&&this.setAttribute(t,""))}}_(this,v,w).call(this),D(this,s)&&!D(this,e)&&U(this,e,V.createRender(D(this,s),D(this,a),this)),D(this,u)&&(U(this,u,!1),_(this,v,j).call(this)),this.mounted()}disconnectedCallback(){U(this,c,!1),D(this,f)||_(this,v,N).call(this),this.unmounted()}attributeChangedCallback(e,s,i){var a;if(D(this,f)||s===i||!R.isObject(this.$data))return;if(D(this,p).has(e))return;const r=null==(a=D(this,t).attributeMap)?void 0:a.get(e);if(!r)return;const n=r.name,o=this.$data[n],l=_(this,v,k).call(this,i,r.default??o,r.type);o!==l&&(U(this,h,!0),this.$data[n]=l,this.attributeChanged(e,o,l))}emit(t,e,s){D(this,f)||this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e,...s}))}emitNative(t,e){D(this,f)||this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0,...e}))}warn(t,e){if(T.IS_DEV&&t){const t=this.tagName.toLowerCase();console.warn(`[${t}] ${e}`)}}error(t,e){if(T.IS_DEV&&t){const t=this.tagName.toLowerCase();console.error(`[${t}] ${e}`)}}dispose(){var t,s;D(this,f)||(U(this,f,!0),U(this,c,!1),_(this,v,N).call(this),null==(t=D(this,e))||t.destroy(),U(this,e,void 0),null==(s=D(this,r))||s.call(this),U(this,r,void 0),this.remove())}created(){}mounted(){}beforeUpdate(){}updated(){}unmounted(){}attributeChanged(t,e,s){}beforeAttributesUpdate(){}afterAttributesUpdate(){}};t=new WeakMap,e=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap,r=new WeakMap,n=new WeakMap,o=new WeakMap,h=new WeakMap,l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap,f=new WeakMap,b=new WeakMap,m=new WeakMap,y=new WeakMap,v=new WeakSet,w=function(){const t=Object.getOwnPropertyNames(this),e=["#","_"],s=D(J,y),i=new Map;let a=Object.getPrototypeOf(this);for(;a&&a!==HTMLElement.prototype;){const t=Object.getOwnPropertyDescriptors(a);for(const[e,s]of Object.entries(t))s.set&&!i.has(e)&&i.set(e,s);a=Object.getPrototypeOf(a)}for(const r of t){if(s.has(r))continue;if(e.some(t=>r.startsWith(t)))continue;const t=Object.getOwnPropertyDescriptor(this,r);if(!t||!("value"in t))continue;const a=t.value,n=i.get(r);(null==n?void 0:n.set)&&(delete this[r],this[r]=a)}},g=function(e){const{proxy:s,dispose:a}=I.observe(e,e=>{var s;if("set"===e.type){const{key:i,newValue:a}=e,r=D(this,t),n=String(i),o=null==(s=r.propMap)?void 0:s.get(n);(null==o?void 0:o.reflect)&&_(this,v,S).call(this,o,a)}this.emit("dataChange",{...e}),_(this,v,j).call(this)});U(this,i,s),U(this,r,a)},S=function(t,e){const s=x.camelToKebab(t.name);D(this,p).add(s);try{if(null==e)return void this.removeAttribute(s);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)}}finally{D(this,p).delete(s)}},M=function(t){t.ir&&U(this,s,t.ir)},O=function(){const e=D(this,t);if(e.attributeMap)for(const[,t]of e.attributeMap){if(!1===t.reactive)continue;let e,s=Object.getPrototypeOf(this);for(;s&&s!==HTMLElement.prototype&&(e=Object.getOwnPropertyDescriptor(s,t.name),!e);)s=Object.getPrototypeOf(s);if(!(null==e?void 0:e.get)&&!(null==e?void 0:e.set)){const e=Object.getOwnPropertyDescriptor(this,t.name);e&&"value"in e&&(this.$data[t.name]=e.value,delete this[t.name]),Object.defineProperty(this,t.name,{get:()=>this.$data[t.name],set:e=>{this.$data[t.name]=e},configurable:!0,enumerable:!0})}}},$=function(){D(this,d)||(U(this,d,!0),_(this,v,O).call(this))},k=function(t,e,s){if(null===t)return"boolean"!==s&&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(i){return console.error(`[Solely] Failed to parse object value: "${t}", using default value.`,i),e}case"array":try{const s=JSON.parse(t);return Array.isArray(s)?s:e}catch(i){return console.error(`[Solely] Failed to parse array value: "${t}", using default value.`,i),e}default:return t}},j=function(){D(this,f)||(D(this,c)?!D(this,o)&&D(this,e)&&(U(this,o,!0),queueMicrotask(()=>{D(this,f)||(U(this,o,!1),_(this,v,W).call(this))})):U(this,u,!0))},W=function(){var t;if(!D(this,f)&&!D(this,n)&&D(this,c)){U(this,n,!0);try{D(this,h)&&this.beforeAttributesUpdate(),this.beforeUpdate(),null==(t=D(this,e))||t.update(),this.updated(),D(this,h)&&(this.afterAttributesUpdate(),U(this,h,!1))}finally{U(this,n,!1)}}},C=function(){var e;const s=D(this,t);if(!s.styles)return;const i=D(this,a);if(s.sheet&&i instanceof ShadowRoot&&"adoptedStyleSheets"in i){if(!i.adoptedStyleSheets.includes(s.sheet)){const t=Array.from(i.adoptedStyleSheets);t.push(s.sheet),i.adoptedStyleSheets=t}return void U(this,b,!0)}const r=i instanceof ShadowRoot?i:document.head,n=`solely-style-${T.SOLELY_VERSION}-${s.tagName}`,o=!(null==(e=s.shadowDOM)?void 0:e.use),h="undefined"!=typeof CSS&&CSS.escape?CSS.escape(n):n.replace(/([.#:[\]()!])/g,"\\$1");if(!r.querySelector(`#${h}`)){const t=document.createElement("style");t.id=n,t.textContent=s.styles,r.appendChild(t)}if(o){const t=D(J,m).get(n)||0;D(J,m).set(n,t+1),U(this,b,!0)}},N=function(){var e,s;if(!D(this,b))return;U(this,b,!1);const i=D(this,t);if(!(null==(e=i.shadowDOM)?void 0:e.use)&&i.styles){const t=`solely-style-${T.SOLELY_VERSION}-${i.tagName}`,e=D(J,m).get(t)||0;if(e<=1){const e=CSS.escape(t);null==(s=document.head.querySelector(`#${e}`))||s.remove(),D(J,m).delete(t)}else D(J,m).set(t,e-1)}},A=function(){D(this,l)||(U(this,l,!0),this.created())},q(J,m,new Map),q(J,y,new Set(["$data","$refs","constructor","created","mounted","beforeUpdate","updated","unmounted","attributeChanged","beforeAttributesUpdate","afterAttributesUpdate","emit","emitNative","refresh","dispose","warn","error"]));let F=J;exports.default=F;
1
+ "use strict";var t,e,s,i,a,r,n,o,h,l,c,u,d,p,f,b,m,y,v,w,S,g,M,O,$,k,j,C,W,N,A,E=Object.defineProperty,P=t=>{throw TypeError(t)},L=(t,e,s)=>e.has(t)||P("Cannot "+s),D=(t,e,s)=>(L(t,e,"read from private field"),s?s.call(t):e.get(t)),q=(t,e,s)=>e.has(t)?P("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),U=(t,e,s,i)=>(L(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),_=(t,e,s)=>(L(t,e,"access private method"),s);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("../../shared/is-object.cjs"),T=require("../../shared/env.cjs"),x=require("../../shared/case-convert.cjs"),I=require("../reactivity/observe.cjs"),V=require("../renderer/renderIR.cjs"),H=Symbol.for("solely.manifest"),J=class extends HTMLElement{constructor(m={}){var y,w;super(),q(this,v),((t,e,s)=>{e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(this,"symbol"!=typeof(w="$refs")?w+"":w,{}),q(this,t),q(this,e),q(this,s),q(this,i),q(this,a),q(this,r),q(this,n,!1),q(this,o,!1),q(this,h,!1),q(this,l,!1),q(this,c,!1),q(this,u,!1),q(this,d,!1),q(this,p,new Set),q(this,f,!1),q(this,b,!1);const g=this.constructor;U(this,t,g[H]||{tagName:"base-element"});const O=D(this,t);U(this,a,(null==(y=O.shadowDOM)?void 0:y.use)?this.attachShadow({mode:O.shadowDOM.mode||"open"}):this),_(this,v,S).call(this,m),_(this,v,M).call(this,O),queueMicrotask(()=>_(this,v,A).call(this))}static get observedAttributes(){const t=this[H];return(null==t?void 0:t.attributeMap)?Array.from(t.attributeMap.keys()):[]}get $data(){return D(this,i)}set $data(t){var e;R.isObject(t)||(t={}),t!==D(this,i)&&(null==(e=D(this,r))||e.call(this),_(this,v,S).call(this,t),_(this,v,$).call(this),_(this,v,j).call(this))}refresh(){_(this,v,j).call(this)}connectedCallback(){if(D(this,f))throw this.remove(),new Error(`[Solely] <${this.tagName.toLowerCase()}> has been disposed and cannot be reconnected.`);U(this,c,!0);const i=D(this,t);if(_(this,v,A).call(this),(i.className||i.tagName||"").split(" ").forEach(t=>t&&this.classList.add(t)),_(this,v,W).call(this),i.attributeMap&&R.isObject(this.$data)){_(this,v,$).call(this);for(const[t,e]of i.attributeMap){const s=e.name;if(this.hasAttribute(t)){const i=this.getAttribute(t),a=_(this,v,k).call(this,i,e.default,e.type);this.$data[s]=a}else"default"in e&&void 0===this.$data[s]&&(this.$data[s]=e.default,"boolean"===e.type&&!0===e.default&&this.setAttribute(t,""))}}_(this,v,w).call(this),D(this,s)&&!D(this,e)&&U(this,e,V.createRender(D(this,s),D(this,a),this)),D(this,u)&&(U(this,u,!1),_(this,v,j).call(this)),this.mounted()}disconnectedCallback(){U(this,c,!1),D(this,f)||_(this,v,N).call(this),this.unmounted()}attributeChangedCallback(e,s,i){var a;if(D(this,f)||s===i||!R.isObject(this.$data))return;if(D(this,p).has(e))return;const r=null==(a=D(this,t).attributeMap)?void 0:a.get(e);if(!r)return;const n=r.name,o=this.$data[n],l=_(this,v,k).call(this,i,r.default??o,r.type);o!==l&&(U(this,h,!0),this.$data[n]=l,this.attributeChanged(e,o,l))}emit(t,e,s){D(this,f)||this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e,...s}))}emitNative(t,e){D(this,f)||this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0,...e}))}warn(t,e){if(T.IS_DEV&&t){const t=this.tagName.toLowerCase();console.warn(`[${t}] ${e}`)}}error(t,e){if(T.IS_DEV&&t){const t=this.tagName.toLowerCase();console.error(`[${t}] ${e}`)}}dispose(){var t,s;D(this,f)||(U(this,f,!0),U(this,c,!1),_(this,v,N).call(this),null==(t=D(this,e))||t.destroy(),U(this,e,void 0),null==(s=D(this,r))||s.call(this),U(this,r,void 0),this.remove())}created(){}mounted(){}beforeUpdate(){}updated(){}unmounted(){}attributeChanged(t,e,s){}beforeAttributesUpdate(){}afterAttributesUpdate(){}};t=new WeakMap,e=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap,r=new WeakMap,n=new WeakMap,o=new WeakMap,h=new WeakMap,l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap,f=new WeakMap,b=new WeakMap,m=new WeakMap,y=new WeakMap,v=new WeakSet,w=function(){const t=Object.getOwnPropertyNames(this),e=["#","_"],s=D(J,y),i=new Map;let a=Object.getPrototypeOf(this);for(;a&&a!==HTMLElement.prototype;){const t=Object.getOwnPropertyDescriptors(a);for(const[e,s]of Object.entries(t))s.set&&!i.has(e)&&i.set(e,s);a=Object.getPrototypeOf(a)}for(const r of t){if(s.has(r))continue;if(e.some(t=>r.startsWith(t)))continue;const t=Object.getOwnPropertyDescriptor(this,r);if(!t||!("value"in t))continue;const a=t.value,n=i.get(r);(null==n?void 0:n.set)&&(delete this[r],this[r]=a)}},S=function(e){const{proxy:s,dispose:a}=I.observe(e,e=>{var s;if("set"===e.type){const{key:i,newValue:a}=e,r=D(this,t),n=String(i),o=null==(s=r.propMap)?void 0:s.get(n);(null==o?void 0:o.reflect)&&_(this,v,g).call(this,o,a)}this.emit("dataChange",{...e}),_(this,v,j).call(this)});U(this,i,s),U(this,r,a)},g=function(t,e){const s=x.camelToKebab(t.name);D(this,p).add(s);try{if(null==e)return void this.removeAttribute(s);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)}}finally{D(this,p).delete(s)}},M=function(t){t.ir&&U(this,s,t.ir)},O=function(){const e=D(this,t);if(e.attributeMap)for(const[,t]of e.attributeMap){if(!1===t.reactive)continue;let e,s=Object.getPrototypeOf(this);for(;s&&s!==HTMLElement.prototype&&(e=Object.getOwnPropertyDescriptor(s,t.name),!e);)s=Object.getPrototypeOf(s);if(!(null==e?void 0:e.get)&&!(null==e?void 0:e.set)){const e=Object.getOwnPropertyDescriptor(this,t.name);e&&"value"in e&&(this.$data[t.name]=e.value,delete this[t.name]),Object.defineProperty(this,t.name,{get:()=>this.$data[t.name],set:e=>{this.$data[t.name]=e},configurable:!0,enumerable:!0})}}},$=function(){D(this,d)||(U(this,d,!0),_(this,v,O).call(this))},k=function(t,e,s){if(null===t)return"boolean"!==s&&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(i){return console.error(`[Solely] Failed to parse object value: "${t}", using default value.`,i),e}case"array":try{const s=JSON.parse(t);return Array.isArray(s)?s:e}catch(i){return console.error(`[Solely] Failed to parse array value: "${t}", using default value.`,i),e}default:return t}},j=function(){D(this,f)||(D(this,c)?!D(this,o)&&D(this,e)&&(U(this,o,!0),queueMicrotask(()=>{D(this,f)||(U(this,o,!1),_(this,v,C).call(this))})):U(this,u,!0))},C=function(){var t;if(!D(this,f)&&!D(this,n)&&D(this,c)){U(this,n,!0);try{D(this,h)&&this.beforeAttributesUpdate(),this.beforeUpdate(),null==(t=D(this,e))||t.update(),this.updated(),D(this,h)&&(this.afterAttributesUpdate(),U(this,h,!1))}finally{U(this,n,!1)}}},W=function(){var e;const s=D(this,t);if(!s.styles)return;const i=D(this,a);if(s.sheet&&i instanceof ShadowRoot&&"adoptedStyleSheets"in i){if(!i.adoptedStyleSheets.includes(s.sheet)){const t=Array.from(i.adoptedStyleSheets);t.push(s.sheet),i.adoptedStyleSheets=t}return void U(this,b,!0)}const r=i instanceof ShadowRoot?i:document.head,n=`solely-style-${T.SOLELY_VERSION}-${s.tagName}`,o=!(null==(e=s.shadowDOM)?void 0:e.use),h="undefined"!=typeof CSS&&CSS.escape?CSS.escape(n):n.replace(/([.#:[\]()!])/g,"\\$1");if(!r.querySelector(`#${h}`)){const t=document.createElement("style");t.id=n,t.textContent=s.styles,r.appendChild(t)}if(o){const t=D(J,m).get(n)||0;D(J,m).set(n,t+1),U(this,b,!0)}},N=function(){var e,s;if(!D(this,b))return;U(this,b,!1);const i=D(this,t);if(!(null==(e=i.shadowDOM)?void 0:e.use)&&i.styles){const t=`solely-style-${T.SOLELY_VERSION}-${i.tagName}`,e=D(J,m).get(t)||0;if(e<=1){const e="undefined"!=typeof CSS&&CSS.escape?CSS.escape(t):t.replace(/([.#:[\]()!])/g,"\\$1");null==(s=document.head.querySelector(`#${e}`))||s.remove(),D(J,m).delete(t)}else D(J,m).set(t,e-1)}},A=function(){D(this,l)||(U(this,l,!0),this.created())},q(J,m,new Map),q(J,y,new Set(["$data","$refs","constructor","created","mounted","beforeUpdate","updated","unmounted","attributeChanged","beforeAttributesUpdate","afterAttributesUpdate","emit","emitNative","refresh","dispose","warn","error"]));let F=J;exports.default=F;
@@ -1 +1 @@
1
- var t,e,s,i,a,r,o,n,h,l,c,d,u,p,f,b,m,y,v,w,g,M,S,$,O,k,j,W,C,A,N,E=Object.defineProperty,P=t=>{throw TypeError(t)},U=(t,e,s)=>e.has(t)||P("Cannot "+s),D=(t,e,s)=>(U(t,e,"read from private field"),s?s.call(t):e.get(t)),L=(t,e,s)=>e.has(t)?P("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),q=(t,e,s,i)=>(U(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),x=(t,e,s)=>(U(t,e,"access private method"),s);import{isObject as T}from"../../shared/is-object.js";import{SOLELY_VERSION as H,IS_DEV as J}from"../../shared/env.js";import{camelToKebab as R}from"../../shared/case-convert.js";import{observe as F}from"../reactivity/observe.js";import{createRender as I}from"../renderer/renderIR.js";const V=Symbol.for("solely.manifest"),_=class extends HTMLElement{constructor(m={}){var y,w;super(),L(this,v),((t,e,s)=>{e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(this,"symbol"!=typeof(w="$refs")?w+"":w,{}),L(this,t),L(this,e),L(this,s),L(this,i),L(this,a),L(this,r),L(this,o,!1),L(this,n,!1),L(this,h,!1),L(this,l,!1),L(this,c,!1),L(this,d,!1),L(this,u,!1),L(this,p,new Set),L(this,f,!1),L(this,b,!1);const M=this.constructor;q(this,t,M[V]||{tagName:"base-element"});const $=D(this,t);q(this,a,(null==(y=$.shadowDOM)?void 0:y.use)?this.attachShadow({mode:$.shadowDOM.mode||"open"}):this),x(this,v,g).call(this,m),x(this,v,S).call(this,$),queueMicrotask(()=>x(this,v,N).call(this))}static get observedAttributes(){const t=this[V];return(null==t?void 0:t.attributeMap)?Array.from(t.attributeMap.keys()):[]}get $data(){return D(this,i)}set $data(t){var e;T(t)||(t={}),t!==D(this,i)&&(null==(e=D(this,r))||e.call(this),x(this,v,g).call(this,t),x(this,v,O).call(this),x(this,v,j).call(this))}refresh(){x(this,v,j).call(this)}connectedCallback(){if(D(this,f))throw this.remove(),new Error(`[Solely] <${this.tagName.toLowerCase()}> has been disposed and cannot be reconnected.`);q(this,c,!0);const i=D(this,t);if(x(this,v,N).call(this),(i.className||i.tagName||"").split(" ").forEach(t=>t&&this.classList.add(t)),x(this,v,C).call(this),i.attributeMap&&T(this.$data)){x(this,v,O).call(this);for(const[t,e]of i.attributeMap){const s=e.name;if(this.hasAttribute(t)){const i=this.getAttribute(t),a=x(this,v,k).call(this,i,e.default,e.type);this.$data[s]=a}else"default"in e&&void 0===this.$data[s]&&(this.$data[s]=e.default,"boolean"===e.type&&!0===e.default&&this.setAttribute(t,""))}}x(this,v,w).call(this),D(this,s)&&!D(this,e)&&q(this,e,I(D(this,s),D(this,a),this)),D(this,d)&&(q(this,d,!1),x(this,v,j).call(this)),this.mounted()}disconnectedCallback(){q(this,c,!1),D(this,f)||x(this,v,A).call(this),this.unmounted()}attributeChangedCallback(e,s,i){var a;if(D(this,f)||s===i||!T(this.$data))return;if(D(this,p).has(e))return;const r=null==(a=D(this,t).attributeMap)?void 0:a.get(e);if(!r)return;const o=r.name,n=this.$data[o],l=x(this,v,k).call(this,i,r.default??n,r.type);n!==l&&(q(this,h,!0),this.$data[o]=l,this.attributeChanged(e,n,l))}emit(t,e,s){D(this,f)||this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e,...s}))}emitNative(t,e){D(this,f)||this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0,...e}))}warn(t,e){if(J&&t){const t=this.tagName.toLowerCase();console.warn(`[${t}] ${e}`)}}error(t,e){if(J&&t){const t=this.tagName.toLowerCase();console.error(`[${t}] ${e}`)}}dispose(){var t,s;D(this,f)||(q(this,f,!0),q(this,c,!1),x(this,v,A).call(this),null==(t=D(this,e))||t.destroy(),q(this,e,void 0),null==(s=D(this,r))||s.call(this),q(this,r,void 0),this.remove())}created(){}mounted(){}beforeUpdate(){}updated(){}unmounted(){}attributeChanged(t,e,s){}beforeAttributesUpdate(){}afterAttributesUpdate(){}};t=new WeakMap,e=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap,r=new WeakMap,o=new WeakMap,n=new WeakMap,h=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,b=new WeakMap,m=new WeakMap,y=new WeakMap,v=new WeakSet,w=function(){const t=Object.getOwnPropertyNames(this),e=["#","_"],s=D(_,y),i=new Map;let a=Object.getPrototypeOf(this);for(;a&&a!==HTMLElement.prototype;){const t=Object.getOwnPropertyDescriptors(a);for(const[e,s]of Object.entries(t))s.set&&!i.has(e)&&i.set(e,s);a=Object.getPrototypeOf(a)}for(const r of t){if(s.has(r))continue;if(e.some(t=>r.startsWith(t)))continue;const t=Object.getOwnPropertyDescriptor(this,r);if(!t||!("value"in t))continue;const a=t.value,o=i.get(r);(null==o?void 0:o.set)&&(delete this[r],this[r]=a)}},g=function(e){const{proxy:s,dispose:a}=F(e,e=>{var s;if("set"===e.type){const{key:i,newValue:a}=e,r=D(this,t),o=String(i),n=null==(s=r.propMap)?void 0:s.get(o);(null==n?void 0:n.reflect)&&x(this,v,M).call(this,n,a)}this.emit("dataChange",{...e}),x(this,v,j).call(this)});q(this,i,s),q(this,r,a)},M=function(t,e){const s=R(t.name);D(this,p).add(s);try{if(null==e)return void this.removeAttribute(s);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)}}finally{D(this,p).delete(s)}},S=function(t){t.ir&&q(this,s,t.ir)},$=function(){const e=D(this,t);if(e.attributeMap)for(const[,t]of e.attributeMap){if(!1===t.reactive)continue;let e,s=Object.getPrototypeOf(this);for(;s&&s!==HTMLElement.prototype&&(e=Object.getOwnPropertyDescriptor(s,t.name),!e);)s=Object.getPrototypeOf(s);if(!(null==e?void 0:e.get)&&!(null==e?void 0:e.set)){const e=Object.getOwnPropertyDescriptor(this,t.name);e&&"value"in e&&(this.$data[t.name]=e.value,delete this[t.name]),Object.defineProperty(this,t.name,{get:()=>this.$data[t.name],set:e=>{this.$data[t.name]=e},configurable:!0,enumerable:!0})}}},O=function(){D(this,u)||(q(this,u,!0),x(this,v,$).call(this))},k=function(t,e,s){if(null===t)return"boolean"!==s&&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(i){return console.error(`[Solely] Failed to parse object value: "${t}", using default value.`,i),e}case"array":try{const s=JSON.parse(t);return Array.isArray(s)?s:e}catch(i){return console.error(`[Solely] Failed to parse array value: "${t}", using default value.`,i),e}default:return t}},j=function(){D(this,f)||(D(this,c)?!D(this,n)&&D(this,e)&&(q(this,n,!0),queueMicrotask(()=>{D(this,f)||(q(this,n,!1),x(this,v,W).call(this))})):q(this,d,!0))},W=function(){var t;if(!D(this,f)&&!D(this,o)&&D(this,c)){q(this,o,!0);try{D(this,h)&&this.beforeAttributesUpdate(),this.beforeUpdate(),null==(t=D(this,e))||t.update(),this.updated(),D(this,h)&&(this.afterAttributesUpdate(),q(this,h,!1))}finally{q(this,o,!1)}}},C=function(){var e;const s=D(this,t);if(!s.styles)return;const i=D(this,a);if(s.sheet&&i instanceof ShadowRoot&&"adoptedStyleSheets"in i){if(!i.adoptedStyleSheets.includes(s.sheet)){const t=Array.from(i.adoptedStyleSheets);t.push(s.sheet),i.adoptedStyleSheets=t}return void q(this,b,!0)}const r=i instanceof ShadowRoot?i:document.head,o=`solely-style-${H}-${s.tagName}`,n=!(null==(e=s.shadowDOM)?void 0:e.use),h="undefined"!=typeof CSS&&CSS.escape?CSS.escape(o):o.replace(/([.#:[\]()!])/g,"\\$1");if(!r.querySelector(`#${h}`)){const t=document.createElement("style");t.id=o,t.textContent=s.styles,r.appendChild(t)}if(n){const t=D(_,m).get(o)||0;D(_,m).set(o,t+1),q(this,b,!0)}},A=function(){var e,s;if(!D(this,b))return;q(this,b,!1);const i=D(this,t);if(!(null==(e=i.shadowDOM)?void 0:e.use)&&i.styles){const t=`solely-style-${H}-${i.tagName}`,e=D(_,m).get(t)||0;if(e<=1){const e=CSS.escape(t);null==(s=document.head.querySelector(`#${e}`))||s.remove(),D(_,m).delete(t)}else D(_,m).set(t,e-1)}},N=function(){D(this,l)||(q(this,l,!0),this.created())},L(_,m,new Map),L(_,y,new Set(["$data","$refs","constructor","created","mounted","beforeUpdate","updated","unmounted","attributeChanged","beforeAttributesUpdate","afterAttributesUpdate","emit","emitNative","refresh","dispose","warn","error"]));let z=_;export{z as default};
1
+ var t,e,s,i,a,r,o,n,h,l,c,d,u,p,f,b,m,y,v,w,g,S,M,$,O,k,C,j,W,A,N,E=Object.defineProperty,P=t=>{throw TypeError(t)},U=(t,e,s)=>e.has(t)||P("Cannot "+s),D=(t,e,s)=>(U(t,e,"read from private field"),s?s.call(t):e.get(t)),L=(t,e,s)=>e.has(t)?P("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),q=(t,e,s,i)=>(U(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),x=(t,e,s)=>(U(t,e,"access private method"),s);import{isObject as T}from"../../shared/is-object.js";import{SOLELY_VERSION as H,IS_DEV as J}from"../../shared/env.js";import{camelToKebab as R}from"../../shared/case-convert.js";import{observe as F}from"../reactivity/observe.js";import{createRender as I}from"../renderer/renderIR.js";const V=Symbol.for("solely.manifest"),_=class extends HTMLElement{constructor(m={}){var y,w;super(),L(this,v),((t,e,s)=>{e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(this,"symbol"!=typeof(w="$refs")?w+"":w,{}),L(this,t),L(this,e),L(this,s),L(this,i),L(this,a),L(this,r),L(this,o,!1),L(this,n,!1),L(this,h,!1),L(this,l,!1),L(this,c,!1),L(this,d,!1),L(this,u,!1),L(this,p,new Set),L(this,f,!1),L(this,b,!1);const S=this.constructor;q(this,t,S[V]||{tagName:"base-element"});const $=D(this,t);q(this,a,(null==(y=$.shadowDOM)?void 0:y.use)?this.attachShadow({mode:$.shadowDOM.mode||"open"}):this),x(this,v,g).call(this,m),x(this,v,M).call(this,$),queueMicrotask(()=>x(this,v,N).call(this))}static get observedAttributes(){const t=this[V];return(null==t?void 0:t.attributeMap)?Array.from(t.attributeMap.keys()):[]}get $data(){return D(this,i)}set $data(t){var e;T(t)||(t={}),t!==D(this,i)&&(null==(e=D(this,r))||e.call(this),x(this,v,g).call(this,t),x(this,v,O).call(this),x(this,v,C).call(this))}refresh(){x(this,v,C).call(this)}connectedCallback(){if(D(this,f))throw this.remove(),new Error(`[Solely] <${this.tagName.toLowerCase()}> has been disposed and cannot be reconnected.`);q(this,c,!0);const i=D(this,t);if(x(this,v,N).call(this),(i.className||i.tagName||"").split(" ").forEach(t=>t&&this.classList.add(t)),x(this,v,W).call(this),i.attributeMap&&T(this.$data)){x(this,v,O).call(this);for(const[t,e]of i.attributeMap){const s=e.name;if(this.hasAttribute(t)){const i=this.getAttribute(t),a=x(this,v,k).call(this,i,e.default,e.type);this.$data[s]=a}else"default"in e&&void 0===this.$data[s]&&(this.$data[s]=e.default,"boolean"===e.type&&!0===e.default&&this.setAttribute(t,""))}}x(this,v,w).call(this),D(this,s)&&!D(this,e)&&q(this,e,I(D(this,s),D(this,a),this)),D(this,d)&&(q(this,d,!1),x(this,v,C).call(this)),this.mounted()}disconnectedCallback(){q(this,c,!1),D(this,f)||x(this,v,A).call(this),this.unmounted()}attributeChangedCallback(e,s,i){var a;if(D(this,f)||s===i||!T(this.$data))return;if(D(this,p).has(e))return;const r=null==(a=D(this,t).attributeMap)?void 0:a.get(e);if(!r)return;const o=r.name,n=this.$data[o],l=x(this,v,k).call(this,i,r.default??n,r.type);n!==l&&(q(this,h,!0),this.$data[o]=l,this.attributeChanged(e,n,l))}emit(t,e,s){D(this,f)||this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e,...s}))}emitNative(t,e){D(this,f)||this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0,...e}))}warn(t,e){if(J&&t){const t=this.tagName.toLowerCase();console.warn(`[${t}] ${e}`)}}error(t,e){if(J&&t){const t=this.tagName.toLowerCase();console.error(`[${t}] ${e}`)}}dispose(){var t,s;D(this,f)||(q(this,f,!0),q(this,c,!1),x(this,v,A).call(this),null==(t=D(this,e))||t.destroy(),q(this,e,void 0),null==(s=D(this,r))||s.call(this),q(this,r,void 0),this.remove())}created(){}mounted(){}beforeUpdate(){}updated(){}unmounted(){}attributeChanged(t,e,s){}beforeAttributesUpdate(){}afterAttributesUpdate(){}};t=new WeakMap,e=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap,r=new WeakMap,o=new WeakMap,n=new WeakMap,h=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,b=new WeakMap,m=new WeakMap,y=new WeakMap,v=new WeakSet,w=function(){const t=Object.getOwnPropertyNames(this),e=["#","_"],s=D(_,y),i=new Map;let a=Object.getPrototypeOf(this);for(;a&&a!==HTMLElement.prototype;){const t=Object.getOwnPropertyDescriptors(a);for(const[e,s]of Object.entries(t))s.set&&!i.has(e)&&i.set(e,s);a=Object.getPrototypeOf(a)}for(const r of t){if(s.has(r))continue;if(e.some(t=>r.startsWith(t)))continue;const t=Object.getOwnPropertyDescriptor(this,r);if(!t||!("value"in t))continue;const a=t.value,o=i.get(r);(null==o?void 0:o.set)&&(delete this[r],this[r]=a)}},g=function(e){const{proxy:s,dispose:a}=F(e,e=>{var s;if("set"===e.type){const{key:i,newValue:a}=e,r=D(this,t),o=String(i),n=null==(s=r.propMap)?void 0:s.get(o);(null==n?void 0:n.reflect)&&x(this,v,S).call(this,n,a)}this.emit("dataChange",{...e}),x(this,v,C).call(this)});q(this,i,s),q(this,r,a)},S=function(t,e){const s=R(t.name);D(this,p).add(s);try{if(null==e)return void this.removeAttribute(s);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)}}finally{D(this,p).delete(s)}},M=function(t){t.ir&&q(this,s,t.ir)},$=function(){const e=D(this,t);if(e.attributeMap)for(const[,t]of e.attributeMap){if(!1===t.reactive)continue;let e,s=Object.getPrototypeOf(this);for(;s&&s!==HTMLElement.prototype&&(e=Object.getOwnPropertyDescriptor(s,t.name),!e);)s=Object.getPrototypeOf(s);if(!(null==e?void 0:e.get)&&!(null==e?void 0:e.set)){const e=Object.getOwnPropertyDescriptor(this,t.name);e&&"value"in e&&(this.$data[t.name]=e.value,delete this[t.name]),Object.defineProperty(this,t.name,{get:()=>this.$data[t.name],set:e=>{this.$data[t.name]=e},configurable:!0,enumerable:!0})}}},O=function(){D(this,u)||(q(this,u,!0),x(this,v,$).call(this))},k=function(t,e,s){if(null===t)return"boolean"!==s&&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(i){return console.error(`[Solely] Failed to parse object value: "${t}", using default value.`,i),e}case"array":try{const s=JSON.parse(t);return Array.isArray(s)?s:e}catch(i){return console.error(`[Solely] Failed to parse array value: "${t}", using default value.`,i),e}default:return t}},C=function(){D(this,f)||(D(this,c)?!D(this,n)&&D(this,e)&&(q(this,n,!0),queueMicrotask(()=>{D(this,f)||(q(this,n,!1),x(this,v,j).call(this))})):q(this,d,!0))},j=function(){var t;if(!D(this,f)&&!D(this,o)&&D(this,c)){q(this,o,!0);try{D(this,h)&&this.beforeAttributesUpdate(),this.beforeUpdate(),null==(t=D(this,e))||t.update(),this.updated(),D(this,h)&&(this.afterAttributesUpdate(),q(this,h,!1))}finally{q(this,o,!1)}}},W=function(){var e;const s=D(this,t);if(!s.styles)return;const i=D(this,a);if(s.sheet&&i instanceof ShadowRoot&&"adoptedStyleSheets"in i){if(!i.adoptedStyleSheets.includes(s.sheet)){const t=Array.from(i.adoptedStyleSheets);t.push(s.sheet),i.adoptedStyleSheets=t}return void q(this,b,!0)}const r=i instanceof ShadowRoot?i:document.head,o=`solely-style-${H}-${s.tagName}`,n=!(null==(e=s.shadowDOM)?void 0:e.use),h="undefined"!=typeof CSS&&CSS.escape?CSS.escape(o):o.replace(/([.#:[\]()!])/g,"\\$1");if(!r.querySelector(`#${h}`)){const t=document.createElement("style");t.id=o,t.textContent=s.styles,r.appendChild(t)}if(n){const t=D(_,m).get(o)||0;D(_,m).set(o,t+1),q(this,b,!0)}},A=function(){var e,s;if(!D(this,b))return;q(this,b,!1);const i=D(this,t);if(!(null==(e=i.shadowDOM)?void 0:e.use)&&i.styles){const t=`solely-style-${H}-${i.tagName}`,e=D(_,m).get(t)||0;if(e<=1){const e="undefined"!=typeof CSS&&CSS.escape?CSS.escape(t):t.replace(/([.#:[\]()!])/g,"\\$1");null==(s=document.head.querySelector(`#${e}`))||s.remove(),D(_,m).delete(t)}else D(_,m).set(t,e-1)}},N=function(){D(this,l)||(q(this,l,!0),this.created())},L(_,m,new Map),L(_,y,new Set(["$data","$refs","constructor","created","mounted","beforeUpdate","updated","unmounted","attributeChanged","beforeAttributesUpdate","afterAttributesUpdate","emit","emitNative","refresh","dispose","warn","error"]));let z=_;export{z as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../shared/is-object.cjs"),t=Symbol("solely.raw"),n=new WeakMap,r=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap;function c(e,t,n){l(e,t);let r=o.get(e);r||(r=new Map,o.set(e,r)),r.set(t,n);let i=s.get(n);i||(i=[],s.set(n,i)),i.some(n=>n.parentRef.deref()===e&&n.key===t)||i.push({parentRef:new WeakRef(e),key:t})}function l(e,t){const n=o.get(e);if(!n)return;const r=n.get(t);if(!r)return;n.delete(t);const i=s.get(r);if(i){const n=i.filter(n=>{const r=n.parentRef.deref();return void 0!==r&&!(r===e&&n.key===t)});0===n.length?s.delete(r):s.set(r,n)}}function a(t,n){const r=o.get(n);if(r)for(const e of r.keys())l(n,e);for(let i=0;i<t.length;i++){const r=t[i];e.isObject(r)&&!p(r)&&c(n,String(i),w(r))}}function f(e){if(e&&"object"==typeof e){const n=e[t];if(n)return n}return e}const u=Object.prototype.toString,p=e=>{if(!e||"object"!=typeof e)return!1;const t=u.call(e);return"[object Date]"===t||"[object RegExp]"===t||"[object Map]"===t||"[object Set]"===t||e instanceof File||e instanceof Blob||e instanceof FormData||e instanceof ArrayBuffer||e instanceof Response||e instanceof Request};function y(e){return!(!e||!e[t])}const h=new Map,g=(e,t)=>{if(0===t.length)return!0;const n=e.map(String);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(".");if(t.some(t=>t.test(e)))return!0}return!1},d=(e,t)=>{if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!d(e[n],t[n]))return!1;return!0}if(Array.isArray(e)!==Array.isArray(t))return!1;const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);if(n.length!==r.length)return!1;for(const i of n){if(!Reflect.has(t,i))return!1;if(!d(e[i],t[i]))return!1}return!0},b=(e,t)=>{e.active&&(e.deepCompare&&"set"===t.type&&d(t.oldValue,t.newValue)||(e.throttle>0?(e.pending.push(t),e.timer||(e.timer=setTimeout(()=>{if(!e.active)return;const t=[...e.pending];e.pending=[],e.timer=null,t.length>0&&(e.onBatch?e.onBatch(t):e.callback(t[t.length-1]))},e.throttle))):e.onBatch?e.onBatch([t]):e.callback(t)))},v=(e,t)=>{const n=[{node:e,relativePath:[],visited:new Set([e])}];let i=0;for(;i<n.length;){const{node:e,relativePath:o,visited:c}=n[i++],l=r.get(e);l&&l.forEach(e=>{if(!e.active)return;let n=o;if("set"===t.type||"delete"===t.type?n=[...o,t.key]:"array-push"!==t.type&&"array-splice"!==t.type||(n=[...o,String(t.index)]),!g(n,e.filterRegexes))return;const r={...t,path:n};b(e,r)});const a=s.get(e);if(a)for(let t=a.length-1;t>=0;t--){const e=a[t],r=e.parentRef.deref();if(!r){a.splice(t,1);continue}if(c.has(r))continue;const i=new Set(c);i.add(r),n.push({node:r,relativePath:[e.key,...o],visited:i})}}},R={};["push","pop","shift","unshift","splice"].forEach(t=>{R[t]=function(...n){const r=this,o=f(r),s=i.get(r)||0;i.set(r,s+1);try{const i=o.length,s=o[t].apply(o,n);if("push"===t){const t=o.length-n.length;for(let i=0;i<n.length;i++){const n=o[t+i];e.isObject(n)&&!p(n)&&c(r,String(t+i),w(n))}v(r,{type:"array-push",index:t,values:n})}else if("pop"===t)l(r,String(i-1)),v(r,{type:"array-splice",index:i-1,deleteCount:1,insert:[]});else if(a(o,r),"unshift"===t)v(r,{type:"array-push",index:0,values:n});else if("shift"===t)v(r,{type:"array-splice",index:0,deleteCount:1,insert:[]});else if("splice"===t){const[e,t,...i]=n;v(r,{type:"array-splice",index:e,deleteCount:t,insert:i})}return s}finally{i.set(r,s)}}}),["sort","reverse","fill","copyWithin"].forEach(e=>{R[e]=function(...t){const n=this,r=f(n),o=i.get(n)||0;i.set(n,o+1);try{const i=r[e].apply(r,t);return a(r,n),v(n,{type:"array-reset",method:e}),i}finally{i.set(n,o)}}}),["indexOf","lastIndexOf","includes"].forEach(e=>{R[e]=function(t,...n){const r=f(this);let i=r[e].apply(r,[t,...n]);return-1!==i&&!1!==i||!y(t)||(i=r[e].apply(r,[f(t),...n])),i}});const j={get(n,r,i){var s;if(r===t)return n;if(Array.isArray(n)&&Object.prototype.hasOwnProperty.call(R,r))return Reflect.get(R,r,i);const l=Reflect.get(n,r,i);if("symbol"==typeof r)return l;if(e.isObject(l)&&!p(l)){const e=w(l);return(null==(s=o.get(i))?void 0:s.get(r))!==e&&c(i,r,e),e}return l},set(t,n,r,o){const s=Reflect.get(t,n,o);if(Object.is(s,r))return!0;const a=Reflect.set(t,n,r,o);return!!a&&(e.isObject(r)&&!p(r)?c(o,n,w(r)):l(o,n),0===(i.get(o)||0)&&(!Array.isArray(t)&&Array.isArray(s)&&Array.isArray(r)?v(o,{type:"array-replace",oldValue:s,newValue:r}):v(o,{type:"set",key:n,newValue:r,oldValue:s})),a)},deleteProperty(e,t){if(!Reflect.has(e,t))return!1;const r=Reflect.get(e,t),o=Reflect.deleteProperty(e,t);if(o){const o=n.get(e);o&&(l(o,t),0===(i.get(o)||0)&&v(o,{type:"delete",key:t,oldValue:r}))}return o}};function w(e){if(!Object.isExtensible(e))return e;if(p(e))return e;if(e[t])return e;const r=n.get(e);if(r)return r;const i=new Proxy(e,j);return n.set(e,i),i}exports.isProxy=y,exports.observe=function(t,n,i={}){const{throttle:o=0,onBatch:s,immediate:c=!1,deepCompare:l}=i,a={callback:n,onBatch:s,throttle:o,filterRegexes:(Array.isArray(i.filter)?i.filter:i.filter?[i.filter]:[]).map(e=>{if(""===e)return/^.*$/;const t=h.get(e);if(t)return t;let n="";for(let c=0;c<e.length;c++){const t=e[c];"*"===t&&"*"===e[c+1]?(n+="**",c++):"*"===t?n+="*":"."===t?n+=".":/[.*+?^${}()|[\]\\]/.test(t)?n+="\\"+t:n+=t}const r=n.split("."),i=[];for(let c=0;c<r.length;c++){const e=r[c];"**"===e?1===r.length?i.push(".*"):0===c?i.push("(?:[^.]+\\.)*"):i.push("(?:\\.[^.]+)*"):"*"===e?i.push("[^.]+"):i.push(e)}let o="^";for(let c=0;c<i.length;c++)if(o+=i[c],c<i.length-1){const e=i[c],t=i[c+1];if(e.endsWith("\\.)*"))continue;if(t.startsWith("(?:\\."))continue;o+="\\."}o+="$";const s=new RegExp(o);return h.set(e,s),s}),pending:[],timer:null,active:!0,deepCompare:l},u=w(t);let y=r.get(u);if(y||(y=new Set,r.set(u,y)),y.add(a),c){const n=[...y],r=(t,i,o=[],s=new WeakSet)=>{e.isObject(t)&&!s.has(t)&&(s.add(t),Reflect.ownKeys(t).forEach(c=>{const l=Reflect.get(t,c);if(e.isObject(l)&&s.has(l))return;const a=Reflect.get(i,c),f=[...o,c];n.forEach(e=>{g(f,e.filterRegexes)&&b(e,{type:"set",key:c,newValue:l,oldValue:void 0,path:f})}),e.isObject(l)&&!p(l)&&r(l,a,f,s)}))};r(f(t),u)}const d=()=>{const e=r.get(u);e&&(e.delete(a),0===e.size&&r.delete(u)),a.pending=[],a.timer&&(clearTimeout(a.timer),a.timer=null)};return{proxy:u,unobserve:()=>{a.active&&(a.active=!1,d())},resume:()=>{a.active||(a.active=!0,(()=>{let e=r.get(u);e||(e=new Set,r.set(u,e)),e.add(a)})())},dispose:()=>{if(!a.active)return a.callback=()=>{},void(a.onBatch=void 0);a.active=!1,d(),a.callback=()=>{},a.onBatch=void 0}}},exports.toProxy=function(e){return e&&"object"==typeof e&&"proxy"in e?e.proxy:e},exports.toRaw=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../shared/is-object.cjs"),t=Symbol("solely.raw"),n=new WeakMap,r=new WeakMap,o=new WeakMap,i=new WeakMap,s=new WeakMap;function c(e,t,n){l(e,t);let r=i.get(e);r||(r=new Map,i.set(e,r)),r.set(t,n);let o=s.get(n);o||(o=[],s.set(n,o)),o.some(n=>n.parentRef.deref()===e&&n.key===t)||o.push({parentRef:new WeakRef(e),key:t})}function l(e,t){const n=i.get(e);if(!n)return;const r=n.get(t);if(!r)return;n.delete(t);const o=s.get(r);if(o){const n=o.filter(n=>{const r=n.parentRef.deref();return void 0!==r&&!(r===e&&n.key===t)});0===n.length?s.delete(r):s.set(r,n)}}function a(t,n){const r=i.get(n);if(r)for(const e of r.keys())l(n,e);for(let o=0;o<t.length;o++){const r=t[o];e.isObject(r)&&!p(r)&&c(n,String(o),m(r))}}function f(e){if(e&&"object"==typeof e){const n=e[t];if(n)return n}return e}const u=Object.prototype.toString,p=e=>{if(!e||"object"!=typeof e)return!1;const t=u.call(e);return"[object Date]"===t||"[object RegExp]"===t||"[object Map]"===t||"[object Set]"===t||"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||"undefined"!=typeof FormData&&e instanceof FormData||"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||"undefined"!=typeof Response&&e instanceof Response||"undefined"!=typeof Request&&e instanceof Request};function y(e){return!(!e||!e[t])}const h=new Map,d=(e,t)=>{if(0===t.length)return!0;const n=e.map(String);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(".");if(t.some(t=>t.test(e)))return!0}return!1},g=(e,t)=>{if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!g(e[n],t[n]))return!1;return!0}if(Array.isArray(e)!==Array.isArray(t))return!1;const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);if(n.length!==r.length)return!1;for(const o of n){if(!Reflect.has(t,o))return!1;if(!g(e[o],t[o]))return!1}return!0},b=(e,t)=>{e.active&&(e.deepCompare&&"set"===t.type&&g(t.oldValue,t.newValue)||(e.throttle>0?(e.pending.push(t),e.timer||(e.timer=setTimeout(()=>{if(!e.active)return;const t=[...e.pending];e.pending=[],e.timer=null,t.length>0&&(e.onBatch?e.onBatch(t):e.callback(t[t.length-1]))},e.throttle))):e.onBatch?e.onBatch([t]):e.callback(t)))},v=(e,t)=>{const n=[{node:e,relativePath:[],visited:new Set([e])}];let o=0;for(;o<n.length;){const{node:e,relativePath:i,visited:c}=n[o++],l=r.get(e);l&&l.forEach(e=>{if(!e.active)return;let n=i;if("set"===t.type||"delete"===t.type?n=[...i,t.key]:"array-push"!==t.type&&"array-splice"!==t.type||(n=[...i,String(t.index)]),!d(n,e.filterRegexes))return;const r={...t,path:n};b(e,r)});const a=s.get(e);if(a)for(let t=a.length-1;t>=0;t--){const e=a[t],r=e.parentRef.deref();if(!r){a.splice(t,1);continue}if(c.has(r))continue;const o=new Set(c);o.add(r),n.push({node:r,relativePath:[e.key,...i],visited:o})}}},R={};["push","pop","shift","unshift","splice"].forEach(t=>{R[t]=function(...n){const r=this,i=f(r),s=o.get(r)||0;o.set(r,s+1);try{const o=i.length,s=i[t].apply(i,n);if("push"===t){const t=i.length-n.length;for(let o=0;o<n.length;o++){const n=i[t+o];e.isObject(n)&&!p(n)&&c(r,String(t+o),m(n))}v(r,{type:"array-push",index:t,values:n})}else if("pop"===t)l(r,String(o-1)),v(r,{type:"array-splice",index:o-1,deleteCount:1,insert:[]});else if(a(i,r),"unshift"===t)v(r,{type:"array-push",index:0,values:n});else if("shift"===t)v(r,{type:"array-splice",index:0,deleteCount:1,insert:[]});else if("splice"===t){const[e,t,...o]=n;v(r,{type:"array-splice",index:e,deleteCount:t,insert:o})}return s}finally{o.set(r,s)}}}),["sort","reverse","fill","copyWithin"].forEach(e=>{R[e]=function(...t){const n=this,r=f(n),i=o.get(n)||0;o.set(n,i+1);try{const o=r[e].apply(r,t);return a(r,n),v(n,{type:"array-reset",method:e}),o}finally{o.set(n,i)}}}),["indexOf","lastIndexOf","includes"].forEach(e=>{R[e]=function(t,...n){const r=f(this);let o=r[e].apply(r,[t,...n]);return-1!==o&&!1!==o||!y(t)||(o=r[e].apply(r,[f(t),...n])),o}});const j={get(n,r,o){var s;if(r===t)return n;if(Array.isArray(n)&&Object.prototype.hasOwnProperty.call(R,r))return Reflect.get(R,r,o);const l=Reflect.get(n,r,o);if("symbol"==typeof r)return l;if(e.isObject(l)&&!p(l)){const e=m(l);return(null==(s=i.get(o))?void 0:s.get(r))!==e&&c(o,r,e),e}return l},set(t,n,r,i){const s=Reflect.get(t,n,i),a=f(r);if(Object.is(s,a))return!0;const u=Reflect.set(t,n,a,i);return!!u&&(e.isObject(a)&&!p(a)?c(i,n,m(a)):l(i,n),0===(o.get(i)||0)&&(!Array.isArray(t)&&Array.isArray(s)&&Array.isArray(a)?v(i,{type:"array-replace",oldValue:s,newValue:a}):v(i,{type:"set",key:n,newValue:a,oldValue:s})),u)},deleteProperty(e,t){if(!Reflect.has(e,t))return!1;const r=Reflect.get(e,t),i=Reflect.deleteProperty(e,t);if(i){const i=n.get(e);i&&(l(i,t),0===(o.get(i)||0)&&v(i,{type:"delete",key:t,oldValue:r}))}return i}};function m(e){if(!Object.isExtensible(e))return e;if(p(e))return e;if(e[t])return e;const r=n.get(e);if(r)return r;const o=new Proxy(e,j);return n.set(e,o),o}exports.isProxy=y,exports.observe=function(t,n,o={}){const{throttle:i=0,onBatch:s,immediate:c=!1,deepCompare:l}=o,a={callback:n,onBatch:s,throttle:i,filterRegexes:(Array.isArray(o.filter)?o.filter:o.filter?[o.filter]:[]).map(e=>{if(""===e)return/^.*$/;const t=h.get(e);if(t)return t;let n="";for(let c=0;c<e.length;c++){const t=e[c];"*"===t&&"*"===e[c+1]?(n+="**",c++):"*"===t?n+="*":"."===t?n+=".":/[.*+?^${}()|[\]\\]/.test(t)?n+="\\"+t:n+=t}const r=n.split("."),o=[];for(let c=0;c<r.length;c++){const e=r[c];"**"===e?1===r.length?o.push(".*"):0===c?o.push("(?:[^.]+\\.)*"):o.push("(?:\\.[^.]+)*"):"*"===e?o.push("[^.]+"):o.push(e)}let i="^";for(let c=0;c<o.length;c++)if(i+=o[c],c<o.length-1){const e=o[c],t=o[c+1];if(e.endsWith("\\.)*"))continue;if(t.startsWith("(?:\\."))continue;i+="\\."}i+="$";const s=new RegExp(i);return h.set(e,s),s}),pending:[],timer:null,active:!0,deepCompare:l},u=m(t);let y=r.get(u);if(y||(y=new Set,r.set(u,y)),y.add(a),c){const n=[...y],r=(t,o,i=[],s=new WeakSet)=>{e.isObject(t)&&!s.has(t)&&(s.add(t),Reflect.ownKeys(t).forEach(c=>{const l=Reflect.get(t,c);if(e.isObject(l)&&s.has(l))return;const a=Reflect.get(o,c),f=[...i,c];n.forEach(e=>{d(f,e.filterRegexes)&&b(e,{type:"set",key:c,newValue:l,oldValue:void 0,path:f})}),e.isObject(l)&&!p(l)&&r(l,a,f,s)}))};r(f(t),u)}const g=()=>{const e=r.get(u);e&&(e.delete(a),0===e.size&&r.delete(u)),a.pending=[],a.timer&&(clearTimeout(a.timer),a.timer=null)};return{proxy:u,unobserve:()=>{a.active&&(a.active=!1,g())},resume:()=>{a.active||(a.active=!0,(()=>{let e=r.get(u);e||(e=new Set,r.set(u,e)),e.add(a)})())},dispose:()=>{if(!a.active)return a.callback=()=>{},void(a.onBatch=void 0);a.active=!1,g(),a.callback=()=>{},a.onBatch=void 0}}},exports.toProxy=function(e){return e&&"object"==typeof e&&"proxy"in e?e.proxy:e},exports.toRaw=f;
@@ -1 +1 @@
1
- import{isObject as e}from"../../shared/is-object.js";const t=Symbol("solely.raw"),n=new WeakMap,r=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap;function l(e,t,n){c(e,t);let r=o.get(e);r||(r=new Map,o.set(e,r)),r.set(t,n);let i=s.get(n);i||(i=[],s.set(n,i)),i.some(n=>n.parentRef.deref()===e&&n.key===t)||i.push({parentRef:new WeakRef(e),key:t})}function c(e,t){const n=o.get(e);if(!n)return;const r=n.get(t);if(!r)return;n.delete(t);const i=s.get(r);if(i){const n=i.filter(n=>{const r=n.parentRef.deref();return void 0!==r&&!(r===e&&n.key===t)});0===n.length?s.delete(r):s.set(r,n)}}function a(t,n){const r=o.get(n);if(r)for(const e of r.keys())c(n,e);for(let i=0;i<t.length;i++){const r=t[i];e(r)&&!p(r)&&l(n,String(i),k(r))}}function f(e){if(e&&"object"==typeof e){const n=e[t];if(n)return n}return e}const u=Object.prototype.toString,p=e=>{if(!e||"object"!=typeof e)return!1;const t=u.call(e);return"[object Date]"===t||"[object RegExp]"===t||"[object Map]"===t||"[object Set]"===t||e instanceof File||e instanceof Blob||e instanceof FormData||e instanceof ArrayBuffer||e instanceof Response||e instanceof Request};function y(e){return!(!e||!e[t])}function h(e){return e&&"object"==typeof e&&"proxy"in e?e.proxy:e}const g=new Map,d=(e,t)=>{if(0===t.length)return!0;const n=e.map(String);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(".");if(t.some(t=>t.test(e)))return!0}return!1},v=(e,t)=>{if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!v(e[n],t[n]))return!1;return!0}if(Array.isArray(e)!==Array.isArray(t))return!1;const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);if(n.length!==r.length)return!1;for(const i of n){if(!Reflect.has(t,i))return!1;if(!v(e[i],t[i]))return!1}return!0},b=(e,t)=>{e.active&&(e.deepCompare&&"set"===t.type&&v(t.oldValue,t.newValue)||(e.throttle>0?(e.pending.push(t),e.timer||(e.timer=setTimeout(()=>{if(!e.active)return;const t=[...e.pending];e.pending=[],e.timer=null,t.length>0&&(e.onBatch?e.onBatch(t):e.callback(t[t.length-1]))},e.throttle))):e.onBatch?e.onBatch([t]):e.callback(t)))},m=(e,t)=>{const n=[{node:e,relativePath:[],visited:new Set([e])}];let i=0;for(;i<n.length;){const{node:e,relativePath:o,visited:l}=n[i++],c=r.get(e);c&&c.forEach(e=>{if(!e.active)return;let n=o;if("set"===t.type||"delete"===t.type?n=[...o,t.key]:"array-push"!==t.type&&"array-splice"!==t.type||(n=[...o,String(t.index)]),!d(n,e.filterRegexes))return;const r={...t,path:n};b(e,r)});const a=s.get(e);if(a)for(let t=a.length-1;t>=0;t--){const e=a[t],r=e.parentRef.deref();if(!r){a.splice(t,1);continue}if(l.has(r))continue;const i=new Set(l);i.add(r),n.push({node:r,relativePath:[e.key,...o],visited:i})}}},R={};["push","pop","shift","unshift","splice"].forEach(t=>{R[t]=function(...n){const r=this,o=f(r),s=i.get(r)||0;i.set(r,s+1);try{const i=o.length,s=o[t].apply(o,n);if("push"===t){const t=o.length-n.length;for(let i=0;i<n.length;i++){const n=o[t+i];e(n)&&!p(n)&&l(r,String(t+i),k(n))}m(r,{type:"array-push",index:t,values:n})}else if("pop"===t)c(r,String(i-1)),m(r,{type:"array-splice",index:i-1,deleteCount:1,insert:[]});else if(a(o,r),"unshift"===t)m(r,{type:"array-push",index:0,values:n});else if("shift"===t)m(r,{type:"array-splice",index:0,deleteCount:1,insert:[]});else if("splice"===t){const[e,t,...i]=n;m(r,{type:"array-splice",index:e,deleteCount:t,insert:i})}return s}finally{i.set(r,s)}}}),["sort","reverse","fill","copyWithin"].forEach(e=>{R[e]=function(...t){const n=this,r=f(n),o=i.get(n)||0;i.set(n,o+1);try{const i=r[e].apply(r,t);return a(r,n),m(n,{type:"array-reset",method:e}),i}finally{i.set(n,o)}}}),["indexOf","lastIndexOf","includes"].forEach(e=>{R[e]=function(t,...n){const r=f(this);let i=r[e].apply(r,[t,...n]);return-1!==i&&!1!==i||!y(t)||(i=r[e].apply(r,[f(t),...n])),i}});const w={get(n,r,i){var s;if(r===t)return n;if(Array.isArray(n)&&Object.prototype.hasOwnProperty.call(R,r))return Reflect.get(R,r,i);const c=Reflect.get(n,r,i);if("symbol"==typeof r)return c;if(e(c)&&!p(c)){const e=k(c);return(null==(s=o.get(i))?void 0:s.get(r))!==e&&l(i,r,e),e}return c},set(t,n,r,o){const s=Reflect.get(t,n,o);if(Object.is(s,r))return!0;const a=Reflect.set(t,n,r,o);return!!a&&(e(r)&&!p(r)?l(o,n,k(r)):c(o,n),0===(i.get(o)||0)&&(!Array.isArray(t)&&Array.isArray(s)&&Array.isArray(r)?m(o,{type:"array-replace",oldValue:s,newValue:r}):m(o,{type:"set",key:n,newValue:r,oldValue:s})),a)},deleteProperty(e,t){if(!Reflect.has(e,t))return!1;const r=Reflect.get(e,t),o=Reflect.deleteProperty(e,t);if(o){const o=n.get(e);o&&(c(o,t),0===(i.get(o)||0)&&m(o,{type:"delete",key:t,oldValue:r}))}return o}};function k(e){if(!Object.isExtensible(e))return e;if(p(e))return e;if(e[t])return e;const r=n.get(e);if(r)return r;const i=new Proxy(e,w);return n.set(e,i),i}function x(t,n,i={}){const{throttle:o=0,onBatch:s,immediate:l=!1,deepCompare:c}=i,a={callback:n,onBatch:s,throttle:o,filterRegexes:(Array.isArray(i.filter)?i.filter:i.filter?[i.filter]:[]).map(e=>{if(""===e)return/^.*$/;const t=g.get(e);if(t)return t;let n="";for(let l=0;l<e.length;l++){const t=e[l];"*"===t&&"*"===e[l+1]?(n+="**",l++):"*"===t?n+="*":"."===t?n+=".":/[.*+?^${}()|[\]\\]/.test(t)?n+="\\"+t:n+=t}const r=n.split("."),i=[];for(let l=0;l<r.length;l++){const e=r[l];"**"===e?1===r.length?i.push(".*"):0===l?i.push("(?:[^.]+\\.)*"):i.push("(?:\\.[^.]+)*"):"*"===e?i.push("[^.]+"):i.push(e)}let o="^";for(let l=0;l<i.length;l++)if(o+=i[l],l<i.length-1){const e=i[l],t=i[l+1];if(e.endsWith("\\.)*"))continue;if(t.startsWith("(?:\\."))continue;o+="\\."}o+="$";const s=new RegExp(o);return g.set(e,s),s}),pending:[],timer:null,active:!0,deepCompare:c},u=k(t);let y=r.get(u);if(y||(y=new Set,r.set(u,y)),y.add(a),l){const n=[...y],r=(t,i,o=[],s=new WeakSet)=>{e(t)&&!s.has(t)&&(s.add(t),Reflect.ownKeys(t).forEach(l=>{const c=Reflect.get(t,l);if(e(c)&&s.has(c))return;const a=Reflect.get(i,l),f=[...o,l];n.forEach(e=>{d(f,e.filterRegexes)&&b(e,{type:"set",key:l,newValue:c,oldValue:void 0,path:f})}),e(c)&&!p(c)&&r(c,a,f,s)}))};r(f(t),u)}const h=()=>{const e=r.get(u);e&&(e.delete(a),0===e.size&&r.delete(u)),a.pending=[],a.timer&&(clearTimeout(a.timer),a.timer=null)};return{proxy:u,unobserve:()=>{a.active&&(a.active=!1,h())},resume:()=>{a.active||(a.active=!0,(()=>{let e=r.get(u);e||(e=new Set,r.set(u,e)),e.add(a)})())},dispose:()=>{if(!a.active)return a.callback=()=>{},void(a.onBatch=void 0);a.active=!1,h(),a.callback=()=>{},a.onBatch=void 0}}}export{y as isProxy,x as observe,h as toProxy,f as toRaw};
1
+ import{isObject as e}from"../../shared/is-object.js";const t=Symbol("solely.raw"),n=new WeakMap,r=new WeakMap,o=new WeakMap,i=new WeakMap,s=new WeakMap;function l(e,t,n){a(e,t);let r=i.get(e);r||(r=new Map,i.set(e,r)),r.set(t,n);let o=s.get(n);o||(o=[],s.set(n,o)),o.some(n=>n.parentRef.deref()===e&&n.key===t)||o.push({parentRef:new WeakRef(e),key:t})}function a(e,t){const n=i.get(e);if(!n)return;const r=n.get(t);if(!r)return;n.delete(t);const o=s.get(r);if(o){const n=o.filter(n=>{const r=n.parentRef.deref();return void 0!==r&&!(r===e&&n.key===t)});0===n.length?s.delete(r):s.set(r,n)}}function c(t,n){const r=i.get(n);if(r)for(const e of r.keys())a(n,e);for(let o=0;o<t.length;o++){const r=t[o];e(r)&&!p(r)&&l(n,String(o),k(r))}}function f(e){if(e&&"object"==typeof e){const n=e[t];if(n)return n}return e}const u=Object.prototype.toString,p=e=>{if(!e||"object"!=typeof e)return!1;const t=u.call(e);return"[object Date]"===t||"[object RegExp]"===t||"[object Map]"===t||"[object Set]"===t||"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||"undefined"!=typeof FormData&&e instanceof FormData||"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||"undefined"!=typeof Response&&e instanceof Response||"undefined"!=typeof Request&&e instanceof Request};function y(e){return!(!e||!e[t])}function h(e){return e&&"object"==typeof e&&"proxy"in e?e.proxy:e}const d=new Map,g=(e,t)=>{if(0===t.length)return!0;const n=e.map(String);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(".");if(t.some(t=>t.test(e)))return!0}return!1},v=(e,t)=>{if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!v(e[n],t[n]))return!1;return!0}if(Array.isArray(e)!==Array.isArray(t))return!1;const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);if(n.length!==r.length)return!1;for(const o of n){if(!Reflect.has(t,o))return!1;if(!v(e[o],t[o]))return!1}return!0},R=(e,t)=>{e.active&&(e.deepCompare&&"set"===t.type&&v(t.oldValue,t.newValue)||(e.throttle>0?(e.pending.push(t),e.timer||(e.timer=setTimeout(()=>{if(!e.active)return;const t=[...e.pending];e.pending=[],e.timer=null,t.length>0&&(e.onBatch?e.onBatch(t):e.callback(t[t.length-1]))},e.throttle))):e.onBatch?e.onBatch([t]):e.callback(t)))},b=(e,t)=>{const n=[{node:e,relativePath:[],visited:new Set([e])}];let o=0;for(;o<n.length;){const{node:e,relativePath:i,visited:l}=n[o++],a=r.get(e);a&&a.forEach(e=>{if(!e.active)return;let n=i;if("set"===t.type||"delete"===t.type?n=[...i,t.key]:"array-push"!==t.type&&"array-splice"!==t.type||(n=[...i,String(t.index)]),!g(n,e.filterRegexes))return;const r={...t,path:n};R(e,r)});const c=s.get(e);if(c)for(let t=c.length-1;t>=0;t--){const e=c[t],r=e.parentRef.deref();if(!r){c.splice(t,1);continue}if(l.has(r))continue;const o=new Set(l);o.add(r),n.push({node:r,relativePath:[e.key,...i],visited:o})}}},m={};["push","pop","shift","unshift","splice"].forEach(t=>{m[t]=function(...n){const r=this,i=f(r),s=o.get(r)||0;o.set(r,s+1);try{const o=i.length,s=i[t].apply(i,n);if("push"===t){const t=i.length-n.length;for(let o=0;o<n.length;o++){const n=i[t+o];e(n)&&!p(n)&&l(r,String(t+o),k(n))}b(r,{type:"array-push",index:t,values:n})}else if("pop"===t)a(r,String(o-1)),b(r,{type:"array-splice",index:o-1,deleteCount:1,insert:[]});else if(c(i,r),"unshift"===t)b(r,{type:"array-push",index:0,values:n});else if("shift"===t)b(r,{type:"array-splice",index:0,deleteCount:1,insert:[]});else if("splice"===t){const[e,t,...o]=n;b(r,{type:"array-splice",index:e,deleteCount:t,insert:o})}return s}finally{o.set(r,s)}}}),["sort","reverse","fill","copyWithin"].forEach(e=>{m[e]=function(...t){const n=this,r=f(n),i=o.get(n)||0;o.set(n,i+1);try{const o=r[e].apply(r,t);return c(r,n),b(n,{type:"array-reset",method:e}),o}finally{o.set(n,i)}}}),["indexOf","lastIndexOf","includes"].forEach(e=>{m[e]=function(t,...n){const r=f(this);let o=r[e].apply(r,[t,...n]);return-1!==o&&!1!==o||!y(t)||(o=r[e].apply(r,[f(t),...n])),o}});const w={get(n,r,o){var s;if(r===t)return n;if(Array.isArray(n)&&Object.prototype.hasOwnProperty.call(m,r))return Reflect.get(m,r,o);const a=Reflect.get(n,r,o);if("symbol"==typeof r)return a;if(e(a)&&!p(a)){const e=k(a);return(null==(s=i.get(o))?void 0:s.get(r))!==e&&l(o,r,e),e}return a},set(t,n,r,i){const s=Reflect.get(t,n,i),c=f(r);if(Object.is(s,c))return!0;const u=Reflect.set(t,n,c,i);return!!u&&(e(c)&&!p(c)?l(i,n,k(c)):a(i,n),0===(o.get(i)||0)&&(!Array.isArray(t)&&Array.isArray(s)&&Array.isArray(c)?b(i,{type:"array-replace",oldValue:s,newValue:c}):b(i,{type:"set",key:n,newValue:c,oldValue:s})),u)},deleteProperty(e,t){if(!Reflect.has(e,t))return!1;const r=Reflect.get(e,t),i=Reflect.deleteProperty(e,t);if(i){const i=n.get(e);i&&(a(i,t),0===(o.get(i)||0)&&b(i,{type:"delete",key:t,oldValue:r}))}return i}};function k(e){if(!Object.isExtensible(e))return e;if(p(e))return e;if(e[t])return e;const r=n.get(e);if(r)return r;const o=new Proxy(e,w);return n.set(e,o),o}function A(t,n,o={}){const{throttle:i=0,onBatch:s,immediate:l=!1,deepCompare:a}=o,c={callback:n,onBatch:s,throttle:i,filterRegexes:(Array.isArray(o.filter)?o.filter:o.filter?[o.filter]:[]).map(e=>{if(""===e)return/^.*$/;const t=d.get(e);if(t)return t;let n="";for(let l=0;l<e.length;l++){const t=e[l];"*"===t&&"*"===e[l+1]?(n+="**",l++):"*"===t?n+="*":"."===t?n+=".":/[.*+?^${}()|[\]\\]/.test(t)?n+="\\"+t:n+=t}const r=n.split("."),o=[];for(let l=0;l<r.length;l++){const e=r[l];"**"===e?1===r.length?o.push(".*"):0===l?o.push("(?:[^.]+\\.)*"):o.push("(?:\\.[^.]+)*"):"*"===e?o.push("[^.]+"):o.push(e)}let i="^";for(let l=0;l<o.length;l++)if(i+=o[l],l<o.length-1){const e=o[l],t=o[l+1];if(e.endsWith("\\.)*"))continue;if(t.startsWith("(?:\\."))continue;i+="\\."}i+="$";const s=new RegExp(i);return d.set(e,s),s}),pending:[],timer:null,active:!0,deepCompare:a},u=k(t);let y=r.get(u);if(y||(y=new Set,r.set(u,y)),y.add(c),l){const n=[...y],r=(t,o,i=[],s=new WeakSet)=>{e(t)&&!s.has(t)&&(s.add(t),Reflect.ownKeys(t).forEach(l=>{const a=Reflect.get(t,l);if(e(a)&&s.has(a))return;const c=Reflect.get(o,l),f=[...i,l];n.forEach(e=>{g(f,e.filterRegexes)&&R(e,{type:"set",key:l,newValue:a,oldValue:void 0,path:f})}),e(a)&&!p(a)&&r(a,c,f,s)}))};r(f(t),u)}const h=()=>{const e=r.get(u);e&&(e.delete(c),0===e.size&&r.delete(u)),c.pending=[],c.timer&&(clearTimeout(c.timer),c.timer=null)};return{proxy:u,unobserve:()=>{c.active&&(c.active=!1,h())},resume:()=>{c.active||(c.active=!0,(()=>{let e=r.get(u);e||(e=new Set,r.set(u,e)),e.add(c)})())},dispose:()=>{if(!c.active)return c.callback=()=>{},void(c.onBatch=void 0);c.active=!1,h(),c.callback=()=>{},c.onBatch=void 0}}}export{y as isProxy,A as observe,h as toProxy,f as toRaw};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./observe.cjs");exports.watch=function(o,r,t={}){const s=e.toProxy(o);if(!e.isProxy(s))throw new Error("[solely] watch: source 必须是响应式代理对象或 observe 返回值,请先调用 observe()");const n=e.observe(s,r,{deepCompare:t.deepCompare,throttle:t.throttle,immediate:t.immediate});return{dispose:()=>n.dispose(),pause:()=>n.unobserve(),resume:()=>n.resume()}},exports.watchGetter=function(o,r,t,s={}){let n,i=!1;const c=[],u=()=>{if(i)return;const e=r();e!==n&&(t(e,n),n=e)};for(const p of o){const o=e.toProxy(p);if(!e.isProxy(o))throw new Error("[solely] watchGetter: sources 必须是响应式代理对象或 observe 返回值,请先调用 observe()");const r=e.observe(o,u,{deepCompare:s.deepCompare,throttle:s.throttle});c.push(r)}return s.immediate&&(n=r(),t(n,void 0)),{dispose:()=>{if(!i){i=!0;for(const e of c)e.dispose();c.length=0}},pause:()=>{for(const e of c)e.unobserve()},resume:()=>{for(const e of c)e.resume()}}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./observe.cjs");exports.watch=function(o,r,t={}){const s=e.toProxy(o);if(!e.isProxy(s))throw new Error("[solely] watch: source 必须是响应式代理对象或 observe 返回值,请先调用 observe()");const n=e.observe(s,r,{deepCompare:t.deepCompare,throttle:t.throttle,immediate:t.immediate});return{dispose:()=>n.dispose(),pause:()=>n.unobserve(),resume:()=>n.resume()}},exports.watchGetter=function(o,r,t,s={}){let n,i=!1;const c=[],u=()=>{if(i)return;const e=r();e!==n&&(t(e,n),n=e)};for(const p of o){const o=e.toProxy(p);if(!e.isProxy(o))throw new Error("[solely] watchGetter: sources 必须是响应式代理对象或 observe 返回值,请先调用 observe()");const r=e.observe(o,u,{deepCompare:s.deepCompare,throttle:s.throttle});c.push(r)}return s.immediate?(n=r(),t(n,void 0)):n=r(),{dispose:()=>{if(!i){i=!0;for(const e of c)e.dispose();c.length=0}},pause:()=>{for(const e of c)e.unobserve()},resume:()=>{for(const e of c)e.resume()}}};
@@ -1 +1 @@
1
- import{toProxy as e,isProxy as o,observe as r}from"./observe.js";function t(t,s,n={}){const i=e(t);if(!o(i))throw new Error("[solely] watch: source 必须是响应式代理对象或 observe 返回值,请先调用 observe()");const p=r(i,s,{deepCompare:n.deepCompare,throttle:n.throttle,immediate:n.immediate});return{dispose:()=>p.dispose(),pause:()=>p.unobserve(),resume:()=>p.resume()}}function s(t,s,n,i={}){let p,c=!1;const m=[],u=()=>{if(c)return;const e=s();e!==p&&(n(e,p),p=e)};for(const f of t){const t=e(f);if(!o(t))throw new Error("[solely] watchGetter: sources 必须是响应式代理对象或 observe 返回值,请先调用 observe()");const s=r(t,u,{deepCompare:i.deepCompare,throttle:i.throttle});m.push(s)}return i.immediate&&(p=s(),n(p,void 0)),{dispose:()=>{if(!c){c=!0;for(const e of m)e.dispose();m.length=0}},pause:()=>{for(const e of m)e.unobserve()},resume:()=>{for(const e of m)e.resume()}}}export{t as watch,s as watchGetter};
1
+ import{toProxy as e,isProxy as o,observe as r}from"./observe.js";function t(t,s,n={}){const i=e(t);if(!o(i))throw new Error("[solely] watch: source 必须是响应式代理对象或 observe 返回值,请先调用 observe()");const p=r(i,s,{deepCompare:n.deepCompare,throttle:n.throttle,immediate:n.immediate});return{dispose:()=>p.dispose(),pause:()=>p.unobserve(),resume:()=>p.resume()}}function s(t,s,n,i={}){let p,c=!1;const m=[],u=()=>{if(c)return;const e=s();e!==p&&(n(e,p),p=e)};for(const f of t){const t=e(f);if(!o(t))throw new Error("[solely] watchGetter: sources 必须是响应式代理对象或 observe 返回值,请先调用 observe()");const s=r(t,u,{deepCompare:i.deepCompare,throttle:i.throttle});m.push(s)}return i.immediate?(p=s(),n(p,void 0)):p=s(),{dispose:()=>{if(!c){c=!0;for(const e of m)e.dispose();m.length=0}},pause:()=>{for(const e of m)e.unobserve()},resume:()=>{for(const e of m)e.resume()}}}export{t as watch,s as watchGetter};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(()=>{var o,e;if("undefined"!=typeof window){if(null==(o=window.location)?void 0:o.search.includes("debug"))return!0;const e=globalThis;if(!0===e.__DEBUG__||!0===e.__IS_DEV__)return!0}return!("undefined"==typeof window||!["localhost","127.0.0.1","0.0.0.0"].includes((null==(e=window.location)?void 0:e.hostname)||""))})(),e=!o;exports.IS_DEV=o,exports.IS_PROD=e,exports.SOLELY_VERSION="0.5.3";
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(()=>{var o,e;if("undefined"!=typeof window){if(null==(o=window.location)?void 0:o.search.includes("debug"))return!0;const e=globalThis;if(!0===e.__DEBUG__||!0===e.__IS_DEV__)return!0}return!("undefined"==typeof window||!["localhost","127.0.0.1","0.0.0.0"].includes((null==(e=window.location)?void 0:e.hostname)||""))})(),e=!o;exports.IS_DEV=o,exports.IS_PROD=e,exports.SOLELY_VERSION="0.5.5";
@@ -1 +1 @@
1
- const n=(()=>{var n,o;if("undefined"!=typeof window){if(null==(n=window.location)?void 0:n.search.includes("debug"))return!0;const o=globalThis;if(!0===o.__DEBUG__||!0===o.__IS_DEV__)return!0}return!("undefined"==typeof window||!["localhost","127.0.0.1","0.0.0.0"].includes((null==(o=window.location)?void 0:o.hostname)||""))})(),o=!n,i="0.5.3";export{n as IS_DEV,o as IS_PROD,i as SOLELY_VERSION};
1
+ const n=(()=>{var n,o;if("undefined"!=typeof window){if(null==(n=window.location)?void 0:n.search.includes("debug"))return!0;const o=globalThis;if(!0===o.__DEBUG__||!0===o.__IS_DEV__)return!0}return!("undefined"==typeof window||!["localhost","127.0.0.1","0.0.0.0"].includes((null==(o=window.location)?void 0:o.hostname)||""))})(),o=!n,i="0.5.5";export{n as IS_DEV,o as IS_PROD,i as SOLELY_VERSION};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.parseHashUrl=function(e=window.location){let t;t="string"==typeof e?new URL(e).hash:e.hash;const o=t.split("?");let n=o[0];const s=o[1],r={};return n=n.replace(/^#\/?/,""),s&&s.split("&").forEach(e=>{const[t,o]=e.split("=");t&&o&&(r[decodeURIComponent(t)]=decodeURIComponent(o))}),{path:n.split("/").filter(Boolean),query:r}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.parseHashUrl=function(e){let t;t="string"==typeof e?new URL(e,"undefined"!=typeof window?window.location.href:"http://localhost/").hash:e?e.hash:window.location.hash;const o=t.indexOf("?");let r=-1===o?t:t.slice(0,o);const n=-1===o?"":t.slice(o+1),a={};return r=r.replace(/^#\/?/,""),n&&new URLSearchParams(n).forEach((e,t)=>{Object.defineProperty(a,t,{value:e,writable:!0,enumerable:!0,configurable:!0})}),{path:r.split("/").filter(Boolean),query:a}};
@@ -1 +1 @@
1
- function t(t=window.location){let o;o="string"==typeof t?new URL(t).hash:t.hash;const e=o.split("?");let n=e[0];const l=e[1],p={};return n=n.replace(/^#\/?/,""),l&&l.split("&").forEach(t=>{const[o,e]=t.split("=");o&&e&&(p[decodeURIComponent(o)]=decodeURIComponent(e))}),{path:n.split("/").filter(Boolean),query:p}}export{t as parseHashUrl};
1
+ function e(e){let t;t="string"==typeof e?new URL(e,"undefined"!=typeof window?window.location.href:"http://localhost/").hash:e?e.hash:window.location.hash;const n=t.indexOf("?");let o=-1===n?t:t.slice(0,n);const a=-1===n?"":t.slice(n+1),i={};return o=o.replace(/^#\/?/,""),a&&new URLSearchParams(a).forEach((e,t)=>{Object.defineProperty(i,t,{value:e,writable:!0,enumerable:!0,configurable:!0})}),{path:o.split("/").filter(Boolean),query:i}}export{e as parseHashUrl};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solely",
3
3
  "private": false,
4
- "version": "0.5.3",
4
+ "version": "0.5.5",
5
5
  "description": "A lightweight TypeScript framework for building web components with compile-time optimizations",
6
6
  "type": "module",
7
7
  "sideEffects": [