@gamepark/react-game 7.7.4 → 7.7.5

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.
Files changed (22) hide show
  1. package/dist/components/material/GameTable/DevTools/BotTool.d.ts +8 -0
  2. package/dist/components/material/GameTable/DevTools/BotTool.js +13 -0
  3. package/dist/components/material/GameTable/DevTools/BotTool.js.map +1 -0
  4. package/dist/components/material/GameTable/DevTools/GamePanel.d.ts +1 -0
  5. package/dist/components/material/GameTable/DevTools/GamePanel.js +7 -179
  6. package/dist/components/material/GameTable/DevTools/GamePanel.js.map +1 -1
  7. package/dist/components/material/GameTable/DevTools/NewGameTool.d.ts +9 -0
  8. package/dist/components/material/GameTable/DevTools/NewGameTool.js +64 -0
  9. package/dist/components/material/GameTable/DevTools/NewGameTool.js.map +1 -0
  10. package/dist/components/material/GameTable/DevTools/SwitchPlayerTool.d.ts +8 -0
  11. package/dist/components/material/GameTable/DevTools/SwitchPlayerTool.js +9 -0
  12. package/dist/components/material/GameTable/DevTools/SwitchPlayerTool.js.map +1 -0
  13. package/dist/components/material/GameTable/DevTools/TutorialTool.d.ts +8 -0
  14. package/dist/components/material/GameTable/DevTools/TutorialTool.js +4 -0
  15. package/dist/components/material/GameTable/DevTools/TutorialTool.js.map +1 -0
  16. package/dist/components/material/GameTable/DevTools/UndoTool.d.ts +8 -0
  17. package/dist/components/material/GameTable/DevTools/UndoTool.js +9 -0
  18. package/dist/components/material/GameTable/DevTools/UndoTool.js.map +1 -0
  19. package/dist/components/material/GameTable/DevTools/devtools.css.d.ts +24 -0
  20. package/dist/components/material/GameTable/DevTools/devtools.css.js +183 -0
  21. package/dist/components/material/GameTable/DevTools/devtools.css.js.map +1 -0
  22. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ import { FC } from 'react';
3
+ type BotToolProps = {
4
+ exec: (action: () => void, msg: string) => void;
5
+ g: any;
6
+ };
7
+ export declare const BotTool: FC<BotToolProps>;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { useState } from 'react';
4
+ import { activeIndicatorCss, toolBtnActiveCss, toolBtnCss, toolDescCss, toolIconCss, toolLabelCss } from './devtools.css';
5
+ export const BotTool = ({ exec, g }) => {
6
+ const [botActive, setBotActive] = useState(false);
7
+ return (_jsxs("button", { css: [toolBtnCss, botActive && toolBtnActiveCss], onClick: () => {
8
+ const next = !botActive;
9
+ exec(() => g.bot(next), next ? 'Bots enabled' : 'Bots disabled');
10
+ setBotActive(next);
11
+ }, children: [_jsx("span", { css: toolIconCss, children: '\u2699' }), _jsx("span", { css: toolLabelCss, children: botActive ? 'Disable Bots' : 'Enable Bots' }), _jsx("span", { css: toolDescCss, children: botActive ? 'Stop auto-play' : 'Auto-play all moves' }), botActive && _jsx("span", { css: activeIndicatorCss })] }));
12
+ };
13
+ //# sourceMappingURL=BotTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BotTool.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/BotTool.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EACL,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EACzF,MAAM,gBAAgB,CAAA;AAOvB,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE;IACvD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEjD,OAAO,CACL,kBAAQ,GAAG,EAAE,CAAC,UAAU,EAAE,SAAS,IAAI,gBAAgB,CAAC,EACtD,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,IAAI,GAAG,CAAC,SAAS,CAAA;YACvB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;YAChE,YAAY,CAAC,IAAI,CAAC,CAAA;QACpB,CAAC,aACD,eAAM,GAAG,EAAE,WAAW,YAAG,QAAQ,GAAQ,EACzC,eAAM,GAAG,EAAE,YAAY,YAAG,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,GAAQ,EAC5E,eAAM,GAAG,EAAE,WAAW,YAAG,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,qBAAqB,GAAQ,EACpF,SAAS,IAAI,eAAM,GAAG,EAAE,kBAAkB,GAAI,IACxC,CACV,CAAA;AACH,CAAC,CAAA"}
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource @emotion/react */
1
2
  import { FC } from 'react';
2
3
  import { GameOption } from './DevToolsHub';
