react-os-shell 0.7.0 → 0.7.1

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 (51) hide show
  1. package/dist/{Browser-42ZTL3DQ.js → Browser-WVSS64J6.js} +3 -3
  2. package/dist/{Browser-42ZTL3DQ.js.map → Browser-WVSS64J6.js.map} +1 -1
  3. package/dist/{Calculator-QMC43H6W.js → Calculator-37EIFRDU.js} +4 -4
  4. package/dist/{Calculator-QMC43H6W.js.map → Calculator-37EIFRDU.js.map} +1 -1
  5. package/dist/{Calendar-OSPNZXPD.js → Calendar-KCZQJ5CY.js} +3 -3
  6. package/dist/{Calendar-OSPNZXPD.js.map → Calendar-KCZQJ5CY.js.map} +1 -1
  7. package/dist/{CurrencyConverter-RQKXZ56O.js → CurrencyConverter-PWX3FKRK.js} +4 -4
  8. package/dist/{CurrencyConverter-RQKXZ56O.js.map → CurrencyConverter-PWX3FKRK.js.map} +1 -1
  9. package/dist/{Documents-SNNWYPAS.js → Documents-W2DABIOW.js} +3 -3
  10. package/dist/{Documents-SNNWYPAS.js.map → Documents-W2DABIOW.js.map} +1 -1
  11. package/dist/{Email-QIDYGDSR.js → Email-GTGL7CW5.js} +3 -3
  12. package/dist/{Email-QIDYGDSR.js.map → Email-GTGL7CW5.js.map} +1 -1
  13. package/dist/Files-XNAPEBFF.js +11 -0
  14. package/dist/{Files-JUWNFKSF.js.map → Files-XNAPEBFF.js.map} +1 -1
  15. package/dist/{Minesweeper-TZU7VTBR.js → Minesweeper-N73MSPJV.js} +3 -3
  16. package/dist/{Minesweeper-TZU7VTBR.js.map → Minesweeper-N73MSPJV.js.map} +1 -1
  17. package/dist/{Notepad-RXDODESR.js → Notepad-MXEQCIC7.js} +3 -3
  18. package/dist/{Notepad-RXDODESR.js.map → Notepad-MXEQCIC7.js.map} +1 -1
  19. package/dist/{PomodoroTimer-YYFTVAAT.js → PomodoroTimer-VEYXRZWZ.js} +4 -4
  20. package/dist/{PomodoroTimer-YYFTVAAT.js.map → PomodoroTimer-VEYXRZWZ.js.map} +1 -1
  21. package/dist/Preview-VMKMY6SY.js +8 -0
  22. package/dist/{Preview-HDHGK3QA.js.map → Preview-VMKMY6SY.js.map} +1 -1
  23. package/dist/Spreadsheet-UZMNMLZH.js +6 -0
  24. package/dist/{Spreadsheet-2ZWIDCBD.js.map → Spreadsheet-UZMNMLZH.js.map} +1 -1
  25. package/dist/{Weather-G7GAZWKB.js → Weather-R6ULA547.js} +4 -4
  26. package/dist/{Weather-G7GAZWKB.js.map → Weather-R6ULA547.js.map} +1 -1
  27. package/dist/{WorldClock-H3TAHY3V.js → WorldClock-HHIBQXUR.js} +4 -5
  28. package/dist/WorldClock-HHIBQXUR.js.map +1 -0
  29. package/dist/apps/index.js +21 -21
  30. package/dist/apps/index.js.map +1 -1
  31. package/dist/{chunk-ZIRRB5P2.js → chunk-3T6SQ4UO.js} +36 -15
  32. package/dist/chunk-3T6SQ4UO.js.map +1 -0
  33. package/dist/{chunk-EIMG6KP7.js → chunk-CDSFAXIS.js} +4 -4
  34. package/dist/{chunk-EIMG6KP7.js.map → chunk-CDSFAXIS.js.map} +1 -1
  35. package/dist/{chunk-VIUW7IPZ.js → chunk-KJ5664G7.js} +3 -3
  36. package/dist/{chunk-VIUW7IPZ.js.map → chunk-KJ5664G7.js.map} +1 -1
  37. package/dist/{chunk-U7XDTOFD.js → chunk-LWVRQWGV.js} +3 -3
  38. package/dist/{chunk-U7XDTOFD.js.map → chunk-LWVRQWGV.js.map} +1 -1
  39. package/dist/{chunk-QWQHSHAX.js → chunk-SUUADOG6.js} +4 -4
  40. package/dist/{chunk-QWQHSHAX.js.map → chunk-SUUADOG6.js.map} +1 -1
  41. package/dist/{chunk-OMCRYSXD.js → chunk-ZETQWO2W.js} +3 -3
  42. package/dist/{chunk-OMCRYSXD.js.map → chunk-ZETQWO2W.js.map} +1 -1
  43. package/dist/index.d.ts +22 -1
  44. package/dist/index.js +67 -8
  45. package/dist/index.js.map +1 -1
  46. package/package.json +1 -1
  47. package/dist/Files-JUWNFKSF.js +0 -11
  48. package/dist/Preview-HDHGK3QA.js +0 -8
  49. package/dist/Spreadsheet-2ZWIDCBD.js +0 -6
  50. package/dist/WorldClock-H3TAHY3V.js.map +0 -1
  51. package/dist/chunk-ZIRRB5P2.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -131,6 +131,27 @@ declare function setWindowDefaultPosition(key: string, pos: {
131
131
  w: number;
132
132
  h: number;
133
133
  }): void;
