cloudcmd 19.5.0 → 19.6.0

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/dist/sw.js CHANGED
@@ -311,7 +311,7 @@ const respondWith = currify((f, e) => {
311
311
  e.respondWith(f(e));
312
312
  });
313
313
  const getPathName = url => new URL(url).pathname;
314
- const date = "Wed Feb 18 2026 19:46:26 GMT+0200 (Eastern European Standard Time)";
314
+ const date = "Sat Feb 21 2026 17:34:34 GMT+0200 (Eastern European Standard Time)";
315
315
  const NAME = `cloudcmd: ${date}`;
316
316
  const createRequest = a => new Request(a, {
317
317
  credentials: 'same-origin'
@@ -851,7 +851,7 @@ a:active {
851
851
  float: right;
852
852
  }
853
853
 
854
- .menu-item:hover {
854
+ .menu-item:hover, .menu-item-selected {
855
855
  background-color: #e3f2ff;
856
856
  }
857
857
 
@@ -1078,61 +1078,6 @@ eval("{\n\nconst findit = __webpack_require__(/*! domfs-findit */ \"./node_modul
1078
1078
 
1079
1079
  /***/ },
1080
1080
 
1081
- /***/ "./node_modules/supermenu/lib/build-items.js"
1082
- /*!***************************************************!*\
1083
- !*** ./node_modules/supermenu/lib/build-items.js ***!
1084
- \***************************************************/
1085
- (module, __unused_webpack_exports, __webpack_require__) {
1086
-
1087
- "use strict";
1088
- eval("{\n\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/supermenu/node_modules/rendy/lib/rendy.js\");\nconst TEMPLATE = __webpack_require__(/*! ./template */ \"./node_modules/supermenu/lib/template.js\");\n\nconst isObj = (a) => typeof a === 'object';\nconst DATA_MENU = 'data-menu=\"js-submenu\"';\n\nconst {entries} = Object;\n\nmodule.exports = function buildItems(menuData, menuFuncs, options, path = '') {\n let items = '';\n \n if (path)\n path += '.';\n \n for (const [name, data] of entries(menuData)) {\n let nameIcon;\n let subitems = '';\n let className = '';\n let attribute = '';\n \n const pathName = path + name;\n \n if (!isObj(data)) {\n menuFuncs[pathName] = data;\n } else {\n subitems = rendy(TEMPLATE.MAIN, {\n items: buildItems(data, menuFuncs, options, pathName),\n });\n \n className = ' menu-submenu';\n attribute = ` ${DATA_MENU}`;\n }\n \n if (options.icon) {\n nameIcon = name\n .replace(/\\(|\\)/g, '')\n .replace(/\\s/g, '-')\n .toLowerCase();\n \n className += ` icon icon-${nameIcon}`;\n }\n \n items += rendy(TEMPLATE.ITEM, {\n name,\n subitems,\n className,\n attribute,\n path: pathName,\n });\n }\n \n return items;\n};\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/lib/build-items.js\n}");
1089
-
1090
- /***/ },
1091
-
1092
- /***/ "./node_modules/supermenu/lib/element-funcs.js"
1093
- /*!*****************************************************!*\
1094
- !*** ./node_modules/supermenu/lib/element-funcs.js ***!
1095
- \*****************************************************/
1096
- (module) {
1097
-
1098
- "use strict";
1099
- eval("{\n\nmodule.exports = class ElementFuncsProto {\n getItem(element) {\n if (this.isName(element))\n return element.parentElement;\n \n return element;\n }\n \n getName(element) {\n if (!element)\n return null;\n \n if (this.isName(element))\n return element;\n \n return element.querySelector('[data-menu-path]');\n }\n \n isName(element) {\n if (!element)\n return false;\n \n return element.hasAttribute('data-menu-path');\n }\n \n isItem(element) {\n return this.checkElementsName(element, 'js-menu-item');\n }\n \n isMenu(element) {\n return this.checkElementsName(element, 'js-menu');\n }\n \n checkElementsName(element, nameElement, attribute) {\n if (!attribute)\n attribute = 'data-name';\n \n if (element) {\n const name = element.getAttribute(attribute);\n \n if (name === nameElement)\n return true;\n }\n \n return false;\n }\n \n isSubMenu(element) {\n const attribute = 'data-menu';\n const value = 'js-submenu';\n const item = this.getItem(element);\n \n return this.checkElementsName(item, value, attribute);\n }\n};\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/lib/element-funcs.js\n}");
1100
-
1101
- /***/ },
1102
-
1103
- /***/ "./node_modules/supermenu/lib/supermenu.js"
1104
- /*!*************************************************!*\
1105
- !*** ./node_modules/supermenu/lib/supermenu.js ***!
1106
- \*************************************************/
1107
- (module, __unused_webpack_exports, __webpack_require__) {
1108
-
1109
- "use strict";
1110
- eval("{\n\n__webpack_require__(/*! ../css/supermenu.css */ \"./node_modules/supermenu/css/supermenu.css\");\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst buildItems = __webpack_require__(/*! ./build-items */ \"./node_modules/supermenu/lib/build-items.js\");\nconst ElementFuncsProto = __webpack_require__(/*! ./element-funcs */ \"./node_modules/supermenu/lib/element-funcs.js\");\nconst isFn = (a) => typeof a === 'function';\nconst isNumber = (a) => typeof a === 'number';\nconst exec = (f, ...a) => isFn(f) && f(...a);\n\nmodule.exports = Supermenu;\n\nfunction Supermenu(element, options, menuData) {\n if (!(this instanceof Supermenu))\n return new Supermenu(element, options, menuData);\n \n const ElementFuncs = new ElementFuncsProto();\n \n let Options = {};\n let Element;\n let ElementHeight;\n let ElementWidth;\n let ElementEvent;\n \n if (menuData) {\n Element = ElementEvent = element;\n Options = options;\n } else if (options) {\n Element = ElementEvent = element;\n menuData = options;\n } else {\n Element = document.body;\n ElementEvent = window;\n menuData = element;\n }\n \n const MenuFuncs = {};\n const ElementMenu = createMenu(menuData);\n \n ElementEvent.addEventListener('click', onClick);\n \n function createMenu(menuData) {\n const items = buildItems(menuData, MenuFuncs, Options);\n \n const menu = createElement('ul', {\n dataName: 'js-menu',\n className: 'menu menu-hidden',\n innerHTML: items,\n parent: Element,\n uniq: false,\n });\n \n return menu;\n }\n \n this.show = showMenuElement;\n this.hide = hideMenuElement;\n \n this.addContextMenuListener = () => {\n ElementEvent.addEventListener('contextmenu', onContextMenu);\n };\n \n this.removeContextMenuListener = () => {\n ElementEvent.addEventListener('contextmenu', onContextMenu);\n };\n \n this.remove = removeElement;\n \n function removeElement() {\n ElementEvent.removeEventListener('click', onClick);\n ElementEvent.removeEventListener('contextmenu', onContextMenu);\n \n Element.removeChild(ElementMenu);\n }\n \n function checkElement(target, position) {\n let element = ElementFuncs.getItem(target);\n let isName = ElementFuncs.isName(element);\n let isItem = ElementFuncs.isItem(element);\n let isSub = ElementFuncs.isSubMenu(element);\n \n if (!isName || !isItem) {\n element = document.elementFromPoint(position.x, position.y);\n isSub = ElementFuncs.isSubMenu(element);\n isName = ElementFuncs.isName(element);\n isItem = ElementFuncs.isItem(element);\n }\n \n return {\n name: isName,\n item: isItem,\n sub: isSub,\n };\n }\n \n function onClick(event, checkResult) {\n event.stopPropagation();\n \n const {\n afterClick,\n beforeClick,\n beforeHide,\n afterHide,\n name,\n } = Options;\n \n const element = event.target;\n \n const is = checkResult || checkElement(element, {\n x: event.clientX,\n y: event.clientY,\n });\n \n const notClick = exec(beforeClick, name);\n \n if (is.sub)\n return event.preventDefault();\n \n exec(beforeHide);\n hideMenuElement();\n exec(afterHide);\n \n if (!notClick && (is.name || is.item)) {\n const itemData = getMenuItemData(element);\n \n exec(itemData);\n exec(afterClick);\n }\n }\n \n function onContextMenu(event) {\n event.preventDefault();\n \n const element = event.target;\n const x = event.clientX;\n const y = event.clientY;\n \n const is = checkElement(element, {\n x,\n y,\n });\n \n if (is.name || is.item || is.sub)\n return onClick(event, is);\n \n hideMenuElement();\n showMenuElement(x, y);\n }\n \n function setMenuPosition(x, y) {\n const isNumberX = isNumber(x);\n const isNumberY = isNumber(y);\n const heightMenu = getMenuHeight();\n const widthMenu = getMenuWidth();\n const heightInner = window.innerHeight;\n const widthInner = window.innerWidth;\n \n if (widthInner < widthMenu + x) {\n x -= widthMenu;\n \n if (x < 0)\n x = 0;\n }\n \n if (heightInner < heightMenu + y) {\n y -= heightMenu;\n \n if (y < 0)\n y = 0;\n }\n \n if (isNumberX)\n ElementMenu.style.left = `${x}px`;\n \n if (isNumberY)\n ElementMenu.style.top = y - 14 + 'px';\n }\n \n function showMenuElement(x, y) {\n const {\n name,\n beforeShow,\n afterShow,\n } = Options;\n \n const params = {\n x,\n y,\n name,\n };\n \n const isShow = exec(beforeShow, params);\n \n if (isShow || isShow !== false) {\n ElementMenu.classList.remove('menu-hidden');\n setMenuPosition(params.x, params.y);\n exec(afterShow, params);\n }\n }\n \n function hideMenuElement() {\n const notHide = exec(Options.beforeClose);\n \n if (!notHide)\n ElementMenu.classList.add('menu-hidden');\n }\n \n function getMenuItemData(element) {\n const nameElement = ElementFuncs.getName(element);\n \n if (!nameElement)\n return null;\n \n const path = nameElement.getAttribute('data-menu-path');\n \n return MenuFuncs[path];\n }\n \n function getMenuHeight() {\n if (!ElementHeight) {\n const {height} = getComputedStyle(ElementMenu);\n \n ElementHeight = parseInt(height, 10);\n }\n \n return ElementHeight;\n }\n \n function getMenuWidth() {\n if (!ElementWidth) {\n const {width} = getComputedStyle(ElementMenu);\n \n ElementWidth = parseInt(width, 10);\n }\n \n return ElementWidth;\n }\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/lib/supermenu.js\n}");
1111
-
1112
- /***/ },
1113
-
1114
- /***/ "./node_modules/supermenu/lib/template.js"
1115
- /*!************************************************!*\
1116
- !*** ./node_modules/supermenu/lib/template.js ***!
1117
- \************************************************/
1118
- (module) {
1119
-
1120
- "use strict";
1121
- eval("{\n\nmodule.exports.MAIN = '<ul data-name=\"js-menu\" class=\"menu menu-hidden\">{{ items }}</ul>';\nmodule.exports.ITEM = '<li data-name=\"js-menu-item\" class=\"menu-item{{ className }}\"{{ attribute }}>' +\n '<label data-menu-path=\"{{ path }}\">{{ name }}</label>' +\n '{{ subitems }}' +\n '</li>';\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/lib/template.js\n}");
1122
-
1123
- /***/ },
1124
-
1125
- /***/ "./node_modules/supermenu/node_modules/rendy/lib/rendy.js"
1126
- /*!****************************************************************!*\
1127
- !*** ./node_modules/supermenu/node_modules/rendy/lib/rendy.js ***!
1128
- \****************************************************************/
1129
- (module) {
1130
-
1131
- "use strict";
1132
- eval("{\n\nconst isString = (a) => typeof a === 'string';\nconst constant = (a) => () => a;\nconst {keys} = Object;\n\nmodule.exports = (template, values, modifiers) => {\n check(template, values);\n \n let result = template;\n \n const names = !modifiers ? keys(values) : template.match(/{{(.*?)}}/g);\n \n for (const key of names) {\n const [parsedKey, value] = parseValue(key, values, modifiers);\n const str = constant(value);\n \n while (result.includes(parsedKey))\n result = result.replace(parsedKey, str);\n }\n \n if (result.includes('{{'))\n result = result.replace(/{{.*?}}/g, '');\n \n return result;\n};\n\nfunction check(template, values) {\n if (!isString(template))\n throw Error('template should be a string!');\n \n if (typeof values !== 'object')\n throw Error('values should be an object!');\n}\n\nfunction parseValue(key, values, modifiers) {\n if (!modifiers)\n return [\n `{{ ${key} }}`,\n values[key],\n ];\n \n const preparedKey = key\n .replaceAll('{{', '')\n .replaceAll('}}', '')\n .replaceAll(' ', '');\n \n const value = values[preparedKey] || '';\n \n if (!preparedKey.includes('|'))\n return [key, value];\n \n const [name, modifierName] = preparedKey.split('|');\n const fn = modifiers[modifierName];\n const currentValue = values[name];\n \n if (!fn)\n return [key, currentValue];\n \n return [key, fn(currentValue)];\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/node_modules/rendy/lib/rendy.js\n}");
1133
-
1134
- /***/ },
1135
-
1136
1081
  /***/ "./node_modules/@cloudcmd/modal/lib/get-class-name.js"
1137
1082
  /*!************************************************************!*\
1138
1083
  !*** ./node_modules/@cloudcmd/modal/lib/get-class-name.js ***!
@@ -1646,7 +1591,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
1646
1591
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1647
1592
 
1648
1593
  "use strict";
1649
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ isChanged: () => (/* binding */ isChanged),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var format_io__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var execon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n/* global CloudCmd, DOM*/\n\n\n\n\nCloudCmd.EditFile = {\n init,\n show,\n hide,\n isChanged\n};\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog,\n Images\n} = DOM;\nconst {\n config\n} = CloudCmd;\nlet Menu;\nlet MSG_CHANGED;\nconst isLoading = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__.fullstore)();\nconst ConfigView = {\n beforeClose: async () => {\n execon__WEBPACK_IMPORTED_MODULE_2__.ifExist(Menu, 'hide');\n await isChanged();\n }\n};\nasync function init() {\n isLoading(true);\n await CloudCmd.Edit();\n const editor = CloudCmd.Edit.getEditor();\n authCheck(editor);\n setListeners(editor);\n isLoading(false);\n}\nfunction getName() {\n const {\n name,\n isDir\n } = Info;\n if (isDir) return `${name}.json`;\n return name;\n}\nasync function show(options) {\n if (isLoading()) return;\n const optionsEdit = {\n ...ConfigView,\n ...options\n };\n if (CloudCmd.config('showFileName')) optionsEdit.title = Info.name;\n Images.show.load();\n CloudCmd.Edit.getEditor().setOption('keyMap', 'default');\n const [error, data] = await Info.getData();\n if (error) {\n Images.hide();\n return CloudCmd.Edit;\n }\n const {\n path\n } = Info;\n const name = getName();\n setMsgChanged(name);\n CloudCmd.Edit.getEditor().setValueFirst(path, data).setModeForPath(name).enableKey();\n CloudCmd.Edit.show(optionsEdit);\n return CloudCmd.Edit;\n}\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners(editor) {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n editor.on('save', value => {\n DOM.setCurrentSize(format_io__WEBPACK_IMPORTED_MODULE_0__.size(value));\n });\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\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 options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n CloudCmd.Edit.getEditor().focus();\n }\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu__WEBPACK_IMPORTED_MODULE_3__(element, options, getMenuData());\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nfunction getMenuData() {\n const editor = CloudCmd.Edit.getEditor();\n return {\n 'Save Ctrl+S': () => {\n editor.save();\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}\nfunction setMsgChanged(name) {\n MSG_CHANGED = `Do you want to save changes to ${name}?`;\n}\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const is = editor.isChanged();\n if (!is) return;\n const [cancel] = await Dialog.confirm(MSG_CHANGED);\n if (cancel) return;\n editor.save();\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-file.js\n}");
1594
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ isChanged: () => (/* binding */ isChanged),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var format_io__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\n/* harmony import */ var fullstore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n/* harmony import */ var execon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n/* global CloudCmd, DOM*/\n\n\n\n\nCloudCmd.EditFile = {\n init,\n show,\n hide,\n isChanged\n};\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog,\n Images\n} = DOM;\nconst {\n config\n} = CloudCmd;\nlet Menu;\nlet MSG_CHANGED;\nconst isLoading = (0,fullstore__WEBPACK_IMPORTED_MODULE_1__.fullstore)();\nconst ConfigView = {\n beforeClose: async () => {\n execon__WEBPACK_IMPORTED_MODULE_2__.ifExist(Menu, 'hide');\n await isChanged();\n }\n};\nasync function init() {\n isLoading(true);\n await CloudCmd.Edit();\n const editor = CloudCmd.Edit.getEditor();\n authCheck(editor);\n setListeners(editor);\n isLoading(false);\n}\nfunction getName() {\n const {\n name,\n isDir\n } = Info;\n if (isDir) return `${name}.json`;\n return name;\n}\nasync function show(options) {\n if (isLoading()) return;\n const optionsEdit = {\n ...ConfigView,\n ...options\n };\n if (CloudCmd.config('showFileName')) optionsEdit.title = Info.name;\n Images.show.load();\n CloudCmd.Edit.getEditor().setOption('keyMap', 'default');\n const [error, data] = await Info.getData();\n if (error) {\n Images.hide();\n return CloudCmd.Edit;\n }\n const {\n path\n } = Info;\n const name = getName();\n setMsgChanged(name);\n CloudCmd.Edit.getEditor().setValueFirst(path, data).setModeForPath(name).enableKey();\n CloudCmd.Edit.show(optionsEdit);\n return CloudCmd.Edit;\n}\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners(editor) {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n editor.on('save', value => {\n DOM.setCurrentSize(format_io__WEBPACK_IMPORTED_MODULE_0__.size(value));\n });\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\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 options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n CloudCmd.Edit.getEditor().focus();\n }\n };\n const element = CloudCmd.Edit.getElement();\n Menu = (0,supermenu__WEBPACK_IMPORTED_MODULE_3__.supermenu)(element, options, getMenuData());\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nfunction getMenuData() {\n const editor = CloudCmd.Edit.getEditor();\n return {\n 'Save Ctrl+S': () => {\n editor.save();\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}\nfunction setMsgChanged(name) {\n MSG_CHANGED = `Do you want to save changes to ${name}?`;\n}\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const is = editor.isChanged();\n if (!is) return;\n const [cancel] = await Dialog.confirm(MSG_CHANGED);\n if (cancel) return;\n editor.save();\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-file.js\n}");
1650
1595
 
1651
1596
  /***/ },