3
4
  type GamePanelProps = {
@@ -1,180 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
- /** @jsxImportSource @emotion/react */
3
- import { css, keyframes } from '@emotion/react';
4
- import { useState } from 'react';
5
- import { usePlayerId, usePlayerIds } from '../../../../hooks/usePlayerId';
6
- const GP_PRIMARY = '#28B8CE';
7
- const toolReveal = keyframes `
8
- from { opacity: 0; transform: translateX(-0.375em); }
9
- to { opacity: 1; transform: translateX(0); }
10
- `;
11
- export const GamePanel = ({ exec, g, gameOptions }) => {
12
- const [newGamePlayers, setNewGamePlayers] = useState(2);
13
- const [options, setOptions] = useState({});
14
- const [undoCount, setUndoCount] = useState(1);
15
- const [botActive, setBotActive] = useState(false);
16
- const currentPlayer = usePlayerId();
17
- const players = usePlayerIds();
18
- return (_jsxs(_Fragment, { children: [_jsxs("div", { css: toolBtnCss, children: [_jsx("span", { css: toolIconCss, children: '\u21BB' }), _jsx("span", { css: toolLabelCss, children: "New Game" }), _jsx("span", { css: toolDescCss, children: "Reset with N players" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [_jsx("button", { css: stepBtnCss, onClick: () => setNewGamePlayers(c => Math.max(1, c - 1)), children: "-" }), _jsx("input", { type: "number", min: 1, max: 10, value: newGamePlayers, onChange: e => setNewGamePlayers(Math.max(1, parseInt(e.target.value) || 2)), css: numberInputCss }), _jsx("button", { css: stepBtnCss, onClick: () => setNewGamePlayers(c => Math.min(10, c + 1)), children: "+" }), _jsx("button", { css: goBtnCss, onClick: () => exec(() => {
19
- const hasOptions = gameOptions?.length && Object.values(options).some(Boolean);
20
- g.new(hasOptions ? { players: newGamePlayers, ...options } : newGamePlayers);
21
- }, `New game ${newGamePlayers}p`), children: "Go" })] }), gameOptions?.map(opt => (_jsxs("label", { css: toggleRowCss, onClick: e => e.stopPropagation(), children: [_jsx("input", { type: "checkbox", checked: options[opt.key] ?? false, onChange: e => setOptions(prev => ({ ...prev, [opt.key]: e.target.checked })), css: checkboxCss }), _jsx("span", { css: toggleLabelCss, children: opt.label })] }, opt.key)))] }), _jsxs("div", { css: toolBtnCss, children: [_jsx("span", { css: toolIconCss, children: '\u238C' }), _jsx("span", { css: toolLabelCss, children: "Undo" }), _jsx("span", { css: toolDescCss, children: "Revert N moves" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [_jsx("button", { css: stepBtnCss, onClick: () => setUndoCount(c => Math.max(1, c - 1)), children: "-" }), _jsx("input", { type: "number", min: 1, max: 999, value: undoCount, onChange: e => setUndoCount(Math.max(1, parseInt(e.target.value) || 1)), css: numberInputCss }), _jsx("button", { css: stepBtnCss, onClick: () => setUndoCount(c => c + 1), children: "+" }), _jsx("button", { css: goBtnCss, onClick: () => exec(() => g.undo(undoCount), `Undo ${undoCount} move${undoCount > 1 ? 's' : ''}`), children: "Go" })] })] }), _jsxs("div", { css: toolBtnCss, children: [_jsx("span", { css: toolIconCss, children: '\u2194' }), _jsx("span", { css: toolLabelCss, children: "Switch Player" }), _jsx("span", { css: toolDescCss, children: "View as another player" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [players.map(pid => (_jsxs("button", { css: [playerBtnCss, pid === currentPlayer && playerBtnActiveCss], onClick: () => exec(() => g.changePlayer(pid), `Switched to P${pid}`), children: ["P", String(pid)] }, String(pid)))), _jsx("button", { css: [playerBtnCss, currentPlayer === undefined && playerBtnActiveCss], onClick: () => exec(() => g.changePlayer(), 'Spectator mode'), children: "Spect" })] })] }), _jsxs("button", { css: [toolBtnCss, botActive && toolBtnActiveCss], onClick: () => {
22
- const next = !botActive;
23
- exec(() => g.bot(next), next ? 'Bots enabled' : 'Bots disabled');
24
- setBotActive(next);
25
- }, children: [_jsx("span", { css: toolIconCss, children: '\u2699' }), _jsx("span", { css: toolLabelCss, children: botActive ? 'Disable Bots' : 'Enable Bots' }), _jsx("span", { css: toolDescCss, children: botActive ? 'Stop auto-play' : 'Auto-play all moves' }), botActive && _jsx("span", { css: activeIndicatorCss })] }), _jsxs("button", { css: toolBtnCss, onClick: () => exec(() => g.tutorial(), 'Tutorial started'), children: [_jsx("span", { css: toolIconCss, children: "?" }), _jsx("span", { css: toolLabelCss, children: "Tutorial" }), _jsx("span", { css: toolDescCss, children: "Start tutorial mode" })] })] }));
26
- };
27
- // ── Styles ──
28
- const toolBtnCss = css `
29
- position: relative;
30
- display: grid;
31
- grid-template-columns: 1.75em 1fr;
32
- grid-template-rows: auto auto;
33
- align-items: center;
34
- gap: 0 0.625em;
35
- padding: 0.625em 0.75em;
36
- border: none;
37
- border-radius: 0.5em;
38
- background: transparent;
39
- cursor: pointer;
40
- text-align: left;
41
- transition: background 0.15s;
42
- animation: ${toolReveal} 0.25s ease-out backwards;
43
- font-family: inherit;
44
- &:hover { background: rgba(40, 184, 206, 0.08); }
45
- &:active { background: rgba(40, 184, 206, 0.14); }
46
- `;
47
- const toolBtnActiveCss = css `
48
- background: rgba(40, 184, 206, 0.1);
49
- &::after {
50
- content: '';
51
- position: absolute;
52
- left: 0; top: 0.5em; bottom: 0.5em;
53
- width: 0.2em;
54
- border-radius: 0 0.2em 0.2em 0;
55
- background: ${GP_PRIMARY};
56
- }
57
- `;
58
- const toolIconCss = css `
59
- grid-row: 1 / -1;
60
- color: ${GP_PRIMARY};
61
- display: flex;
62
- align-items: center;
63
- justify-content: center;
64
- width: 1.75em; height: 1.75em;
65
- border-radius: 0.375em;
66
- background: rgba(40, 184, 206, 0.08);
67
- `;
68
- const toolLabelCss = css `
69
- font-weight: 700;
70
- color: #e0f0f4;
71
- line-height: 1.2;
72
- `;
73
- const toolDescCss = css `
74
- color: #5a8a98;
75
- line-height: 1.2;
76
- `;
77
- const activeIndicatorCss = css `
78
- position: absolute;
79
- top: 0.625em; right: 0.75em;
80
- width: 0.44em; height: 0.44em;
81
- border-radius: 50%;
82
- background: ${GP_PRIMARY};
83
- box-shadow: 0 0 0.375em rgba(40, 184, 206, 0.5);
84
- `;
85
- const inlineRowCss = css `
86
- grid-column: 1 / -1;
87
- display: flex;
88
- align-items: center;
89
- gap: 0.25em;
90
- margin-top: 0.375em;
91
- `;
92
- const stepBtnCss = css `
93
- width: 1.625em; height: 1.625em;
94
- border-radius: 0.3em;
95
- border: 0.06em solid rgba(40, 184, 206, 0.25);
96
- background: rgba(40, 184, 206, 0.06);
97
- color: ${GP_PRIMARY};
98
- font-weight: 700;
99
- cursor: pointer;
100
- display: flex; align-items: center; justify-content: center;
101
- font-family: inherit;
102
- transition: all 0.15s;
103
- &:hover { background: rgba(40, 184, 206, 0.14); border-color: rgba(40, 184, 206, 0.4); }
104
- `;
105
- const numberInputCss = css `
106
- width: 3em; height: 1.625em;
107
- border-radius: 0.3em;
108
- border: 0.06em solid rgba(40, 184, 206, 0.25);
109
- background: rgba(0, 0, 0, 0.3);
110
- color: #e0f0f4;
111
- font-weight: 700;
112
- text-align: center;
113
- font-family: inherit;
114
- font-variant-numeric: tabular-nums;
115
- &:focus { outline: none; border-color: ${GP_PRIMARY}; box-shadow: 0 0 0 0.125em rgba(40, 184, 206, 0.15); }
116
- &::-webkit-inner-spin-button, &::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
117
- `;
118
- const goBtnCss = css `
119
- height: 1.625em;
120
- padding: 0 0.75em;
121
- border-radius: 0.3em;
122
- border: 0.06em solid rgba(40, 184, 206, 0.35);
123
- background: rgba(40, 184, 206, 0.15);
124
- color: ${GP_PRIMARY};
125
- font-weight: 800;
126
- text-transform: uppercase;
127
- letter-spacing: 0.05em;
128
- cursor: pointer;
129
- margin-left: auto;
130
- font-family: inherit;
131
- transition: all 0.15s;
132
- flex-shrink: 0;
133
- &:hover { background: rgba(40, 184, 206, 0.25); border-color: rgba(40, 184, 206, 0.5); }
134
- `;
135
- const playerBtnCss = css `
136
- height: 1.625em;
137
- padding: 0 0.625em;
138
- border-radius: 0.3em;
139
- border: 0.06em solid rgba(40, 184, 206, 0.25);
140
- background: rgba(40, 184, 206, 0.06);
141
- color: #5a8a98;
142
- font-weight: 700;
143
- cursor: pointer;
144
- font-family: inherit;
145
- transition: all 0.15s;
146
- &:hover { background: rgba(40, 184, 206, 0.14); border-color: rgba(40, 184, 206, 0.4); color: #e0f0f4; }
147
- `;
148
- const playerBtnActiveCss = css `
149
- background: rgba(40, 184, 206, 0.2);
150
- border-color: ${GP_PRIMARY};
151
- color: ${GP_PRIMARY};
152
- `;
153
- const toggleRowCss = css `
154
- grid-column: 1 / -1;
155
- display: flex; align-items: center; gap: 0.5em;
156
- margin-top: 0.25em; padding: 0.25em 0;
157
- cursor: pointer;
158
- `;
159
- const checkboxCss = css `
160
- appearance: none;
161
- width: 1em; height: 1em;
162
- border-radius: 0.25em;
163
- border: 0.06em solid rgba(40, 184, 206, 0.35);
164
- background: rgba(0, 0, 0, 0.3);
165
- cursor: pointer; flex-shrink: 0;
166
- position: relative;
167
- transition: all 0.15s;
168
- &:checked { background: rgba(40, 184, 206, 0.2); border-color: ${GP_PRIMARY}; }
169
- &:checked::after {
170
- content: '\u2713';
171
- position: absolute; top: 50%; left: 50%;
172
- transform: translate(-50%, -50%);
173
- color: ${GP_PRIMARY}; font-weight: 700;
174
- }
175
- &:hover { border-color: rgba(40, 184, 206, 0.5); }
176
- `;
177
- const toggleLabelCss = css `
178
- font-weight: 600; color: #5a8a98;
179
- `;
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { NewGameTool } from './NewGameTool';
3
+ import { UndoTool } from './UndoTool';
4
+ import { SwitchPlayerTool } from './SwitchPlayerTool';
5
+ import { BotTool } from './BotTool';
6
+ import { TutorialTool } from './TutorialTool';
7
+ export const GamePanel = ({ exec, g, gameOptions }) => (_jsxs(_Fragment, { children: [_jsx(NewGameTool, { exec: exec, g: g, gameOptions: gameOptions }), _jsx(UndoTool, { exec: exec, g: g }), _jsx(SwitchPlayerTool, { exec: exec, g: g }), _jsx(BotTool, { exec: exec, g: g }), _jsx(TutorialTool, { exec: exec, g: g })] }));
180
8
  //# sourceMappingURL=GamePanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GamePanel.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/GamePanel.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGzE,MAAM,UAAU,GAAG,SAAS,CAAA;AAE5B,MAAM,UAAU,GAAG,SAAS,CAAA;;;CAG3B,CAAA;AAQD,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;IACxE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ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AG,GAAG,CAAA;;CAEzB,CAAA"}
1
+ {"version":3,"file":"GamePanel.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/GamePanel.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7C,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CACzE,8BACE,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,WAAW,GAAI,EAC3D,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,GAAI,EAC9B,KAAC,gBAAgB,IAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,GAAI,EACtC,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,GAAI,EAC7B,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,GAAI,IACjC,CACJ,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { GameOption } from './DevToolsHub';
3
+ type NewGameToolProps = {
4
+ exec: (action: () => void, msg: string) => void;
5
+ g: any;
6
+ gameOptions?: GameOption[];
7
+ };
8
+ export declare const NewGameTool: FC<NewGameToolProps>;
9
+ export {};
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { isEnumOption, isWithPlayerOptions } from '@gamepark/rules-api';
4
+ import { useContext, useMemo, useState } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { gameContext } from '../../../GameProvider/GameContext';
7
+ import { checkboxCss, goBtnCss, inlineRowCss, numberInputCss, optionsToggleCss, selectCss, stepBtnCss, toggleLabelCss, toggleRowCss, toolBtnCss, toolDescCss, toolIconCss, toolLabelCss } from './devtools.css';
8
+ const reservedKeys = new Set(['players', 'validate', 'subscriberRequired', 'competitivePlayers']);
9
+ const playerReservedKeys = new Set(['id']);
10
+ export const NewGameTool = ({ exec, g, gameOptions }) => {
11
+ const [newGamePlayers, setNewGamePlayers] = useState(2);
12
+ const [options, setOptions] = useState({});
13
+ const [playerOptions, setPlayerOptions] = useState([]);
14
+ const [showOptions, setShowOptions] = useState(false);
15
+ const optionsSpec = useContext(gameContext).optionsSpec;
16
+ const { t } = useTranslation();
17
+ const specOptions = useMemo(() => {
18
+ if (!optionsSpec)
19
+ return [];
20
+ return Object.keys(optionsSpec)
21
+ .filter(key => !reservedKeys.has(key))
22
+ .map(key => ({ key, spec: optionsSpec[key] }))
23
+ .filter(({ spec }) => spec && typeof spec.label === 'function');
24
+ }, [optionsSpec]);
25
+ const playerSpecOptions = useMemo(() => {
26
+ if (!optionsSpec || !isWithPlayerOptions(optionsSpec))
27
+ return [];
28
+ const playersSpec = optionsSpec.players;
29
+ return Object.keys(playersSpec)
30
+ .filter(key => !playerReservedKeys.has(key))
31
+ .map(key => ({ key, spec: playersSpec[key] }))
32
+ .filter(({ spec }) => spec && typeof spec.label === 'function' && Array.isArray(spec.values));
33
+ }, [optionsSpec]);
34
+ const setPlayerCount = (count) => {
35
+ setNewGamePlayers(count);
36
+ setPlayerOptions(prev => prev.length > count ? prev.slice(0, count) : prev);
37
+ };
38
+ const setPlayerOption = (playerIndex, key, value) => {
39
+ setPlayerOptions(prev => {
40
+ const next = [...prev];
41
+ while (next.length <= playerIndex)
42
+ next.push({});
43
+ next[playerIndex] = { ...next[playerIndex], [key]: value };
44
+ return next;
45
+ });
46
+ };
47
+ const buildOptions = () => {
48
+ const definedOptions = Object.fromEntries(Object.entries(options).filter(([, v]) => v !== undefined && v !== false));
49
+ const hasPlayerOpts = playerOptions.some(p => Object.values(p).some(v => v !== undefined));
50
+ const hasOptions = Object.keys(definedOptions).length > 0 || hasPlayerOpts;
51
+ if (!hasOptions)
52
+ return newGamePlayers;
53
+ const result = { ...definedOptions };
54
+ if (hasPlayerOpts) {
55
+ result.players = Array.from({ length: newGamePlayers }, (_, i) => playerOptions[i] ?? {});
56
+ }
57
+ else {
58
+ result.players = newGamePlayers;
59
+ }
60
+ return result;
61
+ };
62
+ return (_jsxs("div", { css: toolBtnCss, children: [_jsx("span", { css: toolIconCss, children: '\u21BB' }), _jsx("span", { css: toolLabelCss, children: "New Game" }), _jsx("span", { css: toolDescCss, children: "Reset with N players" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [_jsx("button", { css: stepBtnCss, onClick: () => setPlayerCount(Math.max(1, newGamePlayers - 1)), children: "-" }), _jsx("input", { type: "number", min: 1, max: 10, value: newGamePlayers, onChange: e => setPlayerCount(Math.max(1, parseInt(e.target.value) || 2)), css: numberInputCss }), _jsx("button", { css: stepBtnCss, onClick: () => setPlayerCount(Math.min(10, newGamePlayers + 1)), children: "+" }), _jsx("button", { css: goBtnCss, onClick: () => exec(() => g.new(buildOptions()), `New game ${newGamePlayers}p`), children: "Go" })] }), (specOptions.length > 0 || playerSpecOptions.length > 0 || gameOptions?.length) && (_jsxs("button", { css: optionsToggleCss, onClick: e => { e.stopPropagation(); setShowOptions(o => !o); }, children: [_jsx("span", { children: showOptions ? '\u25BE' : '\u25B8' }), _jsx("span", { children: "Options" })] })), showOptions && _jsxs(_Fragment, { children: [specOptions.map(({ key, spec }) => (isEnumOption(spec) ? (_jsxs("div", { css: toggleRowCss, onClick: e => e.stopPropagation(), children: [_jsx("span", { css: toggleLabelCss, children: spec.label(t) }), _jsxs("select", { value: options[key] ?? '', onChange: e => setOptions(prev => ({ ...prev, [key]: e.target.value === '' ? undefined : isNaN(Number(e.target.value)) ? e.target.value : Number(e.target.value) })), css: selectCss, children: [_jsx("option", { value: "", children: "\u2014" }), spec.values.map((v) => (_jsx("option", { value: v, children: spec.valueSpec(v).label(t) }, String(v))))] })] }, key)) : (_jsxs("label", { css: toggleRowCss, onClick: e => e.stopPropagation(), children: [_jsx("input", { type: "checkbox", checked: options[key] ?? false, onChange: e => setOptions(prev => ({ ...prev, [key]: e.target.checked })), css: checkboxCss }), _jsx("span", { css: toggleLabelCss, children: spec.label(t) })] }, key)))), playerSpecOptions.length > 0 && Array.from({ length: newGamePlayers }, (_, i) => (playerSpecOptions.map(({ key, spec }) => (_jsxs("div", { css: toggleRowCss, onClick: e => e.stopPropagation(), children: [_jsxs("span", { css: toggleLabelCss, children: ["P", i + 1, " ", spec.label(t)] }), _jsxs("select", { value: playerOptions[i]?.[key] ?? '', onChange: e => setPlayerOption(i, key, e.target.value === '' ? undefined : isNaN(Number(e.target.value)) ? e.target.value : Number(e.target.value)), css: selectCss, children: [_jsx("option", { value: "", children: "\u2014" }), spec.values.map((v) => (_jsx("option", { value: v, children: spec.valueSpec(v).label(t) }, String(v))))] })] }, `${i}-${key}`))))), gameOptions?.map(opt => (_jsxs("label", { css: toggleRowCss, onClick: e => e.stopPropagation(), children: [_jsx("input", { type: "checkbox", checked: options[opt.key] ?? false, onChange: e => setOptions(prev => ({ ...prev, [opt.key]: e.target.checked })), css: checkboxCss }), _jsx("span", { css: toggleLabelCss, children: opt.label })] }, opt.key)))] })] }));
63
+ };
64
+ //# sourceMappingURL=NewGameTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NewGameTool.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/NewGameTool.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAA4B,MAAM,qBAAqB,CAAA;AACjG,OAAO,EAAM,UAAU,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AAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAC7E,GAAG,EAAE,WAAW,GAChB,EACF,eAAM,GAAG,EAAE,cAAc,YAAG,GAAG,CAAC,KAAK,GAAQ,KAPnC,GAAG,CAAC,GAAG,CAQX,CACT,CAAC,IACD,IACC,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ import { FC } from 'react';
3
+ type SwitchPlayerToolProps = {
4
+ exec: (action: () => void, msg: string) => void;
5
+ g: any;
6
+ };
7
+ export declare const SwitchPlayerTool: FC<SwitchPlayerToolProps>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { usePlayerId, usePlayerIds } from '../../../../hooks/usePlayerId';
3
+ import { inlineRowCss, playerBtnActiveCss, playerBtnCss, toolBtnCss, toolDescCss, toolIconCss, toolLabelCss } from './devtools.css';
4
+ export const SwitchPlayerTool = ({ exec, g }) => {
5
+ const currentPlayer = usePlayerId();
6
+ const players = usePlayerIds();
7
+ return (_jsxs("div", { css: toolBtnCss, children: [_jsx("span", { css: toolIconCss, children: '\u2194' }), _jsx("span", { css: toolLabelCss, children: "Switch Player" }), _jsx("span", { css: toolDescCss, children: "View as another player" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [players.map(pid => (_jsxs("button", { css: [playerBtnCss, pid === currentPlayer && playerBtnActiveCss], onClick: () => exec(() => g.changePlayer(pid), `Switched to P${pid}`), children: ["P", String(pid)] }, String(pid)))), _jsx("button", { css: [playerBtnCss, currentPlayer === undefined && playerBtnActiveCss], onClick: () => exec(() => g.changePlayer(), 'Spectator mode'), children: "Spect" })] })] }));
8
+ };
9
+ //# sourceMappingURL=SwitchPlayerTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchPlayerTool.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/SwitchPlayerTool.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACzE,OAAO,EACL,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAC9C,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EACnD,MAAM,gBAAgB,CAAA;AAOvB,MAAM,CAAC,MAAM,gBAAgB,GAA8B,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE;IACzE,MAAM,aAAa,GAAG,WAAW,EAAE,CAAA;IACnC,MAAM,OAAO,GAAG,YAAY,EAAE,CAAA;IAE9B,OAAO,CACL,eAAK,GAAG,EAAE,UAAU,aAClB,eAAM,GAAG,EAAE,WAAW,YAAG,QAAQ,GAAQ,EACzC,eAAM,GAAG,EAAE,YAAY,8BAAsB,EAC7C,eAAM,GAAG,EAAE,WAAW,uCAA+B,EACrD,eAAK,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,aACtD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAClB,kBACE,GAAG,EAAE,CAAC,YAAY,EAAE,GAAG,KAAK,aAAa,IAAI,kBAAkB,CAAC,EAChE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,EAAE,CAAC,kBACnE,MAAM,CAAC,GAAG,CAAC,KAHF,MAAM,CAAC,GAAG,CAAC,CAIf,CACV,CAAC,EACF,iBACE,GAAG,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,SAAS,IAAI,kBAAkB,CAAC,EACtE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,gBAAgB,CAAC,sBAEtD,IACL,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ import { FC } from 'react';
3
+ type TutorialToolProps = {
4
+ exec: (action: () => void, msg: string) => void;
5
+ g: any;
6
+ };
7
+ export declare const TutorialTool: FC<TutorialToolProps>;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { toolBtnCss, toolDescCss, toolIconCss, toolLabelCss } from './devtools.css';
3
+ export const TutorialTool = ({ exec, g }) => (_jsxs("button", { css: toolBtnCss, onClick: () => exec(() => g.tutorial(), 'Tutorial started'), children: [_jsx("span", { css: toolIconCss, children: "?" }), _jsx("span", { css: toolLabelCss, children: "Tutorial" }), _jsx("span", { css: toolDescCss, children: "Start tutorial mode" })] }));
4
+ //# sourceMappingURL=TutorialTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TutorialTool.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/TutorialTool.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAOnF,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAClE,kBAAQ,GAAG,EAAE,UAAU,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,kBAAkB,CAAC,aAC3D,eAAM,GAAG,EAAE,WAAW,kBAAU,EAChC,eAAM,GAAG,EAAE,YAAY,yBAAiB,EACxC,eAAM,GAAG,EAAE,WAAW,oCAA4B,IAC3C,CACV,CAAA"}
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ import { FC } from 'react';
3
+ type UndoToolProps = {
4
+ exec: (action: () => void, msg: string) => void;
5
+ g: any;
6
+ };
7
+ export declare const UndoTool: FC<UndoToolProps>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { useState } from 'react';
4
+ import { goBtnCss, inlineRowCss, numberInputCss, stepBtnCss, toolBtnCss, toolDescCss, toolIconCss, toolLabelCss } from './devtools.css';
5
+ export const UndoTool = ({ exec, g }) => {
6
+ const [undoCount, setUndoCount] = useState(1);
7
+ return (_jsxs("div", { css: toolBtnCss, children: [_jsx("span", { css: toolIconCss, children: '\u238C' }), _jsx("span", { css: toolLabelCss, children: "Undo" }), _jsx("span", { css: toolDescCss, children: "Revert N moves" }), _jsxs("div", { css: inlineRowCss, onClick: e => e.stopPropagation(), children: [_jsx("button", { css: stepBtnCss, onClick: () => setUndoCount(c => Math.max(1, c - 1)), children: "-" }), _jsx("input", { type: "number", min: 1, max: 999, value: undoCount, onChange: e => setUndoCount(Math.max(1, parseInt(e.target.value) || 1)), css: numberInputCss }), _jsx("button", { css: stepBtnCss, onClick: () => setUndoCount(c => c + 1), children: "+" }), _jsx("button", { css: goBtnCss, onClick: () => exec(() => g.undo(undoCount), `Undo ${undoCount} move${undoCount > 1 ? 's' : ''}`), children: "Go" })] })] }));
8
+ };
9
+ //# sourceMappingURL=UndoTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UndoTool.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/UndoTool.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EACL,QAAQ,EAAE,YAAY,EAAE,cAAc,EACtC,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAC/D,MAA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,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAE1F,IACL,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,24 @@
1
+ export declare const GP_PRIMARY = "#28B8CE";
2
+ export declare const toolReveal: {
3
+ name: string;
4
+ styles: string;
5
+ anim: 1;
6
+ toString: () => string;
7
+ } & string;
8
+ export declare const toolBtnCss: import("@emotion/utils").SerializedStyles;
9
+ export declare const toolBtnActiveCss: import("@emotion/utils").SerializedStyles;
10
+ export declare const toolIconCss: import("@emotion/utils").SerializedStyles;
11
+ export declare const toolLabelCss: import("@emotion/utils").SerializedStyles;
12
+ export declare const toolDescCss: import("@emotion/utils").SerializedStyles;
13
+ export declare const activeIndicatorCss: import("@emotion/utils").SerializedStyles;
14
+ export declare const inlineRowCss: import("@emotion/utils").SerializedStyles;
15
+ export declare const stepBtnCss: import("@emotion/utils").SerializedStyles;
16
+ export declare const numberInputCss: import("@emotion/utils").SerializedStyles;
17
+ export declare const goBtnCss: import("@emotion/utils").SerializedStyles;
18
+ export declare const playerBtnCss: import("@emotion/utils").SerializedStyles;
19
+ export declare const playerBtnActiveCss: import("@emotion/utils").SerializedStyles;
20
+ export declare const toggleRowCss: import("@emotion/utils").SerializedStyles;
21
+ export declare const checkboxCss: import("@emotion/utils").SerializedStyles;
22
+ export declare const toggleLabelCss: import("@emotion/utils").SerializedStyles;
23
+ export declare const optionsToggleCss: import("@emotion/utils").SerializedStyles;
24
+ export declare const selectCss: import("@emotion/utils").SerializedStyles;
@@ -0,0 +1,183 @@
1
+ import { css, keyframes } from '@emotion/react';
2
+ export const GP_PRIMARY = '#28B8CE';
3
+ export const toolReveal = keyframes `
4
+ from { opacity: 0; transform: translateX(-0.375em); }
5
+ to { opacity: 1; transform: translateX(0); }
6
+ `;
7
+ export const toolBtnCss = css `
8
+ position: relative;
9
+ display: grid;
10
+ grid-template-columns: 1.75em 1fr;
11
+ grid-template-rows: auto auto;
12
+ align-items: center;
13
+ gap: 0 0.625em;
14
+ padding: 0.625em 0.75em;
15
+ border: none;
16
+ border-radius: 0.5em;
17
+ background: transparent;
18
+ cursor: pointer;
19
+ text-align: left;
20
+ transition: background 0.15s;
21
+ animation: ${toolReveal} 0.25s ease-out backwards;
22
+ font-family: inherit;
23
+ &:hover { background: rgba(40, 184, 206, 0.08); }
24
+ &:active { background: rgba(40, 184, 206, 0.14); }
25
+ `;
26
+ export const toolBtnActiveCss = css `
27
+ background: rgba(40, 184, 206, 0.1);
28
+ &::after {
29
+ content: '';
30
+ position: absolute;
31
+ left: 0; top: 0.5em; bottom: 0.5em;
32
+ width: 0.2em;
33
+ border-radius: 0 0.2em 0.2em 0;
34
+ background: ${GP_PRIMARY};
35
+ }
36
+ `;
37
+ export const toolIconCss = css `
38
+ grid-row: 1 / -1;
39
+ color: ${GP_PRIMARY};
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ width: 1.75em; height: 1.75em;
44
+ border-radius: 0.375em;
45
+ background: rgba(40, 184, 206, 0.08);
46
+ `;
47
+ export const toolLabelCss = css `
48
+ font-weight: 700;
49
+ color: #e0f0f4;
50
+ line-height: 1.2;
51
+ `;
52
+ export const toolDescCss = css `
53
+ color: #5a8a98;
54
+ line-height: 1.2;
55
+ `;
56
+ export const activeIndicatorCss = css `
57
+ position: absolute;
58
+ top: 0.625em; right: 0.75em;
59
+ width: 0.44em; height: 0.44em;
60
+ border-radius: 50%;
61
+ background: ${GP_PRIMARY};
62
+ box-shadow: 0 0 0.375em rgba(40, 184, 206, 0.5);
63
+ `;
64
+ export const inlineRowCss = css `
65
+ grid-column: 1 / -1;
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 0.25em;
69
+ margin-top: 0.375em;
70
+ `;
71
+ export const stepBtnCss = css `
72
+ width: 1.625em; height: 1.625em;
73
+ border-radius: 0.3em;
74
+ border: 0.06em solid rgba(40, 184, 206, 0.25);
75
+ background: rgba(40, 184, 206, 0.06);
76
+ color: ${GP_PRIMARY};
77
+ font-weight: 700;
78
+ cursor: pointer;
79
+ display: flex; align-items: center; justify-content: center;
80
+ font-family: inherit;
81
+ transition: all 0.15s;
82
+ &:hover { background: rgba(40, 184, 206, 0.14); border-color: rgba(40, 184, 206, 0.4); }
83
+ `;
84
+ export const numberInputCss = css `
85
+ width: 3em; height: 1.625em;
86
+ border-radius: 0.3em;
87
+ border: 0.06em solid rgba(40, 184, 206, 0.25);
88
+ background: rgba(0, 0, 0, 0.3);
89
+ color: #e0f0f4;
90
+ font-weight: 700;
91
+ text-align: center;
92
+ font-family: inherit;
93
+ font-variant-numeric: tabular-nums;
94
+ &:focus { outline: none; border-color: ${GP_PRIMARY}; box-shadow: 0 0 0 0.125em rgba(40, 184, 206, 0.15); }
95
+ &::-webkit-inner-spin-button, &::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
96
+ `;
97
+ export const goBtnCss = css `
98
+ height: 1.625em;
99
+ padding: 0 0.75em;
100
+ border-radius: 0.3em;
101
+ border: 0.06em solid rgba(40, 184, 206, 0.35);
102
+ background: rgba(40, 184, 206, 0.15);
103
+ color: ${GP_PRIMARY};
104
+ font-weight: 800;
105
+ text-transform: uppercase;
106
+ letter-spacing: 0.05em;
107
+ cursor: pointer;
108
+ margin-left: auto;
109
+ font-family: inherit;
110
+ transition: all 0.15s;
111
+ flex-shrink: 0;
112
+ &:hover { background: rgba(40, 184, 206, 0.25); border-color: rgba(40, 184, 206, 0.5); }
113
+ `;
114
+ export const playerBtnCss = css `
115
+ height: 1.625em;
116
+ padding: 0 0.625em;
117
+ border-radius: 0.3em;
118
+ border: 0.06em solid rgba(40, 184, 206, 0.25);
119
+ background: rgba(40, 184, 206, 0.06);
120
+ color: #5a8a98;
121
+ font-weight: 700;
122
+ cursor: pointer;
123
+ font-family: inherit;
124
+ transition: all 0.15s;
125
+ &:hover { background: rgba(40, 184, 206, 0.14); border-color: rgba(40, 184, 206, 0.4); color: #e0f0f4; }
126
+ `;
127
+ export const playerBtnActiveCss = css `
128
+ background: rgba(40, 184, 206, 0.2);
129
+ border-color: ${GP_PRIMARY};
130
+ color: ${GP_PRIMARY};
131
+ `;
132
+ export const toggleRowCss = css `
133
+ grid-column: 1 / -1;
134
+ display: flex; align-items: center; gap: 0.5em;
135
+ margin-top: 0.25em; padding: 0.25em 0;
136
+ cursor: pointer;
137
+ `;
138
+ export const checkboxCss = css `
139
+ appearance: none;
140
+ width: 1em; height: 1em;
141
+ border-radius: 0.25em;
142
+ border: 0.06em solid rgba(40, 184, 206, 0.35);
143
+ background: rgba(0, 0, 0, 0.3);
144
+ cursor: pointer; flex-shrink: 0;
145
+ position: relative;
146
+ transition: all 0.15s;
147
+ &:checked { background: rgba(40, 184, 206, 0.2); border-color: ${GP_PRIMARY}; }
148
+ &:checked::after {
149
+ content: '\u2713';
150
+ position: absolute; top: 50%; left: 50%;
151
+ transform: translate(-50%, -50%);
152
+ color: ${GP_PRIMARY}; font-weight: 700;
153
+ }
154
+ &:hover { border-color: rgba(40, 184, 206, 0.5); }
155
+ `;
156
+ export const toggleLabelCss = css `
157
+ font-weight: 600; color: #5a8a98;
158
+ `;
159
+ export const optionsToggleCss = css `
160
+ grid-column: 1 / -1;
161
+ display: flex; align-items: center; gap: 0.375em;
162
+ margin-top: 0.375em; padding: 0.25em 0;
163
+ border: none; background: none;
164
+ cursor: pointer; font-family: inherit;
165
+ color: ${GP_PRIMARY}; font-weight: 700;
166
+ font-size: 0.85em;
167
+ &:hover { color: #9fe2f7; }
168
+ `;
169
+ export const selectCss = css `
170
+ margin-left: auto;
171
+ height: 1.625em;
172
+ padding: 0 0.5em;
173
+ border-radius: 0.3em;
174
+ border: 0.06em solid rgba(40, 184, 206, 0.25);
175
+ background: rgba(0, 0, 0, 0.3);
176
+ color: #e0f0f4;
177
+ font-weight: 600;
178
+ font-family: inherit;
179
+ cursor: pointer;
180
+ &:focus { outline: none; border-color: ${GP_PRIMARY}; box-shadow: 0 0 0 0.125em rgba(40, 184, 206, 0.15); }
181
+ option { background: #0a1929; color: #e0f0f4; }
182
+ `;
183
+ //# sourceMappingURL=devtools.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools.css.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/devtools.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAA;AAEnC,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAA;;;CAGlC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;eAcd,UAAU;;;;CAIxB,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;kBAQjB,UAAU;;CAE3B,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;WAEnB,UAAU;;;;;;;CAOpB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;CAI9B,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;CAG7B,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;;;;;gBAKrB,UAAU;;CAEzB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;CAM9B,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;WAKlB,UAAU;;;;;;;CAOpB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;2CAUU,UAAU;;CAEpD,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;WAMhB,UAAU;;;;;;;;;;CAUpB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;CAY9B,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;;kBAEnB,UAAU;WACjB,UAAU;CACpB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;CAK9B,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;mEASqC,UAAU;;;;;aAKhE,UAAU;;;CAGtB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;CAEhC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;WAMxB,UAAU;;;CAGpB,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;;;;;2CAWe,UAAU;;CAEpD,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/react-game",
3
- "version": "7.7.4",
3
+ "version": "7.7.5",
4
4
  "type": "module",
5
5
  "description": "React components & tools to create a Board Game user interface for Game Park",
6
6
  "author": "Romain Fromi <romain@game-park.com> (https://game-park.com/)",