cloudcmd 15.9.13 → 15.9.14

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/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2022.01.13, v15.9.14
2
+
3
+ fix:
4
+ - (cloudcmd) client: edit-names in vim mode
5
+ - (docker) images: make dockerfiles use node:lts-buster and node:lts-buster-slim for alpine (#363)
6
+ - (docker) images: make dockerfiles use node:lts-buster-slim as base image (#357)
7
+ feature:
8
+ - (package) eslint-plugin-putout v13.0.1
9
+ - (package) putout v24.0.2
10
+
1
11
  2021.12.23, v15.9.13
2
12
 
3
13
  feature:
package/HELP.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v15.9.13
1
+ # Cloud Commander v15.9.14
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL]
4
4
 
@@ -1082,6 +1082,7 @@ There are a lot of ways to be involved in `Cloud Commander` development:
1082
1082
 
1083
1083
  ## Version history
1084
1084
 
1085
+ - *2022.01.13*, **[v15.9.14](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.14)**
1085
1086
  - *2021.12.23*, **[v15.9.13](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.13)**
1086
1087
  - *2021.12.16*, **[v15.9.12](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.12)**
1087
1088
  - *2021.12.09*, **[v15.9.11](//github.com/coderaiser/cloudcmd/releases/tag/v15.9.11)**
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v15.9.13 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
1
+ # Cloud Commander v15.9.14 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL]
4
4
 
@@ -1,2 +1,2 @@
1
- !function(e){function t(t){for(var o,l,d=t[0],u=t[1],s=t[2],a=0,f=[];a<d.length;a++)l=d[a],Object.prototype.hasOwnProperty.call(r,l)&&r[l]&&f.push(r[l][0]),r[l]=0;for(o in u)Object.prototype.hasOwnProperty.call(u,o)&&(e[o]=u[o]);for(c&&c(t);f.length;)f.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,d=1;d<n.length;d++){var u=n[d];0!==r[u]&&(o=!1)}o&&(i.splice(t--,1),e=l(l.s=n[0]))}return e}var o={},r={7:0},i=[];function l(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,l),n.l=!0,n.exports}l.m=e,l.c=o,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)l.d(n,o,function(t){return e[t]}.bind(null,o));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/dist/";var d=window.webpackJsonp=window.webpackJsonp||[],u=d.push.bind(d);d.push=t,d=d.slice();for(var s=0;s<d.length;s++)t(d[s]);var c=u;i.push([89,0]),n()}({89:function(e,t,n){"use strict";CloudCmd.EditNames=t;const o=n(0),r=n(5),i=n(22),l=n(90),d=Promise.reject.bind(Promise),u=DOM.CurrentInfo,{Dialog:s}=DOM,c=o((function(e,t,n){if(404===n.status)return n.text().then(d);const o=e[t];CloudCmd.refresh({currentName:o})})),a=o((function(e,t,n,o){const r=function(e,t){return"/"===e?t:e+t}(o,e),{prefix:i}=CloudCmd;return fetch(i+"/rename",{method:"put",credentials:"include",body:JSON.stringify({from:t,to:n,dir:r})})}));let f;const p={beforeClose:async()=>{r.ifExist(f,"hide"),DOM.Events.remove("keydown",C),await b()}};async function C(e){const t=e.ctrlKey,n=e.metaKey,o=t||n,{Key:r}=CloudCmd;if(o&&e.keyCode===r.S)y();else if(o&&e.keyCode===r.P){const[,e]=await s.prompt("Apply pattern:","[n][e]");e&&function(e){const t=l(e,m());CloudCmd.Edit.getEditor().setValue(t.join("\n"))}(e)}e.preventDefault()}function m(){return DOM.getFilenames(DOM.getActiveFiles())}function y(){CloudCmd.Edit.hide()}function h(){const e=u.dirPath,t=m(),n=t.indexOf(u.name),o=CloudCmd.Edit.getEditor().getValue().split("\n"),r=CloudCmd.config("root");Promise.resolve(r).then(a(e,t,o)).then(c(o,n)).catch(alert)}function g(e){const t={x:e.clientX,y:e.clientY};if(e.preventDefault(),f)return;const n=CloudCmd.Edit.getEditor(),o={beforeShow:e=>{e.x-=18,e.y-=27},afterClick:()=>{n.focus()}},r={"Save Ctrl+S":()=>{h(),y()},"Go To Line Ctrl+G":()=>{n.goToLine()},"Cut Ctrl+X":()=>{n.cutToClipboard()},"Copy Ctrl+C":()=>{n.copyToClipboard()},"Paste Ctrl+V":()=>{n.pasteFromClipboard()},"Delete Del":()=>{n.remove("right")},"Select All Ctrl+A":()=>{n.selectAll()},"Close Esc":y},l=CloudCmd.Edit.getElement();f=i(l,o,r),f.addContextMenuListener(),f.show(t.x,t.y)}async function b(){if(!CloudCmd.Edit.getEditor().isChanged())return;const[,e]=await s.confirm("Apply new names?");e&&h()}e.exports.init=async()=>{await CloudCmd.Edit(),function(){const e=CloudCmd.Edit.getElement();DOM.Events.addOnce("contextmenu",e,g)}()},e.exports.show=e=>{const t=m().join("\n"),n={...p,...e};return".."===u.name&&1===t.length?s.alert.noFiles():(DOM.Events.addKey(C),CloudCmd.Edit.getEditor().setValueFirst("edit-names",t).setMode().setOption("keyMap","default").disableKey(),CloudCmd.Edit.show(n),CloudCmd.Edit)},e.exports.hide=y,e.exports.isChanged=b}});
1
+ !function(e){function t(t){for(var o,d,l=t[0],u=t[1],s=t[2],a=0,f=[];a<l.length;a++)d=l[a],Object.prototype.hasOwnProperty.call(r,d)&&r[d]&&f.push(r[d][0]),r[d]=0;for(o in u)Object.prototype.hasOwnProperty.call(u,o)&&(e[o]=u[o]);for(c&&c(t);f.length;)f.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,l=1;l<n.length;l++){var u=n[l];0!==r[u]&&(o=!1)}o&&(i.splice(t--,1),e=d(d.s=n[0]))}return e}var o={},r={7:0},i=[];function d(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,d),n.l=!0,n.exports}d.m=e,d.c=o,d.d=function(e,t,n){d.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.t=function(e,t){if(1&t&&(e=d(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(d.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)d.d(n,o,function(t){return e[t]}.bind(null,o));return n},d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,"a",t),t},d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var c=u;i.push([89,0]),n()}({89:function(e,t,n){"use strict";CloudCmd.EditNames=t;const o=n(0),r=n(5),i=n(22),d=n(90),l=Promise.reject.bind(Promise),u=DOM.CurrentInfo,{Dialog:s}=DOM,c=o((function(e,t,n){if(404===n.status)return n.text().then(l);const o=e[t];CloudCmd.refresh({currentName:o})})),a=o((function(e,t,n,o){const r=function(e,t){return"/"===e?t:e+t}(o,e),{prefix:i}=CloudCmd;return fetch(i+"/rename",{method:"put",credentials:"include",body:JSON.stringify({from:t,to:n,dir:r})})}));let f;const p={beforeClose:async()=>{r.ifExist(f,"hide"),DOM.Events.remove("keydown",C),await b()}};async function C(e){const t=e.ctrlKey,n=e.metaKey,o=t||n,{Key:r}=CloudCmd;if(o&&e.keyCode===r.S)y();else if(o&&e.keyCode===r.P){const[,e]=await s.prompt("Apply pattern:","[n][e]");e&&function(e){const t=d(e,m());CloudCmd.Edit.getEditor().setValue(t.join("\n"))}(e)}}function m(){return DOM.getFilenames(DOM.getActiveFiles())}function y(){CloudCmd.Edit.hide()}function h(){const e=u.dirPath,t=m(),n=t.indexOf(u.name),o=CloudCmd.Edit.getEditor().getValue().split("\n"),r=CloudCmd.config("root");Promise.resolve(r).then(a(e,t,o)).then(c(o,n)).catch(alert)}function g(e){const t={x:e.clientX,y:e.clientY};if(e.preventDefault(),f)return;const n=CloudCmd.Edit.getEditor(),o={beforeShow:e=>{e.x-=18,e.y-=27},afterClick:()=>{n.focus()}},r={"Save Ctrl+S":()=>{h(),y()},"Go To Line Ctrl+G":()=>{n.goToLine()},"Cut Ctrl+X":()=>{n.cutToClipboard()},"Copy Ctrl+C":()=>{n.copyToClipboard()},"Paste Ctrl+V":()=>{n.pasteFromClipboard()},"Delete Del":()=>{n.remove("right")},"Select All Ctrl+A":()=>{n.selectAll()},"Close Esc":y},d=CloudCmd.Edit.getElement();f=i(d,o,r),f.addContextMenuListener(),f.show(t.x,t.y)}async function b(){if(!CloudCmd.Edit.getEditor().isChanged())return;const[,e]=await s.confirm("Apply new names?");e&&h()}e.exports.init=async()=>{await CloudCmd.Edit(),function(){const e=CloudCmd.Edit.getElement();DOM.Events.addOnce("contextmenu",e,g)}()},e.exports.show=e=>{const t=m().join("\n"),n={...p,...e};return".."===u.name&&1===t.length?s.alert.noFiles():(DOM.Events.addKey(C),CloudCmd.Edit.getEditor().setValueFirst("edit-names",t).setMode().setOption("keyMap","default").disableKey(),CloudCmd.Edit.show(n),CloudCmd.Edit)},e.exports.hide=y,e.exports.isChanged=b}});
2
2
  //# sourceMappingURL=edit-names.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["file://cloudcmd/modules/edit-names.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","7","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","89","CloudCmd","EditNames","currify","exec","supermenu","multiRename","reject","Promise","Info","DOM","CurrentInfo","Dialog","refresh","to","nameIndex","res","status","text","then","currentName","rename","path","from","root","dir","getDir","prefix","fetch","method","credentials","body","JSON","stringify","Menu","ConfigView","beforeClose","async","ifExist","Events","remove","keyListener","isChanged","event","ctrl","ctrlKey","meta","metaKey","ctrlMeta","Key","keyCode","S","hide","P","pattern","prompt","newNames","getActiveNames","Edit","getEditor","setValue","join","applyPattern","preventDefault","getFilenames","getActiveFiles","applyNames","dirPath","indexOf","getValue","split","config","resolve","catch","alert","setMenu","position","x","clientX","y","clientY","editor","options","beforeShow","params","afterClick","focus","menuData","Save Ctrl+S","Go To Line Ctrl+G","goToLine","Cut Ctrl+X","cutToClipboard","Copy Ctrl+C","copyToClipboard","Paste Ctrl+V","pasteFromClipboard","Delete Del","Select All Ctrl+A","selectAll","Close Esc","element","getElement","addContextMenuListener","show","names","confirm","init","addOnce","setListeners","noFiles","addKey","setValueFirst","setMode","set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D,SAAe7F,EAAO8F,QAFnB,oBAGZD,GAASvC,IAlJXhG,EAAOD,QAAQ0I,KAAOtE,gBACdpC,SAASyD,OA8CjB,WACE,MAAM2C,EAAUpG,SAASyD,KAAK4C,aAC9B5F,IAAI6B,OAAOqE,QAAQ,cAAeP,EAAS1B,GA/C3CkC,IAGF3I,EAAOD,QAAQuI,KAAOtB,IACpB,MAAMuB,EAAQhD,IAAiBI,KAAK,MAC9BU,EAAS,IAAKpC,KACf+C,GAEL,MAAkB,OAAdzE,EAAKlC,MAAkC,IAAjBkI,EAAM9J,OAAqBiE,EAAO8D,MAAMoC,WAClEpG,IAAI6B,OAAOwE,OAAOtE,GAClBxC,SAASyD,KAAKC,YAAYqD,cAAc,aAAcP,GAAOQ,UAAUC,UAAU,SAAU,WAAWC,aACtGlH,SAASyD,KAAK8C,KAAKjC,GACZtE,SAASyD,OA2BlBxF,EAAOD,QAAQmF,KAAOA,EAkGtBlF,EAAOD,QAAQyE,UAAYA","file":"./modules/edit-names.js","sourceRoot":""}
1
+ {"version":3,"sources":["file://cloudcmd/modules/edit-names.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","7","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","89","CloudCmd","EditNames","currify","exec","supermenu","multiRename","reject","Promise","Info","DOM","CurrentInfo","Dialog","refresh","to","nameIndex","res","status","text","then","currentName","rename","path","from","root","dir","getDir","prefix","fetch","method","credentials","body","JSON","stringify","Menu","ConfigView","beforeClose","async","ifExist","Events","remove","keyListener","isChanged","event","ctrl","ctrlKey","meta","metaKey","ctrlMeta","Key","keyCode","S","hide","P","pattern","prompt","newNames","getActiveNames","Edit","getEditor","setValue","join","applyPattern","getFilenames","getActiveFiles","applyNames","dirPath","indexOf","getValue","split","config","resolve","catch","alert","setMenu","position","x","clientX","y","clientY","preventDefault","editor","options","beforeShow","params","afterClick","focus","menuData","Save Ctrl+S","Go To Line Ctrl+G","goToLine","Cut Ctrl+X","cutToClipboard","Copy Ctrl+C","copyToClipboard","Paste Ctrl+V","pasteFromClipboard","Delete Del","Select All Ctrl+A","selectAll","Close Esc","element","getElement","addContextMenuListener","show","names","confirm","init","addOnce","setListeners","noFiles","addKey","setValueFirst","setMode","setOption","disableKey"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeb,OAAQe,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BV,EAAgBW,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOnB,IAAK,GAC5Bc,EAASM,EAAoBA,EAAoBC,EAAIN,EA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AyB,KACvBZ,EAAOa,mBAETC,wBAAyB,KACvBd,EAAOe,sBAETC,qBAAsB,KACpBhB,EAAOzC,OAAO,UAEhB0D,wBAAyB,KACvBjB,EAAOkB,aAETC,qBAAsBhD,GAElBiD,EAAUpG,SAASyD,KAAK4C,aAC9BpE,EAAO7B,EAAUgG,EAASnB,EAASK,GACnCrD,EAAKqE,yBACLrE,EAAKsE,KAAK7B,EAASC,EAAGD,EAASG,GAKjCzC,eAAeK,IAGb,IAFezC,SAASyD,KAAKC,YAEjBjB,YAAa,OACzB,MAAO,CAAE+D,SAAe7F,EAAO8F,QAFnB,oBAGZD,GAASxC,IAjJX/F,EAAOD,QAAQ0I,KAAOtE,gBACdpC,SAASyD,OA6CjB,WACE,MAAM2C,EAAUpG,SAASyD,KAAK4C,aAC9B5F,IAAI6B,OAAOqE,QAAQ,cAAeP,EAAS3B,GA9C3CmC,IAGF3I,EAAOD,QAAQuI,KAAOtB,IACpB,MAAMuB,EAAQhD,IAAiBI,KAAK,MAC9BS,EAAS,IAAKnC,KACf+C,GAEL,MAAkB,OAAdzE,EAAKlC,MAAkC,IAAjBkI,EAAM9J,OAAqBiE,EAAO6D,MAAMqC,WAClEpG,IAAI6B,OAAOwE,OAAOtE,GAClBxC,SAASyD,KAAKC,YAAYqD,cAAc,aAAcP,GAAOQ,UAAUC,UAAU,SAAU,WAAWC,aACtGlH,SAASyD,KAAK8C,KAAKlC,GACZrE,SAASyD,OA0BlBxF,EAAOD,QAAQmF,KAAOA,EAkGtBlF,EAAOD,QAAQyE,UAAYA","file":"./modules/edit-names.js","sourceRoot":""}
package/dist/sw.js CHANGED
@@ -5,5 +5,5 @@ var serviceWorkerOption = {
5
5
  ]
6
6
  };
7
7
 
8
- !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=o((t,e)=>e.waitUntil(t())),c=o((t,e)=>{const{request:n}=e,{url:r}=n,o=u(r);/\/$/.test(r)||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(/^\/api/.test(o)||/^socket.io/.test(o)||e.respondWith(t(e)))}),u=t=>new URL(t).pathname,a="cloudcmd: Thu Dec 23 2021 12:10:40 GMT+0200 (Eastern European Standard Time)",s=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",i((async function(){console.info("cloudcmd: sw: install: "+a),await self.skipWaiting()}))),self.addEventListener("fetch",c((async function(t){const{request:e}=t,{url:n}=e,o=u(n),i=s(o,t.request),c=await caches.open(a),f=await c.match(e);if(f)return f;const[l,d]=await r(fetch,i,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(a)).put(t,e)}(e,d.clone()),d)}))),self.addEventListener("activate",i((async function(){console.info("cloudcmd: sw: activate: "+a),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e,n){"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}},function(t,e,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(n)[o]||n};t.exports=r}]);
8
+ !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=o((t,e)=>e.waitUntil(t())),c=o((t,e)=>{const{request:n}=e,{url:r}=n,o=u(r);/\/$/.test(r)||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(/^\/api/.test(o)||/^socket.io/.test(o)||e.respondWith(t(e)))}),u=t=>new URL(t).pathname,a="cloudcmd: Thu Jan 13 2022 15:50:44 GMT+0200 (Eastern European Standard Time)",s=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",i((async function(){console.info("cloudcmd: sw: install: "+a),await self.skipWaiting()}))),self.addEventListener("fetch",c((async function(t){const{request:e}=t,{url:n}=e,o=u(n),i=s(o,t.request),c=await caches.open(a),f=await c.match(e);if(f)return f;const[l,d]=await r(fetch,i,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(a)).put(t,e)}(e,d.clone()),d)}))),self.addEventListener("activate",i((async function(){console.info("cloudcmd: sw: activate: "+a),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e,n){"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}},function(t,e,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(n)[o]||n};t.exports=r}]);
9
9
  //# sourceMappingURL=sw.js.map
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n/* global CloudCmd, DOM */\n\nCloudCmd.EditNames = exports;\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n\nconst multiRename = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\n\nconst reject = Promise.reject.bind(Promise);\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nconst refresh = currify(_refresh);\nconst rename = currify(_rename);\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n exec.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\n\nmodule.exports.init = async () => {\n await CloudCmd.Edit();\n setListeners();\n};\n\nmodule.exports.show = options => {\n const names = getActiveNames().join('\\n');\n const config = { ...ConfigView,\n ...options\n };\n if (Info.name === '..' && names.length === 1) return Dialog.alert.noFiles();\n DOM.Events.addKey(keyListener);\n CloudCmd.Edit.getEditor().setValueFirst('edit-names', names).setMode().setOption('keyMap', 'default').disableKey();\n CloudCmd.Edit.show(config);\n return CloudCmd.Edit;\n};\n\nasync function keyListener(event) {\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n const {\n Key\n } = CloudCmd;\n if (ctrlMeta && event.keyCode === Key.S) hide();else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n event.preventDefault();\n}\n\nfunction applyPattern(pattern) {\n const newNames = multiRename(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\n\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\n\nmodule.exports.hide = hide;\n\nfunction hide() {\n CloudCmd.Edit.hide();\n}\n\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\n\nfunction applyNames() {\n const dir = Info.dirPath;\n const from = getActiveNames();\n const nameIndex = from.indexOf(Info.name);\n const editor = CloudCmd.Edit.getEditor();\n const to = editor.getValue().split('\\n');\n const root = CloudCmd.config('root');\n Promise.resolve(root).then(rename(dir, from, to)).then(refresh(to, nameIndex)).catch(alert);\n}\n\nfunction _refresh(to, nameIndex, res) {\n if (res.status === 404) return res.text().then(reject);\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\n\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\n}\n\nfunction _rename(path, from, to, root) {\n const dir = getDir(root, path);\n const {\n prefix\n } = CloudCmd;\n return fetch(`${prefix}/rename`, {\n method: 'put',\n credentials: 'include',\n body: JSON.stringify({\n from,\n to,\n dir\n })\n });\n}\n\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const editor = CloudCmd.Edit.getEditor();\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n editor.focus();\n }\n };\n const menuData = {\n 'Save Ctrl+S': () => {\n applyNames();\n hide();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\n\nmodule.exports.isChanged = isChanged;\n\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [, names] = await Dialog.confirm(msg);\n names && applyNames();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/edit-names.js");
166
+ eval("\n/* global CloudCmd, DOM */\n\nCloudCmd.EditNames = exports;\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n\nconst multiRename = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\n\nconst reject = Promise.reject.bind(Promise);\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nconst refresh = currify(_refresh);\nconst rename = currify(_rename);\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n exec.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\n\nmodule.exports.init = async () => {\n await CloudCmd.Edit();\n setListeners();\n};\n\nmodule.exports.show = options => {\n const names = getActiveNames().join('\\n');\n const config = { ...ConfigView,\n ...options\n };\n if (Info.name === '..' && names.length === 1) return Dialog.alert.noFiles();\n DOM.Events.addKey(keyListener);\n CloudCmd.Edit.getEditor().setValueFirst('edit-names', names).setMode().setOption('keyMap', 'default').disableKey();\n CloudCmd.Edit.show(config);\n return CloudCmd.Edit;\n};\n\nasync function keyListener(event) {\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n const {\n Key\n } = CloudCmd;\n if (ctrlMeta && event.keyCode === Key.S) hide();else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n}\n\nfunction applyPattern(pattern) {\n const newNames = multiRename(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\n\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\n\nmodule.exports.hide = hide;\n\nfunction hide() {\n CloudCmd.Edit.hide();\n}\n\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\n\nfunction applyNames() {\n const dir = Info.dirPath;\n const from = getActiveNames();\n const nameIndex = from.indexOf(Info.name);\n const editor = CloudCmd.Edit.getEditor();\n const to = editor.getValue().split('\\n');\n const root = CloudCmd.config('root');\n Promise.resolve(root).then(rename(dir, from, to)).then(refresh(to, nameIndex)).catch(alert);\n}\n\nfunction _refresh(to, nameIndex, res) {\n if (res.status === 404) return res.text().then(reject);\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\n\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\n}\n\nfunction _rename(path, from, to, root) {\n const dir = getDir(root, path);\n const {\n prefix\n } = CloudCmd;\n return fetch(`${prefix}/rename`, {\n method: 'put',\n credentials: 'include',\n body: JSON.stringify({\n from,\n to,\n dir\n })\n });\n}\n\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const editor = CloudCmd.Edit.getEditor();\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n editor.focus();\n }\n };\n const menuData = {\n 'Save Ctrl+S': () => {\n applyNames();\n hide();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\n\nmodule.exports.isChanged = isChanged;\n\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [, names] = await Dialog.confirm(msg);\n names && applyNames();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/edit-names.js");
167
167
 
168
168
  /***/ })
