@gamepark/react-game 7.7.14 → 7.7.15
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/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/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/dialogs/Dialog.d.ts +1 -0
- package/dist/components/dialogs/Dialog.js +10 -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/MaterialRulesDialogContent.js +4 -2
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.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/FlatMaterial/MoneyDescription.js +1 -1
- package/dist/components/material/FlatMaterial/MoneyDescription.js.map +1 -1
- 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/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/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/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"}
|
|
@@ -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"}
|
|
@@ -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,9 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { css, keyframes, ThemeProvider, useTheme } from '@emotion/react';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useState } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
+
const DialogBackdropContext = createContext(null);
|
|
6
|
+
export const useDialogBackdrop = () => useContext(DialogBackdropContext);
|
|
5
7
|
export const Dialog = ({ children, open, backdropCss, onBackdropClick, transitionDelay = 0.3, rootId = 'root', ...props }) => {
|
|
6
8
|
const theme = useTheme();
|
|
9
|
+
const [wrapperElement, setWrapperElement] = useState(null);
|
|
10
|
+
const wrapperRef = useCallback((node) => setWrapperElement(node), []);
|
|
7
11
|
const [display, setDisplay] = useState(open);
|
|
8
12
|
// When we open the dialog with use-long-press, Chrome mobile generates a click event on the backdrop even though the pointer down event
|
|
9
13
|
// was done before the dialog existed. It causes the dialog to close immediately. We prevent any backdrop click for 300ms to workaround this issue.
|
|
@@ -38,7 +42,7 @@ export const Dialog = ({ children, open, backdropCss, onBackdropClick, transitio
|
|
|
38
42
|
// game does not provide any theme.buttons.
|
|
39
43
|
const resolvedDialogButtonsCss = [dialogButtonBaseCss, theme.buttons, theme.dialog.buttons];
|
|
40
44
|
const dialogContent = (_jsx("div", { onClick: event => event.stopPropagation(), css: [dialogCss, open ? (theme.dialog.openAnimation ?? dialogShow(transitionDelay)) : (theme.dialog.closeAnimation ?? dialogHide(transitionDelay)), theme.dialog.container], ...props, children: children }));
|
|
41
|
-
return createPortal(_jsx("div", { css: [backdropStyle(transitionDelay), !open && hide(transitionDelay), backdropCss], onClick: event => !justDisplayed && onBackdropClick?.(event), children: _jsx(ThemeProvider, { theme: t => ({ ...t, buttons: resolvedDialogButtonsCss }), children: dialogContent }) }), root);
|
|
45
|
+
return createPortal(_jsx("div", { css: [backdropStyle(transitionDelay), !open && hide(transitionDelay), backdropCss], onClick: event => !justDisplayed && onBackdropClick?.(event), children: _jsx(ThemeProvider, { theme: t => ({ ...t, buttons: resolvedDialogButtonsCss }), children: _jsx("div", { ref: wrapperRef, css: dialogWrapperCss, children: _jsx(DialogBackdropContext.Provider, { value: wrapperElement, children: dialogContent }) }) }) }), root);
|
|
42
46
|
};
|
|
43
47
|
// Structural base — applied to every button rendered inside a Dialog
|
|
44
48
|
// regardless of the active theme. Games override visuals via
|
|
@@ -123,8 +127,12 @@ const dialogShow = (transitionDelay) => css `
|
|
|
123
127
|
const dialogHide = (transitionDelay) => css `
|
|
124
128
|
animation: ${scaleOut} ${transitionDelay}s ease-in forwards;
|
|
125
129
|
`;
|
|
130
|
+
const dialogWrapperCss = css `
|
|
131
|
+
position: relative;
|
|
132
|
+
`;
|
|
126
133
|
const dialogCss = css `
|
|
127
134
|
position: relative;
|
|
135
|
+
z-index: 1;
|
|
128
136
|
background-color: var(--gp-dialog-bg);
|
|
129
137
|
color: var(--gp-dialog-color);
|
|
130
138
|
padding: 1em;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAiB,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACvF,OAAO,EAAqC,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAiB,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACvF,OAAO,EAAE,aAAa,EAAqC,WAAW,EAAE,UAAU,EAAE,SAAS,E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AG,CAAA;;CAE3B,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;;CAQpB,CAAA"}
|
|
@@ -6,10 +6,10 @@ import { faChevronRight } from '@fortawesome/free-solid-svg-icons/faChevronRight
|
|
|
6
6
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
export const BottomBarNavigation = ({ onPrevious, onNext, currentIndex, total }) => {
|
|
9
|
-
const { t } = useTranslation(
|
|
9
|
+
const { t } = useTranslation();
|
|
10
10
|
const theme = useTheme();
|
|
11
11
|
const primary = theme.palette.primary;
|
|
12
|
-
return (_jsxs("div", { css: [barCss(primary), theme.dialog.navigationCss], children: [_jsxs("button", { css: btnCss(primary), onClick: onPrevious, disabled: !onPrevious, children: [_jsx(FontAwesomeIcon, { icon: faChevronLeft, css: iconCss }), _jsx("span", { children: t('
|
|
12
|
+
return (_jsxs("div", { css: [barCss(primary), theme.dialog.navigationCss], children: [_jsxs("button", { css: btnCss(primary), onClick: onPrevious, disabled: !onPrevious, children: [_jsx(FontAwesomeIcon, { icon: faChevronLeft, css: iconCss }), _jsx("span", { children: t('Previous', { ns: 'common' }) })] }), _jsxs("div", { css: counterCss, children: [_jsx("div", { css: dotsCss, children: Array.from({ length: Math.min(total, 8) }, (_, i) => (_jsx("div", { css: [dotCss(primary), i === Math.min(currentIndex, 7) && activeDotCss(primary)] }, i))) }), _jsxs("span", { children: [currentIndex + 1, " / ", total] })] }), _jsxs("button", { css: btnCss(primary), onClick: onNext, disabled: !onNext, children: [_jsx("span", { children: t('Next', { ns: 'common' }) }), _jsx(FontAwesomeIcon, { icon: faChevronRight, css: iconCss })] })] }));
|
|
13
13
|
};
|
|
14
14
|
const barCss = (primary) => css `
|
|
15
15
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomBarNavigation.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/BottomBarNavigation.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C,MAAM,CAAC,MAAM,mBAAmB,GAA8B,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5G,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"BottomBarNavigation.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/BottomBarNavigation.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C,MAAM,CAAC,MAAM,mBAAmB,GAA8B,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5G,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAA;IACrC,OAAO,CACL,eAAK,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,a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O;;;;;qCAKb,OAAO;oBACxB,OAAO;;;;qCAIU,OAAO;;;;;;;CAO3C,CAAA;AAED,MAAM,OAAO,GAAG,GAAG,CAAA;;CAElB,CAAA;AAED,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;CAQrB,CAAA;AAED,MAAM,OAAO,GAAG,GAAG,CAAA;;;CAGlB,CAAA;AAED,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,CAAA;;;;mCAIJ,OAAO;;CAEzC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,CAAA;gBAC7B,OAAO;;;CAGtB,CAAA"}
|
|
@@ -5,8 +5,10 @@ import { faChevronRight } from '@fortawesome/free-solid-svg-icons/faChevronRight
|
|
|
5
5
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
6
|
import { isSameLocationArea, MaterialMoveBuilder } from '@gamepark/rules-api';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
|
+
import { createPortal } from 'react-dom';
|
|
8
9
|
import { useKeyDown, useMaterialContext, useMaterialDescription, usePlay, useRules } from '../../../hooks';
|
|
9
10
|
import { useLocators } from '../../../hooks/useLocators';
|
|
11
|
+
import { useDialogBackdrop } from '../Dialog';
|
|
10
12
|
import { helpDialogContentCss } from './RulesHelpDialogContent';
|
|
11
13
|
var displayHelp = MaterialMoveBuilder.displayHelp;
|
|
12
14
|
var displayMaterialHelp = MaterialMoveBuilder.displayMaterialHelp;
|
|
@@ -63,7 +65,8 @@ export const MaterialRulesDialogContent = ({ helpDisplay }) => {
|
|
|
63
65
|
if (hasNavigation && Navigation) {
|
|
64
66
|
return _jsxs("div", { css: navigationWrapper, children: [_jsxs("div", { css: [flex, navigationContent], children: [_jsx(description.helpDisplay, { item: item, itemType: helpDisplay.itemType, itemIndex: helpDisplay.itemIndex, displayIndex: helpDisplay.displayIndex, closeDialog: closeDialog }), _jsx("div", { css: [helpDialogContentCss, theme.dialog.content], children: description.help && _jsx(description.help, { ...helpDisplay, closeDialog: closeDialog }) })] }), _jsx(Navigation, { onPrevious: onPrevious, onNext: onNext, currentIndex: currentIndex, total: total })] });
|
|
65
67
|
}
|
|
66
|
-
|
|
68
|
+
const backdrop = useDialogBackdrop();
|
|
69
|
+
return _jsxs(_Fragment, { children: [_jsxs("div", { css: [flex, hasNavigation && fullSize], children: [_jsx(description.helpDisplay, { item: item, itemType: helpDisplay.itemType, itemIndex: helpDisplay.itemIndex, displayIndex: helpDisplay.displayIndex, closeDialog: closeDialog }), _jsx("div", { css: [helpDialogContentCss, theme.dialog.content], children: description.help && _jsx(description.help, { ...helpDisplay, closeDialog: closeDialog }) })] }), hasNavigation && backdrop && createPortal(_jsxs(_Fragment, { children: [previous && _jsx(PreviousArrow, { onPrevious: () => play(previous, { transient: true }) }), next && _jsx(NextArrow, { onNext: () => play(next, { transient: true }) })] }), backdrop)] });
|
|
67
70
|
};
|
|
68
71
|
const NextArrow = (props) => {
|
|
69
72
|
const { onNext } = props;
|
|
@@ -76,7 +79,6 @@ const PreviousArrow = (props) => {
|
|
|
76
79
|
const navigationArrow = css `
|
|
77
80
|
position: absolute;
|
|
78
81
|
top: 50%;
|
|
79
|
-
z-index: -1;
|
|
80
82
|
transform: translateY(-50%);
|
|
81
83
|
background-color: var(--gp-dialog-bg);
|
|
82
84
|
color: var(--gp-dialog-color);
|