1652
1597
 
@@ -1668,7 +1613,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
1668
1613
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1669
1614
 
1670
1615
  "use strict";
1671
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ isChanged: () => (/* binding */ isChanged),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var execon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n/* harmony import */ var multi_rename__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\n\n\n\n\nconst {\n CloudCmd,\n DOM\n} = globalThis;\nCloudCmd.EditNames = {\n init,\n show,\n hide,\n isChanged\n};\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n execon__WEBPACK_IMPORTED_MODULE_1__.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\nasync function init() {\n await CloudCmd.Edit();\n setListeners();\n}\nfunction show(options) {\n const names = getActiveNames().join('\\n');\n const config = {\n ...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}\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) {\n hide();\n } else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n}\nfunction applyPattern(pattern) {\n const newNames = (0,multi_rename__WEBPACK_IMPORTED_MODULE_3__.multiRename)(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\nasync function 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 const response = rename(dir, from, to, root);\n const [error] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_0__.tryToCatch)(refresh, to, nameIndex, response);\n if (error) alert(error);\n}\nfunction refresh(to, nameIndex, res) {\n if (res.status === 404) {\n const error = res.text();\n throw error;\n }\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\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}\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': async () => {\n await 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__WEBPACK_IMPORTED_MODULE_2__(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [cancel] = await Dialog.confirm(msg);\n !cancel && (await applyNames());\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-names.js\n}");
1616
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hide: () => (/* binding */ hide),\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ isChanged: () => (/* binding */ isChanged),\n/* harmony export */ show: () => (/* binding */ show)\n/* harmony export */ });\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var execon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n/* harmony import */ var multi_rename__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\n\n\n\n\nconst {\n CloudCmd,\n DOM\n} = globalThis;\nCloudCmd.EditNames = {\n init,\n show,\n hide,\n isChanged\n};\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n execon__WEBPACK_IMPORTED_MODULE_1__.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\nasync function init() {\n await CloudCmd.Edit();\n setListeners();\n}\nfunction show(options) {\n const names = getActiveNames().join('\\n');\n const config = {\n ...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}\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) {\n hide();\n } else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n}\nfunction applyPattern(pattern) {\n const newNames = (0,multi_rename__WEBPACK_IMPORTED_MODULE_3__.multiRename)(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\nasync function 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 const response = rename(dir, from, to, root);\n const [error] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_0__.tryToCatch)(refresh, to, nameIndex, response);\n if (error) alert(error);\n}\nfunction refresh(to, nameIndex, res) {\n if (res.status === 404) {\n const error = res.text();\n throw error;\n }\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\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}\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': async () => {\n await 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 = (0,supermenu__WEBPACK_IMPORTED_MODULE_2__.supermenu)(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [cancel] = await Dialog.confirm(msg);\n !cancel && (await applyNames());\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/edit-names.js\n}");
1672
1617
 
