react-os-shell 0.1.15 → 0.1.18

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.
Files changed (34) hide show
  1. package/dist/{Calculator-ZD2BPHGW.js → Calculator-ZZMTB7Y7.js} +4 -4
  2. package/dist/{Calculator-ZD2BPHGW.js.map → Calculator-ZZMTB7Y7.js.map} +1 -1
  3. package/dist/{Calendar-T2LRMLL4.js → Calendar-RQVSPJAJ.js} +3 -3
  4. package/dist/{Calendar-T2LRMLL4.js.map → Calendar-RQVSPJAJ.js.map} +1 -1
  5. package/dist/{CurrencyConverter-ELXFKEFY.js → CurrencyConverter-S37JTKKZ.js} +4 -4
  6. package/dist/{CurrencyConverter-ELXFKEFY.js.map → CurrencyConverter-S37JTKKZ.js.map} +1 -1
  7. package/dist/{Email-TD6OTHBH.js → Email-UCNJ53MV.js} +3 -3
  8. package/dist/{Email-TD6OTHBH.js.map → Email-UCNJ53MV.js.map} +1 -1
  9. package/dist/{Minesweeper-CGOAQKR7.js → Minesweeper-KAOD327F.js} +3 -3
  10. package/dist/{Minesweeper-CGOAQKR7.js.map → Minesweeper-KAOD327F.js.map} +1 -1
  11. package/dist/{Notepad-YTQZPTCO.js → Notepad-C453L2M2.js} +3 -3
  12. package/dist/{Notepad-YTQZPTCO.js.map → Notepad-C453L2M2.js.map} +1 -1
  13. package/dist/{PomodoroTimer-YWP4W2NZ.js → PomodoroTimer-ZZUXEFM6.js} +4 -4
  14. package/dist/{PomodoroTimer-YWP4W2NZ.js.map → PomodoroTimer-ZZUXEFM6.js.map} +1 -1
  15. package/dist/Preview-5GRB2ADJ.js +4 -0
  16. package/dist/{Preview-Z7U7VV7N.js.map → Preview-5GRB2ADJ.js.map} +1 -1
  17. package/dist/{Spreadsheet-2O7ARM7N.js → Spreadsheet-SOJL4SQA.js} +3 -3
  18. package/dist/{Spreadsheet-2O7ARM7N.js.map → Spreadsheet-SOJL4SQA.js.map} +1 -1
  19. package/dist/{Weather-QHE7ANE7.js → Weather-H7R7YVRB.js} +4 -4
  20. package/dist/{Weather-QHE7ANE7.js.map → Weather-H7R7YVRB.js.map} +1 -1
  21. package/dist/apps/index.js +11 -11
  22. package/dist/{chunk-XKN6O2JW.js → chunk-AKZTZLKP.js} +39 -46
  23. package/dist/chunk-AKZTZLKP.js.map +1 -0
  24. package/dist/{chunk-WUGRI2GM.js → chunk-D7UDGZIH.js} +3 -3
  25. package/dist/{chunk-WUGRI2GM.js.map → chunk-D7UDGZIH.js.map} +1 -1
  26. package/dist/{chunk-6HUAE6SB.js → chunk-KLAHLSYK.js} +3 -3
  27. package/dist/chunk-KLAHLSYK.js.map +1 -0
  28. package/dist/index.d.ts +15 -1
  29. package/dist/index.js +55 -20
  30. package/dist/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/dist/Preview-Z7U7VV7N.js +0 -4
  33. package/dist/chunk-6HUAE6SB.js.map +0 -1
  34. package/dist/chunk-XKN6O2JW.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -426,6 +426,18 @@ declare function WindowManagerProvider({ children }: {
426
426
  children: ReactNode;
427
427
  }): react_jsx_runtime.JSX.Element;
428
428
 
