ywana-core8 0.2.6 → 0.2.8

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.
@@ -1985,7 +1985,9 @@ const Button = (props) => {
1985
1985
  icon: loading ? "hourglass_empty" : icon,
1986
1986
  size: size === "small" ? "small" : size === "large" ? "normal" : "small",
1987
1987
  disabled: disabled || loading,
1988
- className: loading ? "loading-icon" : ""
1988
+ className: loading ? "loading-icon" : "",
1989
+ eventPropagation: true
1990
+ // Allow click events to bubble up to button
1989
1991
  };
1990
1992
  return /* @__PURE__ */ React.createElement(
1991
1993
  "button",
@@ -31708,6 +31710,7 @@ class WindowManager {
31708
31710
  this.windows = /* @__PURE__ */ new Map();
31709
31711
  this.activeWindowId = null;
31710
31712
  this.nextZIndex = 1e3;
31713
+ this.maxZIndex = 9999;
31711
31714
  this.listeners = /* @__PURE__ */ new Set();
31712
31715
  this.desktopSize = desktopSize;
31713
31716
  }
@@ -31769,7 +31772,7 @@ class WindowManager {
31769
31772
  size,
31770
31773
  minimized: false,
31771
31774
  maximized: false,
31772
- zIndex: this.nextZIndex++,
31775
+ zIndex: Math.min(this.nextZIndex++, this.maxZIndex),
31773
31776
  ...config
31774
31777
  };
31775
31778
  this.windows.set(window2.id, window2);
@@ -31788,7 +31791,7 @@ class WindowManager {
31788
31791
  let x = baseX + existingWindows.length * offsetStep;
31789
31792
  let y = baseY + existingWindows.length * offsetStep;
31790
31793
  const maxX = this.desktopSize.width - windowSize.width - 20;
31791
- const maxY = this.desktopSize.height - windowSize.height - 100;
31794
+ const maxY = this.desktopSize.height - windowSize.height - 20;
31792
31795
  if (x > maxX || y > maxY) {
31793
31796
  const cascadeIndex = existingWindows.length % 8;
31794
31797
  x = baseX + cascadeIndex * 30;
@@ -31824,7 +31827,10 @@ class WindowManager {
31824
31827
  if (window2.minimized) {
31825
31828
  window2.minimized = false;
31826
31829
  }
31827
- window2.zIndex = this.nextZIndex++;
31830
+ if (this.nextZIndex >= this.maxZIndex) {
31831
+ this.resetZIndexes();
31832
+ }
31833
+ window2.zIndex = Math.min(this.nextZIndex++, this.maxZIndex);
31828
31834
  this.activeWindowId = windowId;
31829
31835
  this.notifyListeners();
31830
31836
  return true;
@@ -31876,7 +31882,7 @@ class WindowManager {
31876
31882
  const minWidth = 200;
31877
31883
  const minHeight = 150;
31878
31884
  const maxWidth = this.desktopSize.width;
31879
- const maxHeight = this.desktopSize.height - 50;
31885
+ const maxHeight = this.desktopSize.height;
31880
31886
  const constrainedSize = {
31881
31887
  width: Math.max(minWidth, Math.min(size.width || window2.size.width, maxWidth)),
31882
31888
  height: Math.max(minHeight, Math.min(size.height || window2.size.height, maxHeight))
@@ -31912,7 +31918,7 @@ class WindowManager {
31912
31918
  this.windows.forEach((window2) => {
31913
31919
  if (window2.maximized) return;
31914
31920
  const maxX = this.desktopSize.width - window2.size.width;
31915
- const maxY = this.desktopSize.height - window2.size.height - 50;
31921
+ const maxY = this.desktopSize.height - window2.size.height;
31916
31922
  if (window2.position.x > maxX) {
31917
31923
  window2.position.x = Math.max(0, maxX);
31918
31924
  }
@@ -31947,7 +31953,7 @@ class WindowManager {
31947
31953
  const cols = Math.ceil(Math.sqrt(visibleWindows.length));
31948
31954
  const rows = Math.ceil(visibleWindows.length / cols);
31949
31955
  const windowWidth = Math.floor(this.desktopSize.width / cols);
31950
- const windowHeight = Math.floor((this.desktopSize.height - 80) / rows);
31956
+ const windowHeight = Math.floor(this.desktopSize.height / rows);
31951
31957
  visibleWindows.forEach((window2, index) => {
31952
31958
  const col = index % cols;
31953
31959
  const row = Math.floor(index / cols);
@@ -31972,8 +31978,8 @@ class WindowManager {
31972
31978
  if (!window2 || window2.maximized) return false;
31973
31979
  window2.position = {
31974
31980
  x: (this.desktopSize.width - window2.size.width) / 2,
31975
- y: (this.desktopSize.height - window2.size.height - 50) / 2
31976
- // Space for taskbar
31981
+ y: (this.desktopSize.height - window2.size.height) / 2
31982
+ // Workspace center
31977
31983
  };
31978
31984
  this.notifyListeners();
31979
31985
  return true;
@@ -31986,7 +31992,7 @@ class WindowManager {
31986
31992
  const offsetStep = 20;
31987
31993
  visibleWindows.forEach((window2, index) => {
31988
31994
  const baseX = (this.desktopSize.width - window2.size.width) / 2;
31989
- const baseY = (this.desktopSize.height - window2.size.height - 50) / 2;
31995
+ const baseY = (this.desktopSize.height - window2.size.height) / 2;
31990
31996
  window2.position = {
31991
31997
  x: baseX + index * offsetStep,
31992
31998
  y: baseY + index * offsetStep
@@ -32007,6 +32013,19 @@ class WindowManager {
32007
32013
  desktopSize: this.desktopSize
32008
32014
  };
32009
32015
  }
32016
+ /**
32017
+ * Reset z-indexes when they reach the maximum
32018
+ */
32019
+ resetZIndexes() {
32020
+ const windows = Array.from(this.windows.values());
32021
+ windows.sort((a, b) => a.zIndex - b.zIndex);
32022
+ this.nextZIndex = 1e3;
32023
+ windows.forEach((window2, index) => {
32024
+ window2.zIndex = this.nextZIndex + index;
32025
+ });
32026
+ this.nextZIndex = 1e3 + windows.length;
32027
+ this.notifyListeners();
32028
+ }
32010
32029
  }
32011
32030
  const WindowContext = createContext(null);
32012
32031
  const WindowProvider = ({ children, desktopSize }) => {
@@ -32031,8 +32050,10 @@ const WindowProvider = ({ children, desktopSize }) => {
32031
32050
  }
32032
32051
  }, [desktopSize]);
32033
32052
  if (!state || !windowManagerRef.current) {
32053
+ console.log("WindowProvider not ready - state:", state, "windowManager:", windowManagerRef.current);
32034
32054
  return null;
32035
32055
  }
32056
+ console.log("WindowProvider ready - providing context");
32036
32057
  const value = {
32037
32058
  // Current state
32038
32059
  windows: state.windows,
@@ -32174,6 +32195,86 @@ const Window = ({
32174
32195
  };
32175
32196
  updateWindowPosition(id, finalPosition);
32176
32197
  };
32198
+ const handleResizeStart = (e, direction) => {
32199
+ if (!resizable || maximized) return;
32200
+ e.preventDefault();
32201
+ e.stopPropagation();
32202
+ setIsResizing(true);
32203
+ setResizeDirection(direction);
32204
+ setResizeStartSize(size);
32205
+ setResizeStartPosition(position);
32206
+ setResizeStartMouse({ x: e.clientX, y: e.clientY });
32207
+ focusWindow(id);
32208
+ };
32209
+ const handleResizeMove = (e) => {
32210
+ if (!isResizing) return;
32211
+ e.preventDefault();
32212
+ const deltaX = e.clientX - resizeStartMouse.x;
32213
+ const deltaY = e.clientY - resizeStartMouse.y;
32214
+ let newSize = { ...resizeStartSize };
32215
+ let newPosition = { ...resizeStartPosition };
32216
+ switch (resizeDirection) {
32217
+ case "n":
32218
+ newSize.height = Math.max(150, resizeStartSize.height - deltaY);
32219
+ newPosition.y = resizeStartPosition.y + (resizeStartSize.height - newSize.height);
32220
+ break;
32221
+ case "s":
32222
+ newSize.height = Math.max(150, resizeStartSize.height + deltaY);
32223
+ break;
32224
+ case "e":
32225
+ newSize.width = Math.max(200, resizeStartSize.width + deltaX);
32226
+ break;
32227
+ case "w":
32228
+ newSize.width = Math.max(200, resizeStartSize.width - deltaX);
32229
+ newPosition.x = resizeStartPosition.x + (resizeStartSize.width - newSize.width);
32230
+ break;
32231
+ case "ne":
32232
+ newSize.width = Math.max(200, resizeStartSize.width + deltaX);
32233
+ newSize.height = Math.max(150, resizeStartSize.height - deltaY);
32234
+ newPosition.y = resizeStartPosition.y + (resizeStartSize.height - newSize.height);
32235
+ break;
32236
+ case "nw":
32237
+ newSize.width = Math.max(200, resizeStartSize.width - deltaX);
32238
+ newSize.height = Math.max(150, resizeStartSize.height - deltaY);
32239
+ newPosition.x = resizeStartPosition.x + (resizeStartSize.width - newSize.width);
32240
+ newPosition.y = resizeStartPosition.y + (resizeStartSize.height - newSize.height);
32241
+ break;
32242
+ case "se":
32243
+ newSize.width = Math.max(200, resizeStartSize.width + deltaX);
32244
+ newSize.height = Math.max(150, resizeStartSize.height + deltaY);
32245
+ break;
32246
+ case "sw":
32247
+ newSize.width = Math.max(200, resizeStartSize.width - deltaX);
32248
+ newSize.height = Math.max(150, resizeStartSize.height + deltaY);
32249
+ newPosition.x = resizeStartPosition.x + (resizeStartSize.width - newSize.width);
32250
+ break;
32251
+ }
32252
+ if (windowRef.current) {
32253
+ windowRef.current.style.width = `${newSize.width}px`;
32254
+ windowRef.current.style.height = `${newSize.height}px`;
32255
+ windowRef.current.style.left = `${newPosition.x}px`;
32256
+ windowRef.current.style.top = `${newPosition.y}px`;
32257
+ }
32258
+ };
32259
+ const handleResizeEnd = () => {
32260
+ if (!isResizing) return;
32261
+ setIsResizing(false);
32262
+ setResizeDirection("");
32263
+ const desktopContainer = windowRef.current?.parentElement;
32264
+ if (!desktopContainer) return;
32265
+ const windowRect = windowRef.current.getBoundingClientRect();
32266
+ const desktopRect = desktopContainer.getBoundingClientRect();
32267
+ const finalSize = {
32268
+ width: windowRect.width,
32269
+ height: windowRect.height
32270
+ };
32271
+ const finalPosition = {
32272
+ x: windowRect.left - desktopRect.left,
32273
+ y: windowRect.top - desktopRect.top
32274
+ };
32275
+ updateWindowSize(id, finalSize);
32276
+ updateWindowPosition(id, finalPosition);
32277
+ };
32177
32278
  useEffect(() => {
32178
32279
  if (isDragging) {
32179
32280
  document.addEventListener("mousemove", handleMouseMove);
@@ -32188,6 +32289,18 @@ const Window = ({
32188
32289
  };
32189
32290
  }
32190
32291
  }, [isDragging]);
32292
+ useEffect(() => {
32293
+ if (isResizing) {
32294
+ document.addEventListener("mousemove", handleResizeMove);
32295
+ document.addEventListener("mouseup", handleResizeEnd);
32296
+ document.body.style.userSelect = "none";
32297
+ return () => {
32298
+ document.removeEventListener("mousemove", handleResizeMove);
32299
+ document.removeEventListener("mouseup", handleResizeEnd);
32300
+ document.body.style.userSelect = "";
32301
+ };
32302
+ }
32303
+ }, [isResizing]);
32191
32304
  const handleMinimize = (e) => {
32192
32305
  e.stopPropagation();
32193
32306
  minimizeWindow(id, !minimized);
@@ -32222,6 +32335,7 @@ const Window = ({
32222
32335
  "window",
32223
32336
  maximized && "window--maximized",
32224
32337
  isDragging && "window--dragging",
32338
+ isResizing && "window--resizing",
32225
32339
  className
32226
32340
  ].filter(Boolean).join(" ");
32227
32341
  return /* @__PURE__ */ React.createElement(
@@ -32271,10 +32385,60 @@ const Window = ({
32271
32385
  ),
32272
32386
  toolbar && /* @__PURE__ */ React.createElement("div", { className: "window__toolbar" }, toolbar),
32273
32387
  /* @__PURE__ */ React.createElement("div", { className: "window__content" }, content || children),
32274
- statusBar && /* @__PURE__ */ React.createElement("div", { className: "window__status-bar" }, statusBar)
32388
+ statusBar && /* @__PURE__ */ React.createElement("div", { className: "window__status-bar" }, statusBar),
32389
+ resizable && !maximized && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
32390
+ "div",
32391
+ {
32392
+ className: "window__resize-handle window__resize-handle--n",
32393
+ onMouseDown: (e) => handleResizeStart(e, "n")
32394
+ }
32395
+ ), /* @__PURE__ */ React.createElement(
32396
+ "div",
32397
+ {
32398
+ className: "window__resize-handle window__resize-handle--s",
32399
+ onMouseDown: (e) => handleResizeStart(e, "s")
32400
+ }
32401
+ ), /* @__PURE__ */ React.createElement(
32402
+ "div",
32403
+ {
32404
+ className: "window__resize-handle window__resize-handle--e",
32405
+ onMouseDown: (e) => handleResizeStart(e, "e")
32406
+ }
32407
+ ), /* @__PURE__ */ React.createElement(
32408
+ "div",
32409
+ {
32410
+ className: "window__resize-handle window__resize-handle--w",
32411
+ onMouseDown: (e) => handleResizeStart(e, "w")
32412
+ }
32413
+ ), /* @__PURE__ */ React.createElement(
32414
+ "div",
32415
+ {
32416
+ className: "window__resize-handle window__resize-handle--ne",
32417
+ onMouseDown: (e) => handleResizeStart(e, "ne")
32418
+ }
32419
+ ), /* @__PURE__ */ React.createElement(
32420
+ "div",
32421
+ {
32422
+ className: "window__resize-handle window__resize-handle--nw",
32423
+ onMouseDown: (e) => handleResizeStart(e, "nw")
32424
+ }
32425
+ ), /* @__PURE__ */ React.createElement(
32426
+ "div",
32427
+ {
32428
+ className: "window__resize-handle window__resize-handle--se",
32429
+ onMouseDown: (e) => handleResizeStart(e, "se")
32430
+ }
32431
+ ), /* @__PURE__ */ React.createElement(
32432
+ "div",
32433
+ {
32434
+ className: "window__resize-handle window__resize-handle--sw",
32435
+ onMouseDown: (e) => handleResizeStart(e, "sw")
32436
+ }
32437
+ ))
32275
32438
  );
32276
32439
  };
32277
32440
  const ApplicationMenu = ({ isOpen, onClose }) => {
32441
+ console.log("ApplicationMenu render - isOpen:", isOpen, "onClose:", onClose);
32278
32442
  const appManager = useAppManager();
32279
32443
  const [searchTerm, setSearchTerm] = useState("");
32280
32444
  const [selectedCategory, setSelectedCategory] = useState("all");
@@ -32359,14 +32523,14 @@ const ApplicationMenu = ({ isOpen, onClose }) => {
32359
32523
  onChange: (e) => setSearchTerm(e.target.value),
32360
32524
  className: "application-menu__search-input"
32361
32525
  }
32362
- )), /* @__PURE__ */ React.createElement("div", { className: "application-menu__categories" }, /* @__PURE__ */ React.createElement(
32526
+ )), /* @__PURE__ */ React.createElement("div", { className: "application-menu__main" }, /* @__PURE__ */ React.createElement("div", { className: "application-menu__sidebar" }, /* @__PURE__ */ React.createElement("div", { className: "application-menu__categories" }, /* @__PURE__ */ React.createElement(
32363
32527
  "button",
32364
32528
  {
32365
32529
  className: `application-menu__category ${selectedCategory === "all" ? "active" : ""}`,
32366
32530
  onClick: () => handleCategorySelect("all")
32367
32531
  },
32368
32532
  /* @__PURE__ */ React.createElement("span", { className: "category-icon" }, "📱"),
32369
- "All Apps"
32533
+ /* @__PURE__ */ React.createElement("span", { className: "category-name" }, "All Apps")
32370
32534
  ), categories.map((category) => /* @__PURE__ */ React.createElement(
32371
32535
  "button",
32372
32536
  {
@@ -32375,8 +32539,8 @@ const ApplicationMenu = ({ isOpen, onClose }) => {
32375
32539
  onClick: () => handleCategorySelect(category.id)
32376
32540
  },
32377
32541
  /* @__PURE__ */ React.createElement("span", { className: "category-icon" }, category.icon),
32378
- category.name
32379
- ))), /* @__PURE__ */ React.createElement("div", { className: "application-menu__content" }, searchTerm && /* @__PURE__ */ React.createElement("div", { className: "application-menu__search-results" }, /* @__PURE__ */ React.createElement("h3", null, "Search Results (", filteredApps.length, ")"), /* @__PURE__ */ React.createElement("div", { className: "application-menu__apps-grid" }, filteredApps.map((app) => /* @__PURE__ */ React.createElement(
32542
+ /* @__PURE__ */ React.createElement("span", { className: "category-name" }, category.name)
32543
+ )))), /* @__PURE__ */ React.createElement("div", { className: "application-menu__content" }, searchTerm && /* @__PURE__ */ React.createElement("div", { className: "application-menu__search-results" }, /* @__PURE__ */ React.createElement("h3", null, "Search Results (", filteredApps.length, ")"), /* @__PURE__ */ React.createElement("div", { className: "application-menu__apps-grid" }, filteredApps.map((app) => /* @__PURE__ */ React.createElement(
32380
32544
  "div",
32381
32545
  {
32382
32546
  key: app.id,
@@ -32396,7 +32560,7 @@ const ApplicationMenu = ({ isOpen, onClose }) => {
32396
32560
  },
32397
32561
  /* @__PURE__ */ React.createElement("div", { className: "app-icon" }, app.icon),
32398
32562
  /* @__PURE__ */ React.createElement("div", { className: "app-name" }, app.name)
32399
- )))))), filteredApps.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "application-menu__no-results" }, /* @__PURE__ */ React.createElement("div", { style: { fontSize: "48px", marginBottom: "16px" } }, "🔍"), /* @__PURE__ */ React.createElement("h3", null, "No applications found"), /* @__PURE__ */ React.createElement("p", null, "Try adjusting your search or category filter.")))));
32563
+ )))))), filteredApps.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "application-menu__no-results" }, /* @__PURE__ */ React.createElement("div", { style: { fontSize: "48px", marginBottom: "16px" } }, "🔍"), /* @__PURE__ */ React.createElement("h3", null, "No applications found"), /* @__PURE__ */ React.createElement("p", null, "Try adjusting your search or category filter."))))));
32400
32564
  };
32401
32565
  class AppManager {
32402
32566
  constructor() {
@@ -32654,14 +32818,14 @@ const AppProvider = ({ children, appManager = defaultAppManager }) => {
32654
32818
  };
32655
32819
  return /* @__PURE__ */ React.createElement(AppContext.Provider, { value }, children);
32656
32820
  };
32657
- const DesktopLayout = ({ children, className = "", theme = "windows", ...props }) => {
32821
+ const DesktopLayout = ({ children, className = "", theme = "windows", workspaceRef, ...props }) => {
32658
32822
  const desktopRef = useRef(null);
32659
32823
  const { windowManager } = useWindows();
32660
32824
  useEffect(() => {
32661
- let currentSize = { width: 1200, height: 800 };
32662
- const measureDesktop = () => {
32663
- if (desktopRef.current) {
32664
- const rect = desktopRef.current.getBoundingClientRect();
32825
+ let currentSize = { width: 1200, height: 750 };
32826
+ const measureWorkspace = () => {
32827
+ if (workspaceRef.current) {
32828
+ const rect = workspaceRef.current.getBoundingClientRect();
32665
32829
  const newSize = {
32666
32830
  width: rect.width,
32667
32831
  height: rect.height
@@ -32672,10 +32836,10 @@ const DesktopLayout = ({ children, className = "", theme = "windows", ...props }
32672
32836
  }
32673
32837
  }
32674
32838
  };
32675
- measureDesktop();
32676
- const resizeObserver = new ResizeObserver(measureDesktop);
32677
- if (desktopRef.current) {
32678
- resizeObserver.observe(desktopRef.current);
32839
+ measureWorkspace();
32840
+ const resizeObserver = new ResizeObserver(measureWorkspace);
32841
+ if (workspaceRef.current) {
32842
+ resizeObserver.observe(workspaceRef.current);
32679
32843
  }
32680
32844
  return () => {
32681
32845
  resizeObserver.disconnect();
@@ -32700,7 +32864,7 @@ const DesktopLayout = ({ children, className = "", theme = "windows", ...props }
32700
32864
  };
32701
32865
  const Workspace = ({ children }) => {
32702
32866
  const { windows } = useWindows();
32703
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children, windows.map((window2) => /* @__PURE__ */ React.createElement(
32867
+ return /* @__PURE__ */ React.createElement("div", { className: "workspace" }, children, windows.map((window2) => /* @__PURE__ */ React.createElement(
32704
32868
  Window,
32705
32869
  {
32706
32870
  key: window2.id,
@@ -32714,6 +32878,9 @@ const Workspace = ({ children }) => {
32714
32878
  )));
32715
32879
  };
32716
32880
  const DesktopTaskbar = () => {
32881
+ console.log("DesktopTaskbar render");
32882
+ const windowsContext = useWindows();
32883
+ console.log("useWindows result:", windowsContext);
32717
32884
  const {
32718
32885
  createWindow,
32719
32886
  windows,
@@ -32721,26 +32888,14 @@ const DesktopTaskbar = () => {
32721
32888
  activeWindowId,
32722
32889
  focusWindow,
32723
32890
  minimizeWindow,
32724
- closeWindow
32725
- } = useWindows();
32726
- const { open: openApplicationMenu } = useApplicationMenu();
32727
- const handleCreateWindow = () => {
32728
- const windowTypes = [
32729
- { title: "File Explorer", icon: "📁", size: { width: 600, height: 400 } },
32730
- { title: "Text Editor", icon: "📝", size: { width: 500, height: 350 } },
32731
- { title: "Calculator", icon: "🧮", size: { width: 300, height: 400 } },
32732
- { title: "Settings", icon: "⚙️", size: { width: 450, height: 300 } },
32733
- { title: "Browser", icon: "🌐", size: { width: 800, height: 500 } }
32734
- ];
32735
- const randomType = windowTypes[Math.floor(Math.random() * windowTypes.length)];
32736
- createWindow({
32737
- title: randomType.title,
32738
- icon: randomType.icon,
32739
- size: randomType.size,
32740
- toolbar: randomType.title === "Text Editor" ? /* @__PURE__ */ React.createElement("div", { style: { display: "flex", gap: "8px" } }, /* @__PURE__ */ React.createElement("button", { style: { padding: "4px 8px", fontSize: "12px" } }, "File"), /* @__PURE__ */ React.createElement("button", { style: { padding: "4px 8px", fontSize: "12px" } }, "Edit"), /* @__PURE__ */ React.createElement("button", { style: { padding: "4px 8px", fontSize: "12px" } }, "View")) : null,
32741
- statusBar: randomType.title === "Text Editor" ? /* @__PURE__ */ React.createElement("span", null, "Ready | Line 1, Column 1") : null
32742
- });
32743
- };
32891
+ closeWindow,
32892
+ cascadeWindows,
32893
+ tileWindows,
32894
+ centerAllWindows,
32895
+ clearAllWindows
32896
+ } = windowsContext;
32897
+ const { isOpen, toggle } = useApplicationMenu();
32898
+ console.log("DesktopTaskbar - isOpen:", isOpen, "toggle:", toggle);
32744
32899
  const handleWindowClick = (window2) => {
32745
32900
  if (window2.minimized) {
32746
32901
  minimizeWindow(window2.id, false);
@@ -32763,11 +32918,7 @@ const DesktopTaskbar = () => {
32763
32918
  closeWindow(window2.id);
32764
32919
  }
32765
32920
  };
32766
- return /* @__PURE__ */ React.createElement("div", { style: {
32767
- position: "absolute",
32768
- bottom: 0,
32769
- left: 0,
32770
- right: 0,
32921
+ return /* @__PURE__ */ React.createElement("div", { className: "desktop-taskbar", style: {
32771
32922
  height: "50px",
32772
32923
  background: "rgba(0,0,0,0.8)",
32773
32924
  display: "flex",
@@ -32775,44 +32926,16 @@ const DesktopTaskbar = () => {
32775
32926
  padding: "0 16px",
32776
32927
  gap: "8px"
32777
32928
  } }, /* @__PURE__ */ React.createElement(
32778
- "button",
32929
+ ToggleButton,
32779
32930
  {
32780
- onClick: openApplicationMenu,
32781
- style: {
32782
- padding: "8px 16px",
32783
- background: "#1976d2",
32784
- color: "white",
32785
- border: "none",
32786
- borderRadius: "4px",
32787
- cursor: "pointer",
32788
- fontSize: "14px",
32789
- fontWeight: "bold",
32790
- flexShrink: 0,
32791
- display: "flex",
32792
- alignItems: "center",
32793
- gap: "6px"
32931
+ checked: isOpen,
32932
+ onToggle: () => {
32933
+ console.log("Start button toggled, current state:", isOpen);
32934
+ toggle();
32794
32935
  },
32795
- title: "Open application menu"
32796
- },
32797
- /* @__PURE__ */ React.createElement("span", { style: { fontSize: "16px" } }, "🚀"),
32798
- "Start"
32799
- ), /* @__PURE__ */ React.createElement(
32800
- "button",
32801
- {
32802
- onClick: handleCreateWindow,
32803
- style: {
32804
- padding: "8px 12px",
32805
- background: "#666",
32806
- color: "white",
32807
- border: "none",
32808
- borderRadius: "4px",
32809
- cursor: "pointer",
32810
- fontSize: "12px",
32811
- flexShrink: 0
32812
- },
32813
- title: "Create random window (for testing)"
32814
- },
32815
- "+"
32936
+ icon: "start",
32937
+ label: "Start"
32938
+ }
32816
32939
  ), /* @__PURE__ */ React.createElement("div", { style: {
32817
32940
  width: "1px",
32818
32941
  height: "30px",
@@ -32873,6 +32996,60 @@ Middle click: Close`
32873
32996
  borderRadius: "1px"
32874
32997
  } })
32875
32998
  ))), /* @__PURE__ */ React.createElement("div", { style: {
32999
+ display: "flex",
33000
+ gap: "4px",
33001
+ alignItems: "center",
33002
+ marginLeft: "auto",
33003
+ marginRight: "8px"
33004
+ } }, /* @__PURE__ */ React.createElement(
33005
+ Icon,
33006
+ {
33007
+ clickable: true,
33008
+ size: "small",
33009
+ action: () => {
33010
+ console.log("Cascade windows clicked!");
33011
+ cascadeWindows();
33012
+ },
33013
+ icon: "view_stream",
33014
+ label: "Cascade"
33015
+ }
33016
+ ), /* @__PURE__ */ React.createElement(
33017
+ Icon,
33018
+ {
33019
+ clickable: true,
33020
+ size: "small",
33021
+ action: () => {
33022
+ console.log("Tile windows clicked!");
33023
+ tileWindows();
33024
+ },
33025
+ icon: "view_module",
33026
+ label: "Tile"
33027
+ }
33028
+ ), /* @__PURE__ */ React.createElement(
33029
+ Icon,
33030
+ {
33031
+ clickable: true,
33032
+ size: "small",
33033
+ action: () => {
33034
+ console.log("Center all windows clicked!");
33035
+ centerAllWindows();
33036
+ },
33037
+ icon: "center_focus_strong",
33038
+ label: "Center"
33039
+ }
33040
+ ), /* @__PURE__ */ React.createElement(
33041
+ Icon,
33042
+ {
33043
+ clickable: true,
33044
+ size: "small",
33045
+ action: () => {
33046
+ console.log("Clear all windows clicked!");
33047
+ clearAllWindows();
33048
+ },
33049
+ icon: "clear_all",
33050
+ label: "Clear"
33051
+ }
33052
+ )), /* @__PURE__ */ React.createElement("div", { style: {
32876
33053
  color: "rgba(255,255,255,0.7)",
32877
33054
  fontSize: "11px",
32878
33055
  fontFamily: "monospace",
@@ -32882,13 +33059,14 @@ Middle click: Close`
32882
33059
  };
32883
33060
  const DesktopInternal = ({ desktopSize, children, ...props }) => {
32884
33061
  const { isOpen, close } = useApplicationMenu();
32885
- return /* @__PURE__ */ React.createElement(WindowProvider, { desktopSize }, /* @__PURE__ */ React.createElement(DesktopLayout, { ...props }, /* @__PURE__ */ React.createElement(Workspace, null, children), /* @__PURE__ */ React.createElement(DesktopTaskbar, null), /* @__PURE__ */ React.createElement(
33062
+ const workspaceRef = useRef(null);
33063
+ return /* @__PURE__ */ React.createElement(WindowProvider, { desktopSize }, /* @__PURE__ */ React.createElement(DesktopLayout, { workspaceRef, ...props }, /* @__PURE__ */ React.createElement("div", { ref: workspaceRef, className: "desktop__workspace-container" }, /* @__PURE__ */ React.createElement(Workspace, null, children), /* @__PURE__ */ React.createElement(
32886
33064
  ApplicationMenu,
32887
33065
  {
32888
33066
  isOpen,
32889
33067
  onClose: close
32890
33068
  }
32891
- )));
33069
+ )), /* @__PURE__ */ React.createElement(DesktopTaskbar, null)));
32892
33070
  };
32893
33071
  const Desktop = ({ desktopSize, children, ...props }) => {
32894
33072
  return /* @__PURE__ */ React.createElement(AppProvider, null, /* @__PURE__ */ React.createElement(DesktopInternal, { desktopSize, ...props }, children));