react-os-shell 0.1.14 → 0.1.17
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/{Calculator-PBCTMZCM.js → Calculator-ZD2BPHGW.js} +4 -4
- package/dist/{Calculator-PBCTMZCM.js.map → Calculator-ZD2BPHGW.js.map} +1 -1
- package/dist/{Calendar-ULBZI2ZZ.js → Calendar-T2LRMLL4.js} +3 -3
- package/dist/{Calendar-ULBZI2ZZ.js.map → Calendar-T2LRMLL4.js.map} +1 -1
- package/dist/{CurrencyConverter-6LQTPUPC.js → CurrencyConverter-ELXFKEFY.js} +4 -4
- package/dist/{CurrencyConverter-6LQTPUPC.js.map → CurrencyConverter-ELXFKEFY.js.map} +1 -1
- package/dist/{Email-2BIRDSJB.js → Email-TD6OTHBH.js} +3 -3
- package/dist/{Email-2BIRDSJB.js.map → Email-TD6OTHBH.js.map} +1 -1
- package/dist/{Minesweeper-YNR4S3EJ.js → Minesweeper-CGOAQKR7.js} +3 -3
- package/dist/{Minesweeper-YNR4S3EJ.js.map → Minesweeper-CGOAQKR7.js.map} +1 -1
- package/dist/{Notepad-7ALDRLDP.js → Notepad-YTQZPTCO.js} +3 -3
- package/dist/{Notepad-7ALDRLDP.js.map → Notepad-YTQZPTCO.js.map} +1 -1
- package/dist/{PomodoroTimer-F2NAJ63E.js → PomodoroTimer-YWP4W2NZ.js} +4 -4
- package/dist/{PomodoroTimer-F2NAJ63E.js.map → PomodoroTimer-YWP4W2NZ.js.map} +1 -1
- package/dist/Preview-5GRB2ADJ.js +4 -0
- package/dist/{Preview-Z7U7VV7N.js.map → Preview-5GRB2ADJ.js.map} +1 -1
- package/dist/{Spreadsheet-RJKUJDQS.js → Spreadsheet-2O7ARM7N.js} +3 -3
- package/dist/{Spreadsheet-RJKUJDQS.js.map → Spreadsheet-2O7ARM7N.js.map} +1 -1
- package/dist/{Weather-CQ4ECULG.js → Weather-QHE7ANE7.js} +4 -4
- package/dist/{Weather-CQ4ECULG.js.map → Weather-QHE7ANE7.js.map} +1 -1
- package/dist/apps/index.js +11 -11
- package/dist/{chunk-6HUAE6SB.js → chunk-KLAHLSYK.js} +3 -3
- package/dist/chunk-KLAHLSYK.js.map +1 -0
- package/dist/{chunk-TAQJD73Z.js → chunk-WUGRI2GM.js} +3 -3
- package/dist/{chunk-TAQJD73Z.js.map → chunk-WUGRI2GM.js.map} +1 -1
- package/dist/{chunk-24K73LGZ.js → chunk-XKN6O2JW.js} +19 -16
- package/dist/chunk-XKN6O2JW.js.map +1 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.js +55 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/Preview-Z7U7VV7N.js +0 -4
- package/dist/chunk-24K73LGZ.js.map +0 -1
- package/dist/chunk-6HUAE6SB.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import { toast_default } from './chunk-WIJ45SYD.js';
|
|
|
7
7
|
export { toast_default as toast } from './chunk-WIJ45SYD.js';
|
|
8
8
|
import { useShellPrefs } from './chunk-36VM54SC.js';
|
|
9
9
|
export { ShellPrefsProvider, useLocalStoragePrefs, useShellPrefs } from './chunk-36VM54SC.js';
|
|
10
|
-
import { useWindowManager, glassStyle, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, Modal, startMenuCategories, navSections, isSection, GLASS_INPUT_BG, navIcons, sectionIcons, ModalActions, useModalActive } from './chunk-
|
|
11
|
-
export { CancelButton, CopyButton, DocFavStar, GLASS_DIVIDER, GLASS_INPUT_BG, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, WindowManagerProvider, WindowTitle, glassStyle, isEntityEntry, isPageEntry, setShellApiClient, setShellNavIcons, setShellWindowRegistry, useModalActive, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle } from './chunk-
|
|
10
|
+
import { useWindowManager, glassStyle, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, Modal, startMenuCategories, navSections, isSection, GLASS_INPUT_BG, navIcons, sectionIcons, ModalActions, useModalActive } from './chunk-XKN6O2JW.js';
|
|
11
|
+
export { CancelButton, CopyButton, DocFavStar, GLASS_DIVIDER, GLASS_INPUT_BG, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, WindowManagerProvider, WindowTitle, glassStyle, isEntityEntry, isPageEntry, setShellApiClient, setShellNavIcons, setShellWindowRegistry, useModalActive, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle } from './chunk-XKN6O2JW.js';
|
|
12
12
|
export { ConfirmProvider, confirm, confirmDestructive } from './chunk-RFTLYCSF.js';
|
|
13
13
|
import { createContext, useState, useRef, useEffect, useCallback, useLayoutEffect, useContext, isValidElement, cloneElement, useSyncExternalStore } from 'react';
|
|
14
14
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -643,7 +643,7 @@ function StatusBadge({ status }) {
|
|
|
643
643
|
}
|
|
644
644
|
|
|
645
645
|
// src/version.ts
|
|
646
|
-
var VERSION = "0.1.
|
|
646
|
+
var VERSION = "0.1.17" ;
|
|
647
647
|
var APP_VERSION = VERSION;
|
|
648
648
|
|
|
649
649
|
// src/changelog.ts
|
|
@@ -1034,6 +1034,8 @@ function Desktop({ profile }) {
|
|
|
1034
1034
|
const [editingStickyId, setEditingStickyId] = useState(null);
|
|
1035
1035
|
const [stickyDrag, setStickyDrag] = useState(null);
|
|
1036
1036
|
const [stickyResize, setStickyResize] = useState(null);
|
|
1037
|
+
const [hoverFolderIdx, setHoverFolderIdx] = useState(null);
|
|
1038
|
+
const hoverFolderIdxRef = useRef(null);
|
|
1037
1039
|
const saveDocs = useCallback((docs) => {
|
|
1038
1040
|
if (host.saveShortcuts) host.saveShortcuts(docs);
|
|
1039
1041
|
else saveShellPrefs({ favorite_documents: docs });
|
|
@@ -1095,6 +1097,7 @@ function Desktop({ profile }) {
|
|
|
1095
1097
|
useEffect(() => {
|
|
1096
1098
|
if (!dragging) return;
|
|
1097
1099
|
const entries = dragEntriesRef.current;
|
|
1100
|
+
const isSingleItemDrag = entries.length === 1 && entries[0].type === "item";
|
|
1098
1101
|
const move = (e) => {
|
|
1099
1102
|
const dx = e.clientX - dragging.startX;
|
|
1100
1103
|
const dy = e.clientY - dragging.startY;
|
|
@@ -1106,6 +1109,20 @@ function Desktop({ profile }) {
|
|
|
1106
1109
|
entry.el.style.zIndex = "100";
|
|
1107
1110
|
entry.el.style.opacity = "0.7";
|
|
1108
1111
|
}
|
|
1112
|
+
if (isSingleItemDrag) {
|
|
1113
|
+
const elsBelow = document.elementsFromPoint(e.clientX, e.clientY);
|
|
1114
|
+
let nextHover = null;
|
|
1115
|
+
for (const el of elsBelow) {
|
|
1116
|
+
const fk = el.closest?.('[data-desktop-icon^="folder-"]');
|
|
1117
|
+
if (fk) {
|
|
1118
|
+
const key = fk.getAttribute("data-desktop-icon");
|
|
1119
|
+
if (key) nextHover = parseInt(key.slice(7), 10);
|
|
1120
|
+
break;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
hoverFolderIdxRef.current = nextHover;
|
|
1124
|
+
setHoverFolderIdx((prev) => prev === nextHover ? prev : nextHover);
|
|
1125
|
+
}
|
|
1109
1126
|
};
|
|
1110
1127
|
const up = (e) => {
|
|
1111
1128
|
const dx = e.clientX - dragging.startX;
|
|
@@ -1115,6 +1132,10 @@ function Desktop({ profile }) {
|
|
|
1115
1132
|
entry.el.style.zIndex = "";
|
|
1116
1133
|
entry.el.style.opacity = "";
|
|
1117
1134
|
}
|
|
1135
|
+
const liveHoverIdx = hoverFolderIdxRef.current;
|
|
1136
|
+
const hoveredFolder = liveHoverIdx != null ? folders[liveHoverIdx] : null;
|
|
1137
|
+
hoverFolderIdxRef.current = null;
|
|
1138
|
+
setHoverFolderIdx(null);
|
|
1118
1139
|
const computedPositions = entries.map((entry) => {
|
|
1119
1140
|
let finalRight = entry.origX - dx;
|
|
1120
1141
|
let finalTop = Math.max(0, entry.origY + dy);
|
|
@@ -1131,7 +1152,7 @@ function Desktop({ profile }) {
|
|
|
1131
1152
|
const updated = [...favDocs];
|
|
1132
1153
|
const positionsPatch = {};
|
|
1133
1154
|
const singleItem = itemMoves.length === 1 && entries.length === 1 ? itemMoves[0] : null;
|
|
1134
|
-
const droppedOnFolder = singleItem ? folders.find((f, fi) => {
|
|
1155
|
+
const droppedOnFolder = singleItem ? hoveredFolder ?? folders.find((f, fi) => {
|
|
1135
1156
|
const fp = getFolderPos(f, fi);
|
|
1136
1157
|
return Math.abs(singleItem.finalRight - fp.right) < 40 && Math.abs(singleItem.finalTop - fp.top) < 40;
|
|
1137
1158
|
}) : void 0;
|
|
@@ -1275,8 +1296,11 @@ function Desktop({ profile }) {
|
|
|
1275
1296
|
}, [contextMenu]);
|
|
1276
1297
|
const createFolder = () => {
|
|
1277
1298
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
1278
|
-
const
|
|
1279
|
-
const
|
|
1299
|
+
const containerW = rect?.width ?? 0;
|
|
1300
|
+
const cursorLeft = contextMenu ? contextMenu.x - (rect?.left ?? 0) : containerW - 100;
|
|
1301
|
+
const cursorTop = contextMenu ? contextMenu.y - (rect?.top ?? 0) : 100;
|
|
1302
|
+
const x = Math.max(0, containerW - cursorLeft - 40);
|
|
1303
|
+
const y = Math.max(0, cursorTop - 20);
|
|
1280
1304
|
const id = `folder-${Date.now()}`;
|
|
1281
1305
|
saveFolders([...folders, { id, name: "New Folder", x, y }]);
|
|
1282
1306
|
setContextMenu(null);
|
|
@@ -1506,12 +1530,20 @@ function Desktop({ profile }) {
|
|
|
1506
1530
|
folders.map((folder, i) => {
|
|
1507
1531
|
const pos = localPositions[`folder-${i}`] || getFolderPos(folder, i);
|
|
1508
1532
|
const isSelected = selected.has(`folder-${i}`);
|
|
1533
|
+
const isHovered = hoverFolderIdx === i;
|
|
1509
1534
|
const itemCount = folderItems(folder.id).length;
|
|
1510
1535
|
return /* @__PURE__ */ jsx(
|
|
1511
1536
|
"div",
|
|
1512
1537
|
{
|
|
1513
1538
|
"data-desktop-icon": `folder-${i}`,
|
|
1514
|
-
style: {
|
|
1539
|
+
style: {
|
|
1540
|
+
position: "absolute",
|
|
1541
|
+
right: pos.right,
|
|
1542
|
+
top: pos.top,
|
|
1543
|
+
zIndex: 1,
|
|
1544
|
+
transform: isHovered ? "scale(1.15)" : "scale(1)",
|
|
1545
|
+
transition: "transform 180ms ease-out"
|
|
1546
|
+
},
|
|
1515
1547
|
onPointerDown: (e) => {
|
|
1516
1548
|
e.stopPropagation();
|
|
1517
1549
|
startDrag("folder", i, e);
|
|
@@ -1535,7 +1567,7 @@ function Desktop({ profile }) {
|
|
|
1535
1567
|
},
|
|
1536
1568
|
className: "cursor-default select-none",
|
|
1537
1569
|
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1 w-20 p-2", children: [
|
|
1538
|
-
/* @__PURE__ */ jsx("div", { className: `w-12 h-12 flex items-center justify-center ${isSelected ? "rounded-lg bg-blue-400/30 ring-2 ring-blue-500" : ""}`, children: /* @__PURE__ */ jsxs("svg", { className: "h-12 w-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]", viewBox: "0 0 48 48", children: [
|
|
1570
|
+
/* @__PURE__ */ jsx("div", { className: `w-12 h-12 flex items-center justify-center ${isSelected ? "rounded-lg bg-blue-400/30 ring-2 ring-blue-500" : ""} ${isHovered ? "rounded-lg ring-4 ring-amber-400 shadow-[0_0_20px_rgba(245,158,11,0.6)]" : ""}`, children: /* @__PURE__ */ jsxs("svg", { className: "h-12 w-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]", viewBox: "0 0 48 48", children: [
|
|
1539
1571
|
/* @__PURE__ */ jsx("path", { d: "M6 12a4 4 0 014-4h10l4 4h14a4 4 0 014 4v20a4 4 0 01-4 4H10a4 4 0 01-4-4V12z", fill: "white", stroke: "#eab308", strokeWidth: "2", strokeLinejoin: "round" }),
|
|
1540
1572
|
/* @__PURE__ */ jsx("path", { d: "M6 18h36", stroke: "#eab308", strokeWidth: "1.5" })
|
|
1541
1573
|
] }) }),
|
|
@@ -1847,7 +1879,7 @@ function Desktop({ profile }) {
|
|
|
1847
1879
|
] })
|
|
1848
1880
|
] }) });
|
|
1849
1881
|
})(),
|
|
1850
|
-
|
|
1882
|
+
prefs.show_desktop_version === true && (host.productVersion ?? APP_VERSION) && /* @__PURE__ */ jsx(
|
|
1851
1883
|
"button",
|
|
1852
1884
|
{
|
|
1853
1885
|
onClick: (e) => {
|
|
@@ -1858,17 +1890,20 @@ function Desktop({ profile }) {
|
|
|
1858
1890
|
children: host.productVersion ?? APP_VERSION
|
|
1859
1891
|
}
|
|
1860
1892
|
),
|
|
1861
|
-
whatsNewOpen &&
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
change
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1893
|
+
whatsNewOpen && (() => {
|
|
1894
|
+
const entries = host.productChangelog ?? changelog_default;
|
|
1895
|
+
return /* @__PURE__ */ jsx(Modal, { open: true, onClose: () => setWhatsNewOpen(false), title: "What's New", size: "md", bodyScroll: false, children: /* @__PURE__ */ jsx("div", { className: "space-y-5 max-h-[60vh] overflow-y-auto px-1", children: entries.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-400 text-center py-6", children: "No changelog available." }) : entries.map((entry, i) => /* @__PURE__ */ jsxs("div", { children: [
|
|
1896
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
1897
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-bold text-gray-900 font-mono", children: entry.version }),
|
|
1898
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400", children: formatDate(entry.date) })
|
|
1899
|
+
] }),
|
|
1900
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-1.5 ml-1", children: entry.changes.map((change, j) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm text-gray-600", children: [
|
|
1901
|
+
/* @__PURE__ */ jsx("span", { className: "text-blue-500 mt-1 shrink-0", children: "\u2022" }),
|
|
1902
|
+
change
|
|
1903
|
+
] }, j)) }),
|
|
1904
|
+
i < entries.length - 1 && /* @__PURE__ */ jsx("div", { className: "border-b border-gray-200 mt-4" })
|
|
1905
|
+
] }, entry.version)) }) });
|
|
1906
|
+
})()
|
|
1872
1907
|
]
|
|
1873
1908
|
}
|
|
1874
1909
|
);
|