@gamepark/react-game 7.7.15 → 7.7.17
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/GameLoadingErrorScreen.d.ts +1 -0
- package/dist/components/GameProvider/GameLoadingErrorScreen.js +82 -0
- package/dist/components/GameProvider/GameLoadingErrorScreen.js.map +1 -0
- package/dist/components/GameProvider/GameProvider.js +2 -0
- package/dist/components/GameProvider/GameProvider.js.map +1 -1
- package/dist/components/JournalTabs/History/SetupLogItem.js +19 -19
- package/dist/components/dialogs/FailuresDialog.js +40 -9
- package/dist/components/dialogs/FailuresDialog.js.map +1 -1
- package/dist/components/material/GameTable/DevToolsHub.d.ts +21 -4
- package/dist/components/material/GameTable/DevToolsHub.js +830 -24
- package/dist/components/material/GameTable/DevToolsHub.js.map +1 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.js +2 -2
- package/dist/components/material/GameTable/DynamicItemsDisplay.js.map +1 -1
- package/dist/components/material/MaterialDescription.js +0 -2
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/Wheel/WheelContent.d.ts +13 -0
- package/dist/components/material/Wheel/WheelContent.js +37 -0
- package/dist/components/material/Wheel/WheelContent.js.map +1 -0
- package/dist/components/material/animations/ItemAnimations.js +4 -0
- package/dist/components/material/animations/ItemAnimations.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/useFailures.d.ts +1 -0
- package/dist/hooks/useFailures.js +11 -0
- package/dist/hooks/useFailures.js.map +1 -0
- package/dist/hooks/useWebP.d.ts +1 -0
- package/dist/hooks/useWebP.js +13 -0
- package/dist/hooks/useWebP.js.map +1 -0
- package/dist/locators/Locator.d.ts +8 -9
- package/dist/locators/Locator.js +11 -20
- package/dist/locators/Locator.js.map +1 -1
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +34 -0
- package/dist/vite.js.map +1 -0
- package/package.json +3 -3
- package/dist/components/GameProvider/GameInternalProviders.d.ts +0 -6
- package/dist/components/GameProvider/GameInternalProviders.js +0 -10
- package/dist/components/GameProvider/GameInternalProviders.js.map +0 -1
- package/dist/components/GameProvider/LogHistoryBridge.d.ts +0 -7
- package/dist/components/GameProvider/LogHistoryBridge.js +0 -23
- package/dist/components/GameProvider/LogHistoryBridge.js.map +0 -1
- package/dist/components/JournalTabs/History/VirtualizedLogItem.d.ts +0 -12
- package/dist/components/JournalTabs/History/VirtualizedLogItem.js +0 -6
- package/dist/components/JournalTabs/History/VirtualizedLogItem.js.map +0 -1
- package/dist/components/Log/LogHistoryProvider.d.ts +0 -7
- package/dist/components/Log/LogHistoryProvider.js +0 -22
- package/dist/components/Log/LogHistoryProvider.js.map +0 -1
- package/dist/components/material/Dices/OctahedralDiceDescription.d.ts +0 -48
- package/dist/components/material/Dices/OctahedralDiceDescription.js +0 -142
- package/dist/components/material/Dices/OctahedralDiceDescription.js.map +0 -1
- package/dist/components/material/GameTable/DevToolEntry.d.ts +0 -17
- package/dist/components/material/GameTable/DevToolEntry.js +0 -13
- package/dist/components/material/GameTable/DevToolEntry.js.map +0 -1
- package/dist/components/material/GameTable/DevTools/DevToolsStyles.d.ts +0 -58
- package/dist/components/material/GameTable/DevTools/DevToolsStyles.js +0 -706
- package/dist/components/material/GameTable/DevTools/DevToolsStyles.js.map +0 -1
- package/dist/components/material/GameTable/DevToolsStyles.d.ts +0 -67
- package/dist/components/material/GameTable/DevToolsStyles.js +0 -752
- package/dist/components/material/GameTable/DevToolsStyles.js.map +0 -1
- package/dist/components/material/GameTable/JsonHighlighter.d.ts +0 -3
- package/dist/components/material/GameTable/JsonHighlighter.js +0 -37
- package/dist/components/material/GameTable/JsonHighlighter.js.map +0 -1
- package/dist/components/material/sound/bellSound.d.ts +0 -1
- package/dist/components/material/sound/bellSound.js +0 -2
- package/dist/components/material/sound/bellSound.js.map +0 -1
- package/dist/hooks/LogHistoryContext.d.ts +0 -6
- package/dist/hooks/LogHistoryContext.js +0 -4
- package/dist/hooks/LogHistoryContext.js.map +0 -1
- package/dist/hooks/useBackgroundTabHandler.d.ts +0 -1
- package/dist/hooks/useBackgroundTabHandler.js +0 -38
- package/dist/hooks/useBackgroundTabHandler.js.map +0 -1
- package/dist/hooks/useFastAnimationsOnReturn.d.ts +0 -1
- package/dist/hooks/useFastAnimationsOnReturn.js +0 -38
- package/dist/hooks/useFastAnimationsOnReturn.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 @@
|
|
|
1
|
+
export declare const GameLoadingErrorScreen: () => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css, keyframes } from '@emotion/react';
|
|
4
|
+
import { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
|
+
import { GameLoadingError, PLATFORM_URI, useGameLoadingError } from '@gamepark/react-client';
|
|
7
|
+
import { useContext } from 'react';
|
|
8
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
9
|
+
import { NavButton } from '../menus/Menu/NavButton';
|
|
10
|
+
import { gameContext } from './GameContext';
|
|
11
|
+
const query = new URLSearchParams(window.location.search);
|
|
12
|
+
const locale = query.get('locale') || 'en';
|
|
13
|
+
export const GameLoadingErrorScreen = () => {
|
|
14
|
+
const error = useGameLoadingError();
|
|
15
|
+
const { t } = useTranslation('common');
|
|
16
|
+
const { game } = useContext(gameContext);
|
|
17
|
+
if (!error)
|
|
18
|
+
return null;
|
|
19
|
+
const isNotFound = error === GameLoadingError.NotFound;
|
|
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, { i18nKey: isNotFound ? 'error.game-not-found.title' : 'error.game-load.title', ns: "common" }) }), _jsx("p", { css: hintCss, children: _jsx(Trans, { i18nKey: isNotFound ? 'error.game-not-found.hint' : 'error.game-load.hint', ns: "common" }) }), _jsx(NavButton, { url: `${PLATFORM_URI}/${locale}/board-games/${game}`, children: t('Back to Game Park') })] }) }));
|
|
21
|
+
};
|
|
22
|
+
const fadeIn = keyframes `
|
|
23
|
+
from {
|
|
24
|
+
opacity: 0;
|
|
25
|
+
transform: translateY(16px);
|
|
26
|
+
}
|
|
27
|
+
to {
|
|
28
|
+
opacity: 1;
|
|
29
|
+
transform: translateY(0);
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const containerCss = css `
|
|
33
|
+
position: absolute;
|
|
34
|
+
inset: 0;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
padding: 2em;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
font-family: "Mulish", sans-serif;
|
|
41
|
+
z-index: 2000;
|
|
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;
|
|
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;
|
|
65
|
+
`;
|
|
66
|
+
const iconCss = css `
|
|
67
|
+
font-size: 32px;
|
|
68
|
+
color: #28B8CE;
|
|
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;
|
|
75
|
+
`;
|
|
76
|
+
const hintCss = css `
|
|
77
|
+
font-size: 0.95em;
|
|
78
|
+
line-height: 1.5;
|
|
79
|
+
margin: 0 0 1.2em;
|
|
80
|
+
opacity: 0.8;
|
|
81
|
+
`;
|
|
82
|
+
//# sourceMappingURL=GameLoadingErrorScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameLoadingErrorScreen.js","sourceRoot":"","sources":["../../../src/components/GameProvider/GameLoadingErrorScreen.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAA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AAK,CAAC,OAAO,CAAC,cAAc;8BAC3B,KAAK,CAAC,OAAO,CAAC,eAAe;mBACxC,KAAK,CAAC,OAAO,CAAC,MAAM;yBACd,KAAK,CAAC,OAAO,CAAC,WAAW;0BACxB,KAAK,CAAC,OAAO,CAAC,YAAY;qBAC/B,KAAK,CAAC,OAAO,CAAC,QAAQ;sBACrB,KAAK,CAAC,MAAM,CAAC,eAAe;yBACzB,KAAK,CAAC,MAAM,CAAC,KAAK;yBAClB,KAAK,CAAC,IAAI,CAAC,UAAU;0BACpB,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO;wBAC/C,KAAK,CAAC,MAAM,EAAE,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS;+BACtC,KAAK,CAAC,SAAS,EAAE,eAAe,IAAI,SAAS;8BAC9C,KAAK,CAAC,SAAS,EAAE,cAAc,IAAI,SAAS;yBACjD,KAAK,CAAC,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM;yBAClD,KAAK,CAAC,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqCpF,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;CAiBzC,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAmB,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;IACtE,GAAG,CAAA;kCAC6B,OAAO,KAAK,OAAO,UAAU,KAAK;GACjE,CAAC,CAAC;IACH,GAAG,CAAA;sBACiB,KAAK;GACxB,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
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { css, useTheme } from '@emotion/react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons/faTriangleExclamation';
|
|
4
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
+
import { clearFailures, Failure, PLATFORM_URI, useGameDispatch, useGameSelector } from '@gamepark/react-client';
|
|
6
|
+
import { useContext, useEffect, useState } from 'react';
|
|
5
7
|
import { Trans, useTranslation } from 'react-i18next';
|
|
8
|
+
import { gameContext } from '../GameProvider';
|
|
9
|
+
import { NavButton } from '../menus/Menu/NavButton';
|
|
6
10
|
import { menuButtonCss, menuDialogCss, paletteMenuButtonCss } from '../menus/menuCss';
|
|
7
11
|
import { Dialog } from './Dialog';
|
|
12
|
+
const query = new URLSearchParams(window.location.search);
|
|
13
|
+
const locale = query.get('locale') || 'en';
|
|
8
14
|
export const FailuresDialog = (props) => {
|
|
9
15
|
const { t } = useTranslation('common');
|
|
10
16
|
const theme = useTheme();
|
|
17
|
+
const { game } = useContext(gameContext);
|
|
11
18
|
const failures = useGameSelector((state) => state.failures);
|
|
12
19
|
const dispatch = useGameDispatch();
|
|
13
20
|
const [displayedFailure, setDisplayedFailure] = useState('');
|
|
@@ -16,13 +23,18 @@ export const FailuresDialog = (props) => {
|
|
|
16
23
|
setDisplayedFailure(failures[0]);
|
|
17
24
|
}
|
|
18
25
|
else {
|
|
19
|
-
setTimeout(() => setDisplayedFailure(''), 500);
|
|
26
|
+
const timeout = setTimeout(() => setDisplayedFailure(''), 500);
|
|
27
|
+
return () => clearTimeout(timeout);
|
|
20
28
|
}
|
|
21
29
|
}, [failures]);
|
|
22
|
-
const description = failuresDescription[displayedFailure]
|
|
30
|
+
const description = failuresDescription[displayedFailure] ?? fallbackDescription(displayedFailure);
|
|
31
|
+
const terminal = isTerminalFailure(displayedFailure);
|
|
23
32
|
const themedButtonCss = [menuButtonCss, paletteMenuButtonCss, theme.menu?.button];
|
|
24
|
-
return (_jsxs(Dialog, { open: failures.length > 0, css: menuDialogCss, ...props, children: [
|
|
33
|
+
return (_jsxs(Dialog, { open: failures.length > 0, css: menuDialogCss, backdropCss: terminal && aboveLoadingScreenCss, onBackdropClick: terminal ? undefined : () => dispatch(clearFailures()), ...props, children: [_jsxs("h2", { css: titleCss, children: [_jsx(FontAwesomeIcon, { icon: faTriangleExclamation, css: iconCss }), description.title(t)] }), _jsx("p", { children: description.text(t) }), terminal ? (_jsx(NavButton, { url: `${PLATFORM_URI}/${locale}/board-games/${game}`, children: t('Back to Game Park') })) : (_jsxs(_Fragment, { children: [_jsx("button", { css: [...themedButtonCss, inDialogButton], onClick: () => dispatch(clearFailures()), children: t('OK') }), displayedFailure === Failure.MOVE_FORBIDDEN && _jsx("p", { children: _jsx(Trans, { ns: "common", i18nKey: "failure.dialog.play2", components: [_jsx("button", { css: [...themedButtonCss, css `display: inline-block`], onClick: () => window.location.reload() })] }) })] }))] }));
|
|
25
34
|
};
|
|
35
|
+
function isTerminalFailure(failure) {
|
|
36
|
+
return failure === Failure.GAME_NOT_FOUND || failure === Failure.GAME_LOAD_ERROR;
|
|
37
|
+
}
|
|
26
38
|
const failuresDescription = {
|
|
27
39
|
[Failure.NETWORK]: {
|
|
28
40
|
title: (t) => t('Whoops...'),
|
|
@@ -39,14 +51,33 @@ const failuresDescription = {
|
|
|
39
51
|
[Failure.TUTORIAL_MOVE_EXPECTED]: {
|
|
40
52
|
title: (t) => t('Move not expected in the tutorial'),
|
|
41
53
|
text: (t) => t('failure.dialog.tutorial')
|
|
54
|
+
},
|
|
55
|
+
[Failure.GAME_NOT_FOUND]: {
|
|
56
|
+
title: (t) => t('error.game-not-found.title'),
|
|
57
|
+
text: (t) => t('error.game-not-found.hint')
|
|
58
|
+
},
|
|
59
|
+
[Failure.GAME_LOAD_ERROR]: {
|
|
60
|
+
title: (t) => t('error.game-load.title'),
|
|
61
|
+
text: (t) => t('error.game-load.hint')
|
|
42
62
|
}
|
|
43
63
|
};
|
|
44
64
|
const fallbackDescription = (failure) => ({
|
|
45
65
|
title: (t) => t('Unknown error:'),
|
|
46
66
|
text: () => failure
|
|
47
67
|
});
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
68
|
+
const aboveLoadingScreenCss = css `
|
|
69
|
+
z-index: 1600;
|
|
70
|
+
`;
|
|
71
|
+
const titleCss = css `
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: 0.4em;
|
|
75
|
+
`;
|
|
76
|
+
const iconCss = css `
|
|
77
|
+
color: #28B8CE;
|
|
78
|
+
`;
|
|
79
|
+
const inDialogButton = css `
|
|
80
|
+
margin: 0 0 0 auto;
|
|
81
|
+
font-size: 1.125em;
|
|
51
82
|
`;
|
|
52
83
|
//# sourceMappingURL=FailuresDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FailuresDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/FailuresDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"FailuresDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/FailuresDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE/G,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,cA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,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,4BAA4B,CAAC;QAC7C,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,2BAA2B,CAAC;KAC5C;IACD,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACzB,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,uBAAuB,CAAC;QACxC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC;KACvC;CACF,CAAA;AAED,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC;IAChD,KAAK,EAAE,CAAC,CAAY,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAC5C,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO;CACpB,CAAC,CAAA;AAEF,MAAM,qBAAqB,GAAG,GAAG,CAAA;;CAEhC,CAAA;AAED,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;CAInB,CAAA;AAED,MAAM,OAAO,GAAG,GAAG,CAAA;;CAElB,CAAA;AAED,MAAM,cAAc,GAAG,GAAG,CAAA;;;CAGzB,CAAA"}
|
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import { FC, PropsWithChildren } from 'react';
|
|
3
|
-
export { DevToolEntry } from './DevToolEntry';
|
|
4
|
-
export { devToolBtnCss, devToolIconCss, devToolLabelCss, devToolDescCss } from './DevToolsStyles';
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
5
2
|
export type GameOption = {
|
|
6
3
|
key: string;
|
|
7
4
|
label: string;
|
|
8
5
|
type: 'boolean';
|
|
9
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* A single entry in the DevToolsHub panel.
|
|
9
|
+
* Use this instead of raw `<button>` when adding custom tools via `children`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <DevToolsHub>
|
|
13
|
+
* <DevToolEntry icon="✦" label="Card Viewer" desc="Browse agents" onClick={() => setShowCards(true)} />
|
|
14
|
+
* </DevToolsHub>
|
|
15
|
+
*/
|
|
16
|
+
export declare const DevToolEntry: FC<{
|
|
17
|
+
icon: ReactNode;
|
|
18
|
+
label: string;
|
|
19
|
+
desc?: string;
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
}>;
|
|
10
22
|
type DevToolsHubProps = PropsWithChildren<{
|
|
11
23
|
fabBottom?: string;
|
|
12
24
|
gameOptions?: GameOption[];
|
|
13
25
|
}>;
|
|
14
26
|
export declare const DevToolsHub: FC<DevToolsHubProps>;
|
|
27
|
+
export declare const devToolBtnCss: import("@emotion/utils").SerializedStyles;
|
|
28
|
+
export declare const devToolIconCss: import("@emotion/utils").SerializedStyles;
|
|
29
|
+
export declare const devToolLabelCss: import("@emotion/utils").SerializedStyles;
|
|
30
|
+
export declare const devToolDescCss: import("@emotion/utils").SerializedStyles;
|
|
31
|
+
export {};
|