1673
1618
  /***/ },
1674
1619
 
@@ -1723,7 +1668,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
1723
1668
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1724
1669
 
1725
1670
  "use strict";
1726
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createCloudMenu: () => (/* binding */ createCloudMenu)\n/* harmony export */ });\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n\nconst noop = () => {};\nconst {\n CloudCmd\n} = globalThis;\nconst createCloudMenu = async (fm, options, menuData) => {\n const createMenu = await loadMenu();\n const menu = await createMenu(fm, options, menuData);\n menu.addContextMenuListener = menu.addContextMenuListener || noop;\n return menu;\n};\nasync function loadMenu() {\n if (CloudCmd.config('menu') === 'aleman') {\n const {\n prefix\n } = CloudCmd;\n const {\n host,\n protocol\n } = globalThis.location;\n const url = `${protocol}//${host}${prefix}/node_modules/aleman/menu/menu.js`;\n const {\n createMenu\n } = await import(/* webpackIgnore: true */url);\n return createMenu;\n }\n return createSupermenu;\n}\nfunction createSupermenu(name, options, menuData) {\n const element = document.querySelector('[data-name=\"js-fm\"]');\n return supermenu__WEBPACK_IMPORTED_MODULE_0__(element, options, menuData);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/menu/cloudmenu.js\n}");
1671
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createCloudMenu: () => (/* binding */ createCloudMenu)\n/* harmony export */ });\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n\nconst noop = () => {};\nconst {\n CloudCmd\n} = globalThis;\nconst createCloudMenu = async (fm, options, menuData) => {\n const createMenu = await loadMenu();\n const menu = await createMenu(fm, options, menuData);\n menu.addContextMenuListener = menu.addContextMenuListener || noop;\n return menu;\n};\nasync function loadMenu() {\n if (CloudCmd.config('menu') === 'aleman') {\n const {\n prefix\n } = CloudCmd;\n const {\n host,\n protocol\n } = globalThis.location;\n const url = `${protocol}//${host}${prefix}/node_modules/aleman/menu/menu.js`;\n const {\n createMenu\n } = await import(/* webpackIgnore: true */url);\n return createMenu;\n }\n return createSupermenu;\n}\nfunction createSupermenu(name, options, menuData) {\n const element = document.querySelector('[data-name=\"js-fm\"]');\n return (0,supermenu__WEBPACK_IMPORTED_MODULE_0__.supermenu)(element, options, menuData);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/modules/menu/cloudmenu.js\n}");
1727
1672
 
