@articles-media/articles-dev-box 1.1.3 → 1.1.4

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.
@@ -8,47 +8,50 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  * @param {function} props.useStore - Zustand store hook for accessing nickname state and actions.
9
9
  * @returns {JSX.Element|null} The rendered NicknameInput component or null if useStore is not provided.
10
10
  */
11
- function NicknameInput({ useStore }) {
11
+ function NicknameInput({ useStore, config }) {
12
12
  const _hasHydrated = useStore((state) => state._hasHydrated);
13
13
  const nickname = useStore((state) => state.nickname);
14
14
  const setNickname = useStore((state) => state.setNickname);
15
15
  const randomNickname = useStore((state) => state.randomNickname);
16
16
  if (!useStore) return null;
17
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", {
18
- className: "flex-grow-1",
19
- children: [/* @__PURE__ */ jsxs("div", {
20
- className: "form-group articles mb-0",
21
- children: [/* @__PURE__ */ jsx("label", {
22
- htmlFor: "nickname",
23
- children: "Nickname"
24
- }), /* @__PURE__ */ jsxs("div", {
25
- className: "d-flex align-items-center",
26
- children: [/* @__PURE__ */ jsx("input", {
27
- type: "text",
28
- value: _hasHydrated ? nickname : "",
29
- disabled: !_hasHydrated,
30
- id: "nickname",
31
- name: "nickname",
32
- placeholder: "Enter your nickname",
33
- onChange: (e) => {
34
- setNickname(e.target.value);
35
- },
36
- className: `form-control form-control-sm`
37
- }), /* @__PURE__ */ jsx(ArticlesButton, {
38
- small: true,
39
- className: "",
40
- onClick: () => {
41
- randomNickname();
42
- },
43
- children: /* @__PURE__ */ jsx("i", { className: "fad fa-random" })
17
+ return /* @__PURE__ */ jsxs("div", {
18
+ className: "d-flex w-100",
19
+ children: [config?.PreComponent && /* @__PURE__ */ jsx(Fragment, { children: config.PreComponent }), /* @__PURE__ */ jsxs("div", {
20
+ className: "flex-grow-1",
21
+ children: [/* @__PURE__ */ jsxs("div", {
22
+ className: "form-group articles mb-0",
23
+ children: [/* @__PURE__ */ jsx("label", {
24
+ htmlFor: "nickname",
25
+ children: "Nickname"
26
+ }), /* @__PURE__ */ jsxs("div", {
27
+ className: "d-flex align-items-center",
28
+ children: [/* @__PURE__ */ jsx("input", {
29
+ type: "text",
30
+ value: _hasHydrated ? nickname : "",
31
+ disabled: !_hasHydrated,
32
+ id: "nickname",
33
+ name: "nickname",
34
+ placeholder: "Enter your nickname",
35
+ onChange: (e) => {
36
+ setNickname(e.target.value);
37
+ },
38
+ className: `form-control form-control-sm`
39
+ }), /* @__PURE__ */ jsx(ArticlesButton, {
40
+ small: true,
41
+ className: "",
42
+ onClick: () => {
43
+ randomNickname();
44
+ },
45
+ children: /* @__PURE__ */ jsx("i", { className: "fad fa-random" })
46
+ })]
44
47
  })]
48
+ }), /* @__PURE__ */ jsx("div", {
49
+ className: "mt-1",
50
+ style: { fontSize: "0.8rem" },
51
+ children: "Visible to all players"
45
52
  })]
46
- }), /* @__PURE__ */ jsx("div", {
47
- className: "mt-1",
48
- style: { fontSize: "0.8rem" },
49
- children: "Visible to all players"
50
53
  })]
51
- }) });
54
+ });
52
55
  }
53
56
  //#endregion
54
57
  export { NicknameInput as default };
@@ -11,7 +11,7 @@ var SessionButton = lazy(() => import("./SessionButton.js"));
11
11
  var ReturnToLauncherButton = lazy(() => import("./ReturnToLauncherButton.js"));
12
12
  var GameScoreboard = lazy(() => import("./GameScoreboard.js"));
13
13
  var Ad = lazy(() => import("./Ad.js"));
14
- function PageTemplateLandingPage({ useStore, useSocketStore, RotatingMascot, Link, logoImage, backgroundImage, CardBodyOverride, singlePlayerConfig, multiplayerConfig, brandingTextClass, disableHero, disableAd, disableGameScoreboard, maxInnerWidth = "20rem", AdditionalContent = null, PostCardContent = null, PostExtrasContent = null, PreHeroContent = null, PostHeroContent = null }) {
14
+ function PageTemplateLandingPage({ useStore, useSocketStore, RotatingMascot, Link, logoImage, backgroundImage, CardBodyOverride, singlePlayerConfig, multiplayerConfig, brandingTextClass, disableHero, disableAd, disableGameScoreboard, maxInnerWidth = "20rem", AdditionalContent = null, PostCardContent = null, PostExtrasContent = null, PreHeroContent = null, PostHeroContent = null, NicknameInputConfig = null }) {
15
15
  const { data: userToken, error: userTokenError, isLoading: userTokenLoading, mutate: userTokenMutate } = useUserToken(process.env.NEXT_PUBLIC_GAME_PORT);
16
16
  const { data: userDetails, error: userDetailsError, isLoading: userDetailsLoading, mutate: userDetailsMutate } = useUserDetails({ token: userToken });
17
17
  const darkMode = useStore((state) => state.darkMode);
@@ -63,7 +63,10 @@ function PageTemplateLandingPage({ useStore, useSocketStore, RotatingMascot, Lin
63
63
  children: [
64
64
  /* @__PURE__ */ jsx("div", {
65
65
  className: "card-header",
66
- children: /* @__PURE__ */ jsx(NicknameInput, { useStore })
66
+ children: /* @__PURE__ */ jsx(NicknameInput, {
67
+ useStore,
68
+ config: NicknameInputConfig
69
+ })
67
70
  }),
68
71
  CardBodyOverride ? /* @__PURE__ */ jsx(CardBodyOverride, {}) : /* @__PURE__ */ jsxs("div", {
69
72
  className: "card-body",
@@ -242,7 +242,7 @@ function OtherTab({ useStore, config }) {
242
242
  var package_default = {
243
243
  name: "@articles-media/articles-dev-box",
244
244
  description: "Shared code, functions, and components for different Articles Media projects.",
245
- version: "1.1.3",
245
+ version: "1.1.4",
246
246
  type: "module",
247
247
  sideEffects: false,
248
248
  imports: { "#root/src/*": "./src/*" },
@@ -1,2 +1,2 @@
1
- import { t as SettingsModal } from "./SettingsModal-VLREmj2k.js";
1
+ import { t as SettingsModal } from "./SettingsModal-DP-hFQ5A.js";
2
2
  export { SettingsModal as default };
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import { t as GameScoreboard } from "./GameScoreboard-CYuTBE_E.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-VLREmj2k.js";
19
+ import { t as SettingsModal } from "./SettingsModal-DP-hFQ5A.js";
20
20
  import CreditsModal from "./CreditsModal.js";
21
21
  import InfoModal from "./InfoModal.js";
22
22
  import DarkModeHandler from "./DarkModeHandler.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.1.3",
4
+ "version": "1.1.4",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "imports": {