From 7d2fc8d5e85e8ec8d28297bd8bb1714b8fe62429 Mon Sep 17 00:00:00 2001 From: dwidge Date: Mon, 13 Nov 2023 19:15:06 +0200 Subject: [PATCH] Updates --- 404.html | 2 +- assets/{index-86f39156.js => index-07b36d7b.js} | 2 +- index.html | 2 +- manifest.webmanifest | 2 +- sw.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename assets/{index-86f39156.js => index-07b36d7b.js} (99%) diff --git a/404.html b/404.html index 25dbccf..8fa376d 100644 --- a/404.html +++ b/404.html @@ -19,7 +19,7 @@ sizes="128x128" /> - +
diff --git a/assets/index-86f39156.js b/assets/index-07b36d7b.js similarity index 99% rename from assets/index-86f39156.js rename to assets/index-07b36d7b.js index aba56cd..ada8d60 100644 --- a/assets/index-86f39156.js +++ b/assets/index-07b36d7b.js @@ -176,4 +176,4 @@ https://github.com/nodeca/pako/blob/main/LICENSE - `,Ca=e=>{var t="A".charCodeAt(0),r="";do e-=1,r=String.fromCharCode(t+e%26)+r,e=e/26>>0;while(e>0);return r},_m=e=>{let t={isoDate:new Date().toISOString().slice(0,-2)+"Z",sheets:[],strings:[],stringCount:0},r=0;for(let{title:a,data:s}of e){let o=++r,l=`rId${r+2}`,u=1,f=s.length,c=[];for(let d=1;d<=f;d++){let g=s[d-1],p=[],_=g.length;_>u&&(u=_);for(let y=1;y<=_;y++){let b=g[y-1],E=typeof b=="string"?"s":"n",S=b;E==="s"&&(S=t.strings.indexOf(b),t.stringCount++,S===-1&&(t.strings.push(b),S=t.strings.length-1)),p.push({id:Ca(y)+d,type:E,value:S})}c.push({id:d,cells:p})}let h=Ca(u)+f;t.sheets.push({id:o,rId:l,title:a,rows:c,extent:h})}var n=new sm;n.file("[Content_Types].xml",ym(t)),n.file("_rels/.rels",um()),n.file("docProps/app.xml",cm(t)),n.file("docProps/core.xml",fm(t)),n.file("xl/_rels/workbook.xml.rels",dm(t)),n.file("xl/sharedStrings.xml",hm(t)),n.file("xl/styles.xml",mm()),n.file("xl/theme/theme1.xml",vm()),n.file("xl/workbook.xml",gm(t));for(let a of t.sheets)n.file(`xl/worksheets/sheet${a.id}.xml`,pm(a));const i="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";return{async blob(){if(on)throw new Error("blob not supported on this platform");return await n.generateAsync({type:"blob",mimeType:i})},async base64(){return await n.generateAsync({type:"base64"})},stream(){if(!on)throw new Error("stream not supported on this platform");return n.generateNodeStream({type:"nodebuffer",streamFiles:!0})},async write(a){if(!on)throw new Error("write not supported on this platform");return await new Promise(s=>{n.generateNodeStream({type:"nodebuffer",streamFiles:!0}).pipe(lm.createWriteStream(a)).on("finish",()=>s())})}}},bm={generate:_m},wm=e=>e instanceof Array,Em=e=>{const t=e.map(([r,[n,i]])=>({title:r,data:wm(n)?[Object.keys(n[0]||{}),...n.map(a=>Object.values(a))]:[Object.keys(n||{}),Object.values(n||{})]}));bm.generate(t).base64().then(r=>{window.location.href="data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+r})},xm=[".xlsx",null,Em],Cm=e=>JSON.parse(e),Sm=e=>JSON.stringify(Object.fromEntries(e.map(([t,[r,n]])=>[t,r])),null,2),km=[".json",Cm,Sm],Om={CSV:am,XLSX:xm,JSON:km},Am=([e,t],[r,n])=>[e,t],Sa=()=>Date.now()/1e3|0,Pm=()=>{const e=Ai(Gr(Yr("pairs","[]"),"pairs")),t=Ai(Gr(Yr("sents","[]"),"sents")),r=Eu(Ru(Gr(Yr("progress",""),"progress"))),n=r.state,i=Am(e,n),[a,s]=fe(Sa);return Oe(()=>{const o=setInterval(()=>s(Sa),3e3);return()=>clearTimeout(o)},[]),j(mu,{basename:"/memaword",children:[j("nav",{style:{overflowX:"auto"},children:[j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/add",children:"Add"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/add-paragraph",children:"Add Paragraph"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/learn",children:"Learn"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/match",children:"Match"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/list",children:"List"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/progress",children:"Progress"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/data",children:"Data"})]}),j("div",{children:[j("button",{onClick:()=>r.save(),children:["Save ",r.changed?"*":""]}),j(lu,{children:[j(rt,{path:"/",element:j(_n,{listPairs:i})}),j(rt,{path:"/add",element:j(Io,{listPairs:i,now:a})}),j(rt,{path:"/add-paragraph",element:j(Do,{listPairs:i,listSents:t,now:a})}),j(rt,{path:"/learn",element:j(Mo,{listPairs:i,now:a})}),j(rt,{path:"/match",element:j(_n,{listPairs:i,progress:n,now:a})}),j(rt,{path:"/list",element:j($o,{listPairs:i,progress:n,now:a})}),j(rt,{path:"/progress",element:j(Uo,{listPairs:i,progress:n,now:a})}),j(rt,{path:"/data",element:j(Ws,{tables:{listPairs:i,listSents:t},formats:Om})})]})]})]})};wl.createRoot(document.getElementById("root")).render(j(re.StrictMode,{children:j(Pm,{})}))});export default Tm(); + `,Ca=e=>{var t="A".charCodeAt(0),r="";do e-=1,r=String.fromCharCode(t+e%26)+r,e=e/26>>0;while(e>0);return r},_m=e=>{let t={isoDate:new Date().toISOString().slice(0,-2)+"Z",sheets:[],strings:[],stringCount:0},r=0;for(let{title:a,data:s}of e){let o=++r,l=`rId${r+2}`,u=1,f=s.length,c=[];for(let d=1;d<=f;d++){let g=s[d-1],p=[],_=g.length;_>u&&(u=_);for(let y=1;y<=_;y++){let b=g[y-1],E=typeof b=="string"?"s":"n",S=b;E==="s"&&(S=t.strings.indexOf(b),t.stringCount++,S===-1&&(t.strings.push(b),S=t.strings.length-1)),p.push({id:Ca(y)+d,type:E,value:S})}c.push({id:d,cells:p})}let h=Ca(u)+f;t.sheets.push({id:o,rId:l,title:a,rows:c,extent:h})}var n=new sm;n.file("[Content_Types].xml",ym(t)),n.file("_rels/.rels",um()),n.file("docProps/app.xml",cm(t)),n.file("docProps/core.xml",fm(t)),n.file("xl/_rels/workbook.xml.rels",dm(t)),n.file("xl/sharedStrings.xml",hm(t)),n.file("xl/styles.xml",mm()),n.file("xl/theme/theme1.xml",vm()),n.file("xl/workbook.xml",gm(t));for(let a of t.sheets)n.file(`xl/worksheets/sheet${a.id}.xml`,pm(a));const i="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";return{async blob(){if(on)throw new Error("blob not supported on this platform");return await n.generateAsync({type:"blob",mimeType:i})},async base64(){return await n.generateAsync({type:"base64"})},stream(){if(!on)throw new Error("stream not supported on this platform");return n.generateNodeStream({type:"nodebuffer",streamFiles:!0})},async write(a){if(!on)throw new Error("write not supported on this platform");return await new Promise(s=>{n.generateNodeStream({type:"nodebuffer",streamFiles:!0}).pipe(lm.createWriteStream(a)).on("finish",()=>s())})}}},bm={generate:_m},wm=e=>e instanceof Array,Em=e=>{const t=e.map(([r,[n,i]])=>({title:r,data:wm(n)?[Object.keys(n[0]||{}),...n.map(a=>Object.values(a))]:[Object.keys(n||{}),Object.values(n||{})]}));bm.generate(t).base64().then(r=>{window.location.href="data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+r})},xm=[".xlsx",null,Em],Cm=e=>JSON.parse(e),Sm=e=>JSON.stringify(Object.fromEntries(e.map(([t,[r,n]])=>[t,r])),null,2),km=[".json",Cm,Sm],Om={CSV:am,XLSX:xm,JSON:km},Am=([e,t],[r,n])=>[e,t],Sa=()=>Date.now()/1e3|0,Pm=()=>{const e=Ai(Gr(Yr("pairs","[]"),"pairs")),t=Ai(Gr(Yr("sents","[]"),"sents")),r=Eu(Ru(Gr(Yr("progress",""),"progress"))),n=r.state,i=Am(e,n),[a,s]=fe(Sa);return Oe(()=>{const o=setInterval(()=>s(Sa),3e3);return()=>clearTimeout(o)},[]),j(mu,{basename:"/memaword",children:[j("nav",{style:{display:"flex",flexWrap:"wrap",justifyContent:"stretch"},children:[j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/add",children:"Add"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/add-paragraph",children:"Add Paragraph"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/learn",children:"Learn"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/match",children:"Match"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/list",children:"List"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/progress",children:"Progress"}),j(ht,{className:({isActive:o})=>o?"link-active":"link",to:"/data",children:"Data"})]}),j("div",{children:[j("button",{onClick:()=>r.save(),children:["Save ",r.changed?"*":""]}),j(lu,{children:[j(rt,{path:"/",element:j(_n,{listPairs:i})}),j(rt,{path:"/add",element:j(Io,{listPairs:i,now:a})}),j(rt,{path:"/add-paragraph",element:j(Do,{listPairs:i,listSents:t,now:a})}),j(rt,{path:"/learn",element:j(Mo,{listPairs:i,now:a})}),j(rt,{path:"/match",element:j(_n,{listPairs:i,progress:n,now:a})}),j(rt,{path:"/list",element:j($o,{listPairs:i,progress:n,now:a})}),j(rt,{path:"/progress",element:j(Uo,{listPairs:i,progress:n,now:a})}),j(rt,{path:"/data",element:j(Ws,{tables:{listPairs:i,listSents:t},formats:Om})})]})]})]})};wl.createRoot(document.getElementById("root")).render(j(re.StrictMode,{children:j(Pm,{})}))});export default Tm(); diff --git a/index.html b/index.html index 25dbccf..8fa376d 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ sizes="128x128" /> - +
diff --git a/manifest.webmanifest b/manifest.webmanifest index f4e414c..aba8243 100644 --- a/manifest.webmanifest +++ b/manifest.webmanifest @@ -1 +1 @@ -{"name":"Memaword","short_name":"Memaword","start_url":"/memaword/","display":"standalone","background_color":"#222222","lang":"en","scope":"/memaword","description":"Memorize words and phrases","theme_color":"#ff00ff","icons":[{"src":"apple-touch-icon.png","sizes":"512x512","type":"image/png","purpose":"any maskable"}]} +{"name":"Memaword","short_name":"Memaword","start_url":"/memaword/","display":"standalone","background_color":"#222222","lang":"en","scope":"/memaword/","description":"Memorize words and phrases","theme_color":"#ff00ff","icons":[{"src":"apple-touch-icon.png","sizes":"512x512","type":"image/png","purpose":"any maskable"}]} diff --git a/sw.js b/sw.js index 28832a5..c4b90a6 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,i={};const d=(d,n)=>(d=new URL(d+".js",n).href,i[d]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=d,e.onload=i,document.head.appendChild(e)}else e=d,importScripts(d),i()})).then((()=>{let e=i[d];if(!e)throw new Error(`Module ${d} didn’t register its module`);return e})));self.define=(n,c)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let r={};const s=e=>d(e,o),l={module:{uri:o},exports:r,require:s};i[o]=Promise.all(n.map((e=>l[e]||s(e)))).then((e=>(c(...e),r)))}}define(["./workbox-92f81961"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"1594838ed42b424ddd5d48b70ae046b5"},{url:"assets/index-86f39156.js",revision:null},{url:"assets/index-f073c358.css",revision:null},{url:"favicon.ico",revision:"cef0d0eabdbe94c9c50c4e393be3ddf1"},{url:"index.html",revision:"c367c5ef73cdb06e2997ee9d309934c6"},{url:"logo192.png",revision:"33dbdd0177549353eeeb785d02c294af"},{url:"logo512.png",revision:"917515db74ea8d1aee6a246cfbcc0b45"},{url:"manifest.json",revision:"d9d975cebe2ec20b6c652e1e4c12ccf0"},{url:"manifest.webmanifest",revision:"d11a253e119f39bc10dafa1f72d7d1dd"},{url:"registerSW.js",revision:"5bd60d0fe13c18a8a849ad667d99059d"},{url:"robots.txt",revision:"987497bfb623e1059632e5a607d56454"},{url:"apple-touch-icon.png",revision:"1594838ed42b424ddd5d48b70ae046b5"},{url:"favicon.ico",revision:"cef0d0eabdbe94c9c50c4e393be3ddf1"},{url:"index.html",revision:"d7e6786c10c115912bf90cd2d0e05cc6"},{url:"logo192.png",revision:"33dbdd0177549353eeeb785d02c294af"},{url:"logo512.png",revision:"917515db74ea8d1aee6a246cfbcc0b45"},{url:"manifest.json",revision:"d9d975cebe2ec20b6c652e1e4c12ccf0"},{url:"robots.txt",revision:"987497bfb623e1059632e5a607d56454"},{url:"manifest.webmanifest",revision:"d11a253e119f39bc10dafa1f72d7d1dd"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,i={};const d=(d,c)=>(d=new URL(d+".js",c).href,i[d]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=d,e.onload=i,document.head.appendChild(e)}else e=d,importScripts(d),i()})).then((()=>{let e=i[d];if(!e)throw new Error(`Module ${d} didn’t register its module`);return e})));self.define=(c,n)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let r={};const s=e=>d(e,o),l={module:{uri:o},exports:r,require:s};i[o]=Promise.all(c.map((e=>l[e]||s(e)))).then((e=>(n(...e),r)))}}define(["./workbox-92f81961"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"1594838ed42b424ddd5d48b70ae046b5"},{url:"assets/index-07b36d7b.js",revision:null},{url:"assets/index-f073c358.css",revision:null},{url:"favicon.ico",revision:"cef0d0eabdbe94c9c50c4e393be3ddf1"},{url:"index.html",revision:"08cc5b0576cb53030ca148732e9fc533"},{url:"logo192.png",revision:"33dbdd0177549353eeeb785d02c294af"},{url:"logo512.png",revision:"917515db74ea8d1aee6a246cfbcc0b45"},{url:"manifest.json",revision:"d9d975cebe2ec20b6c652e1e4c12ccf0"},{url:"manifest.webmanifest",revision:"f4e1d7d35beca45d1ac06f9d8d999a9b"},{url:"registerSW.js",revision:"5bd60d0fe13c18a8a849ad667d99059d"},{url:"robots.txt",revision:"987497bfb623e1059632e5a607d56454"},{url:"apple-touch-icon.png",revision:"1594838ed42b424ddd5d48b70ae046b5"},{url:"favicon.ico",revision:"cef0d0eabdbe94c9c50c4e393be3ddf1"},{url:"index.html",revision:"d7e6786c10c115912bf90cd2d0e05cc6"},{url:"logo192.png",revision:"33dbdd0177549353eeeb785d02c294af"},{url:"logo512.png",revision:"917515db74ea8d1aee6a246cfbcc0b45"},{url:"manifest.json",revision:"d9d975cebe2ec20b6c652e1e4c12ccf0"},{url:"robots.txt",revision:"987497bfb623e1059632e5a607d56454"},{url:"manifest.webmanifest",revision:"f4e1d7d35beca45d1ac06f9d8d999a9b"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));