react-os-shell 0.1.50 → 0.1.52
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 +75 -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,80 @@ 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)]", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx(
|
|
1560
|
+
"path",
|
|
1561
|
+
{
|
|
1562
|
+
fill: "#c0c4cc",
|
|
1563
|
+
stroke: "#5f6677",
|
|
1564
|
+
strokeWidth: "0.6",
|
|
1565
|
+
strokeLinejoin: "round",
|
|
1566
|
+
fillRule: "evenodd",
|
|
1567
|
+
clipRule: "evenodd",
|
|
1568
|
+
d: "M16.5 4.478v.227a48.816 48.816 0 013.878.512.75.75 0 11-.256 1.478l-.209-.035-1.005 13.07a3 3 0 01-2.991 2.77H8.084a3 3 0 01-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 01-.256-1.478A48.567 48.567 0 017.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 014.368 0c1.603.051 2.816 1.387 2.816 2.951zm-6.136-1.452a51.196 51.196 0 013.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 00-6 0v-.113c0-.794.609-1.428 1.364-1.452zm-.355 5.945a.75.75 0 10-1.5.058l.347 9a.75.75 0 101.499-.058l-.346-9zm5.48.058a.75.75 0 10-1.498-.058l-.347 9a.75.75 0 001.5.058l.346-9z"
|
|
1569
|
+
}
|
|
1570
|
+
) }) }),
|
|
1571
|
+
/* @__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" })
|
|
1572
|
+
] })
|
|
1573
|
+
}
|
|
1574
|
+
);
|
|
1575
|
+
})(),
|
|
1524
1576
|
desktopItems.map((doc, i) => {
|
|
1525
1577
|
const docIdx = favDocs.indexOf(doc);
|
|
1526
1578
|
const pos = localPositions[`item-${docIdx}`] || getItemPos(doc, i);
|