1function _assert_this_initialized(self) { 2 if (self === void 0) { 3 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 4 } 5 return self; 6} 7function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { 8 try { 9 var info = gen[key](arg); 10 var value = info.value; 11 } catch (error) { 12 reject(error); 13 return; 14 } 15 if (info.done) { 16 resolve(value); 17 } else { 18 Promise.resolve(value).then(_next, _throw); 19 } 20} 21function _async_to_generator(fn) { 22 return function() { 23 var self = this, args = arguments; 24 return new Promise(function(resolve, reject) { 25 var gen = fn.apply(self, args); 26 function _next(value) { 27 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); 28 } 29 function _throw(err) { 30 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); 31 } 32 _next(undefined); 33 }); 34 }; 35} 36function _class_call_check(instance, Constructor) { 37 if (!(instance instanceof Constructor)) { 38 throw new TypeError("Cannot call a class as a function"); 39 } 40} 41function _defineProperties(target, props) { 42 for(var i = 0; i < props.length; i++){ 43 var descriptor = props[i]; 44 descriptor.enumerable = descriptor.enumerable || false; 45 descriptor.configurable = true; 46 if ("value" in descriptor) descriptor.writable = true; 47 Object.defineProperty(target, descriptor.key, descriptor); 48 } 49} 50function _create_class(Constructor, protoProps, staticProps) { 51 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 52 if (staticProps) _defineProperties(Constructor, staticProps); 53 return Constructor; 54} 55function _define_property(obj, key, value) { 56 if (key in obj) { 57 Object.defineProperty(obj, key, { 58 value: value, 59 enumerable: true, 60 configurable: true, 61 writable: true 62 }); 63 } else { 64 obj[key] = value; 65 } 66 return obj; 67} 68function _get_prototype_of(o) { 69 _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) { 70 return o.__proto__ || Object.getPrototypeOf(o); 71 }; 72 return _get_prototype_of(o); 73} 74function _inherits(subClass, superClass) { 75 if (typeof superClass !== "function" && superClass !== null) { 76 throw new TypeError("Super expression must either be null or a function"); 77 } 78 subClass.prototype = Object.create(superClass && superClass.prototype, { 79 constructor: { 80 value: subClass, 81 writable: true, 82 configurable: true 83 } 84 }); 85 if (superClass) _set_prototype_of(subClass, superClass); 86} 87function _possible_constructor_return(self, call) { 88 if (call && (_type_of(call) === "object" || typeof call === "function")) { 89 return call; 90 } 91 return _assert_this_initialized(self); 92} 93function _set_prototype_of(o, p) { 94 _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) { 95 o.__proto__ = p; 96 return o; 97 }; 98 return _set_prototype_of(o, p); 99} 100function _type_of(obj) { 101 "@swc/helpers - typeof"; 102 return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; 103} 104function _is_native_reflect_construct() { 105 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 106 if (Reflect.construct.sham) return false; 107 if (typeof Proxy === "function") return true; 108 try { 109 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); 110 return true; 111 } catch (e) { 112 return false; 113 } 114} 115function _create_super(Derived) { 116 var hasNativeReflectConstruct = _is_native_reflect_construct(); 117 return function _createSuperInternal() { 118 var Super = _get_prototype_of(Derived), result; 119 if (hasNativeReflectConstruct) { 120 var NewTarget = _get_prototype_of(this).constructor; 121 result = Reflect.construct(Super, arguments, NewTarget); 122 } else { 123 result = Super.apply(this, arguments); 124 } 125 return _possible_constructor_return(this, result); 126 }; 127} 128function _ts_generator(thisArg, body) { 129 var f, y, t, g, _ = { 130 label: 0, 131 sent: function() { 132 if (t[0] & 1) throw t[1]; 133 return t[1]; 134 }, 135 trys: [], 136 ops: [] 137 }; 138 return g = { 139 next: verb(0), 140 "throw": verb(1), 141 "return": verb(2) 142 }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { 143 return this; 144 }), g; 145 function verb(n) { 146 return function(v) { 147 return step([ 148 n, 149 v 150 ]); 151 }; 152 } 153 function step(op) { 154 if (f) throw new TypeError("Generator is already executing."); 155 while(_)try {
156 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 157 if (y = 0, t) op = [ 158 op[0] & 2, 159 t.value 160 ]; 161 switch(op[0]){ 162 case 0: 163 case 1: 164 t = op; 165 break; 166 case 4: 167 _.label++; 168 return { 169 value: op[1], 170 done: false 171 }; 172 case 5: 173 _.label++; 174 y = op[1]; 175 op = [ 176 0 177 ]; 178 continue; 179 case 7: 180 op = _.ops.pop(); 181 _.trys.pop(); 182 continue; 183 default: 184 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { 185 _ = 0; 186 continue; 187 } 188 if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { 189 _.label = op[1]; 190 break; 191 } 192 if (op[0] === 6 && _.label < t[1]) { 193 _.label = t[1]; 194 t = op; 195 break; 196 } 197 if (t && _.label < t[2]) { 198 _.label = t[2]; 199 _.ops.push(op); 200 break; 201 } 202 if (t[2]) _.ops.pop(); 203 _.trys.pop(); 204 continue; 205 } 206 op = body.call(thisArg, _); 207 } catch (e) { 208 op = [ 209 6, 210 e 211 ]; 212 y = 0; 213 } finally{ 214 f = t = 0; 215 } 216 if (op[0] & 5) throw op[1]; 217 return { 218 value: op[0] ? op[1] : void 0, 219 done: true 220 }; 221 } 222} 223import { Controller } from "@hotwired/stimulus"; 224import { FileSystemNode } from "../../lib/file-manager/models/FileSystemNode.js"; 225import { formatDateTime, formatRelativeTime } from "../../lib/file-manager/utils/index.js"; 226import FileTypeIconsController from "./filetype_icons_controller.js"; 227var _class = /*#__PURE__*/ function(Controller) { 228 "use strict"; 229 _inherits(_class, Controller); 230 var _super = _create_super(_class); 231 function _class() { 232 _class_call_check(this, _class); 233 var _this; 234 _this = _super.apply(this, arguments); 235 _define_property(_assert_this_initialized(_this), "currentNode", null); 236 _define_property(_assert_this_initialized(_this), "selectedCount", 0); 237 _define_property(_assert_this_initialized(_this), "selectedFilesCount", 0); 238 _define_property(_assert_this_initialized(_this), "selectedDirectoriesCount", 0); 239 _define_property(_assert_this_initialized(_this), "selectedTotalBytes", 0); 240 _define_property(_assert_this_initialized(_this), "iconUrl", null); 241 _define_property(_assert_this_initialized(_this), "isRecalculating", false); 242 _define_property(_assert_this_initialized(_this), "cachedRefreshIconSvg", null); 243 return _this; 244 } 245 _create_class(_class, [ 246 { 247 key: "connect", 248 value: function connect() { 249 this.showEmpty(); 250 } 251 }, 252 { 253 /** 254 * Handle visibility value change 255 */ key: "visibleValueChanged", 256 value: function visibleValueChanged() { 257 if (this.visibleValue) { 258 this.element.classList.remove("hidden"); 259 } else { 260 this.element.classList.add("hidden"); 261 } 262 } 263 }, 264 { 265 /** 266 * Toggle visibility 267 */ key: "toggle", 268 value: function toggle() { 269 this.visibleValue = !this.visibleValue; 270 } 271 }, 272 { 273 /** 274 * Show info for a single file or directory 275 */ key: "showNode", 276 value: function showNode(node, iconUrl) { 277 this.currentNode = node; 278 this.selectedCount = 1; 279 this.iconUrl = iconUrl || null; 280 this.render(); 281 } 282 }, 283 { 284 /** 285 * Show info from node data (raw API response) 286 */ key: "showNodeData", 287 value: function showNodeData(data, iconUrl) { 288 var node = FileSystemNode.fromData(data); 289 this.showNode(node, iconUrl); 290 } 291 }, 292 { 293 /** 294 * Show multiple selection state 295 */ key: "showMultipleSelection", 296 value: function showMultipleSelection(count) { 297 var filesCount = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, directoriesCount = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, totalBytes = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0; 298 this.currentNode = null; 299 this.selectedCount = count; 300 this.selectedFilesCount = filesCount; 301 this.selectedDirectoriesCount = directoriesCount; 302 this.selectedTotalBytes = totalBytes; 303 this.iconUrl = null; 304 this.render(); 305 } 306 }, 307 { 308 /** 309 * Clear selection and show empty state 310 */ key: "clear", 311 value: function clear() { 312 this.currentNode = null; 313 this.selectedCount = 0; 314 this.selectedFilesCount = 0; 315 this.selectedDirectoriesCount = 0; 316 this.selectedTotalBytes = 0; 317 this.iconUrl = null; 318 this.showEmpty(); 319 } 320 }, 321 { 322 key: "showEmpty", 323 value: /** 324 * Show empty state (no selection) 325 */ function showEmpty() { 326 if (this.hasEmptyTarget) { 327 this.emptyTarget.classList.remove("hidden"); 328 } 329 if (this.hasIconTarget) { 330 this.iconTarget.classList.add("hidden"); 331 this.iconTarget.innerHTML = ""; 332 } 333 if (this.hasFilenameTarget) { 334 this.filenameTarget.classList.add("hidden"); 335 this.filenameTarget.textContent = ""; 336 } 337 if (this.hasPropertiesTarget) { 338 this.propertiesTarget.classList.add("hidden"); 339 this.propertiesTarget.innerHTML = ""; 340 } 341 } 342 }, 343 { 344 key: "render", 345 value: /**
346 * Render the info pane based on current state 347 */ function render() { 348 // Multiple selection 349 if (this.selectedCount > 1) { 350 this.renderMultipleSelection(); 351 return; 352 } 353 // Single selection 354 if (this.currentNode) { 355 this.renderSingleNode(); 356 return; 357 } 358 // No selection 359 this.showEmpty(); 360 } 361 }, 362 { 363 key: "renderMultipleSelection", 364 value: /** 365 * Render multiple selection state 366 */ function renderMultipleSelection() { 367 if (this.hasEmptyTarget) { 368 this.emptyTarget.classList.add("hidden"); 369 } 370 if (this.hasIconTarget) { 371 this.iconTarget.classList.remove("hidden"); 372 this.iconTarget.innerHTML = this.createMultipleSelectionIcon(); 373 } 374 if (this.hasFilenameTarget) { 375 this.filenameTarget.classList.remove("hidden"); 376 this.filenameTarget.textContent = this.transMultipleSelectedValue.replace("%count%", String(this.selectedCount)); 377 } 378 if (this.hasPropertiesTarget) { 379 this.propertiesTarget.classList.remove("hidden"); 380 this.propertiesTarget.innerHTML = this.createMultipleSelectionPropertiesHtml(); 381 } 382 } 383 }, 384 { 385 key: "createMultipleSelectionPropertiesHtml", 386 value: /** 387 * Create properties HTML for multiple selection 388 */ function createMultipleSelectionPropertiesHtml() { 389 var _this = this; 390 var props = []; 391 // Files count 392 if (this.selectedFilesCount > 0) { 393 props.push({ 394 label: this.transFilesSelectedValue.replace("%count%", String(this.selectedFilesCount)), 395 value: "" 396 }); 397 } 398 // Directories count 399 if (this.selectedDirectoriesCount > 0) { 400 props.push({ 401 label: this.transDirectoriesSelectedValue.replace("%count%", String(this.selectedDirectoriesCount)), 402 value: "" 403 }); 404 } 405 // Total size (only show if we have files with size) 406 if (this.selectedTotalBytes > 0) { 407 props.push({ 408 label: this.transTotalSizeValue, 409 value: this.formatSize(this.selectedTotalBytes) 410 }); 411 } 412 return '\n <dl class="file-info__properties-list file-info__properties-list--selection">\n '.concat(props.map(function(p) { 413 if (p.value) { 414 return '\n <div class="file-info__property">\n <dt class="file-info__property-label">'.concat(_this.escapeHtml(p.label), '</dt>\n <dd class="file-info__property-value">').concat(_this.escapeHtml(p.value), "</dd>\n </div>\n "); 415 } else { 416 return '\n <div class="file-info__property file-info__property--single">\n <dt class="file-info__property-label">'.concat(_this.escapeHtml(p.label), "</dt>\n </div>\n "); 417 } 418 }).join(""), "\n </dl>\n "); 419 } 420 }, 421 { 422 key: "formatSize", 423 value: /** 424 * Format file size to human-readable string 425 */ function formatSize(bytes) { 426 if (bytes === 0) return "0 B"; 427 var k = 1024; 428 var sizes = [ 429 "B", 430 "KB", 431 "MB", 432 "GB", 433 "TB" 434 ]; 435 var i = Math.floor(Math.log(bytes) / Math.log(k)); 436 var size = bytes / Math.pow(k, i); 437 return "".concat(size.toFixed(i === 0 ? 0 : 1), " ").concat(sizes[i]); 438 } 439 }, 440 {
441 key: "renderSingleNode", 442 value: /** 443 * Render single node information 444 */ function renderSingleNode() { 445 var node = this.currentNode; 446 if (this.hasEmptyTarget) { 447 this.emptyTarget.classList.add("hidden"); 448 } 449 // Icon 450 if (this.hasIconTarget) { 451 this.iconTarget.classList.remove("hidden"); 452 if (this.iconUrl) { 453 this.iconTarget.innerHTML = '<img src="'.concat(this.escapeHtml(this.iconUrl), '" alt="" class="file-info__icon-img" />'); 454 } else { 455 this.iconTarget.innerHTML = this.createDefaultIcon(node); 456 } 457 } 458 // Filename 459 if (this.hasFilenameTarget) { 460 this.filenameTarget.classList.remove("hidden"); 461 this.filenameTarget.textContent = node.name; 462 } 463 // Properties 464 if (this.hasPropertiesTarget) { 465 this.propertiesTarget.classList.remove("hidden"); 466 this.propertiesTarget.innerHTML = this.createPropertiesHtml(node); 467 } 468 } 469 }, 470 { 471 key: "createPropertiesHtml", 472 value: /** 473 * Create properties HTML for the node 474 */ function createPropertiesHtml(node) { 475 var _this = this; 476 // Trash entries get a simplified property display 477 if (node.isTrashEntry()) { 478 return this.createTrashPropertiesHtml(node); 479 } 480 var props = []; 481 // Type 482 var typeLabel = node.isDirectory() ? this.transDirectoryValue : this.transFileValue; 483 props.push({ 484 label: this.transTypeValue, 485 value: typeLabel 486 }); 487 // Media type description (always show for both files and directories) 488 if (node.mediaTypeDescription) { 489 var mediaTypeDisplay = node.mediaTypeDescription; 490 props.push({ 491 label: this.transMediaTypeValue, 492 value: mediaTypeDisplay 493 }); 494 } 495 // Size (for files and directories) 496 if (node.isFile()) { 497 props.push({ 498 label: this.transSizeValue, 499 value: node.sizeFormatted 500 }); 501 } else if (node.isDirectory()) { 502 var dirNode = node; 503 var sizeHtml = this.createDirectorySizeHtml(dirNode); 504 props.push({ 505 label: this.transSizeValue, 506 value: sizeHtml, 507 class: "file-info__property--size", 508 rawHtml: true 509 }); 510 } 511 // Path 512 props.push({ 513 label: this.transPathValue, 514 value: node.path || "/", 515 class: "file-info__property--path" 516 }); 517 // Web Permission (moved after path per user request) 518 if (node.webPermissionDescription) { 519 props.push({ 520 label: this.transWebPermissionValue, 521 value: node.webPermissionDescription 522 }); 523 } 524 // Web Path (URIs) 525 if (node.uris && node.uris.length > 0) { 526 // Join multiple URIs with line breaks 527 var urisHtml = node.uris.map(function(uri) { 528 return '<a href="'.concat(_this.escapeHtml(uri), '" target="_blank" rel="noopener noreferrer">').concat(_this.escapeHtml(uri), "</a>"); 529 }).join("<br>"); 530 props.push({ 531 label: this.transWebPathValue, 532 value: urisHtml, 533 class: "file-info__property--web-path", 534 rawHtml: true 535 }); 536 } 537 // Created time (birth time, if available) 538 var birthTime = node.birthTime; 539 if (birthTime) { 540 props.push({ 541 label: this.transCreatedValue, 542 value: this.formatDateWithRelative(birthTime) 543 }); 544 } 545 // Modified time 546 var modTime = node.modificationTime; 547 props.push({ 548 label: this.transModifiedValue, 549 value: this.formatDateWithRelative(modTime) 550 }); 551 // Change time (metadata updated)
552 var changeTime = node.changeTime; 553 props.push({ 554 label: this.transMetadataUpdatedValue, 555 value: this.formatDateWithRelative(changeTime) 556 }); 557 // Unix Permissions (renamed from just "Permissions") 558 props.push({ 559 label: this.transPermissionsValue, 560 value: node.modeString, 561 class: "file-info__property--permissions" 562 }); 563 // Owner / Group (condensed into one line) 564 props.push({ 565 label: this.transOwnerGroupValue, 566 value: "".concat(node.user, " / ").concat(node.group) 567 }); 568 return '\n <dl class="file-info__properties-list">\n '.concat(props.map(function(p) { 569 return '\n <div class="file-info__property '.concat(p.class || "", '">\n <dt class="file-info__property-label">').concat(_this.escapeHtml(p.label), '</dt>\n <dd class="file-info__property-value">').concat(p.rawHtml ? p.value : _this.escapeHtml(p.value), "</dd>\n </div>\n "); 570 }).join(""), "\n </dl>\n "); 571 } 572 }, 573 { 574 key: "createTrashPropertiesHtml", 575 value: /** 576 * Create properties HTML for trash entries. 577 * Shows only: type, size, original location, and deletion time. 578 */ function createTrashPropertiesHtml(node) { 579 var _this = this; 580 var props = []; 581 // Type 582 var typeLabel = node.isOriginallyDirectory ? this.transDirectoryValue : this.transFileValue; 583 props.push({ 584 label: this.transTypeValue, 585 value: typeLabel 586 }); 587 // Size 588 props.push({ 589 label: this.transSizeValue, 590 value: node.sizeFormatted 591 }); 592 // Original Location 593 props.push({ 594 label: this.transOriginalLocationValue, 595 value: node.originalFilesystemPath || "/", 596 class: "file-info__property--path" 597 }); 598 // Deletion Time 599 props.push({ 600 label: this.transDeletedAtValue, 601 value: this.formatDateWithRelative(node.deletionTime) 602 }); 603 return '\n <dl class="file-info__properties-list">\n '.concat(props.map(function(p) { 604 return '\n <div class="file-info__property '.concat(p.class || "", '">\n <dt class="file-info__property-label">').concat(_this.escapeHtml(p.label), '</dt>\n <dd class="file-info__property-value">').concat(p.rawHtml ? p.value : _this.escapeHtml(p.value), "</dd>\n </div>\n "); 605 }).join(""), "\n </dl>\n "); 606 } 607 }, 608 { 609 key: "formatDateWithRelative", 610 value: /** 611 * Format date with relative time 612 */ function formatDateWithRelative(date) { 613 var absolute = formatDateTime(date); 614 var relative = formatRelativeTime(date); 615 return "".concat(absolute, " (").concat(relative, ")"); 616 } 617 }, 618 { 619 key: "createDefaultIcon", 620 value: /** 621 * Create a default icon for the node using filetype_icons_controller 622 */ function createDefaultIcon(node) { 623 var iconUrl = FileTypeIconsController.getIconUrl(this.element, node); 624 if (iconUrl) { 625 return '<img src="'.concat(this.escapeHtml(iconUrl), '" alt="" class="file-info__icon-img" />'); 626 } 627 return ""; 628 } 629 }, 630 { 631 key: "createMultipleSelectionIcon", 632 value: /** 633 * Create icon for multiple selection 634 */ function createMultipleSelectionIcon() { 635 return '<svg class="file-info__icon-svg file-info__icon-svg--multiple" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <rect x="3" y="3" width="7" height="7" rx="1" />\n <rect x="14" y="3" width="7" height="7" rx="1" />\n <rect x="3" y="14" width="7" height="7" rx="1" />\n <rect x="14" y="14" width="7" height="7" rx="1" />\n </svg>'; 636 } 637 }, 638 { 639 key: "escapeHtml", 640 value: /** 641 * Escape HTML characters 642 */ function escapeHtml(text) { 643 var div = document.createElement("div"); 644 div.textContent = text; 645 return div.innerHTML; 646 } 647 }, 648 { 649 key: "createDirectorySizeHtml", 650 value: /** 651 * Create HTML for directory size with recalculate button 652 */ function createDirectorySizeHtml(node) { 653 var sizeText = node.sizeFormatted !== null ? this.escapeHtml(node.sizeFormatted) : "-"; 654 var spinClass = this.isRecalculating ? " file-info__recalculate-btn--spinning" : ""; 655 // Use cached SVG or placeholder span that will be replaced async 656 var refreshIcon = this.cachedRefreshIconSvg ? this.cachedRefreshIconSvg : '<span class="file-info__recalculate-icon-placeholder" data-refresh-icon-placeholder></span>'; 657 // Trigger async load if we have a URL but no cached SVG yet 658 if (this.refreshIconUrlValue && !this.cachedRefreshIconSvg) { 659 this.loadRefreshIconAsync(); 660 } 661 return '<span class="file-info__size-value" data-size-display>'.concat(sizeText, '</span>\n <button type="button" \n class="file-info__recalculate-btn').concat(spinClass, '" \n title="').concat(this.escapeHtml(this.transRecalculateValue), '"\n data-action="click->
661file-manager--info#recalculateSize"\n data-recalculate-btn\n ').concat(this.isRecalculating ? "disabled" : "", ">\n ").concat(refreshIcon, "\n </button>"); 662 } 663 }, 664 { 665 key: "loadRefreshIconAsync", 666 value: /** 667 * Asynchronously load the refresh icon SVG and inline it 668 */ function loadRefreshIconAsync() { 669 var _this = this; 670 return _async_to_generator(function() { 671 var response, svgContent, parser, doc, svg, _this_propertiesTarget, placeholder, error; 672 return _ts_generator(this, function(_state) { 673 switch(_state.label){ 674 case 0: 675 if (!_this.refreshIconUrlValue || _this.cachedRefreshIconSvg) { 676 return [ 677 2 678 ]; 679 } 680 _state.label = 1; 681 case 1: 682 _state.trys.push([ 683 1, 684 4, 685 , 686 5 687 ]); 688 return [ 689 4, 690 fetch(_this.refreshIconUrlValue) 691 ]; 692 case 2: 693 response = _state.sent(); 694 if (!response.ok) { 695 console.warn("Failed to load refresh icon:", response.status); 696 return [ 697 2 698 ]; 699 } 700 return [ 701 4, 702 response.text() 703 ]; 704 case 3: 705 svgContent = _state.sent(); 706 // Parse the SVG and add our class 707 parser = new DOMParser(); 708 doc = parser.parseFromString(svgContent, "image/svg+xml"); 709 svg = doc.querySelector("svg"); 710 if (svg) { 711 ; 712 // Add our styling class and ensure proper attributes for color inheritance 713 svg.classList.add("file-info__recalculate-icon"); 714 svg.setAttribute("fill", "none"); 715 svg.setAttribute("stroke", "currentColor"); 716 // Serialize back to string 717 _this.cachedRefreshIconSvg = svg.outerHTML; 718 // Replace the placeholder in the DOM if it exists 719 placeholder = (_this_propertiesTarget = _this.propertiesTarget) === null || _this_propertiesTarget === void 0 ? void 0 : _this_propertiesTarget.querySelector("[data-refresh-icon-placeholder]"); 720 if (placeholder) { 721 placeholder.outerHTML = _this.cachedRefreshIconSvg; 722 } 723 } 724 return [ 725 3, 726 5 727 ]; 728 case 4: 729 error = _state.sent(); 730 console.warn("Error loading refresh icon:", error); 731 return [ 732 3, 733 5 734 ]; 735 case 5: 736 return [ 737 2 738 ]; 739 } 740 }); 741 })(); 742 } 743 }, 744 { 745 /** 746 * Handle recalculate size button click
747 */ key: "recalculateSize", 748 value: function recalculateSize(event) { 749 event.preventDefault(); 750 event.stopPropagation(); 751 if (!this.currentNode || !this.currentNode.isDirectory() || this.isRecalculating) { 752 return; 753 } 754 var identifier = this.currentNode.id; 755 this.isRecalculating = true; 756 // Update button to show spinning state 757 var btn = this.propertiesTarget.querySelector("[data-recalculate-btn]"); 758 if (btn) { 759 btn.classList.add("file-info__recalculate-btn--spinning"); 760 btn.disabled = true; 761 } 762 // Dispatch event for the manager to handle 763 this.dispatch("recalculateSize", { 764 detail: { 765 identifier: identifier 766 }, 767 bubbles: true 768 }); 769 } 770 }, 771 { 772 /** 773 * Update the size display after recalculation 774 * Called by the manager controller after the API call completes 775 */ key: "updateSize", 776 value: function updateSize(size) { 777 var _this_currentNode; 778 this.isRecalculating = false; 779 // Update the size in the current node if it's a directory 780 if (this.currentNode && this.currentNode.isDirectory()) { 781 // We need to update the node's data - create a new node with updated size 782 var nodeData = this.currentNode.toData(); 783 nodeData.size = size; 784 this.currentNode = FileSystemNode.fromData(nodeData); 785 } 786 // Update the button state 787 var btn = this.propertiesTarget.querySelector("[data-recalculate-btn]"); 788 if (btn) { 789 btn.classList.remove("file-info__recalculate-btn--spinning"); 790 btn.disabled = false; 791 } 792 // Update the size display 793 var sizeDisplay = this.propertiesTarget.querySelector("[data-size-display]"); 794 if (sizeDisplay && ((_this_currentNode = this.currentNode) === null || _this_currentNode === void 0 ? void 0 : _this_currentNode.isDirectory())) { 795 var dirNode = this.currentNode; 796 var _dirNode_sizeFormatted; 797 sizeDisplay.textContent = (_dirNode_sizeFormatted = dirNode.sizeFormatted) !== null && _dirNode_sizeFormatted !== void 0 ? _dirNode_sizeFormatted : "-"; 798 } 799 } 800 }, 801 { 802 /** 803 * Handle recalculate size error 804 * Called by the manager controller if the API call fails 805 */ key: "recalculateSizeError", 806 value: function recalculateSizeError() { 807 this.isRecalculating = false; 808 // Reset the button state 809 var btn = this.propertiesTarget.querySelector("[data-recalculate-btn]"); 810 if (btn) { 811 btn.classList.remove("file-info__recalculate-btn--spinning"); 812 btn.disabled = false; 813 } 814 } 815 } 816 ]); 817 return _class; 818}(Controller); 819_define_property(_class, "targets", [ 820 "icon", 821 "filename", 822 "properties", 823 "empty" 824]); 825_define_property(_class, "values", { 826 visible: { 827 type: Boolean, 828 default: true 829 }, 830 refreshIconUrl: { 831 type: String, 832 default: "" 833 }, 834 // Translation values 835 transNoSelection: { 836 type: String, 837 default: "No file selected" 838 }, 839 transSelectFile: { 840 type: String, 841 default: "Select a file to view its details" 842 }, 843 transMultipleSelected: { 844 type: String, 845 default: "%count% items selected" 846 }, 847 transFilesSelected: { 848 type: String, 849 default: "%count% file(s)" 850 }, 851 transDirectoriesSelected: { 852 type: String, 853 default: "%count% folder(s)" 854 }, 855 transTotalSize: { 856 type: String, 857 default: "Total size" 858 }, 859 transType: { 860 type: String, 861 default: "Type" 862 }, 863 transSize: { 864 type: String, 865 default: "Size" 866 }, 867 transRecalculate: { 868 type: String, 869 default: "Recalculate size" 870 }, 871 transPath: { 872 type: String, 873 default: "Path" 874 }, 875 transCreated: { 876 type: String, 877 default: "Created" 878 }, 879 transModified: { 880 type: String, 881 default: "Modified" 882 }, 883 transMetadataUpdated: { 884 type: String, 885 default: "Metadata Updated" 886 }, 887 transAccessed: { 888 type: String, 889 default: "Accessed" 890 }, 891 transPermissions: { 892 type: String, 893 default: "Unix Permissions" 894 }, 895 transOwner: { 896 type: String, 897 default: "Owner" 898 }, 899 transGroup: { 900 type: String, 901 default: "Group" 902 }, 903 transOwnerGroup: { 904 type: String, 905 default: "Owner / Group" 906 }, 907 transMediaType: { 908 type: String, 909 default: "Media Type" 910 }, 911 transWebPermission: { 912 type: String, 913 default: "Web Permission" 914 }, 915 transWebPath: { 916 type: String, 917 default: "Web Path" 918 }, 919 transFile: { 920 type: String, 921 default: "File" 922 }, 923 transDirectory: { 924 type: String, 925 default: "Directory" 926 }, 927 transOriginalLocation: { 928 type: String, 929 default: "Original Location" 930 }, 931 transDeletedAt: { 932 type: String, 933 default: "Deleted" 934 }, 935 transTrashEntry: { 936 type: String, 937 default: "Trash Entry" 938 } 939}); 940/** 941 * Info Pane Controller 942 * 943 * Displays detailed information about the currently selected file or directory. 944 * Shows a large icon, filename, and all properties of the selected item. 945 * 946 * Controller identifier: file-manager--info 947 * 948 * @example 949 * <div data-controller="file-manager--info" 950 * data-file-manager--info-visible-value="true"> 951 * <div data-file-manager--info-target="icon"></div> 952 * <div data-file-manager--info-target="filename"></div> 953 * <div data-file-manager--info-target="properties"></div> 954 * <div data-file-manager--info-target="empty"></div> 955 * </div> 956 */ export { _class as default };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.