134
+ /** Read the saved box for a window key (viewport-relative px), or null. */
135
+ declare function getWindowPosition(key: string): {
136
+ x: number;
137
+ y: number;
138
+ w: number;
139
+ h: number;
140
+ } | null;
141
+ /**
142
+ * Force a window's saved position — unlike `setWindowDefaultPosition` this
143
+ * overwrites any existing entry. Use when the consumer wants to deliberately
144
+ * (re)place a window, e.g. the Widget Manager dropping a freshly-added widget
145
+ * into a tidy top-left slot regardless of where it last sat. For `autoHeight`
146
+ * windows the `h` here is only a first-paint placeholder — the window
147
+ * re-measures its content height on open.
148
+ */
149
+ declare function setWindowPosition(key: string, pos: {
150
+ x: number;
151
+ y: number;
152
+ w: number;
153
+ h: number;
154
+ }): void;
134
155
  interface ModalProps {
135
156
  open: boolean;
136
157
  onClose: () => void;
@@ -1288,4 +1309,4 @@ declare function useNewHotkey(callback: () => void): void;
1288
1309
  */
1289
1310
  declare function useEditHotkey(callback: (() => void) | null): void;
1290
1311
 
1291
- export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, type BugReport, type BugReportConfig, BugReportConfigProvider, BugReportDetail, type BugReportExtraField, type BugReportExtraSelectField, BugReportProvider, type BugReportSubmission, type BugReportSubmitPayload, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, type CellStyle, type ChangelogEntry, type ColumnDef, ConfirmProvider, CopyButton, Customization, type CustomizationOmitSection, type CustomizationProps, Desktop, type DesktopHostConfig, DesktopHostProvider, DocFavStar, ENTER, EditableGrid, type EditableGridProps, type EntityFetcher, EntityList, type EntityListColumn, type EntityListProps, GLASS_DIVIDER, GLASS_INPUT_BG, GlobalSearch, type GridColumn, HelpCenter, type HelpCenterDoc, type HelpCenterProps, Layout, type LayoutProps, ListFooter, type LoginPayload, MOD, type MailCapabilities, MailConnectModal, type MailUser, Markdown, type MarkdownProps, Modal, ModalActions, NotificationBell, type NotificationsConfig, type PaginatedResponse, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, type ReportType, ResizableTable, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SemanticGroup, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, type SortState, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, SystemPreferences, type SystemPreferencesProps, type SystemPreferencesSection, VERSION, WidgetManager, WindowManagerProvider, WindowRegistry, WindowTitle, commitExposeHighlight, confirm, confirmDestructive, createWindowRegistry, exitExposeMode, formatDate, getActiveWindowRoute, getExposeHighlight, glassStyle, isMac, openBugReportDialog, prompt, reportBug, setExposeHighlight, setShellApiClient, setShellAuthBridge, setShellMailServer, setShellNavIcons, setWindowDefaultPosition, subscribeExposeHighlight, toast, toggleExposeMode, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useLocalStoragePrefs, useMailAuth, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useSort, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
1312
+ export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, type BugReport, type BugReportConfig, BugReportConfigProvider, BugReportDetail, type BugReportExtraField, type BugReportExtraSelectField, BugReportProvider, type BugReportSubmission, type BugReportSubmitPayload, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, type CellStyle, type ChangelogEntry, type ColumnDef, ConfirmProvider, CopyButton, Customization, type CustomizationOmitSection, type CustomizationProps, Desktop, type DesktopHostConfig, DesktopHostProvider, DocFavStar, ENTER, EditableGrid, type EditableGridProps, type EntityFetcher, EntityList, type EntityListColumn, type EntityListProps, GLASS_DIVIDER, GLASS_INPUT_BG, GlobalSearch, type GridColumn, HelpCenter, type HelpCenterDoc, type HelpCenterProps, Layout, type LayoutProps, ListFooter, type LoginPayload, MOD, type MailCapabilities, MailConnectModal, type MailUser, Markdown, type MarkdownProps, Modal, ModalActions, NotificationBell, type NotificationsConfig, type PaginatedResponse, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, type ReportType, ResizableTable, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SemanticGroup, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, type SortState, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, SystemPreferences, type SystemPreferencesProps, type SystemPreferencesSection, VERSION, WidgetManager, WindowManagerProvider, WindowRegistry, WindowTitle, commitExposeHighlight, confirm, confirmDestructive, createWindowRegistry, exitExposeMode, formatDate, getActiveWindowRoute, getExposeHighlight, getWindowPosition, glassStyle, isMac, openBugReportDialog, prompt, reportBug, setExposeHighlight, setShellApiClient, setShellAuthBridge, setShellMailServer, setShellNavIcons, setWindowDefaultPosition, setWindowPosition, subscribeExposeHighlight, toast, toggleExposeMode, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useLocalStoragePrefs, useMailAuth, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useSort, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
package/dist/index.js CHANGED
@@ -6,15 +6,15 @@ export { setShellMailServer, useMailAuth } from './chunk-VBFB3ZIN.js';
6
6
  import { subscribePomo, getPomoSnapshot } from './chunk-MK3HLUO4.js';
7
7
  import { useShellPrefs } from './chunk-36VM54SC.js';
8
8
  export { ShellPrefsProvider, useLocalStoragePrefs, useShellPrefs } from './chunk-36VM54SC.js';
9
- import { PREVIEW_OPENED_EVENT, openPreviewFile } from './chunk-QWQHSHAX.js';
9
+ import { PREVIEW_OPENED_EVENT, openPreviewFile } from './chunk-SUUADOG6.js';
10
10
  import { playNotification, playStartup, soundsEnabled, getSoundConfig, SOUND_PACK_KEYS, SOUND_PACKS, SOUND_TYPES, SOUND_TYPE_LABELS, setSoundForType, previewSound, setAllSounds, playLogout } from './chunk-D7PYW2QS.js';
11
- import { setPdfPreview } from './chunk-VIUW7IPZ.js';
11
+ import { setPdfPreview } from './chunk-KJ5664G7.js';
12
12
  import './chunk-KUIPWCTJ.js';
13
13
  import { toast_default } from './chunk-WIJ45SYD.js';
14
14
  export { toast_default as toast } from './chunk-WIJ45SYD.js';
15
- export { EditableGrid } from './chunk-OMCRYSXD.js';
16
- import { useWindowManager, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, Modal, WINDOW_REGISTRY, isPageEntry, ModalActions, useIsMobile, useModalActive, client_default, LoadingSpinner, ThumbCard, activateModal } from './chunk-ZIRRB5P2.js';
17
- export { CancelButton, CopyButton, DocFavStar, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, WindowManagerProvider, WindowTitle, commitExposeHighlight, exitExposeMode, getActiveWindowRoute, getExposeHighlight, isEntityEntry, isPageEntry, setExposeHighlight, setShellApiClient, setShellWindowRegistry, setWindowDefaultPosition, subscribeExposeHighlight, toggleExposeMode, useModalActive, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle } from './chunk-ZIRRB5P2.js';
15
+ export { EditableGrid } from './chunk-ZETQWO2W.js';
16
+ import { useWindowManager, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, Modal, WINDOW_REGISTRY, isPageEntry, ModalActions, useIsMobile, useModalActive, client_default, LoadingSpinner, setWindowPosition, ThumbCard, activateModal } from './chunk-3T6SQ4UO.js';
17
+ export { CancelButton, CopyButton, DocFavStar, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, WindowManagerProvider, WindowTitle, commitExposeHighlight, exitExposeMode, getActiveWindowRoute, getExposeHighlight, getWindowPosition, isEntityEntry, isPageEntry, setExposeHighlight, setShellApiClient, setShellWindowRegistry, setWindowDefaultPosition, setWindowPosition, subscribeExposeHighlight, toggleExposeMode, useModalActive, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle } from './chunk-3T6SQ4UO.js';
18
18
  import { confirm } from './chunk-UBN4IUDE.js';
19
19
  export { ConfirmProvider, confirm, confirmDestructive, prompt } from './chunk-UBN4IUDE.js';
20
20
  import { useAuth, useShellAuth } from './chunk-ADJ3CERD.js';
@@ -1243,8 +1243,61 @@ function WidgetManager({ open, onClose }) {
1243
1243
  if (!open) return null;
1244
1244
  const activeByRoute = new Map(openWindows.filter((w) => w.route).map((w) => [w.route, w]));
1245
1245
  const isActive = (route) => activeByRoute.has(route);
1246
+ const PAD = 20, GAP = 16;
1247
+ const workArea = () => {
1248
+ const cs = getComputedStyle(document.documentElement);
1249
+ const tbH = parseInt(cs.getPropertyValue("--taskbar-height")) || 0;
1250
+ const tbW = parseInt(cs.getPropertyValue("--taskbar-width")) || 0;
1251
+ const tbPos = cs.getPropertyValue("--taskbar-position").trim() || "bottom";
1252
+ const sidebarW = parseInt(cs.getPropertyValue("--sidebar-width")) || 0;
1253
+ return {
1254
+ leftOffset: (tbPos === "left" ? tbW : 0) + sidebarW + PAD,
1255
+ topOffset: (tbPos === "top" ? tbH : 0) + PAD,
1256
+ maxBottom: window.innerHeight - (tbPos === "bottom" ? tbH : 0) - PAD
1257
+ };
1258
+ };
1259
+ const liveWidgetRects = () => [...document.querySelectorAll("[data-modal-panel][data-widget]")].map((el) => {
1260
+ const r = el.getBoundingClientRect();
1261
+ return { x: r.left, y: r.top, w: r.width, h: r.height };
1262
+ }).filter((r) => r.w > 0 && r.h > 0);
1263
+ const computeSlot = (occupied, w, h) => {
1264
+ const { leftOffset, topOffset, maxBottom } = workArea();
1265
+ const rightLimit = window.innerWidth - PAD;
1266
+ const lowestInColumn = (colX) => {
1267
+ const ov = occupied.filter((r) => r.x < colX + w && r.x + r.w > colX);
1268
+ return ov.length ? Math.max(...ov.map((r) => r.y + r.h)) + GAP : topOffset;
1269
+ };
1270
+ let x = leftOffset, y = lowestInColumn(x), guard = 0;
1271
+ while (y + h > maxBottom && x + (w + GAP) + w <= rightLimit && guard < 12) {
1272
+ x += w + GAP;
1273
+ y = lowestInColumn(x);
1274
+ guard++;
1275
+ }
1276
+ return { x, y };
1277
+ };
1278
+ const dimsFor = (route) => {
1279
+ const e = WINDOW_REGISTRY[route];
1280
+ return { w: e?.dimensions?.[0] ?? 320, h: e?.dimensions?.[1] ?? 240, auto: !!e?.autoHeight };
1281
+ };
1282
+ const placeAndOpen = (route) => {
1283
+ const { w, h, auto } = dimsFor(route);
1284
+ const selfH = auto ? Math.min(h, 160) : h;
1285
+ const { x, y } = computeSlot(liveWidgetRects(), w, selfH);
1286
+ setWindowPosition(`page:${route}`, { x, y, w, h });
1287
+ openPage(route);
1288
+ };
1289
+ const waitForWidget = (route) => new Promise((resolve) => {
1290
+ const sel = `[data-modal-panel][data-window-key="page:${route}"]`;
1291
+ let n = 0;
1292
+ const tick = () => {
1293
+ const el = document.querySelector(sel);
1294
+ if (el && el.getBoundingClientRect().height > 40 || n++ > 30) resolve();
1295
+ else setTimeout(tick, 30);
1296
+ };
1297
+ setTimeout(tick, 30);
1298
+ });
1246
1299
  const add = (route) => {
1247
- if (!isActive(route)) openPage(route);
1300
+ if (!isActive(route)) placeAndOpen(route);
1248
1301
  };
1249
1302
  const remove = (route) => {
1250
1303
  const w = activeByRoute.get(route);
@@ -1255,7 +1308,13 @@ function WidgetManager({ open, onClose }) {
1255
1308
  };
1256
1309
  const activeCount = widgets.reduce((n, w) => n + (isActive(w.route) ? 1 : 0), 0);
1257
1310
  const allActive = widgets.length > 0 && activeCount === widgets.length;
1258
- const addAll = () => widgets.forEach((w) => add(w.route));
1311
+ const addAll = async () => {
1312
+ for (const w of widgets) {
1313
+ if (isActive(w.route)) continue;
1314
+ placeAndOpen(w.route);
1315
+ await waitForWidget(w.route);
1316
+ }
1317
+ };
1259
1318
  const removeAll = () => widgets.forEach((w) => remove(w.route));
1260
1319
  const widgetGlyph = /* @__PURE__ */ jsxs("svg", { className: "h-5 w-5 text-blue-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
1261
1320
  /* @__PURE__ */ jsx("rect", { x: "3.5", y: "3.5", width: "7", height: "7", rx: "1.5" }),
@@ -1312,7 +1371,7 @@ function WidgetManager({ open, onClose }) {
1312
1371
  }
1313
1372
 
1314
1373
  // src/version.ts
1315
- var VERSION = "0.7.0" ;
1374
+ var VERSION = "0.7.1" ;
1316
1375
  var APP_VERSION = VERSION;
1317
1376
 
1318
1377
  // src/changelog.ts