@articles-media/articles-dev-box 1.3.7 → 1.3.8

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.
@@ -1,20 +1,14 @@
1
1
  "use client";
2
- import { n as __toESM, t as require_classnames } from "./classnames-No-mjhw1.js";
3
- import { n as useMainSiteStatus, t as useAuthSiteStatus } from "./useAuthSiteStatus-D-D-KwEN.js";
4
- import { Suspense, lazy, memo, useState } from "react";
2
+ import { t as require_classnames } from "./classnames-No-mjhw1.js";
3
+ import { lazy, memo } from "react";
5
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- //#region src/components/Global/GlobalBody.jsx
7
- var import_classnames = /* @__PURE__ */ __toESM(require_classnames(), 1);
8
- var StatusModal = lazy(() => import("./StatusModal-DkHAimHp.js"));
5
+ require_classnames();
6
+ lazy(() => import("./StatusModal-i254NkBz.js"));
9
7
  function GlobalBody({ fontawesome = true }) {
10
- const [statusModal, setStatusModal] = useState(false);
11
- const { data: mainSiteStatus, error: mainSiteStatusError, isLoading: mainSiteStatusLoading, mutate: mainSiteStatusMutate } = useMainSiteStatus({ disable: process.env.NODE_ENV !== "development" || process.env.NEXT_PUBLIC_ENABLE_ARTICLES === "false" });
12
- const { data: authSiteStatus, error: authSiteStatusError, isLoading: authSiteStatusLoading, mutate: authSiteStatusMutate } = useAuthSiteStatus({ disable: process.env.NODE_ENV !== "development" || process.env.NEXT_PUBLIC_ENABLE_ARTICLES === "false" });
13
8
  return /* @__PURE__ */ jsxs(Fragment, { children: [fontawesome && /* @__PURE__ */ jsx("link", {
14
9
  rel: "stylesheet",
15
10
  href: `https://cdn.articles.media/fonts/fontawesome/css/all.min.css`
16
- }), process.env.NODE_ENV === "development" && /* @__PURE__ */ jsxs(Fragment, { children: [
17
- /* @__PURE__ */ jsx("style", { children: `
11
+ }), process.env.NODE_ENV === "development" && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("style", { children: `
18
12
  @keyframes grow-shrink {
19
13
  0% { transform: translateY(-50px); }
20
14
  50% { transform: translateY(0px); }
@@ -46,25 +40,7 @@ function GlobalBody({ fontawesome = true }) {
46
40
  .articles-global-body.auth-connected {
47
41
  border-color: blue;
48
42
  }
49
- ` }),
50
- /* @__PURE__ */ jsx("div", {
51
- onClick: () => {
52
- setStatusModal(true);
53
- },
54
- className: (0, import_classnames.default)(`articles-global-body`, {
55
- "main-connected": mainSiteStatus,
56
- "auth-connected": authSiteStatus
57
- }),
58
- children: /* @__PURE__ */ jsx("div", {
59
- className: "content",
60
- children: /* @__PURE__ */ jsx("i", { className: "fas fa-thumbs-up" })
61
- })
62
- }),
63
- statusModal && /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(StatusModal, {
64
- show: statusModal,
65
- setShow: setStatusModal
66
- }) })
67
- ] })] });
43
+ ` }) })] });
68
44
  }
69
45
  var GlobalBody_default = memo(GlobalBody);
70
46
  //#endregion
@@ -1,14 +1,16 @@
1
1
  "use client";
2
- import useUserDetails from "./useUserDetails.js";
3
- import useUserToken from "./useUserToken.js";
2
+ import { n as __toESM, t as require_classnames } from "./classnames-No-mjhw1.js";
3
+ import { n as useMainSiteStatus, t as useAuthSiteStatus } from "./useAuthSiteStatus-D-D-KwEN.js";
4
4
  import { lazy } from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/Global/GlobalClientModals.jsx
7
+ var import_classnames = /* @__PURE__ */ __toESM(require_classnames(), 1);
7
8
  var InfoModal = lazy(() => import("./InfoModal.js"));
8
9
  var CreditsModal = lazy(() => import("./CreditsModal.js"));
9
10
  var FriendsList = lazy(() => import("./FriendsList.js"));
10
11
  var SettingsModal = lazy(() => import("./SettingsModal.js"));
11
12
  var InviteModal = lazy(() => import("./InviteModal.js"));
13
+ var StatusModal = lazy(() => import("./StatusModal-i254NkBz.js"));
12
14
  function GlobalClientModals({ useStore, useAudioStore, useTouchControlsStore, useSocketStore, packageInfo, settingsModalConfig, infoModalConfig }) {
13
15
  const showInfoModal = useStore((state) => state.showInfoModal);
14
16
  const setShowInfoModal = useStore((state) => state.setShowInfoModal);
@@ -20,12 +22,14 @@ function GlobalClientModals({ useStore, useAudioStore, useTouchControlsStore, us
20
22
  const setShowFriendsModal = useStore((state) => state.setShowFriendsModal);
21
23
  const showInviteModal = useStore((state) => state.showInviteModal);
22
24
  const setShowInviteModal = useStore((state) => state.setShowInviteModal);
23
- const { data: userToken, error: userTokenError, isLoading: userTokenLoading, mutate: userTokenMutate } = useUserToken(process.env.NEXT_PUBLIC_GAME_PORT);
24
- const { data: userDetails, error: userDetailsError, isLoading: userDetailsLoading, mutate: userDetailsMutate } = useUserDetails({ token: userToken });
25
+ const showDevStatusModal = useStore((state) => state.showDevStatusModal);
26
+ const setShowDevStatusModal = useStore((state) => state.setShowDevStatusModal);
25
27
  if (!settingsModalConfig) {
26
28
  console.error("GlobalClientModals: settingsModalConfig is not provided!");
27
29
  return;
28
30
  }
31
+ const { data: mainSiteStatus, error: mainSiteStatusError, isLoading: mainSiteStatusLoading, mutate: mainSiteStatusMutate } = useMainSiteStatus({ disable: process.env.NODE_ENV !== "development" || process.env.NEXT_PUBLIC_ENABLE_ARTICLES === "false" });
32
+ const { data: authSiteStatus, error: authSiteStatusError, isLoading: authSiteStatusLoading, mutate: authSiteStatusMutate } = useAuthSiteStatus({ disable: process.env.NODE_ENV !== "development" || process.env.NEXT_PUBLIC_ENABLE_ARTICLES === "false" });
29
33
  return /* @__PURE__ */ jsxs(Fragment, { children: [
30
34
  showInfoModal && /* @__PURE__ */ jsx(InfoModal, {
31
35
  show: showInfoModal,
@@ -56,6 +60,24 @@ function GlobalClientModals({ useStore, useAudioStore, useTouchControlsStore, us
56
60
  show: showInviteModal,
57
61
  setShow: setShowInviteModal,
58
62
  useSocketStore
63
+ }),
64
+ showDevStatusModal && /* @__PURE__ */ jsx(StatusModal, {
65
+ show: showDevStatusModal,
66
+ setShow: setShowDevStatusModal,
67
+ useSocketStore
68
+ }),
69
+ /* @__PURE__ */ jsx("div", {
70
+ onClick: () => {
71
+ setShowDevStatusModal(true);
72
+ },
73
+ className: (0, import_classnames.default)(`articles-global-body`, {
74
+ "main-connected": mainSiteStatus,
75
+ "auth-connected": authSiteStatus
76
+ }),
77
+ children: /* @__PURE__ */ jsx("div", {
78
+ className: "content",
79
+ children: /* @__PURE__ */ jsx("i", { className: "fas fa-thumbs-up" })
80
+ })
59
81
  })
60
82
  ] });
61
83
  }
@@ -224,7 +224,7 @@ function OnlinePlayers({ useStore, multiplayerConfig }) {
224
224
  " online."
225
225
  ]
226
226
  }), /* @__PURE__ */ jsxs("div", {
227
- className: "d-flex justify-content-center mb-3",
227
+ className: "d-flex justify-content-center mb-2",
228
228
  children: [/* @__PURE__ */ jsxs("div", {
229
229
  className: "badge bg-black text-white me-1",
230
230
  children: [landing_player_count || 0, " in lobby"]
@@ -246,7 +246,7 @@ function OtherTab({ useStore, config }) {
246
246
  var package_default = {
247
247
  name: "@articles-media/articles-dev-box",
248
248
  description: "Shared code, functions, and components for different Articles Media projects.",
249
- version: "1.3.7",
249
+ version: "1.3.8",
250
250
  type: "module",
251
251
  sideEffects: false,
252
252
  imports: { "#root/src/*": "./src/*" },
@@ -1,2 +1,2 @@
1
- import { t as SettingsModal } from "./SettingsModal-BTGNqh2d.js";
1
+ import { t as SettingsModal } from "./SettingsModal-Da71CVHO.js";
2
2
  export { SettingsModal as default };
@@ -4,7 +4,8 @@ import { useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Modal } from "react-bootstrap";
6
6
  //#region src/components/Global/StatusModal.jsx
7
- function StatusModal({ show, setShow }) {
7
+ function StatusModal({ show, setShow, useSocketStore }) {
8
+ const socket = useSocketStore((state) => state.socket);
8
9
  const [showMainDetails, setShowMainDetails] = useState(false);
9
10
  const [showAuthDetails, setShowAuthDetails] = useState(false);
10
11
  const getStatusCode = (data, error, loading) => {
@@ -15,6 +16,12 @@ function StatusModal({ show, setShow }) {
15
16
  };
16
17
  const { data: mainSiteStatus, error: mainSiteStatusError, isLoading: mainSiteStatusLoading, mutate: mainSiteStatusMutate } = useMainSiteStatus({ disable: process.env.NODE_ENV !== "development" });
17
18
  const { data: authSiteStatus, error: authSiteStatusError, isLoading: authSiteStatusLoading, mutate: authSiteStatusMutate } = useAuthSiteStatus({ disable: process.env.NODE_ENV !== "development" });
19
+ function openFolder(folderName) {
20
+ socket.emit("open-folder", folderName, (response) => {
21
+ if (response.success) console.log(`Opened folder: ${folderName}`);
22
+ else console.error(`Failed to open folder: ${folderName}`, response.error);
23
+ });
24
+ }
18
25
  return /* @__PURE__ */ jsxs(Modal, {
19
26
  show,
20
27
  size: "md",
@@ -26,19 +33,31 @@ function StatusModal({ show, setShow }) {
26
33
  /* @__PURE__ */ jsxs(Modal.Body, { children: [
27
34
  /* @__PURE__ */ jsxs("div", {
28
35
  className: "d-flex align-items-center mb-2",
29
- children: [/* @__PURE__ */ jsxs("h5", {
30
- className: "mb-0 me-2",
31
- children: ["Main Site Status: ", /* @__PURE__ */ jsx("span", {
32
- className: `badge ${mainSiteStatus ? "bg-success" : "bg-danger"}`,
33
- children: getStatusCode(mainSiteStatus, mainSiteStatusError, mainSiteStatusLoading)
34
- })]
35
- }), /* @__PURE__ */ jsxs(ArticlesButton, {
36
- variant: "link",
37
- size: "sm",
38
- className: "p-0",
39
- onClick: () => setShowMainDetails(!showMainDetails),
40
- children: [showMainDetails ? "Hide" : "View", " More"]
41
- })]
36
+ children: [
37
+ /* @__PURE__ */ jsxs("h5", {
38
+ className: "mb-0 me-2",
39
+ children: ["Main Site Status: ", /* @__PURE__ */ jsx("span", {
40
+ className: `badge ${mainSiteStatus ? "bg-success" : "bg-danger"}`,
41
+ children: getStatusCode(mainSiteStatus, mainSiteStatusError, mainSiteStatusLoading)
42
+ })]
43
+ }),
44
+ /* @__PURE__ */ jsxs(ArticlesButton, {
45
+ variant: "link",
46
+ size: "sm",
47
+ className: "p-0",
48
+ onClick: () => setShowMainDetails(!showMainDetails),
49
+ children: [showMainDetails ? "Hide" : "View", " More"]
50
+ }),
51
+ /* @__PURE__ */ jsx(ArticlesButton, {
52
+ variant: "link",
53
+ size: "sm",
54
+ className: "p-0 d-inline-block ms-2",
55
+ onClick: () => {
56
+ openFolder("articles.media");
57
+ },
58
+ children: "Open Folder"
59
+ })
60
+ ]
42
61
  }),
43
62
  showMainDetails && /* @__PURE__ */ jsxs("pre", { children: [
44
63
  mainSiteStatusLoading && "Loading...",
@@ -47,19 +66,31 @@ function StatusModal({ show, setShow }) {
47
66
  ] }),
48
67
  /* @__PURE__ */ jsxs("div", {
49
68
  className: "d-flex align-items-center mb-2",
50
- children: [/* @__PURE__ */ jsxs("h5", {
51
- className: "mb-0 me-2",
52
- children: ["Auth Site Status: ", /* @__PURE__ */ jsx("span", {
53
- className: `badge ${authSiteStatus ? "bg-success" : "bg-danger"}`,
54
- children: getStatusCode(authSiteStatus, authSiteStatusError, authSiteStatusLoading)
55
- })]
56
- }), /* @__PURE__ */ jsxs(ArticlesButton, {
57
- variant: "link",
58
- size: "sm",
59
- className: "p-0",
60
- onClick: () => setShowAuthDetails(!showAuthDetails),
61
- children: [showAuthDetails ? "Hide" : "View", " More"]
62
- })]
69
+ children: [
70
+ /* @__PURE__ */ jsxs("h5", {
71
+ className: "mb-0 me-2",
72
+ children: ["Auth Site Status: ", /* @__PURE__ */ jsx("span", {
73
+ className: `badge ${authSiteStatus ? "bg-success" : "bg-danger"}`,
74
+ children: getStatusCode(authSiteStatus, authSiteStatusError, authSiteStatusLoading)
75
+ })]
76
+ }),
77
+ /* @__PURE__ */ jsxs(ArticlesButton, {
78
+ variant: "link",
79
+ size: "sm",
80
+ className: "p-0",
81
+ onClick: () => setShowAuthDetails(!showAuthDetails),
82
+ children: [showAuthDetails ? "Hide" : "View", " More"]
83
+ }),
84
+ /* @__PURE__ */ jsx(ArticlesButton, {
85
+ variant: "link",
86
+ size: "sm",
87
+ className: "p-0 d-inline-block ms-2",
88
+ onClick: () => {
89
+ openFolder("accounts.articles.media");
90
+ },
91
+ children: "Open Folder"
92
+ })
93
+ ]
63
94
  }),
64
95
  showAuthDetails && /* @__PURE__ */ jsxs("pre", { children: [
65
96
  authSiteStatusLoading && "Loading...",
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import { t as GameScoreboard } from "./GameScoreboard-BvE_sIDW.js";
16
16
  import PageTemplateLandingPage from "./PageTemplateLandingPage.js";
17
17
  import GlobalHead from "./GlobalHead.js";
18
18
  import GlobalBody_default from "./GlobalBody.js";
19
- import { t as SettingsModal } from "./SettingsModal-BTGNqh2d.js";
19
+ import { t as SettingsModal } from "./SettingsModal-Da71CVHO.js";
20
20
  import CreditsModal from "./CreditsModal.js";
21
21
  import InfoModal from "./InfoModal.js";
22
22
  import DarkModeHandler from "./DarkModeHandler.js";
@@ -70,6 +70,10 @@ var typicalZustandStoreStateSlice = (set, get, generateRandomNickname) => ({
70
70
  setShowInviteModal: (newValue) => {
71
71
  set((prev) => ({ showInviteModal: newValue }));
72
72
  },
73
+ showDevStatusModal: false,
74
+ setShowDevStatusModal: (newValue) => {
75
+ set((prev) => ({ showDevStatusModal: newValue }));
76
+ },
73
77
  graphicsQuality: "High",
74
78
  setGraphicsQuality: (value) => set({ graphicsQuality: value }),
75
79
  lobbyDetails: {
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.3.7",
4
+ "version": "1.3.8",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "imports": {