@articles-media/articles-dev-box 1.0.34 → 1.0.36
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/README.md +1 -1
- package/dist/GameMenu-DrqaN2Qg.js +120 -0
- package/dist/GameMenu.js +1 -1
- package/dist/{SettingsModal-D6AkYDbw.js → SettingsModal-DkLtzl7B.js} +5 -20
- package/dist/SettingsModal.js +1 -1
- package/dist/articles-dev-box.css +3 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/GameMenu-BD1HSDJ-.js +0 -84
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ For newly developed components I sometimes find myself trying to remember what r
|
|
|
79
79
|
|
|
80
80
|
- typicalZustandStoreExcludes - Catching Game and School Run
|
|
81
81
|
- SessionButton - Catching Game and School Run
|
|
82
|
-
- GameMenu - School Run
|
|
82
|
+
- GameMenu - Catching Game and School Run use Static Panel for sidebarStyle and Corner Button for menuBarStyle. Ice Slide uses Floating Panel for sidebarStyle and Bar for menuBarStyle.
|
|
83
83
|
|
|
84
84
|
# Roadmap
|
|
85
85
|
⏹️ Remove Bootstrap reliance?
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { n as __toESM, t as require_classnames } from "./classnames-No-mjhw1.js";
|
|
2
|
+
import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Games/GameMenu/MobileMenu.jsx
|
|
6
|
+
var import_classnames = /* @__PURE__ */ __toESM(require_classnames(), 1);
|
|
7
|
+
function MobileMenu({ useStore, LeftPanelContent, menuBarConfig }) {
|
|
8
|
+
const showMenu = useStore((state) => state.showMenu);
|
|
9
|
+
const setShowMenu = useStore((state) => state.setShowMenu);
|
|
10
|
+
const MenuButton = () => /* @__PURE__ */ jsxs(ArticlesButton, {
|
|
11
|
+
small: true,
|
|
12
|
+
active: showMenu,
|
|
13
|
+
onClick: () => {
|
|
14
|
+
setShowMenu(!showMenu);
|
|
15
|
+
},
|
|
16
|
+
className: "d-flex",
|
|
17
|
+
children: [/* @__PURE__ */ jsx("i", { className: "fad fa-bars" }), /* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "text",
|
|
19
|
+
children: "Menu"
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
22
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: (0, import_classnames.default)(`menu-bar ${menuBarConfig.menuBarClassName || ""}`, {
|
|
24
|
+
"card card-articles p-1 justify-content-center": menuBarConfig.style == "Bar",
|
|
25
|
+
[menuBarConfig.style.replaceAll(" ", "_")]: menuBarConfig.style,
|
|
26
|
+
[menuBarConfig.menuBarButtonPosition]: menuBarConfig.menuBarButtonPosition
|
|
27
|
+
}),
|
|
28
|
+
style: {
|
|
29
|
+
...menuBarConfig.menuBarCssStyle,
|
|
30
|
+
...menuBarConfig.style == "Bar" && { borderRadius: "0px" }
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "flex-header align-items-center",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "Left d-flex align-items-center",
|
|
37
|
+
children: [(menuBarConfig.menuBarButtonPosition == "Left" || !menuBarConfig.menuBarButtonPosition) && /* @__PURE__ */ jsx(MenuButton, {}), menuBarConfig.leftSlotChildren && menuBarConfig.leftSlotChildren]
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", {
|
|
40
|
+
className: "Center d-flex align-items-center",
|
|
41
|
+
children: [menuBarConfig.menuBarButtonPosition == "Center" && /* @__PURE__ */ jsx(MenuButton, {}), menuBarConfig.centerSlotChildren && menuBarConfig.centerSlotChildren]
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", {
|
|
44
|
+
className: "Right d-flex align-items-center",
|
|
45
|
+
children: [menuBarConfig.menuBarButtonPosition == "Right" && /* @__PURE__ */ jsx(MenuButton, {}), menuBarConfig.rightSlotChildren && menuBarConfig.rightSlotChildren]
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: `mobile-menu ${showMenu && "show"}`,
|
|
51
|
+
onClick: () => setShowMenu(false),
|
|
52
|
+
style: {
|
|
53
|
+
...menuBarConfig.style == "Bar" && { bottom: "50px" },
|
|
54
|
+
...menuBarConfig.style == "Corner Button" && { bottom: "0px" }
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
57
|
+
style: {
|
|
58
|
+
maxWidth: "300px",
|
|
59
|
+
maxHeight: "calc(100vh - 100px)",
|
|
60
|
+
overflowY: "auto"
|
|
61
|
+
},
|
|
62
|
+
className: "mobile-menu-container",
|
|
63
|
+
onClick: (e) => e.stopPropagation(),
|
|
64
|
+
children: LeftPanelContent && /* @__PURE__ */ jsx(LeftPanelContent, {})
|
|
65
|
+
})
|
|
66
|
+
})] });
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/Games/GameMenu/GameMenu.jsx
|
|
70
|
+
/**
|
|
71
|
+
* @param {Object} props - The component props.
|
|
72
|
+
* @param {Function} props.useStore - The Zustand store hook used for state management.
|
|
73
|
+
* @param {React.ComponentType} props.LeftPanelContent - Component to render inside the sidebar and mobile-menu panel.
|
|
74
|
+
* @param {Object} props.sidebarConfig - Configuration for the sidebar appearance and behavior.
|
|
75
|
+
* @param {"Static Panel" | "Floating Panel"} props.sidebarConfig.style - Defines if the panel is static or floats over content.
|
|
76
|
+
* @param {string} [props.sidebarConfig.className] - Additional CSS class for the sidebar container.
|
|
77
|
+
* @param {Object} [props.sidebarConfig.cssStyle] - Inline styles to apply to the sidebar.
|
|
78
|
+
* @param {Object} props.menuBarConfig - Configuration for the navigation menu bar.
|
|
79
|
+
* @param {"Bar" | "Corner Button"} props.menuBarConfig.style - Visual style of the menu trigger (a full bar or a small corner button).
|
|
80
|
+
* @param {"left" | "right"} [props.menuBarConfig.menuBarButtonPosition] - Position of the menu button when using "Corner Button" style.
|
|
81
|
+
* @param {string} [props.menuBarConfig.menuBarClassName] - Additional CSS class for the menu bar.
|
|
82
|
+
* @param {Object} [props.menuBarConfig.menuBarCssStyle] - Inline styles to apply to the menu bar.
|
|
83
|
+
* @param {React.ComponentType} [props.menuBarConfig.leftSlotChildren] - Content to render in the left slot of the menu bar.
|
|
84
|
+
* @param {React.ComponentType} [props.menuBarConfig.centerSlotChildren] - Content to render in the center slot of the menu bar.
|
|
85
|
+
* @param {React.ComponentType} [props.menuBarConfig.rightSlotChildren] - Content to render in the right slot of the menu bar.
|
|
86
|
+
*/
|
|
87
|
+
function GameMenu(props) {
|
|
88
|
+
const { useStore, LeftPanelContent, sidebarConfig, menuBarConfig } = props;
|
|
89
|
+
const sidebar = useStore((state) => state.sidebar);
|
|
90
|
+
const setShowMenu = useStore((state) => state.setShowMenu);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (sidebar == true) setShowMenu(false);
|
|
93
|
+
}, [sidebar]);
|
|
94
|
+
const convertedSidebarStyle = (sidebarConfig?.style).replaceAll(" ", "_");
|
|
95
|
+
if (!useStore) {
|
|
96
|
+
console.error("GameMenu: useStore is required");
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MobileMenu, {
|
|
100
|
+
useStore,
|
|
101
|
+
LeftPanelContent,
|
|
102
|
+
menuBarConfig: { ...menuBarConfig }
|
|
103
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
104
|
+
className: `panel-left card rounded-0 ${convertedSidebarStyle} ${sidebarConfig?.className || ""}`,
|
|
105
|
+
style: {
|
|
106
|
+
...sidebarConfig?.cssStyle,
|
|
107
|
+
...convertedSidebarStyle == "Floating_Panel" && {
|
|
108
|
+
position: "absolute",
|
|
109
|
+
top: "0.5rem",
|
|
110
|
+
left: "0.5rem",
|
|
111
|
+
zIndex: 1,
|
|
112
|
+
height: "calc(100vh - 1rem)",
|
|
113
|
+
backgroundColor: "color-mix(in srgb, var(--bs-card-bg) 50%, transparent)"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
children: /* @__PURE__ */ jsx(LeftPanelContent, {})
|
|
117
|
+
})] });
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { GameMenu as t };
|
package/dist/GameMenu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as GameMenu } from "./GameMenu-
|
|
1
|
+
import { t as GameMenu } from "./GameMenu-DrqaN2Qg.js";
|
|
2
2
|
export { GameMenu as default };
|
|
@@ -232,7 +232,7 @@ function OtherTab({ useStore, config }) {
|
|
|
232
232
|
var package_default = {
|
|
233
233
|
name: "@articles-media/articles-dev-box",
|
|
234
234
|
description: "Shared code, functions, and components for different Articles Media projects.",
|
|
235
|
-
version: "1.0.
|
|
235
|
+
version: "1.0.36",
|
|
236
236
|
type: "module",
|
|
237
237
|
imports: { "#root/src/*": "./src/*" },
|
|
238
238
|
main: "./dist/index.js",
|
|
@@ -300,25 +300,10 @@ var package_default = {
|
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region src/components/Games/Settings/DebugTab.jsx
|
|
302
302
|
function DebugTab({ useStore, config }) {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
308
|
-
/* @__PURE__ */ jsxs("div", {
|
|
309
|
-
className: "mb-3",
|
|
310
|
-
children: ["dev-box version: ", package_default.version]
|
|
311
|
-
}),
|
|
312
|
-
/* @__PURE__ */ jsx("div", { children: "Future Thing" }),
|
|
313
|
-
/* @__PURE__ */ jsx("div", {
|
|
314
|
-
className: "mb-3",
|
|
315
|
-
children: [false, true].map((level, i) => /* @__PURE__ */ jsx(ArticlesButton, {
|
|
316
|
-
onClick: () => {},
|
|
317
|
-
children: "Placeholder"
|
|
318
|
-
}, i))
|
|
319
|
-
}),
|
|
320
|
-
config?.tabs?.Debug?.children
|
|
321
|
-
] });
|
|
303
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
304
|
+
className: "mb-3",
|
|
305
|
+
children: ["dev-box version: ", package_default.version]
|
|
306
|
+
}), config?.tabs?.Debug?.children && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("hr", {}), config?.tabs?.Debug?.children] })] });
|
|
322
307
|
}
|
|
323
308
|
//#endregion
|
|
324
309
|
//#region src/components/Games/Settings/SettingsModal.jsx
|
package/dist/SettingsModal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SettingsModal } from "./SettingsModal-
|
|
1
|
+
import { t as SettingsModal } from "./SettingsModal-DkLtzl7B.js";
|
|
2
2
|
export { SettingsModal as default };
|
|
@@ -283,13 +283,13 @@
|
|
|
283
283
|
.menu-bar.Corner_Button {
|
|
284
284
|
position: fixed;
|
|
285
285
|
bottom: 0;
|
|
286
|
+
width: 100%;
|
|
286
287
|
left: 0;
|
|
287
|
-
|
|
288
|
+
right: 0;
|
|
288
289
|
height: 50px;
|
|
289
290
|
z-index: 3;
|
|
290
291
|
}
|
|
291
292
|
.menu-bar.Corner_Button .btn {
|
|
292
|
-
position: absolute;
|
|
293
293
|
width: 100%;
|
|
294
294
|
height: 100%;
|
|
295
295
|
border-radius: 0;
|
|
@@ -334,6 +334,7 @@
|
|
|
334
334
|
.panel-right {
|
|
335
335
|
width: 300px;
|
|
336
336
|
height: calc(100vh - 0px);
|
|
337
|
+
overflow-y: auto;
|
|
337
338
|
flex-shrink: 0;
|
|
338
339
|
}
|
|
339
340
|
|
package/dist/index.js
CHANGED
|
@@ -8,11 +8,11 @@ import useUserFriends from "./useUserFriends.js";
|
|
|
8
8
|
import FriendsList from "./FriendsList.js";
|
|
9
9
|
import SessionButton from "./SessionButton.js";
|
|
10
10
|
import ArticlesAd from "./ArticlesAd.js";
|
|
11
|
-
import { t as GameMenu } from "./GameMenu-
|
|
11
|
+
import { t as GameMenu } from "./GameMenu-DrqaN2Qg.js";
|
|
12
12
|
import { t as GameScoreboard } from "./GameScoreboard-DVoXXDnM.js";
|
|
13
13
|
import GlobalHead from "./GlobalHead.js";
|
|
14
14
|
import GlobalBody_default from "./GlobalBody.js";
|
|
15
|
-
import { t as SettingsModal } from "./SettingsModal-
|
|
15
|
+
import { t as SettingsModal } from "./SettingsModal-DkLtzl7B.js";
|
|
16
16
|
import CreditsModal from "./CreditsModal.js";
|
|
17
17
|
import DarkModeHandler from "./DarkModeHandler.js";
|
|
18
18
|
import ToontownModeHandler from "./ToontownModeHandler.js";
|
package/package.json
CHANGED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { n as __toESM, t as require_classnames } from "./classnames-No-mjhw1.js";
|
|
2
|
-
import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
|
|
3
|
-
import { useEffect } from "react";
|
|
4
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/Games/GameMenu/MobileMenu.jsx
|
|
6
|
-
var import_classnames = /* @__PURE__ */ __toESM(require_classnames(), 1);
|
|
7
|
-
function MobileMenu({ useStore, LeftPanelContent, menuBarStyle }) {
|
|
8
|
-
const showMenu = useStore((state) => state.showMenu);
|
|
9
|
-
const setShowMenu = useStore((state) => state.setShowMenu);
|
|
10
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
11
|
-
className: (0, import_classnames.default)("menu-bar", {
|
|
12
|
-
"card card-articles p-1 justify-content-center": menuBarStyle == "Bar",
|
|
13
|
-
[menuBarStyle.replaceAll(" ", "_")]: menuBarStyle
|
|
14
|
-
}),
|
|
15
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
16
|
-
className: "flex-header align-items-center",
|
|
17
|
-
children: /* @__PURE__ */ jsxs(ArticlesButton, {
|
|
18
|
-
small: true,
|
|
19
|
-
active: showMenu,
|
|
20
|
-
onClick: () => {
|
|
21
|
-
setShowMenu(!showMenu);
|
|
22
|
-
},
|
|
23
|
-
className: "d-flex",
|
|
24
|
-
children: [/* @__PURE__ */ jsx("i", { className: "fad fa-bars" }), /* @__PURE__ */ jsx("span", {
|
|
25
|
-
className: "text",
|
|
26
|
-
children: "Menu"
|
|
27
|
-
})]
|
|
28
|
-
})
|
|
29
|
-
})
|
|
30
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
31
|
-
className: `mobile-menu ${showMenu && "show"}`,
|
|
32
|
-
onClick: () => setShowMenu(false),
|
|
33
|
-
style: {
|
|
34
|
-
...menuBarStyle == "Bar" && { bottom: "50px" },
|
|
35
|
-
...menuBarStyle == "Corner Button" && { bottom: "0px" }
|
|
36
|
-
},
|
|
37
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
38
|
-
style: { maxWidth: "300px" },
|
|
39
|
-
className: "mobile-menu-container",
|
|
40
|
-
onClick: (e) => e.stopPropagation(),
|
|
41
|
-
children: LeftPanelContent && /* @__PURE__ */ jsx(LeftPanelContent, {})
|
|
42
|
-
})
|
|
43
|
-
})] });
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/components/Games/GameMenu/GameMenu.jsx
|
|
47
|
-
/**
|
|
48
|
-
* @param {Object} props
|
|
49
|
-
* @param {Function} props.useStore
|
|
50
|
-
* @param {React.ComponentType} props.LeftPanelContent
|
|
51
|
-
* @param {"Bar" | "Corner Button"} props.menuBarStyle
|
|
52
|
-
* @param {"Static Panel" | "Floating Panel"} [props.sidebarStyle]
|
|
53
|
-
*/
|
|
54
|
-
function GameMenu(props) {
|
|
55
|
-
const { useStore, LeftPanelContent, menuBarStyle, sidebarStyle } = props;
|
|
56
|
-
const sidebar = useStore((state) => state.sidebar);
|
|
57
|
-
const setShowMenu = useStore((state) => state.setShowMenu);
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (sidebar == true) setShowMenu(false);
|
|
60
|
-
}, [sidebar]);
|
|
61
|
-
const convertedSidebarStyle = sidebarStyle.replaceAll(" ", "_");
|
|
62
|
-
if (!useStore) {
|
|
63
|
-
console.error("GameMenu: useStore is required");
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MobileMenu, {
|
|
67
|
-
useStore,
|
|
68
|
-
LeftPanelContent,
|
|
69
|
-
menuBarStyle
|
|
70
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
71
|
-
className: `panel-left card rounded-0 ${convertedSidebarStyle}`,
|
|
72
|
-
style: { ...convertedSidebarStyle == "Floating_Panel" && {
|
|
73
|
-
position: "absolute",
|
|
74
|
-
top: "0.5rem",
|
|
75
|
-
left: "0.5rem",
|
|
76
|
-
zIndex: 1,
|
|
77
|
-
height: "calc(100vh - 1rem)",
|
|
78
|
-
backgroundColor: "color-mix(in srgb, var(--bs-card-bg) 50%, transparent)"
|
|
79
|
-
} },
|
|
80
|
-
children: /* @__PURE__ */ jsx(LeftPanelContent, {})
|
|
81
|
-
})] });
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
export { GameMenu as t };
|