@articles-media/articles-dev-box 1.0.41 → 1.0.42
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 +2 -0
- package/dist/{GameMenu-CyW1MF3Y.js → GameMenu-DeFdYvvR.js} +36 -16
- package/dist/GameMenu.js +1 -1
- package/dist/HasNoMouseHandler.js +28 -0
- package/dist/{SettingsModal-DDTYTP4z.js → SettingsModal-B7EJA7mn.js} +29 -9
- package/dist/SettingsModal.js +1 -1
- package/dist/articles-dev-box.css +8 -0
- package/dist/index.js +4 -3
- package/dist/typicalZustandStoreStateSlice.js +15 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -67,6 +67,8 @@ npm run dev
|
|
|
67
67
|
- Handles setting zustand state from url params if toontownMode is passed.
|
|
68
68
|
- SocketServerUrlHandler
|
|
69
69
|
- Handles setting socket server state from url params if socketServerUrl is passed.
|
|
70
|
+
- HasNoMouseHandler
|
|
71
|
+
- Sets hasNoMouse and isTouchCapable on first load
|
|
70
72
|
- useUserToken
|
|
71
73
|
- Hook for getting the subdomain auth token.
|
|
72
74
|
- useUserDetails
|
|
@@ -7,18 +7,6 @@ var import_classnames = /* @__PURE__ */ __toESM(require_classnames(), 1);
|
|
|
7
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
|
-
});
|
|
22
10
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
23
11
|
className: (0, import_classnames.default)(`menu-bar ${menuBarConfig.menuBarClassName || ""}`, {
|
|
24
12
|
"card card-articles p-1 justify-content-center": menuBarConfig.style == "Bar",
|
|
@@ -30,19 +18,28 @@ function MobileMenu({ useStore, LeftPanelContent, menuBarConfig }) {
|
|
|
30
18
|
...menuBarConfig.style == "Bar" && { borderRadius: "0px" }
|
|
31
19
|
},
|
|
32
20
|
children: /* @__PURE__ */ jsxs("div", {
|
|
33
|
-
className: "flex-header align-items-center",
|
|
21
|
+
className: "menu-bar-container flex-header align-items-center",
|
|
34
22
|
children: [
|
|
35
23
|
/* @__PURE__ */ jsxs("div", {
|
|
36
24
|
className: "Left d-flex align-items-center",
|
|
37
|
-
children: [(menuBarConfig.menuBarButtonPosition == "Left" || !menuBarConfig.menuBarButtonPosition) && /* @__PURE__ */ jsx(MenuButton, {
|
|
25
|
+
children: [(menuBarConfig.menuBarButtonPosition == "Left" || !menuBarConfig.menuBarButtonPosition) && /* @__PURE__ */ jsx(MenuButton, {
|
|
26
|
+
useStore,
|
|
27
|
+
menuBarConfig
|
|
28
|
+
}), menuBarConfig.leftSlotChildren && menuBarConfig.leftSlotChildren]
|
|
38
29
|
}),
|
|
39
30
|
/* @__PURE__ */ jsxs("div", {
|
|
40
31
|
className: "Center d-flex align-items-center",
|
|
41
|
-
children: [menuBarConfig.menuBarButtonPosition == "Center" && /* @__PURE__ */ jsx(MenuButton, {
|
|
32
|
+
children: [menuBarConfig.menuBarButtonPosition == "Center" && /* @__PURE__ */ jsx(MenuButton, {
|
|
33
|
+
useStore,
|
|
34
|
+
menuBarConfig
|
|
35
|
+
}), menuBarConfig.centerSlotChildren && menuBarConfig.centerSlotChildren]
|
|
42
36
|
}),
|
|
43
37
|
/* @__PURE__ */ jsxs("div", {
|
|
44
38
|
className: "Right d-flex align-items-center",
|
|
45
|
-
children: [menuBarConfig.menuBarButtonPosition == "Right" && /* @__PURE__ */ jsx(MenuButton, {
|
|
39
|
+
children: [menuBarConfig.menuBarButtonPosition == "Right" && /* @__PURE__ */ jsx(MenuButton, {
|
|
40
|
+
useStore,
|
|
41
|
+
menuBarConfig
|
|
42
|
+
}), menuBarConfig.rightSlotChildren && menuBarConfig.rightSlotChildren]
|
|
46
43
|
})
|
|
47
44
|
]
|
|
48
45
|
})
|
|
@@ -65,6 +62,29 @@ function MobileMenu({ useStore, LeftPanelContent, menuBarConfig }) {
|
|
|
65
62
|
})
|
|
66
63
|
})] });
|
|
67
64
|
}
|
|
65
|
+
function MenuButton({ useStore, menuBarConfig }) {
|
|
66
|
+
const showMenu = useStore((state) => state.showMenu);
|
|
67
|
+
const setShowMenu = useStore((state) => state.setShowMenu);
|
|
68
|
+
const setShowSettingsModal = useStore((state) => state.setShowSettingsModal);
|
|
69
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(ArticlesButton, {
|
|
70
|
+
small: true,
|
|
71
|
+
active: showMenu,
|
|
72
|
+
onClick: () => {
|
|
73
|
+
console.log("Menu button clicked, toggling menu visibility");
|
|
74
|
+
setShowMenu(!showMenu);
|
|
75
|
+
},
|
|
76
|
+
className: "d-flex",
|
|
77
|
+
children: [/* @__PURE__ */ jsx("i", { className: "fad fa-bars" }), /* @__PURE__ */ jsx("span", {
|
|
78
|
+
className: "text",
|
|
79
|
+
children: "Menu"
|
|
80
|
+
})]
|
|
81
|
+
}), menuBarConfig?.settingsWithMenuButton && /* @__PURE__ */ jsx(ArticlesButton, {
|
|
82
|
+
onClick: () => {
|
|
83
|
+
setShowSettingsModal(true);
|
|
84
|
+
},
|
|
85
|
+
children: /* @__PURE__ */ jsx("i", { className: "fad fa-cog" })
|
|
86
|
+
})] });
|
|
87
|
+
}
|
|
68
88
|
//#endregion
|
|
69
89
|
//#region src/components/Games/GameMenu/GameMenu.jsx
|
|
70
90
|
/**
|
package/dist/GameMenu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as GameMenu } from "./GameMenu-
|
|
1
|
+
import { t as GameMenu } from "./GameMenu-DeFdYvvR.js";
|
|
2
2
|
export { GameMenu as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Handlers/HasNoMouseHandler.jsx
|
|
5
|
+
function HasNoMouseHandler({ useStore }) {
|
|
6
|
+
const hasHydrated = useStore((state) => state._hasHydrated);
|
|
7
|
+
const hasNoMouse = useStore((state) => state.hasNoMouse);
|
|
8
|
+
const setHasNoMouse = useStore((state) => state.setHasNoMouse);
|
|
9
|
+
const isTouchCapable = useStore((state) => state.isTouchCapable);
|
|
10
|
+
const setIsTouchCapable = useStore((state) => state.setIsTouchCapable);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!hasHydrated) return;
|
|
13
|
+
if (hasNoMouse === null) {
|
|
14
|
+
const hasMouse = window.matchMedia("(pointer: fine)").matches;
|
|
15
|
+
setHasNoMouse(!hasMouse);
|
|
16
|
+
}
|
|
17
|
+
if (isTouchCapable === null) setIsTouchCapable("ontouchstart" in window || navigator.maxTouchPoints > 0);
|
|
18
|
+
}, [
|
|
19
|
+
hasHydrated,
|
|
20
|
+
hasNoMouse,
|
|
21
|
+
isTouchCapable,
|
|
22
|
+
setHasNoMouse,
|
|
23
|
+
setIsTouchCapable
|
|
24
|
+
]);
|
|
25
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { HasNoMouseHandler as default };
|
|
@@ -89,9 +89,12 @@ function AudioTab({ useAudioStore, config }) {
|
|
|
89
89
|
/* @__PURE__ */ jsx("div", {
|
|
90
90
|
className: "border mb-3 p-2",
|
|
91
91
|
children: config?.tabs?.Audio?.sliders?.map((slider_obj) => {
|
|
92
|
-
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(Form.Label, {
|
|
93
93
|
className: "mb-0",
|
|
94
|
-
children: slider_obj.label
|
|
94
|
+
children: [/* @__PURE__ */ jsx("span", { children: slider_obj.label }), audioSettings?.[slider_obj.key] && /* @__PURE__ */ jsxs("span", {
|
|
95
|
+
className: "ms-2 text-muted",
|
|
96
|
+
children: [audioSettings[slider_obj.key], "%"]
|
|
97
|
+
})]
|
|
95
98
|
}), /* @__PURE__ */ jsx(Form.Range, {
|
|
96
99
|
value: audioSettings?.[slider_obj.key],
|
|
97
100
|
onChange: (value) => {
|
|
@@ -103,7 +106,7 @@ function AudioTab({ useAudioStore, config }) {
|
|
|
103
106
|
})] }, slider_obj.key);
|
|
104
107
|
})
|
|
105
108
|
}),
|
|
106
|
-
config?.tabs?.
|
|
109
|
+
config?.tabs?.Audio?.children
|
|
107
110
|
] });
|
|
108
111
|
}
|
|
109
112
|
//#endregion
|
|
@@ -163,7 +166,7 @@ function SocketSettings({ useStore }) {
|
|
|
163
166
|
function ControlsTab({ useTouchControlsStore, config }) {
|
|
164
167
|
return /* @__PURE__ */ jsxs("div", {
|
|
165
168
|
className: "",
|
|
166
|
-
children: [useTouchControlsStore && /* @__PURE__ */ jsx(TouchControls, { useTouchControlsStore }), config?.tabs?.Controls?.children]
|
|
169
|
+
children: [useTouchControlsStore && config?.tabs?.Controls?.touchControls && /* @__PURE__ */ jsx(TouchControls, { useTouchControlsStore }), config?.tabs?.Controls?.children]
|
|
167
170
|
});
|
|
168
171
|
}
|
|
169
172
|
function TouchControls({ useTouchControlsStore }) {
|
|
@@ -232,7 +235,7 @@ function OtherTab({ useStore, config }) {
|
|
|
232
235
|
var package_default = {
|
|
233
236
|
name: "@articles-media/articles-dev-box",
|
|
234
237
|
description: "Shared code, functions, and components for different Articles Media projects.",
|
|
235
|
-
version: "1.0.
|
|
238
|
+
version: "1.0.42",
|
|
236
239
|
type: "module",
|
|
237
240
|
imports: { "#root/src/*": "./src/*" },
|
|
238
241
|
main: "./dist/index.js",
|
|
@@ -261,6 +264,7 @@ var package_default = {
|
|
|
261
264
|
"./DarkModeHandler": "./dist/DarkModeHandler.js",
|
|
262
265
|
"./ToontownModeHandler": "./dist/ToontownModeHandler.js",
|
|
263
266
|
"./SocketServerUrlHandler": "./dist/SocketServerUrlHandler.js",
|
|
267
|
+
"./HasNoMouseHandler": "./dist/HasNoMouseHandler.js",
|
|
264
268
|
"./FriendsList": "./dist/FriendsList.js",
|
|
265
269
|
"./useUserDetails": "./dist/useUserDetails.js",
|
|
266
270
|
"./useUserToken": "./dist/useUserToken.js",
|
|
@@ -303,10 +307,26 @@ var package_default = {
|
|
|
303
307
|
//#endregion
|
|
304
308
|
//#region src/components/Games/Settings/DebugTab.jsx
|
|
305
309
|
function DebugTab({ useStore, config }) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
+
const showStats = useStore((state) => state?.debugConfig?.showStats);
|
|
311
|
+
const setDebugConfigKey = useStore((state) => state?.setDebugConfigKey);
|
|
312
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
313
|
+
/* @__PURE__ */ jsxs("div", {
|
|
314
|
+
className: "mb-3",
|
|
315
|
+
children: ["dev-box version: ", package_default.version]
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ jsx("div", { children: "Show Debug Stats" }),
|
|
318
|
+
/* @__PURE__ */ jsx("div", {
|
|
319
|
+
className: "mb-3",
|
|
320
|
+
children: [false, true].map((level, i) => /* @__PURE__ */ jsx(ArticlesButton, {
|
|
321
|
+
active: showStats === level,
|
|
322
|
+
onClick: () => {
|
|
323
|
+
setDebugConfigKey("showStats", level);
|
|
324
|
+
},
|
|
325
|
+
children: level ? "Enabled" : "Disabled"
|
|
326
|
+
}, i))
|
|
327
|
+
}),
|
|
328
|
+
config?.tabs?.Debug?.children && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("hr", {}), config?.tabs?.Debug?.children] })
|
|
329
|
+
] });
|
|
310
330
|
}
|
|
311
331
|
//#endregion
|
|
312
332
|
//#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-B7EJA7mn.js";
|
|
2
2
|
export { SettingsModal as default };
|
|
@@ -303,6 +303,14 @@
|
|
|
303
303
|
margin-right: 0;
|
|
304
304
|
font-size: 1.25rem;
|
|
305
305
|
}
|
|
306
|
+
@media (min-width: 992px) {
|
|
307
|
+
.menu-bar .menu-bar-container .Center {
|
|
308
|
+
position: absolute;
|
|
309
|
+
top: 50%;
|
|
310
|
+
left: 50%;
|
|
311
|
+
transform: translate(-50%, -50%);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
306
314
|
|
|
307
315
|
.mobile-menu {
|
|
308
316
|
position: fixed;
|
package/dist/index.js
CHANGED
|
@@ -8,19 +8,20 @@ import useUserFriends from "./useUserFriends.js";
|
|
|
8
8
|
import FriendsList from "./FriendsList.js";
|
|
9
9
|
import { t as SessionButton } from "./SessionButton-D3cupnzD.js";
|
|
10
10
|
import ArticlesAd from "./ArticlesAd.js";
|
|
11
|
-
import { t as GameMenu } from "./GameMenu-
|
|
11
|
+
import { t as GameMenu } from "./GameMenu-DeFdYvvR.js";
|
|
12
12
|
import useFullscreen from "./useFullscreen.js";
|
|
13
13
|
import PrimaryButtonGroup from "./GameMenuPrimaryButtonGroup.js";
|
|
14
14
|
import NicknameInput from "./NicknameInput.js";
|
|
15
15
|
import { t as GameScoreboard } from "./GameScoreboard-CYuTBE_E.js";
|
|
16
16
|
import GlobalHead from "./GlobalHead.js";
|
|
17
17
|
import GlobalBody_default from "./GlobalBody.js";
|
|
18
|
-
import { t as SettingsModal } from "./SettingsModal-
|
|
18
|
+
import { t as SettingsModal } from "./SettingsModal-B7EJA7mn.js";
|
|
19
19
|
import CreditsModal from "./CreditsModal.js";
|
|
20
20
|
import DarkModeHandler from "./DarkModeHandler.js";
|
|
21
21
|
import ToontownModeHandler from "./ToontownModeHandler.js";
|
|
22
22
|
import SocketServerUrlHandler from "./SocketServerUrlHandler.js";
|
|
23
|
+
import HasNoMouseHandler from "./HasNoMouseHandler.js";
|
|
23
24
|
import typicalZustandStoreExcludes from "./typicalZustandStoreExcludes.js";
|
|
24
25
|
import typicalZustandStoreStateSlice from "./typicalZustandStoreStateSlice.js";
|
|
25
26
|
import getSignOutRedirectUrl from "./getSignOutRedirectUrl.js";
|
|
26
|
-
export { Ad_default as Ad, ArticlesAd, CreditsModal, DarkModeHandler, FriendsList, GameMenu, PrimaryButtonGroup as GameMenuPrimaryButtonGroup, GameScoreboard, GlobalBody_default as GlobalBody, GlobalHead, NicknameInput, ReturnToLauncherButton, SessionButton, SettingsModal, SignInButton, SocketServerUrlHandler, ToontownModeHandler, ViewUserModal, getSignOutRedirectUrl, typicalZustandStoreExcludes, typicalZustandStoreStateSlice, useFullscreen, useUserDetails, useUserFriends, useUserToken };
|
|
27
|
+
export { Ad_default as Ad, ArticlesAd, CreditsModal, DarkModeHandler, FriendsList, GameMenu, PrimaryButtonGroup as GameMenuPrimaryButtonGroup, GameScoreboard, GlobalBody_default as GlobalBody, GlobalHead, HasNoMouseHandler, NicknameInput, ReturnToLauncherButton, SessionButton, SettingsModal, SignInButton, SocketServerUrlHandler, ToontownModeHandler, ViewUserModal, getSignOutRedirectUrl, typicalZustandStoreExcludes, typicalZustandStoreStateSlice, useFullscreen, useUserDetails, useUserFriends, useUserToken };
|
|
@@ -25,6 +25,16 @@ var typicalZustandStoreStateSlice = (set, get, generateRandomNickname) => ({
|
|
|
25
25
|
setDebug: (newValue) => {
|
|
26
26
|
set((prev) => ({ debug: newValue }));
|
|
27
27
|
},
|
|
28
|
+
debugConfig: { showStats: false },
|
|
29
|
+
setDebugConfig: (newValue) => {
|
|
30
|
+
set((prev) => ({ debugConfig: { ...newValue } }));
|
|
31
|
+
},
|
|
32
|
+
setDebugConfigKey: (key, value) => {
|
|
33
|
+
set((prev) => ({ debugConfig: {
|
|
34
|
+
...prev.debugConfig,
|
|
35
|
+
[key]: value
|
|
36
|
+
} }));
|
|
37
|
+
},
|
|
28
38
|
sidebar: true,
|
|
29
39
|
toggleSidebar: () => {
|
|
30
40
|
set((prev) => ({ sidebar: !prev.sidebar }));
|
|
@@ -77,7 +87,11 @@ var typicalZustandStoreStateSlice = (set, get, generateRandomNickname) => ({
|
|
|
77
87
|
},
|
|
78
88
|
reloadScene: () => {
|
|
79
89
|
set((prev) => ({ sceneKey: prev.sceneKey + 1 }));
|
|
80
|
-
}
|
|
90
|
+
},
|
|
91
|
+
hasNoMouse: null,
|
|
92
|
+
setHasNoMouse: (value) => set({ hasNoMouse: value }),
|
|
93
|
+
isTouchCapable: null,
|
|
94
|
+
setIsTouchCapable: (value) => set({ isTouchCapable: value })
|
|
81
95
|
});
|
|
82
96
|
//#endregion
|
|
83
97
|
export { typicalZustandStoreStateSlice as default };
|
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.
|
|
4
|
+
"version": "1.0.42",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
7
7
|
"#root/src/*": "./src/*"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"./DarkModeHandler": "./dist/DarkModeHandler.js",
|
|
35
35
|
"./ToontownModeHandler": "./dist/ToontownModeHandler.js",
|
|
36
36
|
"./SocketServerUrlHandler": "./dist/SocketServerUrlHandler.js",
|
|
37
|
+
"./HasNoMouseHandler": "./dist/HasNoMouseHandler.js",
|
|
37
38
|
"./FriendsList": "./dist/FriendsList.js",
|
|
38
39
|
"./useUserDetails": "./dist/useUserDetails.js",
|
|
39
40
|
"./useUserToken": "./dist/useUserToken.js",
|