@articles-media/articles-dev-box 1.0.35 → 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.
@@ -20,12 +20,15 @@ function MobileMenu({ useStore, LeftPanelContent, menuBarConfig }) {
20
20
  })]
21
21
  });
22
22
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
23
- className: (0, import_classnames.default)("menu-bar", {
23
+ className: (0, import_classnames.default)(`menu-bar ${menuBarConfig.menuBarClassName || ""}`, {
24
24
  "card card-articles p-1 justify-content-center": menuBarConfig.style == "Bar",
25
25
  [menuBarConfig.style.replaceAll(" ", "_")]: menuBarConfig.style,
26
26
  [menuBarConfig.menuBarButtonPosition]: menuBarConfig.menuBarButtonPosition
27
27
  }),
28
- style: { ...menuBarConfig.style == "Bar" && { borderRadius: "0px" } },
28
+ style: {
29
+ ...menuBarConfig.menuBarCssStyle,
30
+ ...menuBarConfig.style == "Bar" && { borderRadius: "0px" }
31
+ },
29
32
  children: /* @__PURE__ */ jsxs("div", {
30
33
  className: "flex-header align-items-center",
31
34
  children: [
@@ -65,20 +68,30 @@ function MobileMenu({ useStore, LeftPanelContent, menuBarConfig }) {
65
68
  //#endregion
66
69
  //#region src/components/Games/GameMenu/GameMenu.jsx
67
70
  /**
68
- * @param {Object} props
69
- * @param {Function} props.useStore
70
- * @param {React.ComponentType} props.LeftPanelContent
71
- * @param {"Bar" | "Corner Button"} props.menuBarStyle
72
- * @param {"Static Panel" | "Floating Panel"} [props.sidebarStyle]
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.
73
86
  */
74
87
  function GameMenu(props) {
75
- const { useStore, LeftPanelContent, sidebarStyleConfig, sidebarStyle, menuBarConfig, menuBarStyle, menuBarButtonPosition } = props;
88
+ const { useStore, LeftPanelContent, sidebarConfig, menuBarConfig } = props;
76
89
  const sidebar = useStore((state) => state.sidebar);
77
90
  const setShowMenu = useStore((state) => state.setShowMenu);
78
91
  useEffect(() => {
79
92
  if (sidebar == true) setShowMenu(false);
80
93
  }, [sidebar]);
81
- const convertedSidebarStyle = sidebarStyle.replaceAll(" ", "_");
94
+ const convertedSidebarStyle = (sidebarConfig?.style).replaceAll(" ", "_");
82
95
  if (!useStore) {
83
96
  console.error("GameMenu: useStore is required");
84
97
  return null;
@@ -86,21 +99,20 @@ function GameMenu(props) {
86
99
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MobileMenu, {
87
100
  useStore,
88
101
  LeftPanelContent,
89
- menuBarConfig: {
90
- ...menuBarConfig,
91
- style: menuBarConfig.style || menuBarStyle,
92
- menuBarButtonPosition: menuBarConfig.menuBarButtonPosition || menuBarButtonPosition
93
- }
102
+ menuBarConfig: { ...menuBarConfig }
94
103
  }), /* @__PURE__ */ jsx("div", {
95
- className: `panel-left card rounded-0 ${convertedSidebarStyle}`,
96
- style: { ...convertedSidebarStyle == "Floating_Panel" && {
97
- position: "absolute",
98
- top: "0.5rem",
99
- left: "0.5rem",
100
- zIndex: 1,
101
- height: "calc(100vh - 1rem)",
102
- backgroundColor: "color-mix(in srgb, var(--bs-card-bg) 50%, transparent)"
103
- } },
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
+ },
104
116
  children: /* @__PURE__ */ jsx(LeftPanelContent, {})
105
117
  })] });
106
118
  }
package/dist/GameMenu.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as GameMenu } from "./GameMenu-lHVT8MdJ.js";
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.35",
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
- useStore((state) => state?.debug);
304
- useStore((state) => state?.setDebug);
305
- useStore((state) => state?.toontownMode);
306
- useStore((state) => state?.setToontownMode);
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
@@ -1,2 +1,2 @@
1
- import { t as SettingsModal } from "./SettingsModal-yJTqjsyc.js";
1
+ import { t as SettingsModal } from "./SettingsModal-DkLtzl7B.js";
2
2
  export { SettingsModal as default };
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-lHVT8MdJ.js";
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-yJTqjsyc.js";
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@articles-media/articles-dev-box",
3
3
  "description": "Shared code, functions, and components for different Articles Media projects.",
4
- "version": "1.0.35",
4
+ "version": "1.0.36",
5
5
  "type": "module",
6
6
  "imports": {
7
7
  "#root/src/*": "./src/*"