1728
1673
  /***/ },
1729
1674
 
@@ -2090,6 +2035,50 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
2090
2035
 
2091
2036
  /***/ },
2092
2037
 
2038
+ /***/ "./node_modules/supermenu/lib/build-items.js"
2039
+ /*!***************************************************!*\
2040
+ !*** ./node_modules/supermenu/lib/build-items.js ***!
2041
+ \***************************************************/
2042
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2043
+
2044
+ "use strict";
2045
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ buildItems)\n/* harmony export */ });\n/* harmony import */ var rendy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n/* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./template.js */ \"./node_modules/supermenu/lib/template.js\");\n\n\n\nconst isObj = (a) => typeof a === 'object';\nconst DATA_MENU = 'data-menu=\"js-submenu\"';\n\nconst {entries} = Object;\n\nfunction buildItems(menuData, menuFuncs, options, path = '') {\n let items = '';\n \n if (path)\n path += '.';\n \n for (const [name, data] of entries(menuData)) {\n let nameIcon;\n let subitems = '';\n let className = '';\n let attribute = '';\n \n const pathName = path + name;\n \n if (!isObj(data)) {\n menuFuncs[pathName] = data;\n } else {\n subitems = (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(_template_js__WEBPACK_IMPORTED_MODULE_1__.MAIN, {\n items: buildItems(data, menuFuncs, options, pathName),\n });\n \n className = ' menu-submenu';\n attribute = ` ${DATA_MENU}`;\n }\n \n if (options.icon) {\n nameIcon = name\n .replace(/[()]/g, '')\n .replace(/\\s/g, '-')\n .toLowerCase();\n \n className += ` icon icon-${nameIcon}`;\n }\n \n items += (0,rendy__WEBPACK_IMPORTED_MODULE_0__.rendy)(_template_js__WEBPACK_IMPORTED_MODULE_1__.ITEM, {\n name,\n subitems,\n className,\n attribute,\n path: pathName,\n });\n }\n \n return items;\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/lib/build-items.js\n}");
2046
+
2047
+ /***/ },
2048
+
2049
+ /***/ "./node_modules/supermenu/lib/element-funcs.js"
2050
+ /*!*****************************************************!*\
2051
+ !*** ./node_modules/supermenu/lib/element-funcs.js ***!
2052
+ \*****************************************************/
2053
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2054
+
2055
+ "use strict";
2056
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ElementFuncsProto)\n/* harmony export */ });\nclass ElementFuncsProto {\n getItem(element) {\n if (this.isName(element))\n return element.parentElement;\n \n return element;\n }\n \n getName(element) {\n if (!element)\n return null;\n \n if (this.isName(element))\n return element;\n \n return element.querySelector('[data-menu-path]');\n }\n \n isName(element) {\n if (!element)\n return false;\n \n return element.hasAttribute('data-menu-path');\n }\n \n isItem(element) {\n return this.checkElementsName(element, 'js-menu-item');\n }\n \n isMenu(element) {\n return this.checkElementsName(element, 'js-menu');\n }\n \n checkElementsName(element, nameElement, attribute) {\n if (!attribute)\n attribute = 'data-name';\n \n if (element) {\n const name = element.getAttribute(attribute);\n \n if (name === nameElement)\n return true;\n }\n \n return false;\n }\n \n isSubMenu(element) {\n const attribute = 'data-menu';\n const value = 'js-submenu';\n const item = this.getItem(element);\n \n return this.checkElementsName(item, value, attribute);\n }\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/lib/element-funcs.js\n}");
2057
+
2058
+ /***/ },
2059
+
2060
+ /***/ "./node_modules/supermenu/lib/supermenu.js"
2061
+ /*!*************************************************!*\
2062
+ !*** ./node_modules/supermenu/lib/supermenu.js ***!
2063
+ \*************************************************/
2064
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2065
+
2066
+ "use strict";
2067
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ supermenu: () => (/* binding */ supermenu)\n/* harmony export */ });\n/* harmony import */ var _css_supermenu_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../css/supermenu.css */ \"./node_modules/supermenu/css/supermenu.css\");\n/* harmony import */ var _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n/* harmony import */ var _build_items_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./build-items.js */ \"./node_modules/supermenu/lib/build-items.js\");\n/* harmony import */ var _element_funcs_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./element-funcs.js */ \"./node_modules/supermenu/lib/element-funcs.js\");\n\n\n\n\n\nconst isNumber = (a) => typeof a === 'number';\nconst exec = (f, ...a) => f?.(...a);\n\nfunction supermenu(element, options, menuData) {\n if (!(this instanceof supermenu))\n return new supermenu(element, options, menuData);\n \n const ElementFuncs = new _element_funcs_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n \n let Options = {};\n let Element;\n let ElementHeight;\n let ElementWidth;\n let ElementEvent;\n \n if (menuData) {\n Element = element;\n ElementEvent = Element;\n Options = options;\n } else if (options) {\n Element = element;\n ElementEvent = Element;\n menuData = options;\n } else {\n Element = document.body;\n ElementEvent = window;\n menuData = element;\n }\n \n const MenuFuncs = {};\n const ElementMenu = createMenu(menuData);\n \n ElementEvent.addEventListener('click', onClick);\n \n function createMenu(menuData) {\n const items = (0,_build_items_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(menuData, MenuFuncs, Options);\n \n const menu = _cloudcmd_create_element__WEBPACK_IMPORTED_MODULE_1__('ul', {\n dataName: 'js-menu',\n className: 'menu menu-hidden',\n innerHTML: items,\n parent: Element,\n uniq: false,\n });\n \n return menu;\n }\n \n this.show = showMenuElement;\n this.hide = hideMenuElement;\n \n this.addContextMenuListener = () => {\n ElementEvent.addEventListener('contextmenu', onContextMenu);\n };\n \n this.removeContextMenuListener = () => {\n ElementEvent.addEventListener('contextmenu', onContextMenu);\n };\n \n this.remove = removeElement;\n \n function removeElement() {\n ElementEvent.removeEventListener('click', onClick);\n ElementEvent.removeEventListener('contextmenu', onContextMenu);\n \n Element.removeChild(ElementMenu);\n }\n \n function checkElement(target, position) {\n let element = ElementFuncs.getItem(target);\n let isName = ElementFuncs.isName(element);\n let isItem = ElementFuncs.isItem(element);\n let isSub = ElementFuncs.isSubMenu(element);\n \n if (!isName || !isItem) {\n element = document.elementFromPoint(position.x, position.y);\n isSub = ElementFuncs.isSubMenu(element);\n isName = ElementFuncs.isName(element);\n isItem = ElementFuncs.isItem(element);\n }\n \n return {\n name: isName,\n item: isItem,\n sub: isSub,\n };\n }\n \n function onClick(event, checkResult) {\n event.stopPropagation();\n \n const {\n afterClick,\n beforeClick,\n beforeHide,\n afterHide,\n name,\n } = Options;\n \n const element = event.target;\n \n const is = checkResult || checkElement(element, {\n x: event.clientX,\n y: event.clientY,\n });\n \n const notClick = exec(beforeClick, name);\n \n if (is.sub)\n return event.preventDefault();\n \n exec(beforeHide);\n hideMenuElement();\n exec(afterHide);\n \n if (!notClick && (is.name || is.item)) {\n const itemData = getMenuItemData(element);\n \n exec(itemData);\n exec(afterClick);\n }\n }\n \n function onContextMenu(event) {\n event.preventDefault();\n \n const element = event.target;\n const x = event.clientX;\n const y = event.clientY;\n \n const is = checkElement(element, {\n x,\n y,\n });\n \n if (is.name || is.item || is.sub)\n return onClick(event, is);\n \n hideMenuElement();\n showMenuElement(x, y);\n }\n \n function setMenuPosition(x, y) {\n const isNumberX = isNumber(x);\n const isNumberY = isNumber(y);\n const heightMenu = getMenuHeight();\n const widthMenu = getMenuWidth();\n const heightInner = globalThis.innerHeight;\n const widthInner = globalThis.innerWidth;\n \n if (widthInner < widthMenu + x) {\n x -= widthMenu;\n \n if (x < 0)\n x = 0;\n }\n \n if (heightInner < heightMenu + y) {\n y -= heightMenu;\n \n if (y < 0)\n y = 0;\n }\n \n if (isNumberX)\n ElementMenu.style.left = `${x}px`;\n \n if (isNumberY)\n ElementMenu.style.top = y - 14 + 'px';\n }\n \n function showMenuElement(x, y) {\n const {\n name,\n beforeShow,\n afterShow,\n } = Options;\n \n const params = {\n x,\n y,\n name,\n };\n \n const isShow = exec(beforeShow, params);\n \n if (isShow || isShow !== false) {\n ElementMenu.classList.remove('menu-hidden');\n setMenuPosition(params.x, params.y);\n exec(afterShow, params);\n }\n }\n \n function hideMenuElement() {\n const notHide = exec(Options.beforeClose);\n \n if (!notHide)\n ElementMenu.classList.add('menu-hidden');\n }\n \n function getMenuItemData(element) {\n const nameElement = ElementFuncs.getName(element);\n \n if (!nameElement)\n return null;\n \n const path = nameElement.getAttribute('data-menu-path');\n \n return MenuFuncs[path];\n }\n \n function getMenuHeight() {\n if (!ElementHeight) {\n const {height} = getComputedStyle(ElementMenu);\n \n ElementHeight = parseInt(height, 10);\n }\n \n return ElementHeight;\n }\n \n function getMenuWidth() {\n if (!ElementWidth) {\n const {width} = getComputedStyle(ElementMenu);\n \n ElementWidth = parseInt(width, 10);\n }\n \n return ElementWidth;\n }\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/lib/supermenu.js\n}");
2068
+
2069
+ /***/ },
2070
+
2071
+ /***/ "./node_modules/supermenu/lib/template.js"
2072
+ /*!************************************************!*\
2073
+ !*** ./node_modules/supermenu/lib/template.js ***!
2074
+ \************************************************/
2075
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2076
+
2077
+ "use strict";
2078
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ITEM: () => (/* binding */ ITEM),\n/* harmony export */ MAIN: () => (/* binding */ MAIN)\n/* harmony export */ });\nconst MAIN = '<ul data-name=\"js-menu\" class=\"menu menu-hidden\">{{ items }}</ul>';\nconst ITEM = '<li data-name=\"js-menu-item\" class=\"menu-item{{ className }}\"{{ attribute }}>' +\n '<label data-menu-path=\"{{ path }}\">{{ name }}</label>' +\n '{{ subitems }}' +\n '</li>';\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/supermenu/lib/template.js\n}");
2079
+
2080
+ /***/ },
2081
+
2093
2082
  /***/ "./node_modules/try-catch/lib/try-catch.js"