169
169
 
package/dist-dev/sw.js CHANGED
@@ -101,7 +101,7 @@ var serviceWorkerOption = {
101
101
  /***/ (function(module, exports, __webpack_require__) {
102
102
 
103
103
  "use strict";
104
- eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isDev = \"development\" === 'development';\n\nconst isGet = a => a.method === 'GET';\n\nconst isBasic = a => a.type === 'basic';\n\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (/\\/$/.test(url) || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (/^\\/api/.test(pathname)) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\n\nconst getPathName = url => new URL(url).pathname;\n\nconst date = \"Thu Dec 23 2021 12:10:53 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\n\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\n\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\n\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\n\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\n\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\n\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\n\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js");
104
+ eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isDev = \"development\" === 'development';\n\nconst isGet = a => a.method === 'GET';\n\nconst isBasic = a => a.type === 'basic';\n\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (/\\/$/.test(url) || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (/^\\/api/.test(pathname)) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\n\nconst getPathName = url => new URL(url).pathname;\n\nconst date = \"Thu Jan 13 2022 15:51:03 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\n\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\n\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\n\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\n\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\n\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\n\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\n\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js");
105
105
 
106
106
  /***/ }),
107
107
 
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "15.9.13",
3
+ "version": "15.9.14",
4
+ "type": "commonjs",
4
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
6
  "description": "File manager for the web with console and editor",
6
7
  "homepage": "http://cloudcmd.io",
@@ -120,7 +121,7 @@
120
121
  "package-json": "^7.0.0",
121
122
  "ponse": "^6.0.0",
122
123
  "pullout": "^4.0.0",
123
- "putout": "^23.0.0",
124
+ "putout": "^24.0.2",
124
125
  "redzip": "^2.0.0",
125
126
  "rendy": "^3.0.0",
126
127
  "restafary": "^10.0.0",
@@ -164,7 +165,7 @@
164
165
  "emitify": "^4.0.1",
165
166
  "eslint": "^8.0.1",
166
167
  "eslint-plugin-node": "^11.0.0",
167
- "eslint-plugin-putout": "^12.2.0",
168
+ "eslint-plugin-putout": "^13.0.1",
168
169
  "extract-text-webpack-plugin": "^4.0.0-alpha.0",
169
170
  "gritty": "^6.0.0",
170
171
  "gunzip-maybe": "^1.3.1",