diff --git a/docs/404.html b/docs/404.html index 942c2df..649a12d 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found.VL2 Forge

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.VL2 Forge

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index 942c2df..649a12d 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.VL2 Forge

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.VL2 Forge

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_next/static/chunks/117-1933c4264b72dbac.js b/docs/_next/static/chunks/117-9787d8272c0ff5f7.js similarity index 100% rename from docs/_next/static/chunks/117-1933c4264b72dbac.js rename to docs/_next/static/chunks/117-9787d8272c0ff5f7.js diff --git a/docs/_next/static/chunks/53c13509-17317f399c482fd7.js b/docs/_next/static/chunks/53c13509-17317f399c482fd7.js deleted file mode 100644 index d7d25bf..0000000 --- a/docs/_next/static/chunks/53c13509-17317f399c482fd7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[240],{1273:function(c,t,a){a.d(t,{W95:function(){return r},ekl:function(){return s}});var n=a(6231);function r(c){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM72 272a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm104-16H304c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16s7.2-16 16-16zM72 368a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm88 0c0-8.8 7.2-16 16-16H304c8.8 0 16 7.2 16 16s-7.2 16-16 16H176c-8.8 0-16-7.2-16-16z"},child:[]}]})(c)}function s(c){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M16 144a144 144 0 1 1 288 0A144 144 0 1 1 16 144zM160 80c8.8 0 16-7.2 16-16s-7.2-16-16-16c-53 0-96 43-96 96c0 8.8 7.2 16 16 16s16-7.2 16-16c0-35.3 28.7-64 64-64zM128 480V317.1c10.4 1.9 21.1 2.9 32 2.9s21.6-1 32-2.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32z"},child:[]}]})(c)}}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/53c13509-84be3322852db000.js b/docs/_next/static/chunks/53c13509-84be3322852db000.js new file mode 100644 index 0000000..10d37c2 --- /dev/null +++ b/docs/_next/static/chunks/53c13509-84be3322852db000.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[240],{1273:function(c,t,n){n.d(t,{ekl:function(){return a}});var s=n(6231);function a(c){return(0,s.w_)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M16 144a144 144 0 1 1 288 0A144 144 0 1 1 16 144zM160 80c8.8 0 16-7.2 16-16s-7.2-16-16-16c-53 0-96 43-96 96c0 8.8 7.2 16 16 16s16-7.2 16-16c0-35.3 28.7-64 64-64zM128 480V317.1c10.4 1.9 21.1 2.9 32 2.9s21.6-1 32-2.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32z"},child:[]}]})(c)}}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/634-d90cc75f8d4e4c06.js b/docs/_next/static/chunks/634-fc7f40d81b6d4544.js similarity index 100% rename from docs/_next/static/chunks/634-d90cc75f8d4e4c06.js rename to docs/_next/static/chunks/634-fc7f40d81b6d4544.js diff --git a/docs/_next/static/chunks/795d4814-41e831b7c57cc385.js b/docs/_next/static/chunks/795d4814-41e831b7c57cc385.js new file mode 100644 index 0000000..617301d --- /dev/null +++ b/docs/_next/static/chunks/795d4814-41e831b7c57cc385.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51],{2744:function(t,n,a){a.d(n,{seb:function(){return h}});var e=a(6231);function h(t){return(0,e.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m14 6-3.75 5 2.85 3.8-1.6 1.2C9.81 13.75 7 10 7 10l-6 8h22L14 6z"},child:[]}]})(t)}}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/795d4814-53044e1cf9e42373.js b/docs/_next/static/chunks/795d4814-53044e1cf9e42373.js deleted file mode 100644 index 4e65aa1..0000000 --- a/docs/_next/static/chunks/795d4814-53044e1cf9e42373.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51],{2744:function(t,h,n){n.d(h,{JEK:function(){return v},seb:function(){return i}});var a=n(6231);function v(t){return(0,a.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 9v2h-2V3h-2v2h-2V3h-2v2h-2V3H9v2H7V3H5v8H3V9H1v12h9v-3c0-1.1.9-2 2-2s2 .9 2 2v3h9V9h-2zm-10 3H9V9h2v3zm4 0h-2V9h2v3z"},child:[]}]})(t)}function i(t){return(0,a.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m14 6-3.75 5 2.85 3.8-1.6 1.2C9.81 13.75 7 10 7 10l-6 8h22L14 6z"},child:[]}]})(t)}}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/app/_not-found/page-fc58ab5e5ff94327.js b/docs/_next/static/chunks/app/_not-found/page-59706d536ba481c2.js similarity index 100% rename from docs/_next/static/chunks/app/_not-found/page-fc58ab5e5ff94327.js rename to docs/_next/static/chunks/app/_not-found/page-59706d536ba481c2.js diff --git a/docs/_next/static/chunks/app/page-65a64361088201e6.js b/docs/_next/static/chunks/app/page-65a64361088201e6.js deleted file mode 100644 index 91c440e..0000000 --- a/docs/_next/static/chunks/app/page-65a64361088201e6.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{9343:function(e,t,i){Promise.resolve().then(i.bind(i,9330))},9330:function(e,t,i){"use strict";i.d(t,{Forge:function(){return T}});var a=i(7437),n=i(2265),s=i(7380),r=i(7635),l=i.n(r),o=i(12),m=i(1124),c=i.n(m),p=i(9089),u=i(2744),d=i(8637),g=i(1273),f=i(7780),y=i(6537),h=i.n(y);function _(e){let t=e.split("/"),i="",a="";return(t.length>1?(i=t.slice(0,-1).join("/"),a=t[t.length-1]):(i="",a=t[0]),i)?"".concat(i,"/").concat(a):(/\.(l|m|h)(male|female|bioderm)\.png$/i.test(a)||/^(vehicle|weapon)_.+png$/i.test(a)||/^dcase\d\d\.png$/i.test(a)?i="textures/skins":/\.(ter|spn)$/i.test(a)?i="terrains":/\.mis$/i.test(a)?i="missions":/\.dif$/i.test(a)&&(i="interiors"),i)?"".concat(i,"/").concat(a):a}function v(e){if(e.type){if(/^image\//i.test(e.type))return{mimeType:e.type,genericType:"image"};if(/^audio\//i.test(e.type))return{mimeType:e.type,genericType:"audio"}}if(/\.png$/i.test(e.name))return{mimeType:"image/png",genericType:"image"};if(/\.jpg$/i.test(e.name))return{mimeType:"image/jpeg",genericType:"image"};if(/\.bmp$/i.test(e.name))return{mimeType:"image/bmp",genericType:"image"};if(/\.webp$/i.test(e.name))return{mimeType:"image/webp",genericType:"image"};if(/\.gif$/i.test(e.name))return{mimeType:"image/gif",genericType:"image"};if(/\.tiff$/i.test(e.name))return{mimeType:"image/tiff",genericType:"image"};if(/\.svg$/i.test(e.name))return{mimeType:"image/svg+xml",genericType:"image"};else if(/\.wav$/i.test(e.name))return{mimeType:"audio/wav",genericType:"audio"};else if(/\.mp3$/i.test(e.name))return{mimeType:"audio/mpeg",genericType:"audio"};return e.type?{mimeType:e.type,genericType:null}:null}function x(e){var t,i;let{file:n,onDelete:s,onRename:r}=e,l=null;return n.dataUri&&(null===(t=n.type)||void 0===t?void 0:t.genericType)==="image"?l=(0,a.jsx)("img",{className:h().PreviewIcon,src:n.dataUri,width:24,alt:""}):(null===(i=n.type)||void 0===i?void 0:i.genericType)==="audio"?l=(0,a.jsx)(f.Eow,{}):/\.cs$/i.test(n.path)?l=(0,a.jsx)(d.HXH,{}):/\.mis$/i.test(n.path)?l=(0,a.jsx)(g.W95,{}):/\.dif$/i.test(n.path)?l=(0,a.jsx)(u.JEK,{}):/\.ter$/i.test(n.path)?l=(0,a.jsx)(u.seb,{}):/\.spn$/i.test(n.path)&&(l=(0,a.jsx)(g.ekl,{})),(0,a.jsxs)("div",{className:h().File,children:[(0,a.jsx)("span",{className:h().IconContainer,children:l})," ",(0,a.jsx)("span",{className:h().Path,onDoubleClick:()=>{let e=window.prompt("Rename file (".concat(n.path,"):"),n.path);e&&(e=e.trim().replace(/\/+/g,"/").replace(/^\//,"").replace(/\/$/,"").trim())&&e!==n.path&&r(n.path,e)},children:n.path}),(0,a.jsx)("button",{className:h().DeleteButton,type:"button","aria-label":"Delete",title:"Delete",onClick:e=>{s(n.path)},children:(0,a.jsx)(p.AMf,{})})]})}async function w(e){let t=await l().loadAsync(e),i=new Map;for(let e in t.files){let s=t.files[e];if(!s.dir){var a,n;let t={path:e=_(e),buffer:await s.async("arraybuffer"),dataUri:null,date:s.date,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,type:v(s)};if((null===(a=t.type)||void 0===a?void 0:a.genericType)==="image"||(null===(n=t.type)||void 0===n?void 0:n.genericType)==="audio"){let e=await s.async("base64");t.dataUri="data:".concat(t.type.mimeType,";base64,").concat(e)}i.set(e,t)}}return i}async function b(e){var t,i;let a;let n=new Map;if(e.path)(a=e.path).startsWith("/")&&(a=a.slice(1));else{if(!e.name)return n;a=e.name}a=_(a);let s=await new Promise((t,i)=>{let a=new FileReader;a.addEventListener("load",e=>{t(e.target.result)}),a.readAsArrayBuffer(e)}),r={path:a,buffer:s,dataUri:null,date:null,unixPermissions:null,dosPermissions:null,type:v(e)};if((null===(t=r.type)||void 0===t?void 0:t.genericType)==="image"||(null===(i=r.type)||void 0===i?void 0:i.genericType)==="audio"){let e=function(e){for(var t,i,a,n,s="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=new Uint8Array(e),o=l.byteLength,m=o%3,c=o-m,p=0;p>18]+r[(258048&n)>>12]+r[(4032&n)>>6]+r[63&n];return 1==m?s+=r[t=(252&(n=l[c]))>>2]+r[(3&n)<<4]+"==":2==m&&(s+=r[t=(64512&(n=l[c]<<8|l[c+1]))>>10]+r[(1008&n)>>4]+r[(15&n)<<2]+"="),s}(s);r.dataUri="data:".concat(r.type.mimeType,";base64,").concat(e)}return n.set(a,r),n}async function F(e){return/\.(zip|vl2)$/i.test(e.name)?w(e):b(e)}async function j(e,t){let i=await e.generateAsync({type:"blob",mimeType:"application/octet-stream"});(0,o.saveAs)(i,t)}function T(){let[e,t]=(0,n.useState)(()=>[]),[i,r]=(0,n.useState)(()=>new Map),o=(0,n.useCallback)(async e=>{let i=[],a=new Map;(await Promise.all(e.map(e=>F(e)))).forEach(e=>{e.forEach((e,t)=>{a.has(t)&&i.push({type:"overwrite",path:t}),a.set(t,e)})}),r(e=>new Map([...Array.from(e.entries()),...Array.from(a.entries())])),t(e=>[...e,...i])},[]),{getRootProps:m,getInputProps:u,open:d,isDragActive:g}=(0,s.uI)({noClick:!0,onDrop:o}),f=(0,n.useMemo)(()=>c()(Array.from(i.keys()),[e=>e.toLowerCase()],["asc"]).map(e=>i.get(e)),[i]),y=(0,a.jsx)("button",{type:"button",className:h().AddButton,"aria-label":"Add files",title:"Add files",onClick:d,children:"+"}),_=(0,n.useCallback)(e=>{r(t=>{let i=new Map(t);return i.delete(e),i})},[]),v=(0,n.useCallback)((e,t)=>{r(i=>{let a={...i.get(e),path:t},n=new Map(i);return n.delete(e),n.set(t,a),n})},[]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:h().Forge,...m(),children:[(0,a.jsxs)("header",{className:h().Header,children:[(0,a.jsx)("a",{className:h().HeaderLink,href:"https://github.com/exogen/vl2-forge",children:(0,a.jsx)(p.hJX,{"aria-label":"GitHub"})}),(0,a.jsx)("img",{width:210,height:188,src:"/vl2-forge/logo-md.png",alt:"VL2 Forge"}),y]}),(0,a.jsx)("input",{...u()}),(0,a.jsx)("div",{className:h().ListArea,children:f.length?(0,a.jsx)("ul",{className:h().FileList,children:f.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)(x,{file:e,onDelete:_,onRename:v})},e.path))}):(0,a.jsx)("div",{className:h().EmptyMessage,children:"Drop files onto the page or press the add button. No need to extract existing .vl2 files first –\xa0just drop ‘em in and it’ll do that for you!"})})]}),(0,a.jsxs)("footer",{className:h().Footer,children:[(0,a.jsx)("a",{className:h().FooterLink,href:"https://github.com/exogen/vl2-forge",children:(0,a.jsx)(p.hJX,{"aria-label":"GitHub"})}),(0,a.jsxs)("form",{onSubmit:async e=>{e.preventDefault();let t=e.target.elements.fileName,i=t.value.trim();if(i){if(f.length){let e=function(e){let t=new(l());for(let i of e)t.file(i.path,i.buffer,{date:i.date,dosPermissions:i.dosPermissions,unixPermissions:i.unixPermissions});return t}(f);await j(e,"".concat(i,".vl2"))}else window.alert("Add some files!")}else window.alert("Name thy file."),t.focus()},children:[(0,a.jsx)("div",{className:h().NameInput,children:(0,a.jsx)("input",{name:"fileName",type:"text",placeholder:"name thy file",onChange:e=>{/\.vl2$/i.test(e.target.value)&&(e.target.value=e.target.value.slice(0,-4))}})}),(0,a.jsx)("button",{type:"submit",className:h().DownloadButton,children:"Download"})]})]})]})}},6537:function(e){e.exports={Forge:"Forge_Forge__dDZFe",Footer:"Forge_Footer__ghw3O",NameInput:"Forge_NameInput__lpcsg",DownloadButton:"Forge_DownloadButton__CnFTn",ListArea:"Forge_ListArea__OpY_R",FileList:"Forge_FileList__9JOyh",EmptyMessage:"Forge_EmptyMessage__Lrlud",AddButton:"Forge_AddButton__09pXD",Header:"Forge_Header__7t3Qc",File:"Forge_File__Mn05Y",DeleteButton:"Forge_DeleteButton__Csfdg",IconContainer:"Forge_IconContainer__AgM_T",PreviewIcon:"Forge_PreviewIcon__HFERe",Path:"Forge_Path__GZs81",HeaderLink:"Forge_HeaderLink__fEDGG",FooterLink:"Forge_FooterLink__gznaM"}}},function(e){e.O(0,[359,51,212,516,240,699,634,971,117,744],function(){return e(e.s=9343)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/app/page-8bfd722117a9a7d9.js b/docs/_next/static/chunks/app/page-8bfd722117a9a7d9.js new file mode 100644 index 0000000..d592a8b --- /dev/null +++ b/docs/_next/static/chunks/app/page-8bfd722117a9a7d9.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{9343:function(e,t,i){Promise.resolve().then(i.bind(i,2967))},2967:function(e,t,i){"use strict";i.d(t,{Forge:function(){return M}});var n=i(7437),a=i(2265),r=i(7380),s=i(1124),o=i.n(s),l=i(9089),m=i(7311),c=i.n(m);function u(){return(0,n.jsx)("div",{className:c().LoadingBackdrop,children:(0,n.jsx)("div",{className:c().LoadingText,children:"Loading…"})})}var p=i(2744),d=i(6417),g=i(8637),f=i(1273),y=i(7780),h=i(3257),_=i(5201),x=i.n(_);function v(e){let{file:t,onDelete:i,onRename:r}=e,s=(0,a.useMemo)(()=>{var e,i;if(t.dataUri&&(null===(e=t.type)||void 0===e?void 0:e.genericType)==="image")return(0,n.jsx)("img",{className:x().PreviewIcon,src:t.dataUri,width:24,alt:""});if((null===(i=t.type)||void 0===i?void 0:i.genericType)==="audio")return(0,n.jsx)(y.Eow,{});if(/\.cs$/i.test(t.path))return(0,n.jsx)(g.HXH,{});if(/\.mis$/i.test(t.path))return(0,n.jsx)(h.Gw8,{});if(/\.dif$/i.test(t.path))return(0,n.jsx)(d.Mm0,{});if(/\.ter$/i.test(t.path))return(0,n.jsx)(p.seb,{});if(/\.spn$/i.test(t.path))return(0,n.jsx)(f.ekl,{});return null},[t]);return(0,n.jsxs)("div",{className:x().File,children:[(0,n.jsx)("span",{className:x().IconContainer,children:s})," ",(0,n.jsx)("span",{className:x().Path,onDoubleClick:()=>{let e=window.prompt("Rename file (".concat(t.path,"):"),t.path);e&&(e=e.trim().replace(/\/+/g,"/").replace(/^\//,"").replace(/\/$/,"").trim())&&e!==t.path&&r(t.path,e)},children:t.path}),(0,n.jsx)("button",{className:x().DeleteButton,type:"button","aria-label":"Delete",title:"Delete",onClick:e=>{i(t.path)},children:(0,n.jsx)(l.AMf,{})})]})}var w=i(7635),F=i.n(w),j=i(12);function T(e){let t=e.split("/"),i="",n="";return(t.length>1?(i=t.slice(0,-1).join("/"),n=t[t.length-1]):(i="",n=t[0]),i)?"".concat(i,"/").concat(n):(/\.(l|m|h)(male|female|bioderm)\.png$/i.test(n)||/^(vehicle|weapon)_.+png$/i.test(n)||/^dcase\d\d\.png$/i.test(n)?i="textures/skins":/\.(ter|spn)$/i.test(n)?i="terrains":/\.mis$/i.test(n)?i="missions":/\.dif$/i.test(n)&&(i="interiors"),i)?"".concat(i,"/").concat(n):n}function b(e){if(e.type){if(/^image\//i.test(e.type))return{mimeType:e.type,genericType:"image"};if(/^audio\//i.test(e.type))return{mimeType:e.type,genericType:"audio"}}if(/\.png$/i.test(e.name))return{mimeType:"image/png",genericType:"image"};if(/\.jpg$/i.test(e.name))return{mimeType:"image/jpeg",genericType:"image"};if(/\.bmp$/i.test(e.name))return{mimeType:"image/bmp",genericType:"image"};if(/\.webp$/i.test(e.name))return{mimeType:"image/webp",genericType:"image"};if(/\.gif$/i.test(e.name))return{mimeType:"image/gif",genericType:"image"};if(/\.tiff$/i.test(e.name))return{mimeType:"image/tiff",genericType:"image"};if(/\.svg$/i.test(e.name))return{mimeType:"image/svg+xml",genericType:"image"};else if(/\.wav$/i.test(e.name))return{mimeType:"audio/wav",genericType:"audio"};else if(/\.mp3$/i.test(e.name))return{mimeType:"audio/mpeg",genericType:"audio"};return e.type?{mimeType:e.type,genericType:null}:null}async function N(e){let t=await F().loadAsync(e),i=new Map;for(let e in t.files){let r=t.files[e];if(!r.dir){var n,a;let t={path:e=T(e),buffer:await r.async("arraybuffer"),dataUri:null,date:r.date,unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions,type:b(r)};if((null===(n=t.type)||void 0===n?void 0:n.genericType)==="image"||(null===(a=t.type)||void 0===a?void 0:a.genericType)==="audio"){let e=await r.async("base64");t.dataUri="data:".concat(t.type.mimeType,";base64,").concat(e)}i.set(e,t)}}return i}async function L(e){var t,i;let n;let a=new Map;if(e.path)(n=e.path).startsWith("/")&&(n=n.slice(1));else{if(!e.name)return a;n=e.name}n=T(n);let r=await new Promise((t,i)=>{let n=new FileReader;n.addEventListener("load",e=>{t(e.target.result)}),n.readAsArrayBuffer(e)}),s={path:n,buffer:r,dataUri:null,date:null,unixPermissions:null,dosPermissions:null,type:b(e)};if((null===(t=s.type)||void 0===t?void 0:t.genericType)==="image"||(null===(i=s.type)||void 0===i?void 0:i.genericType)==="audio"){let e=function(e){for(var t,i,n,a,r="",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(e),l=o.byteLength,m=l%3,c=l-m,u=0;u>18]+s[(258048&a)>>12]+s[(4032&a)>>6]+s[63&a];return 1==m?r+=s[t=(252&(a=o[c]))>>2]+s[(3&a)<<4]+"==":2==m&&(r+=s[t=(64512&(a=o[c]<<8|o[c+1]))>>10]+s[(1008&a)>>4]+s[(15&a)<<2]+"="),r}(r);s.dataUri="data:".concat(s.type.mimeType,";base64,").concat(e)}return a.set(n,s),a}async function k(e){return/\.(zip|vl2)$/i.test(e.name)?N(e):L(e)}async function D(e,t){let i=await e.generateAsync({type:"blob",mimeType:"application/octet-stream"});(0,j.saveAs)(i,t)}var $=i(9349),A=i.n($);function P(e){let{fileList:t}=e;return(0,n.jsxs)("form",{className:A().DownloadForm,onSubmit:async e=>{e.preventDefault();let i=e.target.elements.fileName,n=i.value.trim();if(n){if(t.length){let e=function(e){let t=new(F());for(let i of e)t.file(i.path,i.buffer,{date:i.date,dosPermissions:i.dosPermissions,unixPermissions:i.unixPermissions});return t}(t);await D(e,"".concat(n,".vl2"))}else window.alert("Add some files!")}else window.alert("Name thy file."),i.focus()},children:[(0,n.jsx)("div",{className:A().NameInput,children:(0,n.jsx)("input",{name:"fileName",type:"text",placeholder:"name thy file",onChange:e=>{/\.vl2$/i.test(e.target.value)&&(e.target.value=e.target.value.slice(0,-4))}})}),(0,n.jsx)("button",{type:"submit",className:A().DownloadButton,children:"Download"})]})}var C=i(6537),I=i.n(C);function M(){let[e,t]=(0,a.useTransition)(),[i,s]=(0,a.useState)(0),[m,c]=(0,a.useState)(()=>[]),[p,d]=(0,a.useState)(()=>new Map),g=(0,a.useCallback)(async e=>{s(e=>e+1);let i=[],n=new Map;(await Promise.all(e.map(e=>k(e)))).forEach(e=>{e.forEach((e,t)=>{n.has(t)&&i.push({type:"overwrite",path:t}),n.set(t,e)})}),t(()=>{d(e=>new Map([...Array.from(e.entries()),...Array.from(n.entries())])),c(e=>[...e,...i])}),s(e=>e-1)},[]),{getRootProps:f,getInputProps:y,open:h,isDragActive:_}=(0,r.uI)({noClick:!0,onDrop:g}),x=(0,a.useMemo)(()=>o()(Array.from(p.keys()),[e=>e.toLowerCase()],["asc"]).map(e=>p.get(e)),[p]),w=(0,n.jsx)("button",{type:"button",className:I().AddButton,"aria-label":"Add files",title:"Add files",onClick:h,children:"+"}),F=(0,a.useCallback)(e=>{d(t=>{let i=new Map(t);return i.delete(e),i})},[]),j=(0,a.useCallback)((e,t)=>{d(i=>{let n={...i.get(e),path:t},a=new Map(i);return a.delete(e),a.set(t,n),a})},[]),T=e||i>0;return(0,n.jsxs)("section",{className:I().Forge,...f(),children:[(0,n.jsxs)("header",{className:I().Header,children:[(0,n.jsx)("a",{className:I().HeaderLink,href:"https://github.com/exogen/vl2-forge",children:(0,n.jsx)(l.hJX,{"aria-label":"GitHub"})}),(0,n.jsx)("img",{className:I().Logo,width:210,height:188,src:"/vl2-forge/logo-md.png",alt:"VL2 Forge"}),w]}),(0,n.jsx)("input",{...y()}),(0,n.jsxs)("div",{className:I().ListArea,children:[T?(0,n.jsx)(u,{}):null,x.length?(0,n.jsx)("ul",{className:I().FileList,children:x.map(e=>(0,n.jsx)("li",{children:(0,n.jsx)(v,{file:e,onDelete:F,onRename:j})},e.path))}):T?null:(0,n.jsx)("div",{className:I().EmptyMessage,children:"Drop files onto the page or press the add button. No need to extract existing .vl2 files first –\xa0just drop ‘em in and it’ll take care of that!"})]}),(0,n.jsxs)("footer",{className:I().Footer,children:[(0,n.jsx)("a",{className:I().FooterLink,href:"https://github.com/exogen/vl2-forge",children:(0,n.jsx)(l.hJX,{"aria-label":"GitHub"})}),(0,n.jsx)(P,{fileList:x})]})]})}},9349:function(e){e.exports={DownloadForm:"DownloadForm_DownloadForm__xJrhQ",NameInput:"DownloadForm_NameInput__rJoTF",DownloadButton:"DownloadForm_DownloadButton__THR8u"}},5201:function(e){e.exports={File:"FileItem_File__FC9Rk",IconContainer:"FileItem_IconContainer__B0pA0",PreviewIcon:"FileItem_PreviewIcon__CVUKY",Path:"FileItem_Path__6Y42m",DeleteButton:"FileItem_DeleteButton__qYt5o"}},6537:function(e){e.exports={Forge:"Forge_Forge__dDZFe",Footer:"Forge_Footer__ghw3O",ListArea:"Forge_ListArea__OpY_R",FileList:"Forge_FileList__9JOyh",EmptyMessage:"Forge_EmptyMessage__Lrlud",AddButton:"Forge_AddButton__09pXD",Header:"Forge_Header__7t3Qc",HeaderLink:"Forge_HeaderLink__fEDGG",FooterLink:"Forge_FooterLink__gznaM"}},7311:function(e){e.exports={LoadingBackdrop:"Loading_LoadingBackdrop__9nxZJ",LoadingText:"Loading_LoadingText__cJZao"}}},function(e){e.O(0,[132,665,51,212,516,675,240,699,634,971,117,744],function(){return e(e.s=9343)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/b563f954-107b6adade962249.js b/docs/_next/static/chunks/b563f954-107b6adade962249.js new file mode 100644 index 0000000..0c0aa0b --- /dev/null +++ b/docs/_next/static/chunks/b563f954-107b6adade962249.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[675],{3257:function(t,n,e){e.d(n,{Gw8:function(){return r}});var i=e(6231);function r(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M12,20 L24,20 M12,12 L24,12 M12,4 L24,4 M1,19 L4,22 L9,17 M1,11 L4,14 L9,9 M9,1 L4,6 L1,3"},child:[]}]})(t)}}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/f97e080b-dd5f2930cdd62ec6.js b/docs/_next/static/chunks/f97e080b-dd5f2930cdd62ec6.js new file mode 100644 index 0000000..5c53e85 --- /dev/null +++ b/docs/_next/static/chunks/f97e080b-dd5f2930cdd62ec6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[665],{6417:function(a,t,n){n.d(t,{Mm0:function(){return u}});var r=n(6231);function u(a){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,216H200V115.31L211.31,104A15.86,15.86,0,0,0,216,92.69V48a16,16,0,0,0-16-16H180a8,8,0,0,0-8,8V64H148V40a8,8,0,0,0-8-8H116a8,8,0,0,0-8,8V64H84V40a8,8,0,0,0-8-8H56A16,16,0,0,0,40,48V92.69A15.86,15.86,0,0,0,44.69,104L56,115.31V216H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM112,168a16,16,0,0,1,32,0v48H112Z"},child:[]}]})(a)}}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/fd9d1056-49cc888465909d37.js b/docs/_next/static/chunks/fd9d1056-00e25204c4076378.js similarity index 100% rename from docs/_next/static/chunks/fd9d1056-49cc888465909d37.js rename to docs/_next/static/chunks/fd9d1056-00e25204c4076378.js diff --git a/docs/_next/static/chunks/webpack-95d08392c5372292.js b/docs/_next/static/chunks/webpack-be299594fc1dccd2.js similarity index 96% rename from docs/_next/static/chunks/webpack-95d08392c5372292.js rename to docs/_next/static/chunks/webpack-be299594fc1dccd2.js index 6c43a4a..047a1ff 100644 --- a/docs/_next/static/chunks/webpack-95d08392c5372292.js +++ b/docs/_next/static/chunks/webpack-be299594fc1dccd2.js @@ -1 +1 @@ -!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function d(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,loaded:!1,exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,d),r=!1}finally{r&&delete l[e]}return n.loaded=!0,n.exports}d.m=a,e=[],d.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(d.O).every(function(e){return d.O[e](n[f])})?n.splice(f--,1):(c=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(d.O).every(function(e){return d.O[e](n[f])})?n.splice(f--,1):(c=!1,oVL2 Forge
\ No newline at end of file +VL2 Forge \ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index d8de5b7..63c885b 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -1,6 +1,6 @@ -2:I[9330,["51","static/chunks/795d4814-53044e1cf9e42373.js","212","static/chunks/59650de3-d12eb82ab0e85613.js","516","static/chunks/f7333993-8f32bf8e5c1e3f32.js","240","static/chunks/53c13509-17317f399c482fd7.js","699","static/chunks/8e1d74a4-2e60cc37d7b04363.js","634","static/chunks/634-d90cc75f8d4e4c06.js","931","static/chunks/app/page-65a64361088201e6.js"],"Forge"] +2:I[2967,["665","static/chunks/f97e080b-dd5f2930cdd62ec6.js","51","static/chunks/795d4814-41e831b7c57cc385.js","212","static/chunks/59650de3-d12eb82ab0e85613.js","516","static/chunks/f7333993-8f32bf8e5c1e3f32.js","675","static/chunks/b563f954-107b6adade962249.js","240","static/chunks/53c13509-84be3322852db000.js","699","static/chunks/8e1d74a4-2e60cc37d7b04363.js","634","static/chunks/634-fc7f40d81b6d4544.js","931","static/chunks/app/page-8bfd722117a9a7d9.js"],"Forge"] 3:I[4707,[],""] 4:I[6423,[],""] -0:["be_WUnb__0cQ-xWVpCmQ8",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{}],[["$","link","0",{"rel":"stylesheet","href":"/vl2-forge/_next/static/css/1febfadc1a5e3d46.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/vl2-forge/_next/static/css/9805353de4b13899.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","className":"__variable_6dd175 __variable_60c549 __variable_b97ccf","children":["$","body",null,{"children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L5",null]]]] +0:["d1IhGb8z70Loo4_E-WAtv",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{}],[["$","link","0",{"rel":"stylesheet","href":"/vl2-forge/_next/static/css/e296810e160012c4.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/vl2-forge/_next/static/css/50e7680c75095ce4.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","className":"__variable_6dd175 __variable_60c549 __variable_b97ccf","children":["$","body",null,{"children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L5",null]]]] 5:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"VL2 Forge"}],["$","meta","3",{"name":"description","content":"Create .vl2 files for Tribes 2"}],["$","meta","4",{"name":"next-size-adjust"}]] 1:null