429
+ /**
430
+ * INTERNAL stub — Desktop's About modal references the consumer-side
431
+ * changelog. The package ships no built-in changelog; consumer wires their
432
+ * own through the eventual `branding` prop (TODO). Default = empty array
433
+ * keeps the import compiling.
434
+ */
435
+ interface ChangelogEntry {
436
+ version: string;
437
+ date: string;
438
+ changes: string[];
439
+ }
440
+
429
441
  interface DesktopItem {
430
442
  entityType: string;
431
443
  entityId: string;
@@ -460,6 +472,8 @@ interface DesktopHostConfig {
460
472
  /** Version string shown on the desktop watermark and About dialog. Falls
461
473
  * back to the react-os-shell package version if omitted. */
462
474
  productVersion?: string;
475
+ /** Changelog rendered in the "What's New" dialog. Hidden when omitted. */
476
+ productChangelog?: ChangelogEntry[];
463
477
  /** Copyright line in the About dialog footer. Hidden when omitted. */
464
478
  productCopyright?: string;
465
479
  /** Website URL in the About dialog footer. Hidden when omitted. */
@@ -650,4 +664,4 @@ declare function useNewHotkey(callback: () => void): void;
650
664
  */
651
665
  declare function useEditHotkey(callback: (() => void) | null): void;
652
666
 
653
- export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, type BugReport, type BugReportConfig, BugReportConfigProvider, BugReportDetail, BugReportProvider, type BugReportSubmission, type BugReportSubmitPayload, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, ConfirmProvider, CopyButton, Customization, Desktop, type DesktopHostConfig, DesktopHostProvider, DocFavStar, ENTER, type EntityFetcher, GLASS_DIVIDER, GLASS_INPUT_BG, GlobalSearch, Layout, type LayoutProps, MOD, Modal, ModalActions, NotificationBell, type NotificationsConfig, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SemanticGroup, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, StartMenu, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, VERSION, WindowManagerProvider, WindowRegistry, WindowTitle, confirm, confirmDestructive, createWindowRegistry, formatDate, glassStyle, isMac, openBugReportDialog, reportBug, setShellApiClient, setShellAuthBridge, setShellNavIcons, toast, useBugReport, useClickOutside, useDesktopHost, useEditHotkey, useLocalStoragePrefs, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
667
+ export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, type BugReport, type BugReportConfig, BugReportConfigProvider, BugReportDetail, BugReportProvider, type BugReportSubmission, type BugReportSubmitPayload, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, type ChangelogEntry, ConfirmProvider, CopyButton, Customization, Desktop, type DesktopHostConfig, DesktopHostProvider, DocFavStar, ENTER, type EntityFetcher, GLASS_DIVIDER, GLASS_INPUT_BG, GlobalSearch, Layout, type LayoutProps, MOD, Modal, ModalActions, NotificationBell, type NotificationsConfig, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SemanticGroup, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, StartMenu, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, VERSION, WindowManagerProvider, WindowRegistry, WindowTitle, confirm, confirmDestructive, createWindowRegistry, formatDate, glassStyle, isMac, openBugReportDialog, reportBug, setShellApiClient, setShellAuthBridge, setShellNavIcons, toast, useBugReport, useClickOutside, useDesktopHost, useEditHotkey, useLocalStoragePrefs, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
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-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';
10
+ import { useWindowManager, glassStyle, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, Modal, startMenuCategories, navSections, isSection, GLASS_INPUT_BG, navIcons, sectionIcons, ModalActions, useModalActive } from './chunk-AKZTZLKP.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-AKZTZLKP.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.15" ;
646
+ var VERSION = "0.1.18" ;
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 x = contextMenu ? contextMenu.x - (rect?.left || 0) : 100;
1279
- const y = contextMenu ? contextMenu.y - (rect?.top || 0) : 100;
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: { position: "absolute", right: pos.right, top: pos.top, zIndex: 1 },
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
- (prefs.show_desktop_version ?? true) && (host.productVersion ?? APP_VERSION) && /* @__PURE__ */ jsx(
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 && /* @__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: changelog_default.map((entry, i) => /* @__PURE__ */ jsxs("div", { children: [
1862
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
1863
- /* @__PURE__ */ jsx("span", { className: "text-sm font-bold text-gray-900 font-mono", children: entry.version }),
1864
- /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400", children: formatDate(entry.date) })
1865
- ] }),
1866
- /* @__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: [
1867
- /* @__PURE__ */ jsx("span", { className: "text-blue-500 mt-1 shrink-0", children: "\u2022" }),
1868
- change
1869
- ] }, j)) }),
1870
- i < changelog_default.length - 1 && /* @__PURE__ */ jsx("div", { className: "border-b border-gray-200 mt-4" })
1871
- ] }, entry.version)) }) })
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
  );