@articles-media/articles-dev-box 1.0.33 → 1.0.35

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 CHANGED
@@ -79,11 +79,11 @@ 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
- ⏹️ Remove Bootstrap reliance?
85
+ ⏹️ Remove Bootstrap reliance?
86
86
  ⏹️ Figure out why this package does not work outside webpack, on Turbopack for example it fails. Bootstrap SASS related I think.
87
87
 
88
88
  # TODO
89
- - TODO
89
+ - Nothing major right now, search "TODO" in repo for minor stuff.
@@ -1,12 +1,18 @@
1
1
  import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
2
+ import useUserDetails from "./useUserDetails.js";
3
+ import useUserToken from "./useUserToken.js";
2
4
  import useUserFriends from "./useUserFriends.js";
3
5
  import { jsx, jsxs } from "react/jsx-runtime";
4
6
  import { Modal } from "react-bootstrap";
5
7
  //#region src/components/Friends/FriendsList.jsx
6
- function FriendsList({ show, setShow, componentType, className, style = {}, user_id, user_token, id = null, allowInvite = false, inviteFunction = null, modalBackdropClassName = "" }) {
8
+ function FriendsList({ show, setShow, componentType, className, style = {}, id = null, allowInvite = false, inviteFunction = null, modalBackdropClassName = "", passedPort }) {
9
+ const port = window.location.port || passedPort;
10
+ console.log("Logged a port of ", port, " passedPort: ", passedPort);
11
+ const { data: userToken, error: userTokenError, isLoading: userTokenLoading, mutate: userTokenMutate } = useUserToken(port);
12
+ const { data: userDetails, error: userDetailsError, isLoading: userDetailsLoading, mutate: userDetailsMutate } = useUserDetails({ token: userToken });
7
13
  const { data: friends, error: friendsError, isLoading: friendsLoading, mutate: mutateFriends } = useUserFriends({
8
- user_id,
9
- user_token
14
+ user_id: userDetails?.user_id,
15
+ user_token: userToken
10
16
  });
11
17
  if (!componentType || componentType == "list") {
12
18
  if (!friendsLoading && friends && friends.length > 0) return /* @__PURE__ */ jsx("ul", {
@@ -4,38 +4,58 @@ import { useEffect } from "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/Games/GameMenu/MobileMenu.jsx
6
6
  var import_classnames = /* @__PURE__ */ __toESM(require_classnames(), 1);
7
- function MobileMenu({ useStore, LeftPanelContent, menuBarStyle }) {
7
+ function MobileMenu({ useStore, LeftPanelContent, menuBarConfig }) {
8
8
  const showMenu = useStore((state) => state.showMenu);
9
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
+ });
10
22
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
11
23
  className: (0, import_classnames.default)("menu-bar", {
12
- "card card-articles p-1 justify-content-center": menuBarStyle == "Bar",
13
- [menuBarStyle.replaceAll(" ", "_")]: menuBarStyle
24
+ "card card-articles p-1 justify-content-center": menuBarConfig.style == "Bar",
25
+ [menuBarConfig.style.replaceAll(" ", "_")]: menuBarConfig.style,
26
+ [menuBarConfig.menuBarButtonPosition]: menuBarConfig.menuBarButtonPosition
14
27
  }),
15
- children: /* @__PURE__ */ jsx("div", {
28
+ style: { ...menuBarConfig.style == "Bar" && { borderRadius: "0px" } },
29
+ children: /* @__PURE__ */ jsxs("div", {
16
30
  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
- })
31
+ children: [
32
+ /* @__PURE__ */ jsxs("div", {
33
+ className: "Left d-flex align-items-center",
34
+ children: [(menuBarConfig.menuBarButtonPosition == "Left" || !menuBarConfig.menuBarButtonPosition) && /* @__PURE__ */ jsx(MenuButton, {}), menuBarConfig.leftSlotChildren && menuBarConfig.leftSlotChildren]
35
+ }),
36
+ /* @__PURE__ */ jsxs("div", {
37
+ className: "Center d-flex align-items-center",
38
+ children: [menuBarConfig.menuBarButtonPosition == "Center" && /* @__PURE__ */ jsx(MenuButton, {}), menuBarConfig.centerSlotChildren && menuBarConfig.centerSlotChildren]
39
+ }),
40
+ /* @__PURE__ */ jsxs("div", {
41
+ className: "Right d-flex align-items-center",
42
+ children: [menuBarConfig.menuBarButtonPosition == "Right" && /* @__PURE__ */ jsx(MenuButton, {}), menuBarConfig.rightSlotChildren && menuBarConfig.rightSlotChildren]
43
+ })
44
+ ]
29
45
  })
30
46
  }), /* @__PURE__ */ jsx("div", {
31
47
  className: `mobile-menu ${showMenu && "show"}`,
32
48
  onClick: () => setShowMenu(false),
33
49
  style: {
34
- ...menuBarStyle == "Bar" && { bottom: "50px" },
35
- ...menuBarStyle == "Corner Button" && { bottom: "0px" }
50
+ ...menuBarConfig.style == "Bar" && { bottom: "50px" },
51
+ ...menuBarConfig.style == "Corner Button" && { bottom: "0px" }
36
52
  },
37
53
  children: /* @__PURE__ */ jsx("div", {
38
- style: { maxWidth: "300px" },
54
+ style: {
55
+ maxWidth: "300px",
56
+ maxHeight: "calc(100vh - 100px)",
57
+ overflowY: "auto"
58
+ },
39
59
  className: "mobile-menu-container",
40
60
  onClick: (e) => e.stopPropagation(),
41
61
  children: LeftPanelContent && /* @__PURE__ */ jsx(LeftPanelContent, {})
@@ -52,7 +72,7 @@ function MobileMenu({ useStore, LeftPanelContent, menuBarStyle }) {
52
72
  * @param {"Static Panel" | "Floating Panel"} [props.sidebarStyle]
53
73
  */
54
74
  function GameMenu(props) {
55
- const { useStore, LeftPanelContent, menuBarStyle, sidebarStyle } = props;
75
+ const { useStore, LeftPanelContent, sidebarStyleConfig, sidebarStyle, menuBarConfig, menuBarStyle, menuBarButtonPosition } = props;
56
76
  const sidebar = useStore((state) => state.sidebar);
57
77
  const setShowMenu = useStore((state) => state.setShowMenu);
58
78
  useEffect(() => {
@@ -66,7 +86,11 @@ function GameMenu(props) {
66
86
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MobileMenu, {
67
87
  useStore,
68
88
  LeftPanelContent,
69
- menuBarStyle
89
+ menuBarConfig: {
90
+ ...menuBarConfig,
91
+ style: menuBarConfig.style || menuBarStyle,
92
+ menuBarButtonPosition: menuBarConfig.menuBarButtonPosition || menuBarButtonPosition
93
+ }
70
94
  }), /* @__PURE__ */ jsx("div", {
71
95
  className: `panel-left card rounded-0 ${convertedSidebarStyle}`,
72
96
  style: { ...convertedSidebarStyle == "Floating_Panel" && {
package/dist/GameMenu.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as GameMenu } from "./GameMenu-BD1HSDJ-.js";
1
+ import { t as GameMenu } from "./GameMenu-lHVT8MdJ.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.33",
235
+ version: "1.0.35",
236
236
  type: "module",
237
237
  imports: { "#root/src/*": "./src/*" },
238
238
  main: "./dist/index.js",
@@ -1,2 +1,2 @@
1
- import { t as SettingsModal } from "./SettingsModal-BWEW8IAS.js";
1
+ import { t as SettingsModal } from "./SettingsModal-yJTqjsyc.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
- width: 50px;
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-BD1HSDJ-.js";
11
+ import { t as GameMenu } from "./GameMenu-lHVT8MdJ.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-BWEW8IAS.js";
15
+ import { t as SettingsModal } from "./SettingsModal-yJTqjsyc.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.33",
4
+ "version": "1.0.35",
5
5
  "type": "module",
6
6
  "imports": {
7
7
  "#root/src/*": "./src/*"