@je-es/client 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/main.cjs +44 -14
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.cts +5 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.js +44 -14
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
<div align="center">
|
|
11
|
-
<img src="https://img.shields.io/badge/v-0.1.
|
|
11
|
+
<img src="https://img.shields.io/badge/v-0.1.6-black"/>
|
|
12
12
|
<img src="https://img.shields.io/badge/🔥-@je--es-black"/>
|
|
13
13
|
<br>
|
|
14
14
|
<img src="https://github.com/je-es/client/actions/workflows/ci.yml/badge.svg" alt="CI" />
|
package/dist/main.cjs
CHANGED
|
@@ -7,35 +7,46 @@
|
|
|
7
7
|
<p><strong>Route:</strong> ${t}</p>
|
|
8
8
|
<p><strong>Error:</strong> ${r}</p>
|
|
9
9
|
</div>
|
|
10
|
-
`;}}_handleScrollBehavior(t,e){if(t.hash){let r=document.getElementById(t.hash);if(r){r.scrollIntoView({behavior:this.scrollBehavior});return}}t.path!==e.path&&window.scrollTo({top:0,behavior:this.scrollBehavior});}_getCurrentPath(){if(this._internalPath!==null)return this._internalPath;if(this.mode==="hash")return window.location.hash.substring(1).split("?")[0]||"/";let t=window.location.pathname;return (!t||t==="blank"||t==="about:blank")&&(t="/"),this.base&&t.startsWith(this.base)&&(t=t.substring(this.base.length)),t||"/"}_buildFullPath(t){if(t.startsWith("http"))return t;let e=t.startsWith("/")?t:"/"+t;return this.base+e}_matchRoute(t){let e=t.split("?")[0].split("#")[0];for(let r of this.routes){let n=this._matchPath(r.path,e);if(n!==null)return {route:r,params:n}}return null}_matchPath(t,e){if(t==="*")return {};if(t===e)return {};let r=[],n=t.replace(/\*/g,".*").replace(/:([^/]+)/g,(i,u)=>(r.push(u),"([^/]+)")),s=new RegExp(`^${n}$`),a=e.match(s);return a?r.reduce((i,u,c)=>(i[u]=decodeURIComponent(a[c+1]),i),{}):null}_parseQuery(t){let e=t?t.includes("?")?t.split("?")[1].split("#")[0]:"":window.location.search.substring(1);return e?e.split("&").reduce((r,n)=>{let[s,a]=n.split("=").map(decodeURIComponent);return s&&(r[s]=a||""),r},{}):{}}},S=new R;function mt(o){let t=o;return {async build(){if(!t.build){console.warn("No build configuration provided");return}console.log("\u{1F528} Building @je-es/client application...");try{await this._buildJS(),await this._buildStyles(),console.log("\u2705 Build completed successfully!");}catch(e){throw console.error("\u274C Build error:",e),e}},async _buildJS(){if(!t.build)return;let e=await Bun.build({entrypoints:[t.build.entry],outdir:t.build.output.substring(0,t.build.output.lastIndexOf("/")),target:"browser",minify:t.build.minify??false,sourcemap:t.build.sourcemap?"external":"none",splitting:t.build.optimization?.splitChunks??false,naming:{entry:t.build.output.substring(t.build.output.lastIndexOf("/")+1)},external:["sass","fs","path","url","util","stream","buffer","events","crypto","os","child_process"]});if(!e.success)throw console.error("\u274C JS Build failed:",e.logs),new Error("JS Build failed")},async _buildStyles(){let e=t.build?.styles?.input||"./app/gui/style",r=t.build?.styles?.output||"./static/client.css",n=await import('sass'),{writeFileSync:s,existsSync:a,mkdirSync:i}=await import('fs'),{join:u,dirname:c}=await import('path'),d=c(r),l=r.split("/").pop()||"client.css",h=u(e,"index.scss");if(!a(h)){console.log("\u26A0\uFE0F No index.scss found, skipping CSS build");return}try{a(d)||i(d,{recursive:!0});let _=n.compile(h,{style:t.build?.minify?"compressed":"expanded",sourceMap:!!t.build?.sourcemap,loadPaths:[e]}),K=u(d,l);s(K,_.css,"utf-8"),t.build?.sourcemap&&_.sourceMap&&s(`${K}.map`,JSON.stringify(_.sourceMap),"utf-8");}catch(_){throw console.error("\u274C CSS Build failed:",_),_}},async _collectScssFiles(e){let{readdirSync:r,statSync:n,existsSync:s}=await import('fs'),{join:a,extname:i}=await import('path'),u=[];if(!s(e))return u;let c=r(e);for(let d of c){let l=a(e,d),h=n(l);h.isDirectory()?u.push(...await this._collectScssFiles(l)):h.isFile()&&i(d)===".scss"&&!d.startsWith("_")&&u.push(l);}return u.sort()},async watch(){console.log("\u{1F440} Watching for changes..."),await this.build();let{watch:e}=await import('fs'),{dirname:r}=await import('path'),{existsSync:n}=await import('fs');if(t.build?.entry){let a=r(t.build.entry);e(a,{recursive:true},async(i,u)=>{if(u&&(u.endsWith(".ts")||u.endsWith(".tsx"))){console.log(`\u{1F504} ${u} changed, rebuilding JS...`);try{await this._buildJS(),console.log("\u2705 JS rebuild complete");}catch(c){console.error("\u274C JS rebuild failed:",c);}}});}let s="./app/style";n(s)&&e(s,{recursive:true},async(a,i)=>{if(i&&i.endsWith(".scss")){console.log(`\u{1F504} ${i} changed, rebuilding CSS...`);try{await this._buildStyles(),console.log("\u2705 CSS rebuild complete");}catch(u){console.error("\u274C CSS rebuild failed:",u);}}});},init(){if(t.api){let e={baseURL:t.api.baseURL,timeout:t.api.timeout,headers:t.api.headers};t.api.interceptors&&(e.interceptors={request:t.api.interceptors.request||null,response:t.api.interceptors.response||null,error:t.api.interceptors.error||null}),capi.configureApi(e);}t.router&&t.app?.routes&&(S.init(t.app.routes,t.router.mode,t.router.base),t.router.beforeEach&&S.beforeEach(t.router.beforeEach),t.router.afterEach&&S.afterEach(t.router.afterEach)),t.app?.root&&(document.querySelector(t.app.root)||console.error(`\u274C Root element "${t.app.root}" not found`)),t.devTools?.enabled&&this._enableDevTools();},_enableDevTools(){window.__JEES_DEV__={router:S,config:t,version:"0.0.1"};},getConfig(){return t}}}var P=class{constructor(t){this._subscribers=new Set;this._storage=null;this._middleware=[];this._isHydrating=false;if(this._persist=t.persist??false,this._storageKey=t.storageKey||`store_${Date.now()}`,this._persist&&typeof window<"u"&&(this._storage=t.storage==="sessionStorage"?sessionStorage:localStorage),this._persist&&this._storage){let e=this._loadFromStorage();this._state=e!==null?e:t.state;}else this._state=t.state;t.middleware&&(this._middleware=t.middleware);}get state(){return {...this._state}}set state(t){this.setState(t);}setState(t,e){let r={...this._state},n=typeof t=="function"?t(r):t;this._state={...r,...n};for(let s of this._middleware)try{s(this._state,e);}catch(a){console.error("Store middleware error:",a);}this._persist&&!this._isHydrating&&this._saveToStorage(),this._notify();}get(t){return this._state[t]}set(t,e,r){this.setState({[t]:e},r);}subscribe(t){return this._subscribers.add(t),t(this._state),()=>{this._subscribers.delete(t);}}subscribeToKey(t,e){let r=this._state[t],n=s=>{let a=s[t];r!==a&&(r=a,e(a));};return this.subscribe(n)}use(t){this._middleware.push(t);}clear(){if(this._state={},this._persist&&this._storage)try{this._storage.removeItem(this._storageKey);}catch(t){console.error("Failed to clear storage:",t);}this._notify();}reset(t){this._state={...t},this._persist&&this._saveToStorage(),this._notify();}hydrate(){if(!this._persist||!this._storage){console.warn("Cannot hydrate: persistence not enabled");return}this._isHydrating=true;let t=this._loadFromStorage();t!==null&&(this._state=t,this._notify()),this._isHydrating=false;}getSnapshot(){return {state:{...this._state},subscribers:this._subscribers.size,storageKey:this._storageKey}}batch(t){let e=this._notify.bind(this),r=false;this._notify=()=>{r=true;};try{t();}finally{this._notify=e,r&&this._notify();}}_notify(){let t={...this._state};for(let e of this._subscribers)try{e(t);}catch(r){console.error("Store subscriber error:",r);}}_loadFromStorage(){if(!this._storage)return null;try{let t=this._storage.getItem(this._storageKey);return t?JSON.parse(t):null}catch(t){return console.error("Failed to load from storage:",t),null}}_saveToStorage(){if(this._storage)try{this._storage.setItem(this._storageKey,JSON.stringify(this._state));}catch(t){console.error("Failed to save to storage:",t),t instanceof DOMException&&t.name==="QuotaExceededError"&&console.warn("Storage quota exceeded");}}destroy(){this._subscribers.clear(),this._middleware=[],this._state={};}};function B(o){return new P(o)}function gt(o,t){let e=B({state:{value:t(...o.map(r=>r.state))}});for(let r of o)r.subscribe(()=>{e.setState({value:t(...o.map(n=>n.state))});});return e}function vt(o,t,e){return o.subscribe(n=>{let s=e(n);Object.assign(t,s),typeof t.update=="function"&&t.update();})}function y(o,t){if(t&&typeof t=="object"&&"kind"in t){let a=t.name;return t.addInitializer(function(){let i=this;i.constructor.__reactiveProps__||(i.constructor.__reactiveProps__=[]),i.constructor.__reactiveProps__.includes(a)||i.constructor.__reactiveProps__.push(a);}),function(i){let u=this,c=`_state_${a}`;return u[c]=i,Object.defineProperty(this,a,{get(){return this[c]},set(d){let l=this,h=l[c];h!==d&&(l[c]=d,typeof l._invalidateAllComputed=="function"&&l._invalidateAllComputed(),typeof l._triggerWatchers=="function"&&l._triggerWatchers(a,d,h),l._isMounted&&typeof l.update=="function"&&l.update());},enumerable:true,configurable:true}),i}}let e=t,r=o.constructor;r.__reactiveProps__||(r.__reactiveProps__=[]),r.__reactiveProps__.includes(e)||r.__reactiveProps__.push(e);let n=`_state_${e}`,s=`_state_init_${e}`;Object.defineProperty(o,e,{get(){let a=this;if(a[s])return a[n]},set(a){let i=this;if(!i[s]){i[n]=a,i[s]=true;return}let u=i[n];u!==a&&(i[n]=a,typeof i._invalidateAllComputed=="function"&&i._invalidateAllComputed(),typeof i._triggerWatchers=="function"&&i._triggerWatchers(e,a,u),i._isMounted&&typeof i.update=="function"&&i.update());},enumerable:true,configurable:true});}function bt(o,t,e){if(t&&typeof t=="object"&&"kind"in t){let i=t;if(i.kind!=="getter")throw new Error("@computed can only be used on getters");let u=o,c=i.name,d=`_computed_cache_${c}`,l=`_computed_dirty_${c}`;return function(){let h=this;return h[l]===void 0&&(h[l]=true),h[l]===true&&(h[d]=u.call(this),h[l]=false),h[d]}}let r=t;if(!e)throw new Error("@computed requires a property descriptor");let n=e.get;if(!n)throw new Error("@computed can only be used on getters");let s=`_computed_cache_${r}`,a=`_computed_dirty_${r}`;return {get(){let i=this;return i[a]===void 0&&(i[a]=true),i[a]===true&&(i[s]=n.call(this),i[a]=false),i[s]},enumerable:e.enumerable,configurable:e.configurable}}function _t(o){function t(e,r,n){if(r&&typeof r=="object"&&"kind"in r){if(r.kind!=="method")throw new Error("@watch can only be used on methods");let u=r.name;r.addInitializer(function(){let c=this;c.constructor.__watchers__||(c.constructor.__watchers__={}),c.constructor.__watchers__[o]||(c.constructor.__watchers__[o]=[]),c.constructor.__watchers__[o].includes(u)||c.constructor.__watchers__[o].push(u);});return}let s=r;if(!n)throw new Error("@watch requires a property descriptor");let i=e.constructor;return i.__watchers__||(i.__watchers__={}),i.__watchers__[o]||(i.__watchers__[o]=[]),i.__watchers__[o].includes(s)||i.__watchers__[o].push(s),n}return t}var g=class extends m{constructor(e){super(e);this.fields=[];this.formData={};this.isSubmitting=false;this.submitError="";this.submitSuccess=false;this.fields=this.props.fields.map(r=>({...r,error:void 0,touched:false}));for(let r of this.fields)this.formData[r.name]=r.value||"";}onMount(){}handleChange(e,r){this.formData[e]=r;let n=this.fields.find(s=>s.name===e);n&&this.props.autoValidate&&(n.error=this.validateField(n,r),n.touched=true),this.update();}handleBlur(e){let r=this.fields.find(n=>n.name===e);r&&(r.touched=true,r.error=this.validateField(r,this.formData[e]),this.update());}validateField(e,r){let n=e.validation;if(!n)return;if(n.required&&!r)return n.message||`${e.label||e.name} is required`;if(!r)return;let s=String(r);if(n.minLength&&s.length<n.minLength)return n.message||`Minimum ${n.minLength} characters required`;if(n.maxLength&&s.length>n.maxLength)return n.message||`Maximum ${n.maxLength} characters allowed`;if(n.min!==void 0&&Number(r)<n.min)return n.message||`Minimum value is ${n.min}`;if(n.max!==void 0&&Number(r)>n.max)return n.message||`Maximum value is ${n.max}`;if(n.pattern&&!n.pattern.test(s))return n.message||"Invalid format";if(n.email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s))return n.message||"Invalid email address";if(n.url&&!/^https?:\/\/.+/.test(s))return n.message||"Invalid URL";if(n.custom){let a=n.custom(r);if(a!==true)return typeof a=="string"?a:"Validation failed"}}validateForm(){let e=true,r={};for(let n of this.fields){let s=this.validateField(n,this.formData[n.name]);n.error=s,n.touched=true,s&&(e=false,r[n.name]=s);}return this.update(),!e&&this.props.onValidationError&&this.props.onValidationError(r),e}async handleSubmit(e){if(e.preventDefault(),!this.validateForm()){let r=this.fields.find(n=>n.error);r&&document.querySelector(`[name="${r.name}"]`)?.focus();return}this.isSubmitting=true,this.submitError="",this.submitSuccess=false,this.update();try{if(this.props.onSubmit)await this.props.onSubmit(this.formData,e);else if(this.props.endpoint){let r=await capi.api({method:this.props.method||"POST",url:this.props.endpoint,data:this.formData});this.submitSuccess=!0,this.props.onSuccess&&this.props.onSuccess(r.data);}}catch(r){let n=r instanceof Error?r.message:"Submission failed";this.submitError=n,this.props.onError&&this.props.onError(r);}finally{this.isSubmitting=false,this.update();}}renderField(e){let r=this.formData[e.name]||"";switch(e.type){case "textarea":return vdom.html`
|
|
10
|
+
`;}}_handleScrollBehavior(t,e){if(t.hash){let r=document.getElementById(t.hash);if(r){r.scrollIntoView({behavior:this.scrollBehavior});return}}t.path!==e.path&&window.scrollTo({top:0,behavior:this.scrollBehavior});}_getCurrentPath(){if(this._internalPath!==null)return this._internalPath;if(this.mode==="hash")return window.location.hash.substring(1).split("?")[0]||"/";let t=window.location.pathname;return (!t||t==="blank"||t==="about:blank")&&(t="/"),this.base&&t.startsWith(this.base)&&(t=t.substring(this.base.length)),t||"/"}_buildFullPath(t){if(t.startsWith("http"))return t;let e=t.startsWith("/")?t:"/"+t;return this.base+e}_matchRoute(t){let e=t.split("?")[0].split("#")[0];for(let r of this.routes){let n=this._matchPath(r.path,e);if(n!==null)return {route:r,params:n}}return null}_matchPath(t,e){if(t==="*")return {};if(t===e)return {};let r=[],n=t.replace(/\*/g,".*").replace(/:([^/]+)/g,(i,u)=>(r.push(u),"([^/]+)")),s=new RegExp(`^${n}$`),a=e.match(s);return a?r.reduce((i,u,c)=>(i[u]=decodeURIComponent(a[c+1]),i),{}):null}_parseQuery(t){let e=t?t.includes("?")?t.split("?")[1].split("#")[0]:"":window.location.search.substring(1);return e?e.split("&").reduce((r,n)=>{let[s,a]=n.split("=").map(decodeURIComponent);return s&&(r[s]=a||""),r},{}):{}}},S=new R;function mt(o){let t=o;return {async build(){if(!t.build){console.warn("No build configuration provided");return}console.log("\u{1F528} Building @je-es/client application...");try{await this._buildJS(),await this._buildStyles(),console.log("\u2705 Build completed successfully!");}catch(e){throw console.error("\u274C Build error:",e),e}},async _buildJS(){if(!t.build)return;let e=await Bun.build({entrypoints:[t.build.entry],outdir:t.build.output.substring(0,t.build.output.lastIndexOf("/")),target:"browser",minify:t.build.minify??false,sourcemap:t.build.sourcemap?"external":"none",splitting:t.build.optimization?.splitChunks??false,naming:{entry:t.build.output.substring(t.build.output.lastIndexOf("/")+1)},external:["sass","fs","path","url","util","stream","buffer","events","crypto","os","child_process"]});if(!e.success)throw console.error("\u274C JS Build failed:",e.logs),new Error("JS Build failed")},async _buildStyles(){let e=t.build?.styles?.input||"./app/gui/style",r=t.build?.styles?.output||"./static/client.css",n=await import('sass'),{writeFileSync:s,existsSync:a,mkdirSync:i}=await import('fs'),{join:u,dirname:c}=await import('path'),d=c(r),l=r.split("/").pop()||"client.css",p=u(e,"index.scss");if(!a(p)){console.log("\u26A0\uFE0F No index.scss found, skipping CSS build");return}try{a(d)||i(d,{recursive:!0});let _=n.compile(p,{style:t.build?.minify?"compressed":"expanded",sourceMap:!!t.build?.sourcemap,loadPaths:[e]}),K=u(d,l);s(K,_.css,"utf-8"),t.build?.sourcemap&&_.sourceMap&&s(`${K}.map`,JSON.stringify(_.sourceMap),"utf-8");}catch(_){throw console.error("\u274C CSS Build failed:",_),_}},async _collectScssFiles(e){let{readdirSync:r,statSync:n,existsSync:s}=await import('fs'),{join:a,extname:i}=await import('path'),u=[];if(!s(e))return u;let c=r(e);for(let d of c){let l=a(e,d),p=n(l);p.isDirectory()?u.push(...await this._collectScssFiles(l)):p.isFile()&&i(d)===".scss"&&!d.startsWith("_")&&u.push(l);}return u.sort()},async watch(){console.log("\u{1F440} Watching for changes..."),await this.build();let{watch:e}=await import('fs'),{dirname:r}=await import('path'),{existsSync:n}=await import('fs');if(t.build?.entry){let a=r(t.build.entry);e(a,{recursive:true},async(i,u)=>{if(u&&(u.endsWith(".ts")||u.endsWith(".tsx"))){console.log(`\u{1F504} ${u} changed, rebuilding JS...`);try{await this._buildJS(),console.log("\u2705 JS rebuild complete");}catch(c){console.error("\u274C JS rebuild failed:",c);}}});}let s="./app/style";n(s)&&e(s,{recursive:true},async(a,i)=>{if(i&&i.endsWith(".scss")){console.log(`\u{1F504} ${i} changed, rebuilding CSS...`);try{await this._buildStyles(),console.log("\u2705 CSS rebuild complete");}catch(u){console.error("\u274C CSS rebuild failed:",u);}}});},init(){if(t.api){let e={baseURL:t.api.baseURL,timeout:t.api.timeout,headers:t.api.headers};t.api.interceptors&&(e.interceptors={request:t.api.interceptors.request||null,response:t.api.interceptors.response||null,error:t.api.interceptors.error||null}),capi.configureApi(e);}t.router&&t.app?.routes&&(S.init(t.app.routes,t.router.mode,t.router.base),t.router.beforeEach&&S.beforeEach(t.router.beforeEach),t.router.afterEach&&S.afterEach(t.router.afterEach)),t.app?.root&&(document.querySelector(t.app.root)||console.error(`\u274C Root element "${t.app.root}" not found`)),t.devTools?.enabled&&this._enableDevTools();},_enableDevTools(){window.__JEES_DEV__={router:S,config:t,version:"0.0.1"};},getConfig(){return t}}}var P=class{constructor(t){this._subscribers=new Set;this._storage=null;this._middleware=[];this._isHydrating=false;if(this._persist=t.persist??false,this._storageKey=t.storageKey||`store_${Date.now()}`,this._persist&&typeof window<"u"&&(this._storage=t.storage==="sessionStorage"?sessionStorage:localStorage),this._persist&&this._storage){let e=this._loadFromStorage();this._state=e!==null?e:t.state;}else this._state=t.state;t.middleware&&(this._middleware=t.middleware);}get state(){return {...this._state}}set state(t){this.setState(t);}setState(t,e){let r={...this._state},n=typeof t=="function"?t(r):t;this._state={...r,...n};for(let s of this._middleware)try{s(this._state,e);}catch(a){console.error("Store middleware error:",a);}this._persist&&!this._isHydrating&&this._saveToStorage(),this._notify();}get(t){return this._state[t]}set(t,e,r){this.setState({[t]:e},r);}subscribe(t){return this._subscribers.add(t),t(this._state),()=>{this._subscribers.delete(t);}}subscribeToKey(t,e){let r=this._state[t],n=s=>{let a=s[t];r!==a&&(r=a,e(a));};return this.subscribe(n)}use(t){this._middleware.push(t);}clear(){if(this._state={},this._persist&&this._storage)try{this._storage.removeItem(this._storageKey);}catch(t){console.error("Failed to clear storage:",t);}this._notify();}reset(t){this._state={...t},this._persist&&this._saveToStorage(),this._notify();}hydrate(){if(!this._persist||!this._storage){console.warn("Cannot hydrate: persistence not enabled");return}this._isHydrating=true;let t=this._loadFromStorage();t!==null&&(this._state=t,this._notify()),this._isHydrating=false;}getSnapshot(){return {state:{...this._state},subscribers:this._subscribers.size,storageKey:this._storageKey}}batch(t){let e=this._notify.bind(this),r=false;this._notify=()=>{r=true;};try{t();}finally{this._notify=e,r&&this._notify();}}_notify(){let t={...this._state};for(let e of this._subscribers)try{e(t);}catch(r){console.error("Store subscriber error:",r);}}_loadFromStorage(){if(!this._storage)return null;try{let t=this._storage.getItem(this._storageKey);return t?JSON.parse(t):null}catch(t){return console.error("Failed to load from storage:",t),null}}_saveToStorage(){if(this._storage)try{this._storage.setItem(this._storageKey,JSON.stringify(this._state));}catch(t){console.error("Failed to save to storage:",t),t instanceof DOMException&&t.name==="QuotaExceededError"&&console.warn("Storage quota exceeded");}}destroy(){this._subscribers.clear(),this._middleware=[],this._state={};}};function B(o){return new P(o)}function gt(o,t){let e=B({state:{value:t(...o.map(r=>r.state))}});for(let r of o)r.subscribe(()=>{e.setState({value:t(...o.map(n=>n.state))});});return e}function vt(o,t,e){return o.subscribe(n=>{let s=e(n);Object.assign(t,s),typeof t.update=="function"&&t.update();})}function y(o,t){if(t&&typeof t=="object"&&"kind"in t){let a=t.name;return t.addInitializer(function(){let i=this;i.constructor.__reactiveProps__||(i.constructor.__reactiveProps__=[]),i.constructor.__reactiveProps__.includes(a)||i.constructor.__reactiveProps__.push(a);}),function(i){let u=this,c=`_state_${a}`;return u[c]=i,Object.defineProperty(this,a,{get(){return this[c]},set(d){let l=this,p=l[c];p!==d&&(l[c]=d,typeof l._invalidateAllComputed=="function"&&l._invalidateAllComputed(),typeof l._triggerWatchers=="function"&&l._triggerWatchers(a,d,p),l._isMounted&&typeof l.update=="function"&&l.update());},enumerable:true,configurable:true}),i}}let e=t,r=o.constructor;r.__reactiveProps__||(r.__reactiveProps__=[]),r.__reactiveProps__.includes(e)||r.__reactiveProps__.push(e);let n=`_state_${e}`,s=`_state_init_${e}`;Object.defineProperty(o,e,{get(){let a=this;if(a[s])return a[n]},set(a){let i=this;if(!i[s]){i[n]=a,i[s]=true;return}let u=i[n];u!==a&&(i[n]=a,typeof i._invalidateAllComputed=="function"&&i._invalidateAllComputed(),typeof i._triggerWatchers=="function"&&i._triggerWatchers(e,a,u),i._isMounted&&typeof i.update=="function"&&i.update());},enumerable:true,configurable:true});}function bt(o,t,e){if(t&&typeof t=="object"&&"kind"in t){let i=t;if(i.kind!=="getter")throw new Error("@computed can only be used on getters");let u=o,c=i.name,d=`_computed_cache_${c}`,l=`_computed_dirty_${c}`;return function(){let p=this;return p[l]===void 0&&(p[l]=true),p[l]===true&&(p[d]=u.call(this),p[l]=false),p[d]}}let r=t;if(!e)throw new Error("@computed requires a property descriptor");let n=e.get;if(!n)throw new Error("@computed can only be used on getters");let s=`_computed_cache_${r}`,a=`_computed_dirty_${r}`;return {get(){let i=this;return i[a]===void 0&&(i[a]=true),i[a]===true&&(i[s]=n.call(this),i[a]=false),i[s]},enumerable:e.enumerable,configurable:e.configurable}}function _t(o){function t(e,r,n){if(r&&typeof r=="object"&&"kind"in r){if(r.kind!=="method")throw new Error("@watch can only be used on methods");let u=r.name;r.addInitializer(function(){let c=this;c.constructor.__watchers__||(c.constructor.__watchers__={}),c.constructor.__watchers__[o]||(c.constructor.__watchers__[o]=[]),c.constructor.__watchers__[o].includes(u)||c.constructor.__watchers__[o].push(u);});return}let s=r;if(!n)throw new Error("@watch requires a property descriptor");let i=e.constructor;return i.__watchers__||(i.__watchers__={}),i.__watchers__[o]||(i.__watchers__[o]=[]),i.__watchers__[o].includes(s)||i.__watchers__[o].push(s),n}return t}var g=class extends m{constructor(e){super(e);this.fields=[];this.formData={};this.isSubmitting=false;this.submitError="";this.submitSuccess=false;this.fields=this.props.fields.map(r=>({...r,error:void 0,touched:false}));for(let r of this.fields)this.formData[r.name]=r.value||"";}onMount(){}handleChange(e,r){this.formData[e]=r;let n=this.fields.find(s=>s.name===e);n&&this.props.autoValidate&&(n.error=this.validateField(n,r),n.touched=true),this.update();}handleBlur(e){let r=this.fields.find(n=>n.name===e);r&&(r.touched=true,r.error=this.validateField(r,this.formData[e]),this.update());}validateField(e,r){let n=e.validation;if(!n)return;if(n.required&&!r)return n.message||`${e.label||e.name} is required`;if(!r)return;let s=String(r);if(n.minLength&&s.length<n.minLength)return n.message||`Minimum ${n.minLength} characters required`;if(n.maxLength&&s.length>n.maxLength)return n.message||`Maximum ${n.maxLength} characters allowed`;if(n.min!==void 0&&Number(r)<n.min)return n.message||`Minimum value is ${n.min}`;if(n.max!==void 0&&Number(r)>n.max)return n.message||`Maximum value is ${n.max}`;if(n.pattern&&!n.pattern.test(s))return n.message||"Invalid format";if(n.email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s))return n.message||"Invalid email address";if(n.url&&!/^https?:\/\/.+/.test(s))return n.message||"Invalid URL";if(n.custom){let a=n.custom(r);if(a!==true)return typeof a=="string"?a:"Validation failed"}}validateForm(){let e=true,r={};for(let n of this.fields){let s=this.validateField(n,this.formData[n.name]);n.error=s,n.touched=true,s&&(e=false,r[n.name]=s);}return this.update(),!e&&this.props.onValidationError&&this.props.onValidationError(r),e}async handleSubmit(e){if(e.preventDefault(),!this.validateForm()){let r=this.fields.find(n=>n.error);r&&document.querySelector(`[name="${r.name}"]`)?.focus();return}this.isSubmitting=true,this.submitError="",this.submitSuccess=false,this.update();try{if(this.props.onSubmit)await this.props.onSubmit(this.formData,e);else if(this.props.endpoint){let r=await capi.api({method:this.props.method||"POST",url:this.props.endpoint,data:this.formData});this.submitSuccess=!0,this.props.onSuccess&&this.props.onSuccess(r.data);}}catch(r){let n=r instanceof Error?r.message:"Submission failed";this.submitError=n,this.props.onError&&this.props.onError(r);}finally{this.isSubmitting=false,this.update();}}renderLabel(e){return !e.label&&!e.icon?"":e.icon?vdom.html`
|
|
11
|
+
<label for=${e.name}>
|
|
12
|
+
<i class="fa ${e.icon}"></i>
|
|
13
|
+
${e.label?vdom.html`<span>${e.label}</span>`:""}
|
|
14
|
+
</label>
|
|
15
|
+
`:vdom.html`<label for=${e.name}>${e.label}</label>`}renderField(e){let r=this.formData[e.name]||"",n=this.renderLabel(e);switch(e.type){case "textarea":return vdom.html`
|
|
11
16
|
<div class="form-field ${e.className||""}">
|
|
12
|
-
${
|
|
17
|
+
${n}
|
|
13
18
|
<textarea
|
|
14
19
|
id=${e.name}
|
|
15
20
|
name=${e.name}
|
|
16
21
|
placeholder=${e.placeholder||""}
|
|
17
22
|
value=${String(r)}
|
|
18
23
|
disabled=${String(e.disabled||this.isSubmitting)}
|
|
19
|
-
oninput=${
|
|
24
|
+
oninput=${s=>{let a=s.target;this.handleChange(e.name,a.value);}}
|
|
20
25
|
onblur=${()=>this.handleBlur(e.name)}
|
|
21
26
|
></textarea>
|
|
27
|
+
${e.error&&e.touched?vdom.html`
|
|
28
|
+
<span class="field-error">${e.error}</span>
|
|
29
|
+
`:""}
|
|
22
30
|
</div>
|
|
23
|
-
`;case "select":{let
|
|
24
|
-
<option value=${String(
|
|
31
|
+
`;case "select":{let a=(e.options||[]).map(i=>vdom.html`
|
|
32
|
+
<option value=${String(i.value)}>${i.label}</option>
|
|
25
33
|
`);return vdom.html`
|
|
26
34
|
<div class="form-field ${e.className||""}">
|
|
27
|
-
${
|
|
35
|
+
${n}
|
|
28
36
|
<select
|
|
29
37
|
id=${e.name}
|
|
30
38
|
name=${e.name}
|
|
31
39
|
value=${String(r)}
|
|
32
40
|
disabled=${String(e.disabled||this.isSubmitting)}
|
|
33
|
-
onchange=${
|
|
41
|
+
onchange=${i=>{let u=i.target;this.handleChange(e.name,u.value);}}
|
|
34
42
|
onblur=${()=>this.handleBlur(e.name)}
|
|
35
43
|
>
|
|
36
44
|
<option value="">Select...</option>
|
|
37
|
-
${
|
|
45
|
+
${a}
|
|
38
46
|
</select>
|
|
47
|
+
${e.error&&e.touched?vdom.html`
|
|
48
|
+
<span class="field-error">${e.error}</span>
|
|
49
|
+
`:""}
|
|
39
50
|
</div>
|
|
40
51
|
`}case "checkbox":return vdom.html`
|
|
41
52
|
<div class="form-field form-field-checkbox ${e.className||""}">
|
|
@@ -46,23 +57,31 @@
|
|
|
46
57
|
name=${e.name}
|
|
47
58
|
checked=${String(r)}
|
|
48
59
|
disabled=${String(e.disabled||this.isSubmitting)}
|
|
49
|
-
onchange=${
|
|
60
|
+
onchange=${s=>{let a=s.target;this.handleChange(e.name,a.checked);}}
|
|
50
61
|
/>
|
|
62
|
+
${e.icon?vdom.html`<i class="fa ${e.icon}"></i>`:""}
|
|
51
63
|
${e.label||""}
|
|
52
64
|
</label>
|
|
65
|
+
${e.error&&e.touched?vdom.html`
|
|
66
|
+
<span class="field-error">${e.error}</span>
|
|
67
|
+
`:""}
|
|
53
68
|
</div>
|
|
54
69
|
`;default:return vdom.html`
|
|
55
70
|
<div class="form-field ${e.className||""}">
|
|
56
|
-
${
|
|
71
|
+
${n}
|
|
57
72
|
<input
|
|
58
73
|
type="${e.type||"text"}"
|
|
59
74
|
id="${e.name}"
|
|
60
75
|
name="${e.name}"
|
|
61
76
|
placeholder="${e.placeholder||""}"
|
|
62
77
|
value="${String(r)}"
|
|
63
|
-
|
|
78
|
+
disabled="${e.disabled||this.isSubmitting}"
|
|
79
|
+
oninput=${s=>{let a=s.target;this.handleChange(e.name,a.value);}}
|
|
64
80
|
onblur=${()=>this.handleBlur(e.name)}
|
|
65
81
|
/>
|
|
82
|
+
${e.error&&e.touched?vdom.html`
|
|
83
|
+
<span class="field-error">${e.error}</span>
|
|
84
|
+
`:""}
|
|
66
85
|
</div>
|
|
67
86
|
`}}render(){let e=this.props.submitButton||{},r=this.fields.map(n=>this.renderField(n));return vdom.html`
|
|
68
87
|
<form
|
|
@@ -95,10 +114,15 @@
|
|
|
95
114
|
margin-bottom: 1rem;
|
|
96
115
|
}
|
|
97
116
|
.form-field label {
|
|
98
|
-
display:
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
gap: 0.5rem;
|
|
99
120
|
margin-bottom: 0.5rem;
|
|
100
121
|
font-weight: 500;
|
|
101
122
|
}
|
|
123
|
+
.form-field label i {
|
|
124
|
+
color: #6b7280;
|
|
125
|
+
}
|
|
102
126
|
.form-field input,
|
|
103
127
|
.form-field textarea,
|
|
104
128
|
.form-field select {
|
|
@@ -123,6 +147,12 @@
|
|
|
123
147
|
.form-field-checkbox input[type="checkbox"] {
|
|
124
148
|
width: auto;
|
|
125
149
|
}
|
|
150
|
+
.field-error {
|
|
151
|
+
display: block;
|
|
152
|
+
color: #dc2626;
|
|
153
|
+
font-size: 0.875rem;
|
|
154
|
+
margin-top: 0.25rem;
|
|
155
|
+
}
|
|
126
156
|
.submit-button {
|
|
127
157
|
width: 100%;
|
|
128
158
|
padding: 0.75rem 1rem;
|
|
@@ -155,9 +185,9 @@
|
|
|
155
185
|
background: #d1fae5;
|
|
156
186
|
color: #065f46;
|
|
157
187
|
}
|
|
158
|
-
`}};T([y],g.prototype,"fields"),T([y],g.prototype,"formData"),T([y],g.prototype,"isSubmitting"),T([y],g.prototype,"submitError"),T([y],g.prototype,"submitSuccess");function wt(o){return new g(o).render()}function z(o,t){let e=null;return (...r)=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,o(...r);},t);}}function W(o,t){let e=0,r=null;return (...n)=>{let s=Date.now(),a=s-e;a>=t?(e=s,o(...n)):r||(r=setTimeout(()=>{e=Date.now(),r=null,o(...n);},t-a));}}function q(...o){let t=[];for(let e of o)if(e){if(typeof e=="string")t.push(e);else if(typeof e=="object")for(let[r,n]of Object.entries(e))n&&t.push(r);}return t.join(" ")}function j(o,t="YYYY-MM-DD"){let e=o instanceof Date?o:new Date(o);if(isNaN(e.getTime()))throw new Error("Invalid date provided to formatDate");let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),u=String(e.getSeconds()).padStart(2,"0");return t.replace("YYYY",String(r)).replace("MM",n).replace("DD",s).replace("HH",a).replace("mm",i).replace("ss",u)}function w(o){if(o===null||typeof o!="object")return o;if(o instanceof Date)return new Date(o.getTime());if(Array.isArray(o))return o.map(t=>w(t));if(o instanceof RegExp)return new RegExp(o.source,o.flags);if(o instanceof Map){let t=new Map;return o.forEach((e,r)=>{t.set(w(r),w(e));}),t}if(o instanceof Set){let t=new Set;return o.forEach(e=>{t.add(w(e));}),t}if(Object.prototype.toString.call(o)==="[object Object]"){let t={};for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=w(o[e]));return t}return o}function
|
|
188
|
+
`}};T([y],g.prototype,"fields"),T([y],g.prototype,"formData"),T([y],g.prototype,"isSubmitting"),T([y],g.prototype,"submitError"),T([y],g.prototype,"submitSuccess");function wt(o){return new g(o).render()}function z(o,t){let e=null;return (...r)=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,o(...r);},t);}}function W(o,t){let e=0,r=null;return (...n)=>{let s=Date.now(),a=s-e;a>=t?(e=s,o(...n)):r||(r=setTimeout(()=>{e=Date.now(),r=null,o(...n);},t-a));}}function q(...o){let t=[];for(let e of o)if(e){if(typeof e=="string")t.push(e);else if(typeof e=="object")for(let[r,n]of Object.entries(e))n&&t.push(r);}return t.join(" ")}function j(o,t="YYYY-MM-DD"){let e=o instanceof Date?o:new Date(o);if(isNaN(e.getTime()))throw new Error("Invalid date provided to formatDate");let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),u=String(e.getSeconds()).padStart(2,"0");return t.replace("YYYY",String(r)).replace("MM",n).replace("DD",s).replace("HH",a).replace("mm",i).replace("ss",u)}function w(o){if(o===null||typeof o!="object")return o;if(o instanceof Date)return new Date(o.getTime());if(Array.isArray(o))return o.map(t=>w(t));if(o instanceof RegExp)return new RegExp(o.source,o.flags);if(o instanceof Map){let t=new Map;return o.forEach((e,r)=>{t.set(w(r),w(e));}),t}if(o instanceof Set){let t=new Set;return o.forEach(e=>{t.add(w(e));}),t}if(Object.prototype.toString.call(o)==="[object Object]"){let t={};for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=w(o[e]));return t}return o}function V(o,...t){if(!t.length)return o;let e=t.shift();if(!e)return o;if($(o)&&$(e)){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let n=e[r],s=o[r];n!==void 0&&($(n)&&!Array.isArray(n)?((!s||!$(s))&&(o[r]={}),V(o[r],n)):o[r]=n);}}return V(o,...t)}function $(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}var H=0;function G(o="id"){let t=Date.now().toString(36),e=Math.random().toString(36).substring(2,11);H=(H||0)+1;let r=H.toString(36);return `${o}_${t}_${e}_${r}`}function J(o){if(o<0)throw new Error("Sleep duration must be non-negative");return new Promise(t=>setTimeout(t,o))}function Q(o){return o==null?true:typeof o=="string"?o.trim().length===0:Array.isArray(o)?o.length===0:o instanceof Map||o instanceof Set?o.size===0:typeof o=="object"?Object.keys(o).length===0:false}function Y(o){return o?o.charAt(0).toUpperCase()+o.slice(1):""}function Z(o){return o?o.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():""}function I(o){return o?o.replace(/[-_\s]+(.)?/g,(t,e)=>e?e.toUpperCase():"").replace(/^[A-Z]/,t=>t.toLowerCase()):""}function X(o){if(!o)return "";let t=I(o);return t.charAt(0).toUpperCase()+t.slice(1)}function tt(o,t,e="..."){return !o||o.length<=t?o:o.substring(0,t-e.length)+e}function et(o){let t={},e=o.replace(/^\?/,"");if(!e)return t;let r=e.split("&");for(let n of r){let[s,a]=n.split("=").map(decodeURIComponent);if(!s)continue;let i=a||"";if(s.endsWith("[]")){let u=s.slice(0,-2);t[u]||(t[u]=[]),t[u].push(i);}else t[s]=i;}return t}function rt(o){let t=[];for(let[e,r]of Object.entries(o))if(r!=null)if(Array.isArray(r))for(let n of r)n!=null&&t.push(`${encodeURIComponent(e)}[]=${encodeURIComponent(String(n))}`);else t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`);return t.length>0?`?${t.join("&")}`:""}function nt(o,t,e){return Math.min(Math.max(o,t),e)}function ot(){return typeof window<"u"&&typeof document<"u"}function st(o,t){try{return JSON.parse(o)}catch{return t}}var Tt={debounce:z,throttle:W,classNames:q,formatDate:j,deepClone:w,deepMerge:V,uniqueId:G,sleep:J,isEmpty:Q,capitalize:Y,kebabCase:Z,camelCase:I,pascalCase:X,truncate:tt,parseQuery:et,stringifyQuery:rt,clamp:nt,isBrowser:ot,safeJsonParse:st};var E=class{constructor(t){this._subscribers=new Set;this._value=t,this._defaultValue=t;}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._notify());}subscribe(t){this._subscribers.add(t);try{t(this._value);}catch(e){console.error("Context subscriber error:",e);}return ()=>{this._subscribers.delete(t);}}reset(){this.value=this._defaultValue;}update(t){this.value=t(this._value);}_notify(){for(let t of this._subscribers)try{t(this._value);}catch(e){console.error("Context subscriber error:",e);}}get subscriberCount(){return this._subscribers.size}};function St(o){return new E(o)}var O=class extends m{onMount(){this.props.context.value=this.props.value;}onUpdate(){this.props.context.value=this.props.value;}onUnmount(){}render(){let t=Array.isArray(this.props.children)?this.props.children:[this.props.children];return vdom.html`
|
|
159
189
|
<div class="context-provider" style="display: contents;">
|
|
160
190
|
${t}
|
|
161
191
|
</div>
|
|
162
|
-
`}};function xt(o,t){let e=o.subscribe(()=>{t.isMounted&&t.update();});return t.subscribe(()=>e),o.value}var
|
|
192
|
+
`}};function xt(o,t){let e=o.subscribe(()=>{t.isMounted&&t.update();});return t.subscribe(()=>e),o.value}var F=class{constructor(t){this.contexts=new Map;for(let[e,r]of Object.entries(t))this.contexts.set(e,new E(r));}get(t){let e=this.contexts.get(t);if(!e)throw new Error(`Context key "${String(t)}" not found`);return e}set(t,e){let r=this.contexts.get(t);r&&(r.value=e);}subscribe(t,e){let r=this.contexts.get(t);if(!r)throw new Error(`Context key "${String(t)}" not found`);return r.subscribe(e)}reset(){for(let t of this.contexts.values())t.reset();}};function kt(o){return new F(o)}var f=null,x=0,U=new WeakMap;function it(o){f=o,x=0;}function at(){f=null,x=0;}function M(o){return U.has(o)||U.set(o,[]),U.get(o)}function v(o){if(!f)throw new Error("useState must be called inside a component");let t=f,e=x++,r=M(t);r[e]===void 0&&(r[e]={value:typeof o=="function"?o():o});let n=s=>{let a=r[e],i=typeof s=="function"?s(a.value):s;a.value!==i&&(a.value=i,t.update());};return [r[e].value,n]}function b(o,t){if(!f)throw new Error("useEffect must be called inside a component");let e=f,r=x++,n=M(e),s=n[r];if(!s||!t||!ct(s.deps,t)){if(s?.value&&typeof s.value=="function")try{s.value();}catch(i){console.error("Error in effect cleanup:",i);}Promise.resolve().then(()=>{try{let i=o();n[r]={value:i,deps:t?[...t]:void 0};}catch(i){console.error("Error in effect:",i);}});}}function ut(o,t){if(!f)throw new Error("useMemo must be called inside a component");let e=x++,r=M(f),n=r[e];return (!n||!ct(n.deps,t))&&(r[e]={value:o(),deps:[...t]}),r[e].value}function N(o,t){return ut(()=>o,t)}function D(o){if(!f)throw new Error("useRef must be called inside a component");let t=x++,e=M(f);return e[t]===void 0&&(e[t]={value:{current:o}}),e[t].value}function Et(o,t){let[e,r]=v(t),n=N(s=>{r(a=>o(a,s));},[o]);return [e,n]}function Rt(o,t){let[e,r]=v(()=>{try{let s=window.localStorage.getItem(o);return s?JSON.parse(s):t}catch(s){return console.error("Error loading from localStorage:",s),t}});return [e,s=>{r(a=>{let i=s instanceof Function?s(a):s;try{window.localStorage.setItem(o,JSON.stringify(i));}catch(u){console.error("Error saving to localStorage:",u);}return i});}]}function Pt(o,t){let[e,r]=v(o);return b(()=>{let n=setTimeout(()=>{r(o);},t);return ()=>{clearTimeout(n);}},[o,t]),e}function $t(o){let t=D(void 0);return b(()=>{t.current=o;}),t.current}function Vt(o=false){let[t,e]=v(o),r=N(()=>{e(n=>!n);},[]);return [t,r]}function Ft(o,t){let e=D(o);b(()=>{e.current=o;},[o]),b(()=>{if(t===null)return;let r=setInterval(()=>e.current(),t);return ()=>clearInterval(r)},[t]);}function Mt(o,t){let[e,r]=v(null),[n,s]=v(true),[a,i]=v(null),u=N(async()=>{s(true),i(null);try{let c=await fetch(o,t);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);let d=await c.json();r(d);}catch(c){i(c);}finally{s(false);}},[o]);return b(()=>{u();},[u]),{data:e,loading:n,error:a,refetch:u}}function Nt(){let[o,t]=v({width:window.innerWidth,height:window.innerHeight});return b(()=>{let e=()=>{t({width:window.innerWidth,height:window.innerHeight});};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),o}function Dt(o,t,e=window){let r=D(t);b(()=>{r.current=t;},[t]),b(()=>{if(!(e&&"addEventListener"in e))return;let s=a=>{r.current(a);};return e.addEventListener(o,s),()=>{e.removeEventListener(o,s);}},[o,e]);}function Lt(o,t){class e extends m{render(){it(this);try{return o(this.props)}finally{at();}}}return t&&Object.defineProperty(e,"name",{value:t}),e}function ct(o,t){if(!o||o.length!==t.length)return false;for(let e=0;e<o.length;e++)if(o[e]!==t[e])return false;return true}vdom.setConfig({devMode:false,sanitizeHTML:true});Object.defineProperty(exports,"createDOMElement",{enumerable:true,get:function(){return vdom.createDOMElement}});Object.defineProperty(exports,"createElement",{enumerable:true,get:function(){return vdom.createElement}});Object.defineProperty(exports,"html",{enumerable:true,get:function(){return vdom.html}});Object.defineProperty(exports,"patch",{enumerable:true,get:function(){return vdom.patch}});Object.defineProperty(exports,"api",{enumerable:true,get:function(){return capi.api}});Object.defineProperty(exports,"configureApi",{enumerable:true,get:function(){return capi.configureApi}});Object.defineProperty(exports,"getApiConfig",{enumerable:true,get:function(){return capi.getApiConfig}});Object.defineProperty(exports,"http",{enumerable:true,get:function(){return capi.http}});Object.defineProperty(exports,"resetApiConfig",{enumerable:true,get:function(){return capi.resetApiConfig}});exports.CombinedContext=F;exports.Component=m;exports.Context=E;exports.Provider=O;exports.Router=R;exports.SmartForm=wt;exports.SmartFormComponent=g;exports.Store=P;exports.StyleManager=C;exports.camelCase=I;exports.capitalize=Y;exports.clamp=nt;exports.classNames=q;exports.clearHookContext=at;exports.client=mt;exports.computed=bt;exports.connect=vt;exports.createCombinedContext=kt;exports.createComputedStore=gt;exports.createContext=St;exports.createFunctionalComponent=Lt;exports.createStore=B;exports.css=L;exports.debounce=z;exports.deepClone=w;exports.deepMerge=V;exports.formatDate=j;exports.isBrowser=ot;exports.isEmpty=Q;exports.kebabCase=Z;exports.parseQuery=et;exports.pascalCase=X;exports.router=S;exports.safeJsonParse=st;exports.scheduler=k;exports.setHookContext=it;exports.sleep=J;exports.state=y;exports.stringifyQuery=rt;exports.throttle=W;exports.truncate=tt;exports.uniqueId=G;exports.useCallback=N;exports.useContext=xt;exports.useDebounce=Pt;exports.useEffect=b;exports.useEventListener=Dt;exports.useFetch=Mt;exports.useInterval=Ft;exports.useLocalStorage=Rt;exports.useMemo=ut;exports.usePrevious=$t;exports.useReducer=Et;exports.useRef=D;exports.useState=v;exports.useToggle=Vt;exports.useWindowSize=Nt;exports.utils=Tt;exports.watch=_t;//# sourceMappingURL=main.cjs.map
|
|
163
193
|
//# sourceMappingURL=main.cjs.map
|