ywana-core8 0.2.20 → 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 -110
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +433 -110
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +433 -110
- 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 -29
- 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,7 +32821,7 @@ const rows = [
|
|
32756
32821
|
))
|
32757
32822
|
)));
|
32758
32823
|
};
|
32759
|
-
const
|
32824
|
+
const LaunchPad = ({ isOpen, onClose }) => {
|
32760
32825
|
const appManager = useAppManager();
|
32761
32826
|
const [searchTerm, setSearchTerm] = React.useState("");
|
32762
32827
|
const [selectedCategory, setSelectedCategory] = React.useState("all");
|
@@ -32825,10 +32890,10 @@ const rows = [
|
|
32825
32890
|
setSearchTerm("");
|
32826
32891
|
};
|
32827
32892
|
if (!isOpen) return null;
|
32828
|
-
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(
|
32829
32894
|
"button",
|
32830
32895
|
{
|
32831
|
-
className: `
|
32896
|
+
className: `launchpad__view-toggle ${isCondensed ? "active" : ""}`,
|
32832
32897
|
onClick: () => setIsCondensed(!isCondensed),
|
32833
32898
|
title: isCondensed ? "Normal view" : "Condensed view"
|
32834
32899
|
},
|
@@ -32836,7 +32901,7 @@ const rows = [
|
|
32836
32901
|
), /* @__PURE__ */ React.createElement(
|
32837
32902
|
"button",
|
32838
32903
|
{
|
32839
|
-
className: `
|
32904
|
+
className: `launchpad__view-toggle ${viewMode === "grid" ? "active" : ""}`,
|
32840
32905
|
onClick: () => setViewMode("grid"),
|
32841
32906
|
title: "Grid view"
|
32842
32907
|
},
|
@@ -32844,7 +32909,7 @@ const rows = [
|
|
32844
32909
|
), /* @__PURE__ */ React.createElement(
|
32845
32910
|
"button",
|
32846
32911
|
{
|
32847
|
-
className: `
|
32912
|
+
className: `launchpad__view-toggle ${viewMode === "list" ? "active" : ""}`,
|
32848
32913
|
onClick: () => setViewMode("list"),
|
32849
32914
|
title: "List view"
|
32850
32915
|
},
|
@@ -32852,12 +32917,12 @@ const rows = [
|
|
32852
32917
|
), /* @__PURE__ */ React.createElement(
|
32853
32918
|
"button",
|
32854
32919
|
{
|
32855
|
-
className: "
|
32920
|
+
className: "launchpad__close",
|
32856
32921
|
onClick: onClose,
|
32857
32922
|
title: "Close menu"
|
32858
32923
|
},
|
32859
32924
|
"×"
|
32860
|
-
))), /* @__PURE__ */ React.createElement("div", { className: "
|
32925
|
+
))), /* @__PURE__ */ React.createElement("div", { className: "launchpad__search" }, /* @__PURE__ */ React.createElement(
|
32861
32926
|
"input",
|
32862
32927
|
{
|
32863
32928
|
ref: searchInputRef,
|
@@ -32865,12 +32930,12 @@ const rows = [
|
|
32865
32930
|
placeholder: "Search applications...",
|
32866
32931
|
value: searchTerm,
|
32867
32932
|
onChange: (e) => setSearchTerm(e.target.value),
|
32868
|
-
className: "
|
32933
|
+
className: "launchpad__search-input"
|
32869
32934
|
}
|
32870
|
-
)), /* @__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(
|
32871
32936
|
"button",
|
32872
32937
|
{
|
32873
|
-
className: `
|
32938
|
+
className: `launchpad__category ${selectedCategory === "all" ? "active" : ""}`,
|
32874
32939
|
onClick: () => handleCategorySelect("all"),
|
32875
32940
|
title: "All Apps"
|
32876
32941
|
},
|
@@ -32880,33 +32945,33 @@ const rows = [
|
|
32880
32945
|
"button",
|
32881
32946
|
{
|
32882
32947
|
key: category.id,
|
32883
|
-
className: `
|
32948
|
+
className: `launchpad__category ${selectedCategory === category.id ? "active" : ""}`,
|
32884
32949
|
onClick: () => handleCategorySelect(category.id),
|
32885
32950
|
title: category.name
|
32886
32951
|
},
|
32887
32952
|
/* @__PURE__ */ React.createElement("span", { className: "category-icon" }, category.icon),
|
32888
32953
|
/* @__PURE__ */ React.createElement("span", { className: "category-name" }, category.name)
|
32889
|
-
)))), /* @__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(
|
32890
32955
|
"div",
|
32891
32956
|
{
|
32892
32957
|
key: app.id,
|
32893
|
-
className: `
|
32958
|
+
className: `launchpad__app--${viewMode}`,
|
32894
32959
|
onClick: () => handleLaunchApp(app),
|
32895
32960
|
title: app.description
|
32896
32961
|
},
|
32897
32962
|
/* @__PURE__ */ React.createElement("div", { className: "app-icon" }, app.icon),
|
32898
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)
|
32899
|
-
)))), !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(
|
32900
32965
|
"div",
|
32901
32966
|
{
|
32902
32967
|
key: app.id,
|
32903
|
-
className: `
|
32968
|
+
className: `launchpad__app--${viewMode}`,
|
32904
32969
|
onClick: () => handleLaunchApp(app),
|
32905
32970
|
title: app.description
|
32906
32971
|
},
|
32907
32972
|
/* @__PURE__ */ React.createElement("div", { className: "app-icon" }, app.icon),
|
32908
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)
|
32909
|
-
)))))), 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.")))));
|
32910
32975
|
};
|
32911
32976
|
class AppManager {
|
32912
32977
|
constructor() {
|
@@ -33187,48 +33252,221 @@ const rows = [
|
|
33187
33252
|
]
|
33188
33253
|
};
|
33189
33254
|
const defaultAppManager = new AppManager();
|
33190
|
-
const
|
33191
|
-
const
|
33192
|
-
const context = React.useContext(
|
33255
|
+
const DesktopContext = React.createContext();
|
33256
|
+
const useLaunchPad = () => {
|
33257
|
+
const context = React.useContext(DesktopContext);
|
33193
33258
|
if (!context) {
|
33194
|
-
throw new Error("
|
33259
|
+
throw new Error("useLaunchPad must be used within DesktopProvider");
|
33195
33260
|
}
|
33196
|
-
return context.
|
33261
|
+
return context.launchPad;
|
33197
33262
|
};
|
33198
33263
|
const useAppManager = () => {
|
33199
|
-
const context = React.useContext(
|
33264
|
+
const context = React.useContext(DesktopContext);
|
33200
33265
|
if (!context) {
|
33201
|
-
throw new Error("useAppManager must be used within
|
33266
|
+
throw new Error("useAppManager must be used within DesktopProvider");
|
33202
33267
|
}
|
33203
33268
|
return context.appManager;
|
33204
33269
|
};
|
33205
|
-
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 = ({
|
33206
33285
|
children,
|
33207
|
-
desktopConfig = defaultDesktopConfig
|
33286
|
+
desktopConfig = defaultDesktopConfig,
|
33287
|
+
initialTheme = "windows"
|
33208
33288
|
}) => {
|
33209
33289
|
const appManager = new AppManager();
|
33210
|
-
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);
|
33211
33294
|
React.useEffect(() => {
|
33212
33295
|
if (appManager.getAllApps().length === 0 && desktopConfig) {
|
33213
33296
|
AppLoader.load(appManager, desktopConfig);
|
33214
33297
|
}
|
33215
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
|
+
};
|
33216
33341
|
const value = {
|
33217
|
-
//
|
33218
|
-
|
33219
|
-
isOpen:
|
33220
|
-
open: () =>
|
33221
|
-
close: () =>
|
33222
|
-
toggle: () =>
|
33342
|
+
// LaunchPad state
|
33343
|
+
launchPad: {
|
33344
|
+
isOpen: isLaunchPadOpen,
|
33345
|
+
open: () => setIsLaunchPadOpen(true),
|
33346
|
+
close: () => setIsLaunchPadOpen(false),
|
33347
|
+
toggle: () => setIsLaunchPadOpen(!isLaunchPadOpen)
|
33223
33348
|
},
|
33224
33349
|
// App Manager instance
|
33225
|
-
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
|
+
}
|
33226
33393
|
};
|
33227
|
-
|
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
|
+
)));
|
33228
33465
|
};
|
33229
|
-
const DesktopLayout = ({ children, className = "",
|
33466
|
+
const DesktopLayout = ({ children, className = "", workspaceRef, ...props }) => {
|
33230
33467
|
const desktopRef = React.useRef(null);
|
33231
33468
|
const { windowManager } = useWindows();
|
33469
|
+
const { current: theme } = useDesktopTheme();
|
33232
33470
|
React.useEffect(() => {
|
33233
33471
|
let currentSize = { width: 1200, height: 750 };
|
33234
33472
|
const measureWorkspace = () => {
|
@@ -33285,6 +33523,67 @@ const rows = [
|
|
33285
33523
|
window2.content
|
33286
33524
|
)));
|
33287
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
|
+
};
|
33288
33587
|
const DesktopTaskbar = () => {
|
33289
33588
|
console.log("DesktopTaskbar render");
|
33290
33589
|
const windowsContext = useWindows();
|
@@ -33299,10 +33598,12 @@ const rows = [
|
|
33299
33598
|
closeWindow,
|
33300
33599
|
cascadeWindows,
|
33301
33600
|
tileWindows,
|
33601
|
+
arrangeWindowsInColumns,
|
33602
|
+
arrangeWindowsInRows,
|
33302
33603
|
centerAllWindows,
|
33303
33604
|
clearAllWindows
|
33304
33605
|
} = windowsContext;
|
33305
|
-
const { isOpen, toggle } =
|
33606
|
+
const { isOpen, toggle } = useLaunchPad();
|
33306
33607
|
console.log("DesktopTaskbar - isOpen:", isOpen, "toggle:", toggle);
|
33307
33608
|
const handleWindowClick = (window2) => {
|
33308
33609
|
if (window2.minimized) {
|
@@ -33328,7 +33629,6 @@ const rows = [
|
|
33328
33629
|
};
|
33329
33630
|
return /* @__PURE__ */ React.createElement("div", { className: "desktop-taskbar", style: {
|
33330
33631
|
height: "50px",
|
33331
|
-
background: "rgba(0,0,0,0.8)",
|
33332
33632
|
display: "flex",
|
33333
33633
|
alignItems: "center",
|
33334
33634
|
padding: "0 16px",
|
@@ -33410,71 +33710,92 @@ Middle click: Close`
|
|
33410
33710
|
marginLeft: "auto",
|
33411
33711
|
marginRight: "8px"
|
33412
33712
|
} }, /* @__PURE__ */ React.createElement(
|
33413
|
-
|
33414
|
-
{
|
33415
|
-
clickable: true,
|
33416
|
-
size: "small",
|
33417
|
-
action: () => {
|
33418
|
-
console.log("Cascade windows clicked!");
|
33419
|
-
cascadeWindows();
|
33420
|
-
},
|
33421
|
-
icon: "view_stream",
|
33422
|
-
label: "Cascade"
|
33423
|
-
}
|
33424
|
-
), /* @__PURE__ */ React.createElement(
|
33425
|
-
Icon,
|
33426
|
-
{
|
33427
|
-
clickable: true,
|
33428
|
-
size: "small",
|
33429
|
-
action: () => {
|
33430
|
-
console.log("Tile windows clicked!");
|
33431
|
-
tileWindows();
|
33432
|
-
},
|
33433
|
-
icon: "view_module",
|
33434
|
-
label: "Tile"
|
33435
|
-
}
|
33436
|
-
), /* @__PURE__ */ React.createElement(
|
33437
|
-
Icon,
|
33438
|
-
{
|
33439
|
-
clickable: true,
|
33440
|
-
size: "small",
|
33441
|
-
action: () => {
|
33442
|
-
console.log("Center all windows clicked!");
|
33443
|
-
centerAllWindows();
|
33444
|
-
},
|
33445
|
-
icon: "center_focus_strong",
|
33446
|
-
label: "Center"
|
33447
|
-
}
|
33448
|
-
), /* @__PURE__ */ React.createElement(
|
33449
|
-
Icon,
|
33713
|
+
MenuIcon,
|
33450
33714
|
{
|
33451
|
-
|
33715
|
+
icon: "window",
|
33452
33716
|
size: "small",
|
33453
|
-
|
33454
|
-
|
33455
|
-
|
33456
|
-
|
33457
|
-
|
33458
|
-
|
33459
|
-
|
33460
|
-
|
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: {
|
33461
33789
|
color: "rgba(255,255,255,0.7)",
|
33462
33790
|
fontSize: "11px",
|
33463
33791
|
fontFamily: "monospace",
|
33464
33792
|
flexShrink: 0,
|
33465
33793
|
textAlign: "right"
|
33466
|
-
} }, desktopSize.width, "×", desktopSize.height));
|
33794
|
+
} }, Math.round(desktopSize.width), "×", Math.round(desktopSize.height)));
|
33467
33795
|
};
|
33468
33796
|
const DesktopInternal = ({ desktopSize, children, ...props }) => {
|
33469
|
-
const { isOpen, close } = useApplicationMenu();
|
33470
33797
|
const workspaceRef = React.useRef(null);
|
33471
|
-
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(
|
33472
|
-
ApplicationMenu,
|
33473
|
-
{
|
33474
|
-
isOpen,
|
33475
|
-
onClose: close
|
33476
|
-
}
|
33477
|
-
)), /* @__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)));
|
33478
33799
|
};
|
33479
33800
|
const Desktop = ({
|
33480
33801
|
desktopSize,
|
@@ -33483,7 +33804,7 @@ Middle click: Close`
|
|
33483
33804
|
...props
|
33484
33805
|
}) => {
|
33485
33806
|
return /* @__PURE__ */ React.createElement(
|
33486
|
-
|
33807
|
+
DesktopProvider,
|
33487
33808
|
{
|
33488
33809
|
desktopConfig
|
33489
33810
|
},
|
@@ -43266,8 +43587,6 @@ Middle click: Close`
|
|
43266
43587
|
exports2.ActionButton = ActionButton;
|
43267
43588
|
exports2.ActionsCell = ActionsCell;
|
43268
43589
|
exports2.AppManager = AppManager;
|
43269
|
-
exports2.AppProvider = AppProvider;
|
43270
|
-
exports2.ApplicationMenu = ApplicationMenu;
|
43271
43590
|
exports2.Avatar = Avatar;
|
43272
43591
|
exports2.Button = Button;
|
43273
43592
|
exports2.ButtonExamples = ButtonExamples;
|
@@ -43302,6 +43621,7 @@ Middle click: Close`
|
|
43302
43621
|
exports2.DateRange = DateRange;
|
43303
43622
|
exports2.DateRange2 = DateRange2;
|
43304
43623
|
exports2.Desktop = Desktop;
|
43624
|
+
exports2.DesktopProvider = DesktopProvider;
|
43305
43625
|
exports2.DesktopTaskbar = DesktopTaskbar;
|
43306
43626
|
exports2.Dialog = Dialog;
|
43307
43627
|
exports2.DropDown = DropDown;
|
@@ -43336,6 +43656,7 @@ Middle click: Close`
|
|
43336
43656
|
exports2.LOGIN_API = LOGIN_API;
|
43337
43657
|
exports2.LOGIN_CONTEXT = LOGIN_CONTEXT;
|
43338
43658
|
exports2.LOGIN_DICTIONARY = LOGIN_DICTIONARY;
|
43659
|
+
exports2.LaunchPad = LaunchPad;
|
43339
43660
|
exports2.LinearProgress = LinearProgress;
|
43340
43661
|
exports2.List = List;
|
43341
43662
|
exports2.ListEditor = ListEditor;
|
@@ -43430,9 +43751,11 @@ Middle click: Close`
|
|
43430
43751
|
exports2.isEmpty = isEmpty;
|
43431
43752
|
exports2.isFunction = isFunction;
|
43432
43753
|
exports2.useAppManager = useAppManager;
|
43433
|
-
exports2.useApplicationMenu = useApplicationMenu;
|
43434
43754
|
exports2.useCreateWindow = useCreateWindow;
|
43755
|
+
exports2.useDesktopOverlays = useDesktopOverlays;
|
43756
|
+
exports2.useDesktopTheme = useDesktopTheme;
|
43435
43757
|
exports2.useHashPage = useHashPage;
|
43758
|
+
exports2.useLaunchPad = useLaunchPad;
|
43436
43759
|
exports2.useWindow = useWindow;
|
43437
43760
|
exports2.useWindowContextMenus = useWindowContextMenus;
|
43438
43761
|
exports2.useWindowDialogs = useWindowDialogs;
|