2094
2083
  /*!*************************************************!*\
2095
2084
  !*** ./node_modules/try-catch/lib/try-catch.js ***!
package/dist-dev/sw.js CHANGED
@@ -37,7 +37,7 @@ eval("{// shim for using process in browser\nvar process = module.exports = {};\
37
37
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
38
38
 
39
39
  "use strict";
40
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Wed Feb 18 2026 19:46:28 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\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 (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.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}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
40
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Sat Feb 21 2026 17:34:36 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\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 (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.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}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
41
41
 
42
42
  /***/ },
43
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "19.5.0",
3
+ "version": "19.6.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -122,7 +122,6 @@
122
122
  "montag": "^1.2.1",
123
123
  "nano-memoize": "^3.0.16",
124
124
  "nomine": "^4.0.0",
125
- "object.omit": "^3.0.0",
126
125
  "once": "^1.4.0",
127
126
  "onezip": "^6.0.1",
128
127
  "open": "^11.0.0",
@@ -209,7 +208,7 @@
209
208
  "serve-once": "^3.0.1",
210
209
  "smalltalk": "^5.0.0",
211
210
  "style-loader": "^4.0.0",
212
- "supermenu": "^4.0.1",
211
+ "supermenu": "^5.0.0",
213
212
  "supertape": "^12.0.0",
214
213
  "tar-stream": "^3.0.0",
215
214
  "unionfs": "^4.0.0",
@@ -232,6 +231,7 @@
232
231
  "#dom/storage": "./client/dom/storage.js",
233
232
  "#dom/rest": "./client/dom/rest.js",
234
233
  "#common/util": "./common/util.js",
234
+ "#common/omit": "./common/omit.js",
235
235
  "#common/cloudfunc": "./common/cloudfunc.js",
236
236
  "#common/entity": "./common/entity.js",
237
237
  "#server/cloudcmd": "./server/cloudcmd.js"
@@ -1,7 +1,7 @@
1
1
  import currify from 'currify';
2
2
  import wraptile from 'wraptile';
3
3
  import squad from 'squad';
4
- import omit from 'object.omit';
4
+ import {omit} from '#common/omit';
5
5
  import log, {
6
6
  exportStr,
7
7
  connectedStr,