@gamepark/react-game 7.7.11 → 7.7.13
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 +41 -41
- package/dist/components/GameProvider/GameErrorBoundary.js +108 -108
- package/dist/components/GameProvider/GameInternalProviders.d.ts +6 -0
- package/dist/components/GameProvider/GameInternalProviders.js +10 -0
- package/dist/components/GameProvider/GameInternalProviders.js.map +1 -0
- package/dist/components/GameProvider/LogHistoryBridge.d.ts +7 -0
- package/dist/components/GameProvider/LogHistoryBridge.js +23 -0
- package/dist/components/GameProvider/LogHistoryBridge.js.map +1 -0
- package/dist/components/Header/Header.js +45 -4
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/JournalTabs/History/SetupLogItem.js +19 -19
- package/dist/components/JournalTabs/History/VirtualizedLogItem.d.ts +12 -0
- package/dist/components/JournalTabs/History/VirtualizedLogItem.js +6 -0
- package/dist/components/JournalTabs/History/VirtualizedLogItem.js.map +1 -0
- package/dist/components/Log/LiveLogButton.js +3 -1
- package/dist/components/Log/LiveLogButton.js.map +1 -1
- package/dist/components/Log/LogHistoryProvider.d.ts +7 -0
- package/dist/components/Log/LogHistoryProvider.js +22 -0
- package/dist/components/Log/LogHistoryProvider.js.map +1 -0
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +2 -3
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js.map +1 -1
- package/dist/components/buttons/ThemeButton/ThemeButton.js +4 -1
- package/dist/components/buttons/ThemeButton/ThemeButton.js.map +1 -1
- package/dist/components/dialogs/Dialog.js +35 -2
- package/dist/components/dialogs/Dialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/BottomBarNavigation.js +2 -2
- package/dist/components/dialogs/RulesDialog/BottomBarNavigation.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesDialog.js +2 -3
- package/dist/components/dialogs/RulesDialog/RulesDialog.js.map +1 -1
- package/dist/components/material/Dices/OctahedralDiceDescription.d.ts +48 -0
- package/dist/components/material/Dices/OctahedralDiceDescription.js +142 -0
- package/dist/components/material/Dices/OctahedralDiceDescription.js.map +1 -0
- package/dist/components/material/GameTable/DevToolEntry.d.ts +17 -0
- package/dist/components/material/GameTable/DevToolEntry.js +13 -0
- package/dist/components/material/GameTable/DevToolEntry.js.map +1 -0
- package/dist/components/material/GameTable/DevTools/BotTool.js +23 -2
- package/dist/components/material/GameTable/DevTools/BotTool.js.map +1 -1
- package/dist/components/material/GameTable/DevTools/DevToolsStyles.d.ts +58 -0
- package/dist/components/material/GameTable/DevTools/DevToolsStyles.js +706 -0
- package/dist/components/material/GameTable/DevTools/DevToolsStyles.js.map +1 -0
- package/dist/components/material/GameTable/DevToolsHub.d.ts +4 -21
- package/dist/components/material/GameTable/DevToolsHub.js +24 -830
- package/dist/components/material/GameTable/DevToolsHub.js.map +1 -1
- package/dist/components/material/GameTable/DevToolsStyles.d.ts +67 -0
- package/dist/components/material/GameTable/DevToolsStyles.js +752 -0
- package/dist/components/material/GameTable/DevToolsStyles.js.map +1 -0
- package/dist/components/material/GameTable/JsonHighlighter.d.ts +3 -0
- package/dist/components/material/GameTable/JsonHighlighter.js +37 -0
- package/dist/components/material/GameTable/JsonHighlighter.js.map +1 -0
- package/dist/components/material/sound/bellSound.d.ts +1 -0
- package/dist/components/material/sound/bellSound.js +2 -0
- package/dist/components/material/sound/bellSound.js.map +1 -0
- package/dist/components/menus/BugReport/BugReportButton.js +3 -1
- package/dist/components/menus/BugReport/BugReportButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js +3 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js +3 -2
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js.map +1 -1
- package/dist/components/menus/Menu/LogoIcon.js +1 -1
- package/dist/components/menus/Menu/LogoIcon.js.map +1 -1
- package/dist/components/menus/Menu/Menu.js +2 -1
- package/dist/components/menus/Menu/Menu.js.map +1 -1
- package/dist/components/menus/Menu/NavButton.js +3 -1
- package/dist/components/menus/Menu/NavButton.js.map +1 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js +3 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js.map +1 -1
- package/dist/components/menus/Result/ResultButton.js +3 -1
- package/dist/components/menus/Result/ResultButton.js.map +1 -1
- package/dist/components/menus/SoundButton/SoundButton.js +3 -1
- package/dist/components/menus/SoundButton/SoundButton.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.d.ts +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +5 -0
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoButton.js +3 -1
- package/dist/components/menus/UndoButton/UndoButton.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorialDisplay.js +5 -5
- package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
- package/dist/css/GameTheme.d.ts +8 -0
- package/dist/css/GameTheme.js +4 -0
- package/dist/css/GameTheme.js.map +1 -1
- package/dist/css/backgroundCss.js +3 -3
- package/dist/css/cursorCss.js +6 -6
- package/dist/css/fadeIn.js +6 -6
- package/dist/css/shineEffect.js +28 -28
- package/dist/css/transformCss.js +4 -4
- package/dist/hooks/LogHistoryContext.d.ts +6 -0
- package/dist/hooks/LogHistoryContext.js +4 -0
- package/dist/hooks/LogHistoryContext.js.map +1 -0
- package/dist/hooks/useBackgroundTabHandler.d.ts +1 -0
- package/dist/hooks/useBackgroundTabHandler.js +38 -0
- package/dist/hooks/useBackgroundTabHandler.js.map +1 -0
- package/dist/hooks/useFastAnimationsOnReturn.d.ts +1 -0
- package/dist/hooks/useFastAnimationsOnReturn.js +38 -0
- package/dist/hooks/useFastAnimationsOnReturn.js.map +1 -0
- package/dist/hooks/useFlatHistory.js +4 -1
- package/dist/hooks/useFlatHistory.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/material/Wheel/WheelContent.d.ts +0 -13
- package/dist/components/material/Wheel/WheelContent.js +0 -37
- package/dist/components/material/Wheel/WheelContent.js.map +0 -1
- package/dist/hooks/useFailures.d.ts +0 -1
- package/dist/hooks/useFailures.js +0 -11
- package/dist/hooks/useFailures.js.map +0 -1
- package/dist/hooks/useWebP.d.ts +0 -1
- package/dist/hooks/useWebP.js +0 -13
- package/dist/hooks/useWebP.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
# @gamepark/react-game
|
|
2
|
-
|
|
3
|
-
React components & tools to create a Board Game user interface for Game Park.
|
|
4
|
-
|
|
5
|
-
## Sounds deployment
|
|
6
|
-
|
|
7
|
-
Default sounds (e.g. turn notification) are hosted on `sounds.game-park.com` (Clever Cloud Cellar).
|
|
8
|
-
|
|
9
|
-
The `sounds/` directory at the root of this project contains the sound files to deploy.
|
|
10
|
-
|
|
11
|
-
### rclone configuration
|
|
12
|
-
|
|
13
|
-
Install [rclone](https://rclone.org/) then configure a remote:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
rclone config
|
|
17
|
-
> n
|
|
18
|
-
name> sounds
|
|
19
|
-
Storage> s3
|
|
20
|
-
provider> Other
|
|
21
|
-
env_auth> false
|
|
22
|
-
access_key_id> [your key - do not commit!]
|
|
23
|
-
secret_access_key> [your secret - do not commit!]
|
|
24
|
-
region>
|
|
25
|
-
endpoint> cellar-c2.services.clever-cloud.com
|
|
26
|
-
location_constraint>
|
|
27
|
-
acl> public-read
|
|
28
|
-
Edit advanced config> n
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Deploy sounds
|
|
32
|
-
|
|
33
|
-
Sounds are automatically synced during `yarn publish`. You can also sync manually:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
yarn sync-sounds
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### CORS
|
|
40
|
-
|
|
41
|
-
The Cellar bucket must have CORS configured to allow `fetch()` from game origins (`Access-Control-Allow-Origin: *`).
|
|
1
|
+
# @gamepark/react-game
|
|
2
|
+
|
|
3
|
+
React components & tools to create a Board Game user interface for Game Park.
|
|
4
|
+
|
|
5
|
+
## Sounds deployment
|
|
6
|
+
|
|
7
|
+
Default sounds (e.g. turn notification) are hosted on `sounds.game-park.com` (Clever Cloud Cellar).
|
|
8
|
+
|
|
9
|
+
The `sounds/` directory at the root of this project contains the sound files to deploy.
|
|
10
|
+
|
|
11
|
+
### rclone configuration
|
|
12
|
+
|
|
13
|
+
Install [rclone](https://rclone.org/) then configure a remote:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
rclone config
|
|
17
|
+
> n
|
|
18
|
+
name> sounds
|
|
19
|
+
Storage> s3
|
|
20
|
+
provider> Other
|
|
21
|
+
env_auth> false
|
|
22
|
+
access_key_id> [your key - do not commit!]
|
|
23
|
+
secret_access_key> [your secret - do not commit!]
|
|
24
|
+
region>
|
|
25
|
+
endpoint> cellar-c2.services.clever-cloud.com
|
|
26
|
+
location_constraint>
|
|
27
|
+
acl> public-read
|
|
28
|
+
Edit advanced config> n
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Deploy sounds
|
|
32
|
+
|
|
33
|
+
Sounds are automatically synced during `yarn publish`. You can also sync manually:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn sync-sounds
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### CORS
|
|
40
|
+
|
|
41
|
+
The Cellar bucket must have CORS configured to allow `fetch()` from game origins (`Access-Control-Allow-Origin: *`).
|
|
@@ -20,124 +20,124 @@ export class GameErrorBoundary extends Component {
|
|
|
20
20
|
return (_jsx("div", { css: containerCss, children: _jsxs("div", { css: cardCss, children: [_jsx("div", { css: iconContainerCss, children: _jsx(FontAwesomeIcon, { icon: faTriangleExclamation, css: iconCss }) }), _jsx("p", { css: messageCss, children: _jsx(Trans, { defaults: "A technical error has occurred. The error has been sent to the Game Park team.", i18nKey: "error.crash", ns: "common" }) }), _jsx("p", { css: hintCss, children: _jsx(Trans, { defaults: "You can refresh the page to continue your game.", i18nKey: "error.refresh.hint", ns: "common" }) }), _jsx("button", { css: buttonCss, onClick: () => window.location.reload(), children: _jsx(Trans, { defaults: "Refresh the page", i18nKey: "error.refresh.button", ns: "common" }) }), _jsx("div", { css: dividerCss }), _jsx("p", { css: secondaryMessageCss, children: _jsx(Trans, { defaults: "If the problem persists despite refreshing and the game is corrupted, please let us know on Discord.", i18nKey: "error.discord.hint", ns: "common" }) }), _jsxs("a", { css: discordLinkCss, href: "https://discord.gg/ZMCX5reQm8", target: "_blank", rel: "noopener noreferrer", children: [_jsx("svg", { css: discordIconCss, viewBox: "0 0 127.14 96.36", fill: "currentColor", children: _jsx("path", { d: "M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2.04a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2.04a68.68 68.68 0 0 1-10.87 5.19 77.28 77.28 0 0 0 6.89 11.1 105.45 105.45 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53.05c0-6.94 5.04-12.67 11.45-12.67S53.99 46.1 53.9 53.05c0 6.94-5.08 12.64-11.45 12.64Zm42.24 0C78.41 65.69 73.25 60 73.25 53.05c0-6.94 5.04-12.67 11.44-12.67s11.51 5.73 11.44 12.67c0 6.94-5.04 12.64-11.44 12.64Z" }) }), _jsx(Trans, { defaults: "Join the Game Park Discord", i18nKey: "error.discord.button", ns: "common" })] })] }) }));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const fadeIn = keyframes `
|
|
24
|
-
from {
|
|
25
|
-
opacity: 0;
|
|
26
|
-
transform: translateY(16px);
|
|
27
|
-
}
|
|
28
|
-
to {
|
|
29
|
-
opacity: 1;
|
|
30
|
-
transform: translateY(0);
|
|
31
|
-
}
|
|
23
|
+
const fadeIn = keyframes `
|
|
24
|
+
from {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
transform: translateY(16px);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
transform: translateY(0);
|
|
31
|
+
}
|
|
32
32
|
`;
|
|
33
|
-
const containerCss = css `
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
height: 100%;
|
|
38
|
-
width: 100%;
|
|
39
|
-
padding: 2em;
|
|
40
|
-
box-sizing: border-box;
|
|
41
|
-
font-family: "Mulish", sans-serif;
|
|
33
|
+
const containerCss = css `
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
height: 100%;
|
|
38
|
+
width: 100%;
|
|
39
|
+
padding: 2em;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
font-family: "Mulish", sans-serif;
|
|
42
42
|
`;
|
|
43
|
-
const cardCss = css `
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
align-items: center;
|
|
47
|
-
max-width: 460px;
|
|
48
|
-
padding: 2.5em 2.5em 2em;
|
|
49
|
-
border-radius: 1.2em;
|
|
50
|
-
background: #002448;
|
|
51
|
-
color: #eee;
|
|
52
|
-
text-align: center;
|
|
53
|
-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
54
|
-
animation: ${fadeIn} 0.4s ease-out;
|
|
43
|
+
const cardCss = css `
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
align-items: center;
|
|
47
|
+
max-width: 460px;
|
|
48
|
+
padding: 2.5em 2.5em 2em;
|
|
49
|
+
border-radius: 1.2em;
|
|
50
|
+
background: #002448;
|
|
51
|
+
color: #eee;
|
|
52
|
+
text-align: center;
|
|
53
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
54
|
+
animation: ${fadeIn} 0.4s ease-out;
|
|
55
55
|
`;
|
|
56
|
-
const iconContainerCss = css `
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: center;
|
|
60
|
-
width: 64px;
|
|
61
|
-
height: 64px;
|
|
62
|
-
border-radius: 50%;
|
|
63
|
-
background: rgba(40, 184, 206, 0.15);
|
|
64
|
-
margin-bottom: 1.2em;
|
|
56
|
+
const iconContainerCss = css `
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
width: 64px;
|
|
61
|
+
height: 64px;
|
|
62
|
+
border-radius: 50%;
|
|
63
|
+
background: rgba(40, 184, 206, 0.15);
|
|
64
|
+
margin-bottom: 1.2em;
|
|
65
65
|
`;
|
|
66
|
-
const iconCss = css `
|
|
67
|
-
font-size: 32px;
|
|
68
|
-
color: #28B8CE;
|
|
66
|
+
const iconCss = css `
|
|
67
|
+
font-size: 32px;
|
|
68
|
+
color: #28B8CE;
|
|
69
69
|
`;
|
|
70
|
-
const messageCss = css `
|
|
71
|
-
font-size: 1.05em;
|
|
72
|
-
font-weight: 600;
|
|
73
|
-
line-height: 1.5;
|
|
74
|
-
margin: 0 0 0.3em;
|
|
70
|
+
const messageCss = css `
|
|
71
|
+
font-size: 1.05em;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
line-height: 1.5;
|
|
74
|
+
margin: 0 0 0.3em;
|
|
75
75
|
`;
|
|
76
|
-
const hintCss = css `
|
|
77
|
-
font-size: 0.95em;
|
|
78
|
-
line-height: 1.5;
|
|
79
|
-
margin: 0;
|
|
80
|
-
opacity: 0.8;
|
|
76
|
+
const hintCss = css `
|
|
77
|
+
font-size: 0.95em;
|
|
78
|
+
line-height: 1.5;
|
|
79
|
+
margin: 0;
|
|
80
|
+
opacity: 0.8;
|
|
81
81
|
`;
|
|
82
|
-
const buttonCss = css `
|
|
83
|
-
margin-top: 1.5em;
|
|
84
|
-
padding: 0.65em 2.2em;
|
|
85
|
-
font-size: 1em;
|
|
86
|
-
font-family: inherit;
|
|
87
|
-
font-weight: 700;
|
|
88
|
-
border: none;
|
|
89
|
-
border-radius: 0.6em;
|
|
90
|
-
background: #28B8CE;
|
|
91
|
-
color: white;
|
|
92
|
-
cursor: pointer;
|
|
93
|
-
transition: background 0.2s, transform 0.1s;
|
|
94
|
-
letter-spacing: 0.02em;
|
|
95
|
-
|
|
96
|
-
&:hover {
|
|
97
|
-
background: #24a5b9;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
&:active {
|
|
101
|
-
background: #2092a3;
|
|
102
|
-
transform: scale(0.97);
|
|
103
|
-
}
|
|
82
|
+
const buttonCss = css `
|
|
83
|
+
margin-top: 1.5em;
|
|
84
|
+
padding: 0.65em 2.2em;
|
|
85
|
+
font-size: 1em;
|
|
86
|
+
font-family: inherit;
|
|
87
|
+
font-weight: 700;
|
|
88
|
+
border: none;
|
|
89
|
+
border-radius: 0.6em;
|
|
90
|
+
background: #28B8CE;
|
|
91
|
+
color: white;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
transition: background 0.2s, transform 0.1s;
|
|
94
|
+
letter-spacing: 0.02em;
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
background: #24a5b9;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&:active {
|
|
101
|
+
background: #2092a3;
|
|
102
|
+
transform: scale(0.97);
|
|
103
|
+
}
|
|
104
104
|
`;
|
|
105
|
-
const dividerCss = css `
|
|
106
|
-
width: 60%;
|
|
107
|
-
height: 1px;
|
|
108
|
-
background: rgba(255, 255, 255, 0.12);
|
|
109
|
-
margin: 1.8em 0 1.2em;
|
|
105
|
+
const dividerCss = css `
|
|
106
|
+
width: 60%;
|
|
107
|
+
height: 1px;
|
|
108
|
+
background: rgba(255, 255, 255, 0.12);
|
|
109
|
+
margin: 1.8em 0 1.2em;
|
|
110
110
|
`;
|
|
111
|
-
const secondaryMessageCss = css `
|
|
112
|
-
font-size: 0.85em;
|
|
113
|
-
line-height: 1.6;
|
|
114
|
-
margin: 0 0 1em;
|
|
115
|
-
opacity: 0.65;
|
|
111
|
+
const secondaryMessageCss = css `
|
|
112
|
+
font-size: 0.85em;
|
|
113
|
+
line-height: 1.6;
|
|
114
|
+
margin: 0 0 1em;
|
|
115
|
+
opacity: 0.65;
|
|
116
116
|
`;
|
|
117
|
-
const discordLinkCss = css `
|
|
118
|
-
display: inline-flex;
|
|
119
|
-
align-items: center;
|
|
120
|
-
gap: 0.5em;
|
|
121
|
-
padding: 0.5em 1.4em;
|
|
122
|
-
font-size: 0.9em;
|
|
123
|
-
font-family: inherit;
|
|
124
|
-
font-weight: 600;
|
|
125
|
-
color: white;
|
|
126
|
-
background: #5865F2;
|
|
127
|
-
border-radius: 0.5em;
|
|
128
|
-
text-decoration: none;
|
|
129
|
-
transition: background 0.2s, transform 0.1s;
|
|
130
|
-
|
|
131
|
-
&:hover {
|
|
132
|
-
background: #4752C4;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&:active {
|
|
136
|
-
transform: scale(0.97);
|
|
137
|
-
}
|
|
117
|
+
const discordLinkCss = css `
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 0.5em;
|
|
121
|
+
padding: 0.5em 1.4em;
|
|
122
|
+
font-size: 0.9em;
|
|
123
|
+
font-family: inherit;
|
|
124
|
+
font-weight: 600;
|
|
125
|
+
color: white;
|
|
126
|
+
background: #5865F2;
|
|
127
|
+
border-radius: 0.5em;
|
|
128
|
+
text-decoration: none;
|
|
129
|
+
transition: background 0.2s, transform 0.1s;
|
|
130
|
+
|
|
131
|
+
&:hover {
|
|
132
|
+
background: #4752C4;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:active {
|
|
136
|
+
transform: scale(0.97);
|
|
137
|
+
}
|
|
138
138
|
`;
|
|
139
|
-
const discordIconCss = css `
|
|
140
|
-
width: 20px;
|
|
141
|
-
height: 20px;
|
|
139
|
+
const discordIconCss = css `
|
|
140
|
+
width: 20px;
|
|
141
|
+
height: 20px;
|
|
142
142
|
`;
|
|
143
143
|
//# sourceMappingURL=GameErrorBoundary.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Internal providers that need access to the Redux store (i.e. must be inside Remote/LocalGameProvider).
|
|
4
|
+
* Keeps GameProvider clean — add future internal providers here.
|
|
5
|
+
*/
|
|
6
|
+
export declare const GameInternalProviders: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { LogHistoryProvider } from '../Log/LogHistoryProvider';
|
|
3
|
+
/**
|
|
4
|
+
* Internal providers that need access to the Redux store (i.e. must be inside Remote/LocalGameProvider).
|
|
5
|
+
* Keeps GameProvider clean — add future internal providers here.
|
|
6
|
+
*/
|
|
7
|
+
export const GameInternalProviders = ({ children }) => {
|
|
8
|
+
return (_jsx(LogHistoryProvider, { children: children }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=GameInternalProviders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameInternalProviders.js","sourceRoot":"","sources":["../../../src/components/GameProvider/GameInternalProviders.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,KAAC,kBAAkB,cAChB,QAAQ,GACU,CACtB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Bridge component that computes the log history and injects it into the existing gameContext.
|
|
4
|
+
* Only activates when logs are configured. Sits inside Remote/LocalGameProvider
|
|
5
|
+
* so it has access to the Redux store.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LogHistoryBridge: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useContext, useMemo } from 'react';
|
|
3
|
+
import { useLogHistoryProvider } from '../../hooks/useFlatHistory';
|
|
4
|
+
import { gameContext } from './GameContext';
|
|
5
|
+
/**
|
|
6
|
+
* Bridge component that computes the log history and injects it into the existing gameContext.
|
|
7
|
+
* Only activates when logs are configured. Sits inside Remote/LocalGameProvider
|
|
8
|
+
* so it has access to the Redux store.
|
|
9
|
+
*/
|
|
10
|
+
export const LogHistoryBridge = ({ children }) => {
|
|
11
|
+
const parentContext = useContext(gameContext);
|
|
12
|
+
if (!parentContext.logs) {
|
|
13
|
+
return _jsx(_Fragment, { children: children });
|
|
14
|
+
}
|
|
15
|
+
return _jsx(LogHistoryBridgeInternal, { children: children });
|
|
16
|
+
};
|
|
17
|
+
const LogHistoryBridgeInternal = ({ children }) => {
|
|
18
|
+
const parentContext = useContext(gameContext);
|
|
19
|
+
const logHistory = useLogHistoryProvider();
|
|
20
|
+
const enrichedContext = useMemo(() => ({ ...parentContext, logHistory }), [parentContext, logHistory]);
|
|
21
|
+
return (_jsx(gameContext.Provider, { value: enrichedContext, children: children }));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=LogHistoryBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogHistoryBridge.js","sourceRoot":"","sources":["../../../src/components/GameProvider/LogHistoryBridge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAyB,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAe,WAAW,EAAE,MAAM,eAAe,CAAA;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtE,MAAM,aAAa,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IAC7C,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QACxB,OAAO,4BAAG,QAAQ,GAAI,CAAA;IACxB,CAAC;IACD,OAAO,KAAC,wBAAwB,cAAE,QAAQ,GAA4B,CAAA;AACxE,CAAC,CAAA;AAED,MAAM,wBAAwB,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACvE,MAAM,aAAa,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IAC7C,MAAM,UAAU,GAAG,qBAAqB,EAAE,CAAA;IAE1C,MAAM,eAAe,GAAG,OAAO,CAC7B,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,aAAa,EAAE,UAAU,EAAE,CAAC,EACxC,CAAC,aAAa,EAAE,UAAU,CAAC,CAC5B,CAAA;IAED,OAAO,CACL,KAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,eAAe,YACzC,QAAQ,GACY,CACxB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { css, ThemeProvider, useTheme } from '@emotion/react';
|
|
3
|
-
import { buttonCss } from '../../css';
|
|
4
3
|
export const Header = ({ buttonsCss, children, ...props }) => {
|
|
5
4
|
const theme = useTheme();
|
|
6
|
-
|
|
5
|
+
// Layered button styling for the header bar. Always start with the
|
|
6
|
+
// built-in structural base (padding, bold) AND the default header
|
|
7
|
+
// colours, then stack the game's overrides so they only need to
|
|
8
|
+
// express the delta they care about.
|
|
9
|
+
// 1. headerButtonBaseCss — structural rules (padding, font-weight)
|
|
10
|
+
// 2. defaultHeaderColorsCss — default white-on-dark look. Wins for
|
|
11
|
+
// games without any custom theme.buttons.
|
|
12
|
+
// 3. theme.buttons — game-wide button recipe override.
|
|
13
|
+
// 4. theme.header.buttons — header-specific override.
|
|
14
|
+
// 5. buttonsCss prop — caller-level override.
|
|
15
|
+
const resolvedButtonsCss = [
|
|
16
|
+
headerButtonBaseCss,
|
|
17
|
+
defaultHeaderColorsCss,
|
|
18
|
+
theme.buttons,
|
|
19
|
+
theme.header?.buttons,
|
|
20
|
+
buttonsCss
|
|
21
|
+
];
|
|
7
22
|
return (_jsx(ThemeProvider, { theme: t => ({ ...t, buttons: resolvedButtonsCss }), children: _jsx("div", { css: [headerStyle, theme.header?.bar], ...props, children: _jsx("h1", { css: titleStyle, children: children }) }) }));
|
|
8
23
|
};
|
|
9
24
|
const headerStyle = css `
|
|
@@ -30,9 +45,35 @@ const titleStyle = css `
|
|
|
30
45
|
top: 0.1em;
|
|
31
46
|
}
|
|
32
47
|
`;
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
// Structural base — applied to every header button regardless of the
|
|
49
|
+
// active theme. Games override visuals via theme.buttons /
|
|
50
|
+
// theme.header.buttons but always inherit the structural rules
|
|
51
|
+
// (padding, border, border-radius, cursor, focus, disabled, font
|
|
52
|
+
// weight) from here so they don't have to redeclare them.
|
|
53
|
+
const headerButtonBaseCss = css `
|
|
54
|
+
cursor: pointer;
|
|
35
55
|
padding: 0 0.5em;
|
|
56
|
+
border-radius: 2em;
|
|
57
|
+
border: 0.05em solid currentColor;
|
|
58
|
+
background: transparent;
|
|
36
59
|
font-weight: bold;
|
|
60
|
+
|
|
61
|
+
&:focus { outline: none; }
|
|
62
|
+
|
|
63
|
+
&:disabled {
|
|
64
|
+
color: #555555;
|
|
65
|
+
border-color: #555555;
|
|
66
|
+
cursor: auto;
|
|
67
|
+
opacity: 0.5;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
// Default colours — only takes effect when the game has not provided
|
|
71
|
+
// a theme.buttons override. Preserves the original white-on-dark look
|
|
72
|
+
// of the header bar.
|
|
73
|
+
const defaultHeaderColorsCss = css `
|
|
74
|
+
color: #ffffff;
|
|
75
|
+
|
|
76
|
+
&:focus, &:hover { background: #555555; }
|
|
77
|
+
&:active { background: #888888; }
|
|
37
78
|
`;
|
|
38
79
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/components/Header/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAwB,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/components/Header/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAwB,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAOnF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAe,EAAE,EAAE;IACxE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,mEAAmE;IACnE,kEAAkE;IAClE,gEAAgE;IAChE,qCAAqC;IACrC,sEAAsE;IACtE,qEAAqE;IACrE,wEAAwE;IACxE,gEAAgE;IAChE,wDAAwD;IACxD,qDAAqD;IACrD,MAAM,kBAAkB,GAAG;QACzB,mBAAmB;QACnB,sBAAsB;QACtB,KAAK,CAAC,OAAO;QACb,KAAK,CAAC,MAAM,EAAE,OAAO;QACrB,UAAU;KACX,CAAA;IACD,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,YAChE,cAAK,GAAG,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,KAAM,KAAK,YACnD,aAAI,GAAG,EAAE,UAAU,YAAG,QAAQ,GAAM,GAChC,GACQ,CACjB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;;CAUtB,CAAA;AAED,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;CAYrB,CAAA;AAED,qEAAqE;AACrE,2DAA2D;AAC3D,+DAA+D;AAC/D,iEAAiE;AACjE,0DAA0D;AAC1D,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;CAgB9B,CAAA;AAED,qEAAqE;AACrE,sEAAsE;AACtE,qBAAqB;AACrB,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;CAKjC,CAAA"}
|
|
@@ -3,24 +3,24 @@ import { css } from '@emotion/react';
|
|
|
3
3
|
export const SetupLogItem = ({ log, game, index, customEntryCss, ...rest }) => {
|
|
4
4
|
return (_jsx("div", { ...rest, children: _jsx("div", { css: [entryCss, customEntryCss, log.css], children: _jsx("div", { children: _jsx(log.Component, { game: game, index: index }) }) }) }));
|
|
5
5
|
};
|
|
6
|
-
const entryCss = css `
|
|
7
|
-
width: 100%;
|
|
8
|
-
background-color: rgba(0, 0, 0, 0.7);
|
|
9
|
-
border-radius: 1em;
|
|
10
|
-
margin-bottom: 0.5em;
|
|
11
|
-
min-height: 1em;
|
|
12
|
-
padding-left: 1em;
|
|
13
|
-
margin-left: 0.05em;
|
|
14
|
-
margin-top: 0.05em;
|
|
15
|
-
padding-top: 0.5em;
|
|
16
|
-
padding-bottom: 0.5em;
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
font-size: 2em;
|
|
20
|
-
white-space: pre-wrap;
|
|
21
|
-
|
|
22
|
-
img, picture {
|
|
23
|
-
vertical-align: middle;
|
|
24
|
-
}
|
|
6
|
+
const entryCss = css `
|
|
7
|
+
width: 100%;
|
|
8
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
9
|
+
border-radius: 1em;
|
|
10
|
+
margin-bottom: 0.5em;
|
|
11
|
+
min-height: 1em;
|
|
12
|
+
padding-left: 1em;
|
|
13
|
+
margin-left: 0.05em;
|
|
14
|
+
margin-top: 0.05em;
|
|
15
|
+
padding-top: 0.5em;
|
|
16
|
+
padding-bottom: 0.5em;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
font-size: 2em;
|
|
20
|
+
white-space: pre-wrap;
|
|
21
|
+
|
|
22
|
+
img, picture {
|
|
23
|
+
vertical-align: middle;
|
|
24
|
+
}
|
|
25
25
|
`;
|
|
26
26
|
//# sourceMappingURL=SetupLogItem.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
2
|
+
import { CSSProperties, FC } from 'react';
|
|
3
|
+
import { MoveHistory } from '../../../hooks/useFlatHistory';
|
|
4
|
+
export type VirtualizedLogItemProps = {
|
|
5
|
+
history: MoveHistory;
|
|
6
|
+
itemCss: Interpolation<Theme>;
|
|
7
|
+
customEntryCss: Interpolation<Theme>[];
|
|
8
|
+
};
|
|
9
|
+
export declare const VirtualizedLogItem: FC<VirtualizedLogItemProps & {
|
|
10
|
+
index: number;
|
|
11
|
+
style: CSSProperties;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { LogItem } from '../../Log';
|
|
3
|
+
export const VirtualizedLogItem = ({ history, itemCss, customEntryCss, style }) => {
|
|
4
|
+
return (_jsx("div", { style: style, children: _jsx(LogItem, { history: history, css: itemCss, customEntryCss: customEntryCss }) }));
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=VirtualizedLogItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualizedLogItem.js","sourceRoot":"","sources":["../../../../src/components/JournalTabs/History/VirtualizedLogItem.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,MAAM,CAAC,MAAM,kBAAkB,GAA0E,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,EAAE;IACvJ,OAAO,CACL,cAAK,KAAK,EAAE,KAAK,YACf,KAAC,OAAO,IAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,GAAG,GACtE,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@emotion/react';
|
|
2
3
|
import { faBell } from '@fortawesome/free-solid-svg-icons/faBell';
|
|
3
4
|
import { faBellSlash } from '@fortawesome/free-solid-svg-icons/faBellSlash';
|
|
4
5
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
@@ -9,10 +10,11 @@ import { gameContext } from '../GameProvider';
|
|
|
9
10
|
import { menuButtonCss, paletteMenuButtonCss } from '../menus/menuCss';
|
|
10
11
|
export const LiveLogButton = () => {
|
|
11
12
|
const { t } = useTranslation('common');
|
|
13
|
+
const theme = useTheme();
|
|
12
14
|
const { start, stop, stopped } = useLogControls();
|
|
13
15
|
const hasLogs = useContext(gameContext)?.logs;
|
|
14
16
|
if (!hasLogs)
|
|
15
17
|
return null;
|
|
16
|
-
return (_jsxs("button", { css: [menuButtonCss, paletteMenuButtonCss], onClick: () => stopped ? start() : stop(), children: [_jsx(FontAwesomeIcon, { icon: stopped ? faBellSlash : faBell }), stopped ? t('Enable live history') : t('Disable live history')] }));
|
|
18
|
+
return (_jsxs("button", { css: [menuButtonCss, paletteMenuButtonCss, theme.menu?.button], onClick: () => stopped ? start() : stop(), children: [_jsx(FontAwesomeIcon, { icon: stopped ? faBellSlash : faBell }), stopped ? t('Enable live history') : t('Disable live history')] }));
|
|
17
19
|
};
|
|
18
20
|
//# sourceMappingURL=LiveLogButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveLogButton.js","sourceRoot":"","sources":["../../../src/components/Log/LiveLogButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAEtE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAA;IACjD,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,EAAE,IAAI,CAAA;IAC7C,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IACzB,OAAO,CACL,kBAAQ,GAAG,EAAE,CAAC,aAAa,EAAE,oBAAoB,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"LiveLogButton.js","sourceRoot":"","sources":["../../../src/components/Log/LiveLogButton.tsx"],"names":[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CAAC,IACxD,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Provides log history via a dedicated context, isolated from gameContext.
|
|
4
|
+
* Only mounts the history processing when logs are configured.
|
|
5
|
+
* Changes to the log history only re-render components that consume logHistoryContext.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LogHistoryProvider: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { logHistoryContext } from '../../hooks/LogHistoryContext';
|
|
4
|
+
import { useLogHistoryProvider } from '../../hooks/useFlatHistory';
|
|
5
|
+
import { gameContext } from '../GameProvider';
|
|
6
|
+
const LogHistoryProviderInternal = ({ children }) => {
|
|
7
|
+
const state = useLogHistoryProvider();
|
|
8
|
+
return (_jsx(logHistoryContext.Provider, { value: state, children: children }));
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Provides log history via a dedicated context, isolated from gameContext.
|
|
12
|
+
* Only mounts the history processing when logs are configured.
|
|
13
|
+
* Changes to the log history only re-render components that consume logHistoryContext.
|
|
14
|
+
*/
|
|
15
|
+
export const LogHistoryProvider = ({ children }) => {
|
|
16
|
+
const context = useContext(gameContext);
|
|
17
|
+
if (!context.logs) {
|
|
18
|
+
return _jsx(_Fragment, { children: children });
|
|
19
|
+
}
|
|
20
|
+
return (_jsx(LogHistoryProviderInternal, { children: children }));
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=LogHistoryProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogHistoryProvider.js","sourceRoot":"","sources":["../../../src/components/Log/LogHistoryProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAyB,UAAU,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,MAAM,0BAA0B,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzE,MAAM,KAAK,GAAG,qBAAqB,EAAE,CAAA;IACrC,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACrC,QAAQ,GACkB,CAC9B,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxE,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IACvC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,4BAAG,QAAQ,GAAI,CAAA;IACxB,CAAC;IACD,OAAO,CACL,KAAC,0BAA0B,cACxB,QAAQ,GACkB,CAC9B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
3
|
import { useCallback, useEffect, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { onSurfaceButtonCss } from '../../../css';
|
|
6
5
|
import { usePlay } from '../../../hooks';
|
|
7
6
|
import { Dialog } from '../../dialogs';
|
|
8
7
|
import { ThemeButton } from '../ThemeButton';
|
|
@@ -56,7 +55,7 @@ export const PlayMoveButton = (props) => {
|
|
|
56
55
|
if (countdown === 0)
|
|
57
56
|
doPlay();
|
|
58
57
|
}, [countdown]);
|
|
59
|
-
return (_jsxs(_Fragment, { children: [!!confirmation && (_jsx(Dialog, { open: showDialog, onBackdropClick: () => setShowDialog(false), css: [flex, confirmationDialogCss], children:
|
|
58
|
+
return (_jsxs(_Fragment, { children: [!!confirmation && (_jsx(Dialog, { open: showDialog, onBackdropClick: () => setShowDialog(false), css: [flex, confirmationDialogCss], children: _jsxs("div", { css: content, children: [_jsx("p", { children: confirmation.text }), _jsxs("div", { css: buttons, children: [_jsx(ThemeButton, { onClick: () => setShowDialog(false), ...rest, children: confirmation.cancelText ?? t('Cancel') }), _jsx(ThemeButton, { css: moveButton, onClick: doPlay, ...rest })] })] }) }, "dialog")), _jsx(ThemeButton, { onClick: onClick, disabled: disabled, css: countdown && countdownCss(countdown), ...rest }, "button")] }));
|
|
60
59
|
};
|
|
61
60
|
const buttons = css `
|
|
62
61
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayMoveButton.js","sourceRoot":"","sources":["../../../../src/components/buttons/PlayMoveButton/PlayMoveButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"PlayMoveButton.js","sourceRoot":"","sources":["../../../../src/components/buttons/PlayMoveButton/PlayMoveButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,OAAO,EAAuC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAe5C,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,KAAK,EAAE,EAAE;IAC/D,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CA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AK,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,YACpH,eAAK,GAAG,EAAE,OAAO,aACf,sBAAI,YAAY,CAAC,IAAI,GAAK,EAC1B,eAAK,GAAG,EAAE,OAAO,aACf,KAAC,WAAW,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,KAAM,IAAI,YACvD,YAAY,CAAC,UAAU,IAAI,CAAC,CAAC,QAAQ,CAAC,GAC3B,EACd,KAAC,WAAW,IAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAM,IAAI,GAAI,IACvD,IACF,IATI,QAAQ,CAUX,CACV,EACD,KAAC,WAAW,IAAc,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,IAAI,YAAY,CAAC,SAAS,CAAC,KAAM,IAAI,IAAlG,QAAQ,CAA6F,IACrH,CACJ,CAAA;AACH,CAAC,CAAA;AACD,MAAM,OAAO,GAAG,GAAG,CAAA;;;;;CAKlB,CAAA;AAED,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;CAUrB,CAAA;AAED,MAAM,IAAI,GAAG,GAAG,CAAA;;;;;CAKf,CAAA;AAED,MAAM,OAAO,GAAG,GAAG,CAAA;;;;;;;;;CASlB,CAAA;AAED,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;CAQhC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,GAAG,CAAA;;;;;gBAK/B,SAAS;;;;;CAKxB,CAAA"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useTheme } from '@emotion/react';
|
|
3
|
+
import { onSurfaceButtonCss } from '../../../css';
|
|
3
4
|
export const ThemeButton = (props) => {
|
|
4
5
|
const theme = useTheme();
|
|
5
|
-
|
|
6
|
+
// Fall back to onSurfaceButtonCss when the game does not provide
|
|
7
|
+
// any theme.buttons recipe so the button still has a usable look.
|
|
8
|
+
return _jsx("button", { css: theme.buttons ?? onSurfaceButtonCss, ...props });
|
|
6
9
|
};
|
|
7
10
|
//# sourceMappingURL=ThemeButton.js.map
|