react-os-shell 0.1.50 → 0.1.51
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/index.js +64 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -651,7 +651,7 @@ function StatusBadge({ status }) {
|
|
|
651
651
|
}
|
|
652
652
|
|
|
653
653
|
// src/version.ts
|
|
654
|
-
var VERSION = "0.1.
|
|
654
|
+
var VERSION = "0.1.51" ;
|
|
655
655
|
var APP_VERSION = VERSION;
|
|
656
656
|
|
|
657
657
|
// src/changelog.ts
|
|
@@ -1499,28 +1499,69 @@ function Desktop({ profile }) {
|
|
|
1499
1499
|
setContextMenu(null);
|
|
1500
1500
|
},
|
|
1501
1501
|
children: [
|
|
1502
|
-
|
|
1503
|
-
"
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1502
|
+
(() => {
|
|
1503
|
+
const cs = typeof document !== "undefined" ? getComputedStyle(document.documentElement) : null;
|
|
1504
|
+
const tbH = parseInt(cs?.getPropertyValue("--taskbar-height") || "0") || 0;
|
|
1505
|
+
const tbW = parseInt(cs?.getPropertyValue("--taskbar-width") || "0") || 0;
|
|
1506
|
+
const tbPos = (cs?.getPropertyValue("--taskbar-position") || "bottom").trim();
|
|
1507
|
+
const defaultRight = 20 + (tbPos === "right" ? tbW : 0);
|
|
1508
|
+
const defaultBottom = 20 + (tbPos === "bottom" ? tbH : 0);
|
|
1509
|
+
const trashPos = prefs.desktop_trash_position;
|
|
1510
|
+
const right = trashPos?.right ?? defaultRight;
|
|
1511
|
+
const bottom = trashPos?.bottom ?? defaultBottom;
|
|
1512
|
+
const startTrashDrag = (e) => {
|
|
1513
|
+
if (e.button !== 0) return;
|
|
1514
|
+
e.preventDefault();
|
|
1515
|
+
e.stopPropagation();
|
|
1516
|
+
const el = e.currentTarget;
|
|
1517
|
+
const startX = e.clientX, startY = e.clientY;
|
|
1518
|
+
let moved = false;
|
|
1519
|
+
const move = (ev) => {
|
|
1520
|
+
const dx = ev.clientX - startX;
|
|
1521
|
+
const dy = ev.clientY - startY;
|
|
1522
|
+
if (!moved && (Math.abs(dx) > 3 || Math.abs(dy) > 3)) moved = true;
|
|
1523
|
+
if (!moved) return;
|
|
1524
|
+
el.style.right = `${right - dx}px`;
|
|
1525
|
+
el.style.bottom = `${bottom - dy}px`;
|
|
1526
|
+
el.style.opacity = "0.7";
|
|
1527
|
+
el.style.zIndex = "100";
|
|
1528
|
+
};
|
|
1529
|
+
const up = (ev) => {
|
|
1530
|
+
window.removeEventListener("pointermove", move);
|
|
1531
|
+
window.removeEventListener("pointerup", up);
|
|
1532
|
+
el.style.opacity = "";
|
|
1533
|
+
el.style.zIndex = "";
|
|
1534
|
+
if (!moved) return;
|
|
1535
|
+
const newRight = Math.max(0, right - (ev.clientX - startX));
|
|
1536
|
+
const newBottom = Math.max(0, bottom - (ev.clientY - startY));
|
|
1537
|
+
saveShellPrefs({ desktop_trash_position: { right: newRight, bottom: newBottom } });
|
|
1538
|
+
};
|
|
1539
|
+
window.addEventListener("pointermove", move);
|
|
1540
|
+
window.addEventListener("pointerup", up);
|
|
1541
|
+
};
|
|
1542
|
+
return /* @__PURE__ */ jsx(
|
|
1543
|
+
"div",
|
|
1544
|
+
{
|
|
1545
|
+
"data-desktop-icon": "trash",
|
|
1546
|
+
style: { position: "absolute", right, bottom, zIndex: 1 },
|
|
1547
|
+
onPointerDown: startTrashDrag,
|
|
1548
|
+
onClick: (e) => e.stopPropagation(),
|
|
1549
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
1550
|
+
onDoubleClick: (e) => {
|
|
1551
|
+
e.stopPropagation();
|
|
1552
|
+
window.__REACT_OS_SHELL_FILES_VIEW__ = "trash";
|
|
1553
|
+
window.dispatchEvent(new CustomEvent("react-os-shell:files-show-trash"));
|
|
1554
|
+
openPage("/files");
|
|
1555
|
+
},
|
|
1556
|
+
className: "cursor-default select-none",
|
|
1557
|
+
title: "Trash \u2014 double-click to open, drag to move",
|
|
1558
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1 w-20 p-2", children: [
|
|
1559
|
+
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 flex items-center justify-center", children: /* @__PURE__ */ jsx("svg", { className: "h-12 w-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.4)] text-gray-100", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }) }),
|
|
1560
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-center leading-tight text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]", children: "Trash" })
|
|
1561
|
+
] })
|
|
1562
|
+
}
|
|
1563
|
+
);
|
|
1564
|
+
})(),
|
|
1524
1565
|
desktopItems.map((doc, i) => {
|
|
1525
1566
|
const docIdx = favDocs.indexOf(doc);
|
|
1526
1567
|
const pos = localPositions[`item-${docIdx}`] || getItemPos(doc, i);
|