ywana-core8 0.2.19 → 0.2.21
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.css +2833 -714
- package/dist/index.js +433 -111
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +433 -111
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +433 -111
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/desktop/Desktop.stories.jsx +424 -11
- package/src/desktop/{ApplicationMenu.css → LaunchPad.css} +82 -107
- package/src/desktop/{ApplicationMenu.js → LaunchPad.js} +30 -30
- package/src/desktop/WindowContext.js +2 -0
- package/src/desktop/WindowManager.js +54 -0
- package/src/desktop/{desktop-linux.css → desktop-gnome.css} +64 -46
- package/src/desktop/desktop-macintosh.css +330 -0
- package/src/desktop/desktop-macos.css +60 -18
- package/src/desktop/desktop-msx.css +337 -0
- package/src/desktop/desktop-nextstep.css +315 -0
- package/src/desktop/desktop-windows.css +39 -21
- package/src/desktop/desktop-windows98.css +284 -0
- package/src/desktop/desktop-windowsxp.css +294 -0
- package/src/desktop/desktop.css +428 -1
- package/src/desktop/desktop.js +393 -69
- package/src/desktop/index.js +2 -2
- package/src/html/Menu.stories.jsx +504 -0
- package/src/html/menu.css +85 -6
- package/src/html/menu.js +40 -16
package/dist/index.umd.js
CHANGED
@@ -1669,26 +1669,43 @@
|
|
1669
1669
|
return /* @__PURE__ */ React.createElement(MenuContext.Provider, { value: [open, setOpen] }, /* @__PURE__ */ React.createElement("ul", null, children));
|
1670
1670
|
};
|
1671
1671
|
const MenuIcon = (props) => {
|
1672
|
-
const {
|
1672
|
+
const {
|
1673
|
+
icon = "more_vert",
|
1674
|
+
children,
|
1675
|
+
align,
|
1676
|
+
// Deprecated, kept for backwards compatibility
|
1677
|
+
position = align === "right" ? "bottom-right" : "bottom-left",
|
1678
|
+
size = "normal",
|
1679
|
+
menuSize = "normal"
|
1680
|
+
} = props;
|
1673
1681
|
const [open, setOpen] = React.useState(false);
|
1674
1682
|
function toggle() {
|
1675
1683
|
setOpen(!open);
|
1676
1684
|
}
|
1677
|
-
const
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1685
|
+
const getPositionClass = (pos) => {
|
1686
|
+
const validPositions = [
|
1687
|
+
"bottom-left",
|
1688
|
+
"bottom-right",
|
1689
|
+
"top-left",
|
1690
|
+
"top-right",
|
1691
|
+
"left",
|
1692
|
+
"right",
|
1693
|
+
"top",
|
1694
|
+
"bottom"
|
1695
|
+
];
|
1696
|
+
return validPositions.includes(pos) ? `position-${pos}` : "position-bottom-left";
|
1686
1697
|
};
|
1687
|
-
|
1698
|
+
const menuClasses = [
|
1699
|
+
getPositionClass(position),
|
1700
|
+
menuSize === "compact" ? "menu-compact" : ""
|
1701
|
+
].filter(Boolean).join(" ");
|
1702
|
+
return /* @__PURE__ */ React.createElement(MenuContext.Provider, { value: [open, setOpen, menuSize] }, /* @__PURE__ */ React.createElement("div", { className: "menu-icon" }, /* @__PURE__ */ React.createElement(Icon, { icon, size, clickable: true, action: toggle }), open ? /* @__PURE__ */ React.createElement("menu", { className: menuClasses }, children) : null, open ? /* @__PURE__ */ React.createElement("div", { className: "overlay", onClick: toggle }) : null));
|
1688
1703
|
};
|
1689
1704
|
const MenuItem = (props) => {
|
1690
|
-
const { id, icon, label, meta, disabled = false, size
|
1691
|
-
const
|
1705
|
+
const { id, icon, label, meta, disabled = false, size, onSelect: onSelect2 } = props;
|
1706
|
+
const context = React.useContext(MenuContext);
|
1707
|
+
const [open, setOpen, menuSize] = Array.isArray(context) ? context : [context, null, "normal"];
|
1708
|
+
const iconSize = size || (menuSize === "compact" ? "small" : "normal");
|
1692
1709
|
function select() {
|
1693
1710
|
if (!disabled) {
|
1694
1711
|
if (onSelect2) onSelect2();
|
@@ -1697,7 +1714,7 @@
|
|
1697
1714
|
}
|
1698
1715
|
const style = disabled ? "disabled" : "";
|
1699
1716
|
const labelTxt = label ? /* @__PURE__ */ React.createElement(Text, { format: TEXTFORMATS.STRING }, label) : null;
|
1700
|
-
return /* @__PURE__ */ React.createElement("li", { className: `menu-item ${style}`, onClick: select }, icon ? /* @__PURE__ */ React.createElement(Icon, { icon, size }) : null, /* @__PURE__ */ React.createElement("label", null, labelTxt), meta ? /* @__PURE__ */ React.createElement("div", { className: "meta" }, meta) : null);
|
1717
|
+
return /* @__PURE__ */ React.createElement("li", { className: `menu-item ${style}`, onClick: select }, icon ? /* @__PURE__ */ React.createElement(Icon, { icon, size: iconSize }) : null, /* @__PURE__ */ React.createElement("label", null, labelTxt), meta ? /* @__PURE__ */ React.createElement("div", { className: "meta" }, meta) : null);
|
1701
1718
|
};
|
1702
1719
|
const MenuSeparator = (props) => {
|
1703
1720
|
return /* @__PURE__ */ React.createElement("li", { className: "menu-separator" });
|
@@ -32080,6 +32097,52 @@ const rows = [
|
|
32080
32097
|
});
|
32081
32098
|
this.notifyListeners();
|
32082
32099
|
}
|
32100
|
+
/**
|
32101
|
+
* Arrange windows in columns
|
32102
|
+
*/
|
32103
|
+
arrangeWindowsInColumns() {
|
32104
|
+
const visibleWindows = this.getVisibleWindows().filter((w) => !w.maximized);
|
32105
|
+
if (visibleWindows.length === 0) return;
|
32106
|
+
const cols = visibleWindows.length;
|
32107
|
+
const windowWidth = Math.floor(this.desktopSize.width / cols);
|
32108
|
+
const windowHeight = this.desktopSize.height;
|
32109
|
+
const padding = 5;
|
32110
|
+
visibleWindows.forEach((window2, index) => {
|
32111
|
+
window2.position = {
|
32112
|
+
x: index * windowWidth + padding,
|
32113
|
+
y: padding
|
32114
|
+
};
|
32115
|
+
window2.size = {
|
32116
|
+
width: windowWidth - padding * 2,
|
32117
|
+
height: windowHeight - padding * 2
|
32118
|
+
};
|
32119
|
+
window2.maximized = false;
|
32120
|
+
});
|
32121
|
+
this.notifyListeners();
|
32122
|
+
}
|
32123
|
+
/**
|
32124
|
+
* Arrange windows in rows
|
32125
|
+
*/
|
32126
|
+
arrangeWindowsInRows() {
|
32127
|
+
const visibleWindows = this.getVisibleWindows().filter((w) => !w.maximized);
|
32128
|
+
if (visibleWindows.length === 0) return;
|
32129
|
+
const rows = visibleWindows.length;
|
32130
|
+
const windowWidth = this.desktopSize.width;
|
32131
|
+
const windowHeight = Math.floor(this.desktopSize.height / rows);
|
32132
|
+
const padding = 5;
|
32133
|
+
visibleWindows.forEach((window2, index) => {
|
32134
|
+
window2.position = {
|
32135
|
+
x: padding,
|
32136
|
+
y: index * windowHeight + padding
|
32137
|
+
};
|
32138
|
+
window2.size = {
|
32139
|
+
width: windowWidth - padding * 2,
|
32140
|
+
height: windowHeight - padding * 2
|
32141
|
+
};
|
32142
|
+
window2.maximized = false;
|
32143
|
+
});
|
32144
|
+
this.notifyListeners();
|
32145
|
+
}
|
32083
32146
|
/**
|
32084
32147
|
* Get statistics
|
32085
32148
|
*/
|
@@ -32156,6 +32219,8 @@ const rows = [
|
|
32156
32219
|
// Layout functions
|
32157
32220
|
cascadeWindows: () => windowManagerRef.current.cascadeWindows(),
|
32158
32221
|
tileWindows: () => windowManagerRef.current.tileWindows(),
|
32222
|
+
arrangeWindowsInColumns: () => windowManagerRef.current.arrangeWindowsInColumns(),
|
32223
|
+
arrangeWindowsInRows: () => windowManagerRef.current.arrangeWindowsInRows(),
|
32159
32224
|
centerWindow: (id) => windowManagerRef.current.centerWindow(id),
|
32160
32225
|
centerAllWindows: () => windowManagerRef.current.centerAllWindows(),
|
32161
32226
|
// Utility functions
|
@@ -32756,8 +32821,7 @@ const rows = [
|
|
32756
32821
|
))
|
32757
32822
|
)));
|
32758
32823
|
};
|
32759
|
-
const
|
32760
|
-
console.log("ApplicationMenu render - isOpen:", isOpen, "onClose:", onClose);
|
32824
|
+
const LaunchPad = ({ isOpen, onClose }) => {
|
32761
32825
|
const appManager = useAppManager();
|
32762
32826
|
const [searchTerm, setSearchTerm] = React.useState("");
|
32763
32827
|
const [selectedCategory, setSelectedCategory] = React.useState("all");
|
@@ -32826,10 +32890,10 @@ const rows = [
|
|
32826
32890
|
setSearchTerm("");
|
32827
32891
|
};
|
32828
32892
|
if (!isOpen) return null;
|
32829
|
-
return /* @__PURE__ */ React.createElement("div", { className:
|
32893
|
+
return /* @__PURE__ */ React.createElement("div", { className: `launchpad ${isCondensed ? "launchpad--condensed" : ""}` }, /* @__PURE__ */ React.createElement("div", { className: "launchpad__header" }, /* @__PURE__ */ React.createElement("div", { className: "launchpad__header-controls" }, /* @__PURE__ */ React.createElement(
|
32830
32894
|
"button",
|
32831
32895
|
{
|
32832
|
-
className: `
|
32896
|
+
className: `launchpad__view-toggle ${isCondensed ? "active" : ""}`,
|
32833
32897
|
onClick: () => setIsCondensed(!isCondensed),
|
32834
32898
|
title: isCondensed ? "Normal view" : "Condensed view"
|
32835
32899
|
},
|
@@ -32837,7 +32901,7 @@ const rows = [
|
|
32837
32901
|
), /* @__PURE__ */ React.createElement(
|
32838
32902
|
"button",
|
32839
32903
|
{
|
32840
|
-
className: `
|
32904
|
+
className: `launchpad__view-toggle ${viewMode === "grid" ? "active" : ""}`,
|
32841
32905
|
onClick: () => setViewMode("grid"),
|
32842
32906
|
title: "Grid view"
|
32843
32907
|
},
|
@@ -32845,7 +32909,7 @@ const rows = [
|
|
32845
32909
|
), /* @__PURE__ */ React.createElement(
|
32846
32910
|
"button",
|
32847
32911
|
{
|
32848
|
-
className: `
|
32912
|
+
className: `launchpad__view-toggle ${viewMode === "list" ? "active" : ""}`,
|
32849
32913
|
onClick: () => setViewMode("list"),
|
32850
32914
|
title: "List view"
|
32851
32915
|
},
|
@@ -32853,12 +32917,12 @@ const rows = [
|
|
32853
32917
|
), /* @__PURE__ */ React.createElement(
|
32854
32918
|
"button",
|
32855
32919
|
{
|
32856
|
-
className: "
|
32920
|
+
className: "launchpad__close",
|
32857
32921
|
onClick: onClose,
|
32858
32922
|
title: "Close menu"
|
32859
32923
|
},
|
32860
32924
|
"×"
|
32861
|
-
))), /* @__PURE__ */ React.createElement("div", { className: "
|
32925
|
+
))), /* @__PURE__ */ React.createElement("div", { className: "launchpad__search" }, /* @__PURE__ */ React.createElement(
|
32862
32926
|
"input",
|
32863
32927
|
{
|
32864
32928
|
ref: searchInputRef,
|
@@ -32866,12 +32930,12 @@ const rows = [
|
|
32866
32930
|
placeholder: "Search applications...",
|
32867
32931
|
value: searchTerm,
|
32868
32932
|
onChange: (e) => setSearchTerm(e.target.value),
|
32869
|
-
className: "
|
32933
|
+
className: "launchpad__search-input"
|
32870
32934
|
}
|
32871
|
-
)), /* @__PURE__ */ React.createElement("div", { className: "
|
32935
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "launchpad__main" }, /* @__PURE__ */ React.createElement("div", { className: "launchpad__sidebar" }, /* @__PURE__ */ React.createElement("div", { className: "launchpad__categories" }, /* @__PURE__ */ React.createElement(
|
32872
32936
|
"button",
|
32873
32937
|
{
|
32874
|
-
className: `
|
32938
|
+
className: `launchpad__category ${selectedCategory === "all" ? "active" : ""}`,
|
32875
32939
|
onClick: () => handleCategorySelect("all"),
|
32876
32940
|
title: "All Apps"
|
32877
32941
|
},
|
@@ -32881,33 +32945,33 @@ const rows = [
|
|
32881
32945
|
"button",
|
32882
32946
|
{
|
32883
32947
|
key: category.id,
|
32884
|
-
className: `
|
32948
|
+
className: `launchpad__category ${selectedCategory === category.id ? "active" : ""}`,
|
32885
32949
|
onClick: () => handleCategorySelect(category.id),
|
32886
32950
|
title: category.name
|
32887
32951
|
},
|
32888
32952
|
/* @__PURE__ */ React.createElement("span", { className: "category-icon" }, category.icon),
|
32889
32953
|
/* @__PURE__ */ React.createElement("span", { className: "category-name" }, category.name)
|
32890
|
-
)))), /* @__PURE__ */ React.createElement("div", { className: "
|
32954
|
+
)))), /* @__PURE__ */ React.createElement("div", { className: "launchpad__content" }, searchTerm && /* @__PURE__ */ React.createElement("div", { className: "launchpad__search-results" }, /* @__PURE__ */ React.createElement("h3", null, "Search Results (", filteredApps.length, ")"), /* @__PURE__ */ React.createElement("div", { className: `launchpad__apps-${viewMode}` }, filteredApps.map((app) => /* @__PURE__ */ React.createElement(
|
32891
32955
|
"div",
|
32892
32956
|
{
|
32893
32957
|
key: app.id,
|
32894
|
-
className: `
|
32958
|
+
className: `launchpad__app--${viewMode}`,
|
32895
32959
|
onClick: () => handleLaunchApp(app),
|
32896
32960
|
title: app.description
|
32897
32961
|
},
|
32898
32962
|
/* @__PURE__ */ React.createElement("div", { className: "app-icon" }, app.icon),
|
32899
32963
|
viewMode === "list" ? /* @__PURE__ */ React.createElement("div", { className: "app-info" }, /* @__PURE__ */ React.createElement("div", { className: "app-name" }, app.name), /* @__PURE__ */ React.createElement("div", { className: "app-description" }, app.description)) : /* @__PURE__ */ React.createElement("div", { className: "app-name" }, app.name)
|
32900
|
-
)))), !searchTerm && /* @__PURE__ */ React.createElement("div", { className: "
|
32964
|
+
)))), !searchTerm && /* @__PURE__ */ React.createElement("div", { className: "launchpad__categories-content" }, Object.entries(groupedApps).map(([categoryName, categoryApps]) => /* @__PURE__ */ React.createElement("div", { key: categoryName, className: "launchpad__category-section" }, /* @__PURE__ */ React.createElement("h3", { className: "category-title" }, categoryName), /* @__PURE__ */ React.createElement("div", { className: `launchpad__apps-${viewMode}` }, categoryApps.map((app) => /* @__PURE__ */ React.createElement(
|
32901
32965
|
"div",
|
32902
32966
|
{
|
32903
32967
|
key: app.id,
|
32904
|
-
className: `
|
32968
|
+
className: `launchpad__app--${viewMode}`,
|
32905
32969
|
onClick: () => handleLaunchApp(app),
|
32906
32970
|
title: app.description
|
32907
32971
|
},
|
32908
32972
|
/* @__PURE__ */ React.createElement("div", { className: "app-icon" }, app.icon),
|
32909
32973
|
viewMode === "list" ? /* @__PURE__ */ React.createElement("div", { className: "app-info" }, /* @__PURE__ */ React.createElement("div", { className: "app-name" }, app.name), /* @__PURE__ */ React.createElement("div", { className: "app-description" }, app.description)) : /* @__PURE__ */ React.createElement("div", { className: "app-name" }, app.name)
|
32910
|
-
)))))), filteredApps.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "
|
32974
|
+
)))))), filteredApps.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "launchpad__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.")))));
|
32911
32975
|
};
|
32912
32976
|
class AppManager {
|
32913
32977
|
constructor() {
|
@@ -33188,48 +33252,221 @@ const rows = [
|
|
33188
33252
|
]
|
33189
33253
|
};
|
33190
33254
|
const defaultAppManager = new AppManager();
|
33191
|
-
const
|
33192
|
-
const
|
33193
|
-
const context = React.useContext(
|
33255
|
+
const DesktopContext = React.createContext();
|
33256
|
+
const useLaunchPad = () => {
|
33257
|
+
const context = React.useContext(DesktopContext);
|
33194
33258
|
if (!context) {
|
33195
|
-
throw new Error("
|
33259
|
+
throw new Error("useLaunchPad must be used within DesktopProvider");
|
33196
33260
|
}
|
33197
|
-
return context.
|
33261
|
+
return context.launchPad;
|
33198
33262
|
};
|
33199
33263
|
const useAppManager = () => {
|
33200
|
-
const context = React.useContext(
|
33264
|
+
const context = React.useContext(DesktopContext);
|
33201
33265
|
if (!context) {
|
33202
|
-
throw new Error("useAppManager must be used within
|
33266
|
+
throw new Error("useAppManager must be used within DesktopProvider");
|
33203
33267
|
}
|
33204
33268
|
return context.appManager;
|
33205
33269
|
};
|
33206
|
-
const
|
33270
|
+
const useDesktopOverlays = () => {
|
33271
|
+
const context = React.useContext(DesktopContext);
|
33272
|
+
if (!context) {
|
33273
|
+
throw new Error("useDesktopOverlays must be used within DesktopProvider");
|
33274
|
+
}
|
33275
|
+
return context.overlays;
|
33276
|
+
};
|
33277
|
+
const useDesktopTheme = () => {
|
33278
|
+
const context = React.useContext(DesktopContext);
|
33279
|
+
if (!context) {
|
33280
|
+
throw new Error("useDesktopTheme must be used within DesktopProvider");
|
33281
|
+
}
|
33282
|
+
return context.theme;
|
33283
|
+
};
|
33284
|
+
const DesktopProvider = ({
|
33207
33285
|
children,
|
33208
|
-
desktopConfig = defaultDesktopConfig
|
33286
|
+
desktopConfig = defaultDesktopConfig,
|
33287
|
+
initialTheme = "windows"
|
33209
33288
|
}) => {
|
33210
33289
|
const appManager = new AppManager();
|
33211
|
-
const [
|
33290
|
+
const [isLaunchPadOpen, setIsLaunchPadOpen] = React.useState(false);
|
33291
|
+
const [currentTheme, setCurrentTheme] = React.useState(initialTheme);
|
33292
|
+
const [overlays, setOverlays] = React.useState([]);
|
33293
|
+
const overlayIdCounter = React.useRef(0);
|
33212
33294
|
React.useEffect(() => {
|
33213
33295
|
if (appManager.getAllApps().length === 0 && desktopConfig) {
|
33214
33296
|
AppLoader.load(appManager, desktopConfig);
|
33215
33297
|
}
|
33216
33298
|
}, [appManager, desktopConfig]);
|
33299
|
+
const showOverlay = (config) => {
|
33300
|
+
const id = `overlay-${overlayIdCounter.current++}`;
|
33301
|
+
const overlay = {
|
33302
|
+
id,
|
33303
|
+
content: config.content,
|
33304
|
+
onClose: config.onClose || (() => hideOverlay(id)),
|
33305
|
+
backdrop: config.backdrop !== false,
|
33306
|
+
backdropBlur: config.backdropBlur !== false,
|
33307
|
+
closeOnBackdrop: config.closeOnBackdrop !== false,
|
33308
|
+
closeOnEscape: config.closeOnEscape !== false,
|
33309
|
+
zIndex: config.zIndex || 9500,
|
33310
|
+
animation: config.animation || "fade",
|
33311
|
+
animationDuration: config.animationDuration || 300,
|
33312
|
+
position: config.position || "center",
|
33313
|
+
customPosition: config.customPosition,
|
33314
|
+
size: config.size || "auto",
|
33315
|
+
customSize: config.customSize,
|
33316
|
+
padding: config.padding,
|
33317
|
+
margin: config.margin,
|
33318
|
+
isClosing: false
|
33319
|
+
};
|
33320
|
+
setOverlays((prev) => [...prev, overlay]);
|
33321
|
+
return id;
|
33322
|
+
};
|
33323
|
+
const hideOverlay = (id, animation) => {
|
33324
|
+
setOverlays((prev) => prev.map(
|
33325
|
+
(o) => o.id === id ? { ...o, isClosing: true, exitAnimation: animation } : o
|
33326
|
+
));
|
33327
|
+
const overlay = overlays.find((o) => o.id === id);
|
33328
|
+
const duration = overlay?.animationDuration || 300;
|
33329
|
+
setTimeout(() => {
|
33330
|
+
setOverlays((prev) => prev.filter((o) => o.id !== id));
|
33331
|
+
}, duration);
|
33332
|
+
};
|
33333
|
+
const hideAllOverlays = () => {
|
33334
|
+
setOverlays([]);
|
33335
|
+
};
|
33336
|
+
const updateOverlay = (id, updates) => {
|
33337
|
+
setOverlays((prev) => prev.map(
|
33338
|
+
(o) => o.id === id ? { ...o, ...updates } : o
|
33339
|
+
));
|
33340
|
+
};
|
33217
33341
|
const value = {
|
33218
|
-
//
|
33219
|
-
|
33220
|
-
isOpen:
|
33221
|
-
open: () =>
|
33222
|
-
close: () =>
|
33223
|
-
toggle: () =>
|
33342
|
+
// LaunchPad state
|
33343
|
+
launchPad: {
|
33344
|
+
isOpen: isLaunchPadOpen,
|
33345
|
+
open: () => setIsLaunchPadOpen(true),
|
33346
|
+
close: () => setIsLaunchPadOpen(false),
|
33347
|
+
toggle: () => setIsLaunchPadOpen(!isLaunchPadOpen)
|
33224
33348
|
},
|
33225
33349
|
// App Manager instance
|
33226
|
-
appManager
|
33350
|
+
appManager,
|
33351
|
+
// Desktop Overlays API
|
33352
|
+
overlays: {
|
33353
|
+
items: overlays,
|
33354
|
+
show: showOverlay,
|
33355
|
+
hide: hideOverlay,
|
33356
|
+
hideAll: hideAllOverlays,
|
33357
|
+
update: updateOverlay
|
33358
|
+
},
|
33359
|
+
// Desktop Theme API
|
33360
|
+
theme: {
|
33361
|
+
current: currentTheme,
|
33362
|
+
set: setCurrentTheme,
|
33363
|
+
available: ["windows", "macos", "gnome", "windowsxp", "windows98", "nextstep", "macintosh", "msx"]
|
33364
|
+
}
|
33365
|
+
};
|
33366
|
+
return /* @__PURE__ */ React.createElement(DesktopContext.Provider, { value }, children);
|
33367
|
+
};
|
33368
|
+
const DesktopOverlay = ({
|
33369
|
+
id,
|
33370
|
+
content,
|
33371
|
+
zIndex,
|
33372
|
+
onClose,
|
33373
|
+
backdrop,
|
33374
|
+
backdropBlur,
|
33375
|
+
closeOnBackdrop,
|
33376
|
+
closeOnEscape,
|
33377
|
+
animation,
|
33378
|
+
animationDuration,
|
33379
|
+
position,
|
33380
|
+
customPosition,
|
33381
|
+
size,
|
33382
|
+
customSize,
|
33383
|
+
padding,
|
33384
|
+
margin,
|
33385
|
+
isClosing,
|
33386
|
+
exitAnimation
|
33387
|
+
}) => {
|
33388
|
+
const { hide } = useDesktopOverlays();
|
33389
|
+
const handleBackdropClick = () => {
|
33390
|
+
if (closeOnBackdrop && onClose) {
|
33391
|
+
onClose();
|
33392
|
+
}
|
33227
33393
|
};
|
33228
|
-
|
33394
|
+
React.useEffect(() => {
|
33395
|
+
if (!closeOnEscape) return;
|
33396
|
+
const handleKeyDown = (e) => {
|
33397
|
+
if (e.key === "Escape") {
|
33398
|
+
onClose();
|
33399
|
+
}
|
33400
|
+
};
|
33401
|
+
document.addEventListener("keydown", handleKeyDown);
|
33402
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
33403
|
+
}, [closeOnEscape, onClose]);
|
33404
|
+
const overlayClasses = [
|
33405
|
+
"desktop-overlay",
|
33406
|
+
backdrop ? "desktop-overlay--backdrop" : "",
|
33407
|
+
backdropBlur ? "desktop-overlay--blur" : "",
|
33408
|
+
`desktop-overlay--position-${position}`,
|
33409
|
+
`desktop-overlay--size-${size}`,
|
33410
|
+
isClosing ? `desktop-overlay--exit-${exitAnimation || animation}` : `desktop-overlay--enter-${animation}`
|
33411
|
+
].filter(Boolean).join(" ");
|
33412
|
+
const overlayStyle = {
|
33413
|
+
zIndex,
|
33414
|
+
animationDuration: `${animationDuration}ms`,
|
33415
|
+
...customPosition
|
33416
|
+
};
|
33417
|
+
const contentStyle = {
|
33418
|
+
padding,
|
33419
|
+
margin,
|
33420
|
+
...customSize
|
33421
|
+
};
|
33422
|
+
return /* @__PURE__ */ React.createElement(
|
33423
|
+
"div",
|
33424
|
+
{
|
33425
|
+
className: overlayClasses,
|
33426
|
+
style: overlayStyle,
|
33427
|
+
onClick: handleBackdropClick
|
33428
|
+
},
|
33429
|
+
/* @__PURE__ */ React.createElement(
|
33430
|
+
"div",
|
33431
|
+
{
|
33432
|
+
className: "desktop-overlay__content",
|
33433
|
+
style: contentStyle,
|
33434
|
+
onClick: (e) => e.stopPropagation()
|
33435
|
+
},
|
33436
|
+
content
|
33437
|
+
)
|
33438
|
+
);
|
33439
|
+
};
|
33440
|
+
const DesktopOverlayLayer = () => {
|
33441
|
+
const { items } = useDesktopOverlays();
|
33442
|
+
const { isOpen, close } = useLaunchPad();
|
33443
|
+
return /* @__PURE__ */ React.createElement("div", { className: "desktop-overlay-layer" }, isOpen && /* @__PURE__ */ React.createElement(
|
33444
|
+
"div",
|
33445
|
+
{
|
33446
|
+
className: "desktop-overlay desktop-overlay--backdrop desktop-overlay--blur desktop-overlay--launchpad desktop-overlay--enter-fade",
|
33447
|
+
style: { zIndex: 9e3 },
|
33448
|
+
onClick: close
|
33449
|
+
},
|
33450
|
+
/* @__PURE__ */ React.createElement(
|
33451
|
+
"div",
|
33452
|
+
{
|
33453
|
+
className: "desktop-overlay__content desktop-overlay__content--launchpad",
|
33454
|
+
onClick: (e) => e.stopPropagation()
|
33455
|
+
},
|
33456
|
+
/* @__PURE__ */ React.createElement(LaunchPad, { isOpen, onClose: close })
|
33457
|
+
)
|
33458
|
+
), items.map((overlay) => /* @__PURE__ */ React.createElement(
|
33459
|
+
DesktopOverlay,
|
33460
|
+
{
|
33461
|
+
key: overlay.id,
|
33462
|
+
...overlay
|
33463
|
+
}
|
33464
|
+
)));
|
33229
33465
|
};
|
33230
|
-
const DesktopLayout = ({ children, className = "",
|
33466
|
+
const DesktopLayout = ({ children, className = "", workspaceRef, ...props }) => {
|
33231
33467
|
const desktopRef = React.useRef(null);
|
33232
33468
|
const { windowManager } = useWindows();
|
33469
|
+
const { current: theme } = useDesktopTheme();
|
33233
33470
|
React.useEffect(() => {
|
33234
33471
|
let currentSize = { width: 1200, height: 750 };
|
33235
33472
|
const measureWorkspace = () => {
|
@@ -33286,6 +33523,67 @@ const rows = [
|
|
33286
33523
|
window2.content
|
33287
33524
|
)));
|
33288
33525
|
};
|
33526
|
+
const ThemeMenu = () => {
|
33527
|
+
const { current: currentTheme, set: setTheme, available: availableThemes } = useDesktopTheme();
|
33528
|
+
const themeIcons = {
|
33529
|
+
"windows": "computer",
|
33530
|
+
"macos": "laptop_mac",
|
33531
|
+
"gnome": "terminal",
|
33532
|
+
"windowsxp": "desktop_windows",
|
33533
|
+
"windows98": "computer",
|
33534
|
+
"nextstep": "business_center",
|
33535
|
+
"macintosh": "desktop_mac",
|
33536
|
+
"msx": "videogame_asset"
|
33537
|
+
};
|
33538
|
+
const themeLabels = {
|
33539
|
+
"windows": "Windows 11",
|
33540
|
+
"macos": "macOS",
|
33541
|
+
"gnome": "GNOME",
|
33542
|
+
"windowsxp": "Windows XP",
|
33543
|
+
"windows98": "Windows 98",
|
33544
|
+
"nextstep": "NeXTSTEP",
|
33545
|
+
"macintosh": "Macintosh",
|
33546
|
+
"msx": "MSX"
|
33547
|
+
};
|
33548
|
+
const modernThemes = ["windows", "macos", "gnome"];
|
33549
|
+
const retroThemes = ["windowsxp", "windows98", "nextstep", "macintosh", "msx"];
|
33550
|
+
return /* @__PURE__ */ React.createElement(
|
33551
|
+
MenuIcon,
|
33552
|
+
{
|
33553
|
+
icon: "palette",
|
33554
|
+
size: "small",
|
33555
|
+
position: "top-right",
|
33556
|
+
menuSize: "compact"
|
33557
|
+
},
|
33558
|
+
modernThemes.map((theme) => /* @__PURE__ */ React.createElement(
|
33559
|
+
MenuItem,
|
33560
|
+
{
|
33561
|
+
key: theme,
|
33562
|
+
icon: themeIcons[theme] || "desktop_windows",
|
33563
|
+
label: themeLabels[theme] || theme,
|
33564
|
+
meta: currentTheme === theme ? "✓" : "",
|
33565
|
+
onSelect: () => {
|
33566
|
+
console.log("Theme changed to:", theme);
|
33567
|
+
setTheme(theme);
|
33568
|
+
}
|
33569
|
+
}
|
33570
|
+
)),
|
33571
|
+
/* @__PURE__ */ React.createElement(MenuSeparator, null),
|
33572
|
+
retroThemes.map((theme) => /* @__PURE__ */ React.createElement(
|
33573
|
+
MenuItem,
|
33574
|
+
{
|
33575
|
+
key: theme,
|
33576
|
+
icon: themeIcons[theme] || "desktop_windows",
|
33577
|
+
label: themeLabels[theme] || theme,
|
33578
|
+
meta: currentTheme === theme ? "✓" : "",
|
33579
|
+
onSelect: () => {
|
33580
|
+
console.log("Theme changed to:", theme);
|
33581
|
+
setTheme(theme);
|
33582
|
+
}
|
33583
|
+
}
|
33584
|
+
))
|
33585
|
+
);
|
33586
|
+
};
|
33289
33587
|
const DesktopTaskbar = () => {
|
33290
33588
|
console.log("DesktopTaskbar render");
|
33291
33589
|
const windowsContext = useWindows();
|
@@ -33300,10 +33598,12 @@ const rows = [
|
|
33300
33598
|
closeWindow,
|
33301
33599
|
cascadeWindows,
|
33302
33600
|
tileWindows,
|
33601
|
+
arrangeWindowsInColumns,
|
33602
|
+
arrangeWindowsInRows,
|
33303
33603
|
centerAllWindows,
|
33304
33604
|
clearAllWindows
|
33305
33605
|
} = windowsContext;
|
33306
|
-
const { isOpen, toggle } =
|
33606
|
+
const { isOpen, toggle } = useLaunchPad();
|
33307
33607
|
console.log("DesktopTaskbar - isOpen:", isOpen, "toggle:", toggle);
|
33308
33608
|
const handleWindowClick = (window2) => {
|
33309
33609
|
if (window2.minimized) {
|
@@ -33329,7 +33629,6 @@ const rows = [
|
|
33329
33629
|
};
|
33330
33630
|
return /* @__PURE__ */ React.createElement("div", { className: "desktop-taskbar", style: {
|
33331
33631
|
height: "50px",
|
33332
|
-
background: "rgba(0,0,0,0.8)",
|
33333
33632
|
display: "flex",
|
33334
33633
|
alignItems: "center",
|
33335
33634
|
padding: "0 16px",
|
@@ -33411,71 +33710,92 @@ Middle click: Close`
|
|
33411
33710
|
marginLeft: "auto",
|
33412
33711
|
marginRight: "8px"
|
33413
33712
|
} }, /* @__PURE__ */ React.createElement(
|
33414
|
-
|
33415
|
-
{
|
33416
|
-
clickable: true,
|
33417
|
-
size: "small",
|
33418
|
-
action: () => {
|
33419
|
-
console.log("Cascade windows clicked!");
|
33420
|
-
cascadeWindows();
|
33421
|
-
},
|
33422
|
-
icon: "view_stream",
|
33423
|
-
label: "Cascade"
|
33424
|
-
}
|
33425
|
-
), /* @__PURE__ */ React.createElement(
|
33426
|
-
Icon,
|
33427
|
-
{
|
33428
|
-
clickable: true,
|
33429
|
-
size: "small",
|
33430
|
-
action: () => {
|
33431
|
-
console.log("Tile windows clicked!");
|
33432
|
-
tileWindows();
|
33433
|
-
},
|
33434
|
-
icon: "view_module",
|
33435
|
-
label: "Tile"
|
33436
|
-
}
|
33437
|
-
), /* @__PURE__ */ React.createElement(
|
33438
|
-
Icon,
|
33439
|
-
{
|
33440
|
-
clickable: true,
|
33441
|
-
size: "small",
|
33442
|
-
action: () => {
|
33443
|
-
console.log("Center all windows clicked!");
|
33444
|
-
centerAllWindows();
|
33445
|
-
},
|
33446
|
-
icon: "center_focus_strong",
|
33447
|
-
label: "Center"
|
33448
|
-
}
|
33449
|
-
), /* @__PURE__ */ React.createElement(
|
33450
|
-
Icon,
|
33713
|
+
MenuIcon,
|
33451
33714
|
{
|
33452
|
-
|
33715
|
+
icon: "window",
|
33453
33716
|
size: "small",
|
33454
|
-
|
33455
|
-
|
33456
|
-
|
33457
|
-
|
33458
|
-
|
33459
|
-
|
33460
|
-
|
33461
|
-
|
33717
|
+
position: "top-right",
|
33718
|
+
menuSize: "compact"
|
33719
|
+
},
|
33720
|
+
/* @__PURE__ */ React.createElement(
|
33721
|
+
MenuItem,
|
33722
|
+
{
|
33723
|
+
icon: "view_stream",
|
33724
|
+
label: "Cascade",
|
33725
|
+
onSelect: () => {
|
33726
|
+
console.log("Cascade windows clicked!");
|
33727
|
+
cascadeWindows();
|
33728
|
+
}
|
33729
|
+
}
|
33730
|
+
),
|
33731
|
+
/* @__PURE__ */ React.createElement(
|
33732
|
+
MenuItem,
|
33733
|
+
{
|
33734
|
+
icon: "view_module",
|
33735
|
+
label: "Tile",
|
33736
|
+
onSelect: () => {
|
33737
|
+
console.log("Tile windows clicked!");
|
33738
|
+
tileWindows();
|
33739
|
+
}
|
33740
|
+
}
|
33741
|
+
),
|
33742
|
+
/* @__PURE__ */ React.createElement(MenuSeparator, null),
|
33743
|
+
/* @__PURE__ */ React.createElement(
|
33744
|
+
MenuItem,
|
33745
|
+
{
|
33746
|
+
icon: "view_week",
|
33747
|
+
label: "Columns",
|
33748
|
+
onSelect: () => {
|
33749
|
+
console.log("Arrange in columns clicked!");
|
33750
|
+
arrangeWindowsInColumns();
|
33751
|
+
}
|
33752
|
+
}
|
33753
|
+
),
|
33754
|
+
/* @__PURE__ */ React.createElement(
|
33755
|
+
MenuItem,
|
33756
|
+
{
|
33757
|
+
icon: "view_agenda",
|
33758
|
+
label: "Rows",
|
33759
|
+
onSelect: () => {
|
33760
|
+
console.log("Arrange in rows clicked!");
|
33761
|
+
arrangeWindowsInRows();
|
33762
|
+
}
|
33763
|
+
}
|
33764
|
+
),
|
33765
|
+
/* @__PURE__ */ React.createElement(MenuSeparator, null),
|
33766
|
+
/* @__PURE__ */ React.createElement(
|
33767
|
+
MenuItem,
|
33768
|
+
{
|
33769
|
+
icon: "center_focus_strong",
|
33770
|
+
label: "Center All",
|
33771
|
+
onSelect: () => {
|
33772
|
+
console.log("Center all windows clicked!");
|
33773
|
+
centerAllWindows();
|
33774
|
+
}
|
33775
|
+
}
|
33776
|
+
),
|
33777
|
+
/* @__PURE__ */ React.createElement(
|
33778
|
+
MenuItem,
|
33779
|
+
{
|
33780
|
+
icon: "clear_all",
|
33781
|
+
label: "Clear All",
|
33782
|
+
onSelect: () => {
|
33783
|
+
console.log("Clear all windows clicked!");
|
33784
|
+
clearAllWindows();
|
33785
|
+
}
|
33786
|
+
}
|
33787
|
+
)
|
33788
|
+
), /* @__PURE__ */ React.createElement(ThemeMenu, null)), /* @__PURE__ */ React.createElement("div", { style: {
|
33462
33789
|
color: "rgba(255,255,255,0.7)",
|
33463
33790
|
fontSize: "11px",
|
33464
33791
|
fontFamily: "monospace",
|
33465
33792
|
flexShrink: 0,
|
33466
33793
|
textAlign: "right"
|
33467
|
-
} }, desktopSize.width, "×", desktopSize.height));
|
33794
|
+
} }, Math.round(desktopSize.width), "×", Math.round(desktopSize.height)));
|
33468
33795
|
};
|
33469
33796
|
const DesktopInternal = ({ desktopSize, children, ...props }) => {
|
33470
|
-
const { isOpen, close } = useApplicationMenu();
|
33471
33797
|
const workspaceRef = React.useRef(null);
|
33472
|
-
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(
|
33473
|
-
ApplicationMenu,
|
33474
|
-
{
|
33475
|
-
isOpen,
|
33476
|
-
onClose: close
|
33477
|
-
}
|
33478
|
-
)), /* @__PURE__ */ React.createElement(DesktopTaskbar, null)));
|
33798
|
+
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(DesktopOverlayLayer, null)), /* @__PURE__ */ React.createElement(DesktopTaskbar, null)));
|
33479
33799
|
};
|
33480
33800
|
const Desktop = ({
|
33481
33801
|
desktopSize,
|
@@ -33484,7 +33804,7 @@ Middle click: Close`
|
|
33484
33804
|
...props
|
33485
33805
|
}) => {
|
33486
33806
|
return /* @__PURE__ */ React.createElement(
|
33487
|
-
|
33807
|
+
DesktopProvider,
|
33488
33808
|
{
|
33489
33809
|
desktopConfig
|
33490
33810
|
},
|
@@ -43267,8 +43587,6 @@ Middle click: Close`
|
|
43267
43587
|
exports2.ActionButton = ActionButton;
|
43268
43588
|
exports2.ActionsCell = ActionsCell;
|
43269
43589
|
exports2.AppManager = AppManager;
|
43270
|
-
exports2.AppProvider = AppProvider;
|
43271
|
-
exports2.ApplicationMenu = ApplicationMenu;
|
43272
43590
|
exports2.Avatar = Avatar;
|
43273
43591
|
exports2.Button = Button;
|
43274
43592
|
exports2.ButtonExamples = ButtonExamples;
|
@@ -43303,6 +43621,7 @@ Middle click: Close`
|
|
43303
43621
|
exports2.DateRange = DateRange;
|
43304
43622
|
exports2.DateRange2 = DateRange2;
|
43305
43623
|
exports2.Desktop = Desktop;
|
43624
|
+
exports2.DesktopProvider = DesktopProvider;
|
43306
43625
|
exports2.DesktopTaskbar = DesktopTaskbar;
|
43307
43626
|
exports2.Dialog = Dialog;
|
43308
43627
|
exports2.DropDown = DropDown;
|
@@ -43337,6 +43656,7 @@ Middle click: Close`
|
|
43337
43656
|
exports2.LOGIN_API = LOGIN_API;
|
43338
43657
|
exports2.LOGIN_CONTEXT = LOGIN_CONTEXT;
|
43339
43658
|
exports2.LOGIN_DICTIONARY = LOGIN_DICTIONARY;
|
43659
|
+
exports2.LaunchPad = LaunchPad;
|
43340
43660
|
exports2.LinearProgress = LinearProgress;
|
43341
43661
|
exports2.List = List;
|
43342
43662
|
exports2.ListEditor = ListEditor;
|
@@ -43431,9 +43751,11 @@ Middle click: Close`
|
|
43431
43751
|
exports2.isEmpty = isEmpty;
|
43432
43752
|
exports2.isFunction = isFunction;
|
43433
43753
|
exports2.useAppManager = useAppManager;
|
43434
|
-
exports2.useApplicationMenu = useApplicationMenu;
|
43435
43754
|
exports2.useCreateWindow = useCreateWindow;
|
43755
|
+
exports2.useDesktopOverlays = useDesktopOverlays;
|
43756
|
+
exports2.useDesktopTheme = useDesktopTheme;
|
43436
43757
|
exports2.useHashPage = useHashPage;
|
43758
|
+
exports2.useLaunchPad = useLaunchPad;
|
43437
43759
|
exports2.useWindow = useWindow;
|
43438
43760
|
exports2.useWindowContextMenus = useWindowContextMenus;
|
43439
43761
|
exports2.useWindowDialogs = useWindowDialogs;
|