mtxuilib 0.0.433 → 0.0.436

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.
@@ -1 +1 @@
1
- var i=(e,n,t)=>new Promise((o,r)=>{var v=s=>{try{c(t.next(s))}catch(a){r(a)}},h=s=>{try{c(t.throw(s))}catch(a){r(a)}},c=s=>s.done?o(s.value):Promise.resolve(s.value).then(v,h);c((t=t.apply(e,n)).next())});function l(e){let n=0;for(let t=1;t<=e;t+=4)n+=1/t-1/(t+2);return 4*n}addEventListener("message",e=>{postMessage(l(e.data))});var d=()=>{self.addEventListener("install",()=>{console.log("service worker installed")})};d();var f=()=>{self.addEventListener("activate",()=>{console.log("service worker activated")})};f();var u="v3",p=e=>i(void 0,null,function*(){let n=yield fetch(e.request),t=n.clone();return yield(yield caches.open(u)).put(e.request,t),n}),E=()=>{console.log("setup service worker fetch event"),self.addEventListener("fetch",e=>{console.log("fetch event@serviceworker",e),e.respondWith(p(e).catch(()=>caches.match(e.request)).then(n=>n))})};E();
1
+ function s(e){let n=0;for(let t=1;t<=e;t+=4)n+=1/t-1/(t+2);return 4*n}addEventListener("message",e=>{postMessage(s(e.data))});var o=()=>{self.addEventListener("install",()=>{console.log("service worker installed")})};o();var c=()=>{self.addEventListener("activate",()=>{console.log("service worker activated")})};c();var a=()=>{console.log("setup service worker fetch event"),self.addEventListener("fetch",e=>{console.log("fetch event@serviceworker",e),e.respondWith(new Response("hello response"))})};a();
@@ -1 +1 @@
1
- "use client";const c={};import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useEffect as o,useRef as t}from"react";import{MtButton as i}from"../ui/ui-mt/Button";const a=()=>{const n=t();return o(()=>{typeof window!="undefined"&&"serviceWorker"in navigator&&navigator.serviceWorker.register(new URL("./worker.ts",c.url),{scope:"./"}).then(e=>{console.log("Service worker registered successfully. Scope:",e.scope)}).catch(e=>{console.error("Service worker registration failed:",e)})},[]),s("div",{className:"prose bg-slate-100",children:[r("p",{children:"WebWorker5"}),r(i,{onClick:()=>{console.log("fetch1"),fetch("/")},children:"fetch-test"})]})};export{a as ServiceWorkerMain};
1
+ "use client";const s={};import{jsx as r,jsxs as c}from"react/jsx-runtime";import{useEffect as o,useRef as t}from"react";import{MtButton as i}from"../ui/ui-mt/Button";const a=()=>{const n=t();return o(()=>{typeof window!="undefined"&&"serviceWorker"in navigator&&navigator.serviceWorker.register(new URL("./sw.ts",s.url),{scope:"./"}).then(e=>{console.log("Service worker registered successfully2. Scope:",e.scope)}).catch(e=>{console.error("Service worker registration failed3:",e)})},[]),c("div",{className:"prose bg-slate-100",children:[r("p",{children:"WebWorker7"}),r(i,{onClick:()=>{console.log("fetch1"),fetch("/")},children:"fetch-test"})]})};export{a as ServiceWorkerMain};
@@ -1 +1 @@
1
- var i=(e,s,c)=>new Promise((o,r)=>{var l=t=>{try{n(c.next(t))}catch(a){r(a)}},v=t=>{try{n(c.throw(t))}catch(a){r(a)}},n=t=>t.done?o(t.value):Promise.resolve(t.value).then(l,v);n((c=c.apply(e,s)).next())});import{pi as h}from"./lib";addEventListener("message",e=>{postMessage(h(e.data))});const d=()=>{self.addEventListener("install",()=>{console.log("service worker installed")})};d();const f=()=>{self.addEventListener("activate",()=>{console.log("service worker activated")})};f();const E="v3",g=e=>i(void 0,null,function*(){const s=yield fetch(e.request),c=s.clone();return yield(yield caches.open(E)).put(e.request,c),s}),p=()=>{console.log("setup service worker fetch event"),self.addEventListener("fetch",e=>{console.log("fetch event@serviceworker",e),e.respondWith(g(e).catch(()=>caches.match(e.request)).then(s=>s))})};p();
1
+ var l=(e,n,s)=>new Promise((a,r)=>{var i=t=>{try{c(s.next(t))}catch(o){r(o)}},v=t=>{try{c(s.throw(t))}catch(o){r(o)}},c=t=>t.done?a(t.value):Promise.resolve(t.value).then(i,v);c((s=s.apply(e,n)).next())});import{pi as d}from"./lib";addEventListener("message",e=>{postMessage(d(e.data))});const h=()=>{self.addEventListener("install",()=>{console.log("service worker installed")})};h();const f=()=>{self.addEventListener("activate",()=>{console.log("service worker activated")})};f();const p="v3",u=e=>l(void 0,null,function*(){const n=yield fetch(e.request),s=n.clone();return yield(yield caches.open(p)).put(e.request,s),n}),w=()=>{console.log("setup service worker fetch event"),self.addEventListener("fetch",e=>{console.log("fetch event@serviceworker",e),e.respondWith(new Response("hello response"))})};w();