@gamepark/react-game 7.4.1 → 7.5.1
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/dist/components/Avatar/SpeechBubble.js +1 -1
- package/dist/components/GameProvider/GameProvider.js +33 -1
- package/dist/components/GameProvider/GameProvider.js.map +1 -1
- package/dist/components/Header/Header.js +10 -7
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatTextInput.js +4 -1
- package/dist/components/JournalTabs/Chat/ChatTextInput.js.map +1 -1
- package/dist/components/JournalTabs/Chat/SignInToChat.js +13 -1
- package/dist/components/JournalTabs/Chat/SignInToChat.js.map +1 -1
- package/dist/components/JournalTabs/History/History.js +3 -2
- package/dist/components/JournalTabs/History/History.js.map +1 -1
- package/dist/components/JournalTabs/JournalTabs.js +8 -7
- package/dist/components/JournalTabs/JournalTabs.js.map +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.js +2 -2
- package/dist/components/Log/LiveLogButton.js +2 -2
- package/dist/components/Log/LiveLogButton.js.map +1 -1
- package/dist/components/PlayerPanel/Counters.js +3 -1
- package/dist/components/PlayerPanel/Counters.js.map +1 -1
- package/dist/components/PlayerPanel/PlayerPanel.js +9 -7
- package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.js +6 -5
- package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +6 -6
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js.map +1 -1
- package/dist/components/dialogs/Dialog.js +6 -5
- package/dist/components/dialogs/Dialog.js.map +1 -1
- package/dist/components/dialogs/FailuresDialog.js +5 -3
- package/dist/components/dialogs/FailuresDialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js +4 -3
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchSection.js +4 -3
- package/dist/components/dialogs/ResultDialog/RematchSection.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/ResultDialog.js +36 -21
- package/dist/components/dialogs/ResultDialog/ResultDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/DefaultHelpDisplay.d.ts +2 -0
- package/dist/components/dialogs/RulesDialog/DefaultHelpDisplay.js +25 -0
- package/dist/components/dialogs/RulesDialog/DefaultHelpDisplay.js.map +1 -0
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +3 -2
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +8 -25
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesDialog.js +5 -4
- package/dist/components/dialogs/RulesDialog/RulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js +4 -3
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/index.d.ts +1 -0
- package/dist/components/dialogs/RulesDialog/index.js +1 -0
- package/dist/components/dialogs/RulesDialog/index.js.map +1 -1
- package/dist/components/material/GameTable/GameTableNavigation.js +1 -1
- package/dist/components/material/MaterialDescription.d.ts +13 -0
- package/dist/components/material/MaterialDescription.js +7 -0
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/animations/CreateItemAnimations.js +28 -18
- package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAnimations.js +1 -2
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js +2 -22
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +6 -16
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js +12 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenButton.js +4 -2
- package/dist/components/menus/Fullscreen/FullscreenButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenDialog.js +6 -4
- package/dist/components/menus/Fullscreen/FullscreenDialog.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js +4 -2
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js.map +1 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.js +7 -16
- package/dist/components/menus/GiveUpButton/GiveUpButton.js.map +1 -1
- package/dist/components/menus/Menu/Menu.js +7 -6
- package/dist/components/menus/Menu/Menu.js.map +1 -1
- package/dist/components/menus/Menu/NavButton.js +4 -2
- package/dist/components/menus/Menu/NavButton.js.map +1 -1
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js +4 -2
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js.map +1 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js +2 -2
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js.map +1 -1
- package/dist/components/menus/Result/ResultButton.js +2 -2
- package/dist/components/menus/Result/ResultButton.js.map +1 -1
- package/dist/components/menus/Result/ResultPopButton.js +4 -2
- package/dist/components/menus/Result/ResultPopButton.js.map +1 -1
- package/dist/components/menus/SoundButton/SoundButton.js +2 -2
- package/dist/components/menus/SoundButton/SoundButton.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +12 -11
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoButton.js +2 -2
- package/dist/components/menus/UndoButton/UndoButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoPopButton.js +4 -2
- package/dist/components/menus/UndoButton/UndoPopButton.js.map +1 -1
- package/dist/components/menus/menuCss.d.ts +5 -0
- package/dist/components/menus/menuCss.js +58 -5
- package/dist/components/menus/menuCss.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorialDisplay.js +7 -5
- package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
- package/dist/css/GameTheme.d.ts +64 -0
- package/dist/css/GameTheme.js +17 -1
- package/dist/css/GameTheme.js.map +1 -1
- package/dist/css/buttonCss.d.ts +1 -0
- package/dist/css/buttonCss.js +25 -0
- package/dist/css/buttonCss.js.map +1 -1
- package/dist/locators/GridLocator.d.ts +88 -0
- package/dist/locators/GridLocator.js +156 -0
- package/dist/locators/GridLocator.js.map +1 -0
- package/dist/locators/HandLocator.d.ts +1 -1
- package/dist/locators/ListLocator.d.ts +1 -1
- package/dist/locators/PileLocator.d.ts +1 -1
- package/dist/locators/index.d.ts +1 -0
- package/dist/locators/index.js +1 -0
- package/dist/locators/index.js.map +1 -1
- package/dist/utilities/translation.util.js +7 -9
- package/dist/utilities/translation.util.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAiB,SAAS,
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAiB,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,EAAqC,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAUxC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,GAAG,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,EAAe,EAAE,EAAE;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CAAC,CAAC,aAAa,IAAI,eAAe,EAAE,CAAC,KAAK,CAAC,YACnJ,cAAK,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,KAAM,KAAK,YAChG,QAAQ,GACL,GACF,EACN,IAAI,CACL,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,SAAS,CAAA;;;;;;;CAOvB,CAAA;AAED,MAAM,OAAO,GAAG,SAAS,CAAA;;;;;;;CAOxB,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,eAAuB,EAAE,EAAE,CAAC,GAAG,CAAA;;;;;;;;;wBAS9B,eAAe;eACxB,MAAM,IAAI,eAAe;;;;CAIvC,CAAA;AAED,MAAM,IAAI,GAAG,CAAC,eAAuB,EAAE,EAAE,CAAC,GAAG,CAAA;eAC9B,OAAO,IAAI,eAAe;;CAExC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;CAOpB,CAAA"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, useTheme } from '@emotion/react';
|
|
3
3
|
import { clearFailures, Failure, useGameDispatch, useGameSelector } from '@gamepark/react-client';
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
5
|
import { Trans, useTranslation } from 'react-i18next';
|
|
6
|
-
import { menuButtonCss, menuDialogCss } from '../menus/menuCss';
|
|
6
|
+
import { menuButtonCss, menuDialogCss, paletteMenuButtonCss } from '../menus/menuCss';
|
|
7
7
|
import { Dialog } from './Dialog';
|
|
8
8
|
export const FailuresDialog = (props) => {
|
|
9
9
|
const { t } = useTranslation('common');
|
|
10
|
+
const theme = useTheme();
|
|
10
11
|
const failures = useGameSelector((state) => state.failures);
|
|
11
12
|
const dispatch = useGameDispatch();
|
|
12
13
|
const [displayedFailure, setDisplayedFailure] = useState('');
|
|
@@ -19,7 +20,8 @@ export const FailuresDialog = (props) => {
|
|
|
19
20
|
}
|
|
20
21
|
}, [failures]);
|
|
21
22
|
const description = failuresDescription[displayedFailure] || fallbackDescription(displayedFailure);
|
|
22
|
-
|
|
23
|
+
const themedButtonCss = [menuButtonCss, paletteMenuButtonCss, theme.menu?.button];
|
|
24
|
+
return (_jsxs(Dialog, { open: failures.length > 0, css: menuDialogCss, ...props, children: [_jsx("h2", { children: description.title(t) }), _jsx("p", { children: description.text(t) }), _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() })] }) })] }));
|
|
23
25
|
};
|
|
24
26
|
const failuresDescription = {
|
|
25
27
|
[Failure.NETWORK]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FailuresDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/FailuresDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,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,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEjG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE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,CAAC,CAAY,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC;KACrD;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,cAAc,GAAG,GAAG,CAAA;;;CAGzB,CAAA"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, useTheme } from '@emotion/react';
|
|
3
3
|
import { PLATFORM_URI, pusherClient, trpc, useMe } from '@gamepark/react-client';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { NavButton } from '../../menus/Menu/NavButton';
|
|
7
|
-
import { menuButtonCss } from '../../menus/menuCss';
|
|
7
|
+
import { menuButtonCss, paletteMenuButtonCss } from '../../menus/menuCss';
|
|
8
8
|
export const RematchDisplay = ({ rematch }) => {
|
|
9
9
|
const { t } = useTranslation('common');
|
|
10
|
+
const theme = useTheme();
|
|
10
11
|
const me = useMe();
|
|
11
12
|
const { mutate: acceptRematch } = trpc.rematch.acceptRematch.useMutation();
|
|
12
13
|
const { mutate: refuseRematch } = trpc.rematch.refuseRematch.useMutation();
|
|
@@ -24,7 +25,7 @@ export const RematchDisplay = ({ rematch }) => {
|
|
|
24
25
|
t('rematch.mine') :
|
|
25
26
|
rematch.startDate ?
|
|
26
27
|
t('rematch.offered', { player: rematch.players[0].name }) :
|
|
27
|
-
t('rematch.offer', { player: rematch.players[0].name }) }), player && !player.ready && _jsxs("div", { css: css `margin-bottom: 0.5em;`, children: [_jsx("button", { css: [menuButtonCss, rematchButton, declineButton], onClick: () => refuseRematch(rematch.id), children: t('rematch.decline') }), _jsx("button", { css: [menuButtonCss, rematchButton, acceptButton], onClick: () => acceptRematch(rematch.id), children: t('rematch.accept') })] }), _jsx(NavButton, { css: rematchButton, url: `${PLATFORM_URI}/?id=${rematch.id}`, children: t('rematch.go') })] }));
|
|
28
|
+
t('rematch.offer', { player: rematch.players[0].name }) }), player && !player.ready && _jsxs("div", { css: css `margin-bottom: 0.5em;`, children: [_jsx("button", { css: [menuButtonCss, paletteMenuButtonCss, theme.menu?.button, rematchButton, declineButton], onClick: () => refuseRematch(rematch.id), children: t('rematch.decline') }), _jsx("button", { css: [menuButtonCss, paletteMenuButtonCss, theme.menu?.button, rematchButton, acceptButton], onClick: () => acceptRematch(rematch.id), children: t('rematch.accept') })] }), _jsx(NavButton, { css: rematchButton, url: `${PLATFORM_URI}/?id=${rematch.id}`, children: t('rematch.go') })] }));
|
|
28
29
|
};
|
|
29
30
|
const rematchTitle = css `
|
|
30
31
|
margin: 1em;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RematchDisplay.js","sourceRoot":"","sources":["../../../../src/components/dialogs/ResultDialog/RematchDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"RematchDisplay.js","sourceRoot":"","sources":["../../../../src/components/dialogs/ResultDialog/RematchDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,o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GAAG,GAAG,CAAA;;;CAGxB,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,OAAoB,EAAE,EAAE;IAC/C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACzC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IACxC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAA;AACvB,CAAC,CAAA"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, useTheme } from '@emotion/react';
|
|
3
3
|
import { faRepeat } from '@fortawesome/free-solid-svg-icons/faRepeat';
|
|
4
4
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
5
|
import { useRematch } from '@gamepark/react-client';
|
|
6
6
|
import { useEffect } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { RematchDisplay } from './RematchDisplay';
|
|
9
|
-
import { menuButtonCss } from '../../menus/menuCss';
|
|
9
|
+
import { menuButtonCss, paletteMenuButtonCss } from '../../menus/menuCss';
|
|
10
10
|
export const RematchSection = ({ openDialog }) => {
|
|
11
11
|
const { t } = useTranslation('common');
|
|
12
|
+
const theme = useTheme();
|
|
12
13
|
const { game, rematch } = useRematch();
|
|
13
14
|
useEffect(() => {
|
|
14
15
|
if (game?.rematch)
|
|
15
16
|
openDialog();
|
|
16
17
|
}, [game?.rematch]);
|
|
17
18
|
return (_jsxs("div", { children: [game?.canRematch &&
|
|
18
|
-
_jsxs("button", { css: [menuButtonCss, css `display: inline-block`], onClick: () => rematch(), children: [_jsx(FontAwesomeIcon, { icon: faRepeat }), t('rematch.button')] }), game?.rematch && _jsx(RematchDisplay, { rematch: game.rematch })] }));
|
|
19
|
+
_jsxs("button", { css: [menuButtonCss, paletteMenuButtonCss, theme.menu?.button, css `display: inline-block`], onClick: () => rematch(), children: [_jsx(FontAwesomeIcon, { icon: faRepeat }), t('rematch.button')] }), game?.rematch && _jsx(RematchDisplay, { rematch: game.rematch })] }));
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=RematchSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RematchSection.js","sourceRoot":"","sources":["../../../../src/components/dialogs/ResultDialog/RematchSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"RematchSection.js","sourceRoot":"","sources":["../../../../src/components/dialogs/ResultDialog/RematchSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAMzE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,UAAU,EAAS,EAAE,EAAE;IACtD,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,IAAI,EAAE,OAAO;YAAE,UAAU,EAAE,CAAA;IACjC,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;IACnB,OAAO,CACL,0BACG,IAAI,EAAE,UAAU;gBACf,kBAAQ,GAAG,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAA,uBAAuB,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,aAC1H,KAAC,eAAe,IAAC,IAAI,EAAE,QAAQ,GAAG,EACjC,CAAC,CAAC,gBAAgB,CAAC,IACb,EAEV,IAAI,EAAE,OAAO,IAAI,KAAC,cAAc,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,GAAG,IACtD,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, useTheme } from '@emotion/react';
|
|
3
3
|
import { faChessPawn } from '@fortawesome/free-solid-svg-icons/faChessPawn';
|
|
4
4
|
import { faTrophy } from '@fortawesome/free-solid-svg-icons/faTrophy';
|
|
5
5
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
@@ -23,6 +23,7 @@ const locale = query.get('locale') || 'en';
|
|
|
23
23
|
const gameId = query.get('game');
|
|
24
24
|
export const ResultDialog = ({ openDialog, close, ...props }) => {
|
|
25
25
|
const { t } = useTranslation('common');
|
|
26
|
+
const theme = useTheme();
|
|
26
27
|
const rankedPlayers = useRankedPlayers();
|
|
27
28
|
const context = useContext(gameContext);
|
|
28
29
|
const rules = useRules();
|
|
@@ -31,21 +32,21 @@ export const ResultDialog = ({ openDialog, close, ...props }) => {
|
|
|
31
32
|
const scoringCells = useScoringHeader();
|
|
32
33
|
let row = (gameMode === GameMode.TOURNAMENT ? 3 : gameMode === GameMode.COMPETITIVE ? 2 : 1) + (scoringCells?.length ?? 0);
|
|
33
34
|
const resultText = useResultText();
|
|
34
|
-
return (_jsxs(Dialog, { onBackdropClick: close, css: style, ...props, children: [_jsx(FontAwesomeIcon, { icon: faXmark, css: closeIcon, onClick: close }), _jsx("h2", { children: resultText }), _jsxs("div", { css: buttonLine, children: [gameMode === GameMode.TOURNAMENT && tournament ?
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
return (_jsxs(Dialog, { onBackdropClick: close, css: [style, theme.result?.container], ...props, children: [_jsx(FontAwesomeIcon, { icon: faXmark, css: [closeIcon, theme.result?.closeIcon], onClick: close }), _jsxs("div", { css: scrollableContent, children: [_jsx("h2", { children: resultText }), _jsxs("div", { css: buttonLine, children: [gameMode === GameMode.TOURNAMENT && tournament ?
|
|
36
|
+
_jsx(NavButton, { url: `${PLATFORM_URI}/${locale}/board-games/${context.game}/tournaments/${tournament.number}`, children: t('result.tournament.link') })
|
|
37
|
+
:
|
|
38
|
+
_jsx(NavButton, { url: `${PLATFORM_URI}/${locale}/board-games/${context.game}`, children: t('Back to Game Park') }), gameMode === GameMode.COMPETITIVE &&
|
|
39
|
+
_jsx(NavButton, { url: `${PLATFORM_URI}/${locale}/board-games/${context.game}/play?mode=matchmaking`, children: t('Play again') }), gameMode === GameMode.COMPETITIVE &&
|
|
40
|
+
_jsx(NavButton, { url: `${PLATFORM_URI}/${locale}/board-games/${context.game}/ranking`, children: t('See overall ranking') })] }), _jsxs("div", { css: [gridCss, row > 1 ? multiRows(rankedPlayers.length, row) : singleRow(rankedPlayers.length)], children: [row > 1 && _jsx("div", { css: stickyHeader }), gameMode === GameMode.TOURNAMENT && _jsx("div", { css: [borderTopCss, left], children: t('Tournament') }), (gameMode === GameMode.TOURNAMENT || gameMode === GameMode.COMPETITIVE) && _jsx("div", { css: [borderTopCss, left], children: t('Ranking') }), scoringCells.map((cell, index) => (_jsx("div", { css: [borderTopCss, left], children: cell }, index))), rankedPlayers.map((player, index) => _jsx(PlayerDisplay, { playerId: player.id, gameMode: gameMode, rank: isCompetitive(rules) && player.rank <= 3 ? player.rank : undefined, border: row > 1 }, index))] }), gameMode === GameMode.TUTORIAL &&
|
|
41
|
+
_jsxs("div", { children: [_jsx("p", { css: css `white-space: break-spaces;`, children: t('tuto.over') }), _jsxs("p", { css: buttonsLine, children: [_jsx(RestartTutorialButton, {}), _jsxs(NavButton, { url: `${PLATFORM_URI}/${locale}/board-games/${context.game}/play`, css: css `margin-left: 1em;`, children: [_jsx(FontAwesomeIcon, { icon: faChessPawn }), t('Play')] })] })] }), gameId !== null && _jsx(RematchSection, { openDialog: openDialog })] })] }));
|
|
41
42
|
};
|
|
42
43
|
const PlayerDisplay = ({ gameMode, playerId, rank, border }) => {
|
|
43
44
|
const playerName = usePlayerName(playerId);
|
|
44
45
|
const tournamentPoints = useGameSelector((state) => state.players.find(p => p.id === playerId)?.tournamentPoints ?? undefined);
|
|
45
46
|
const playerData = usePlayerScoring(playerId);
|
|
46
|
-
return _jsxs(_Fragment, { children: [_jsxs("div", { css: [relative, border &&
|
|
47
|
-
_jsx("div", { css: [
|
|
48
|
-
_jsx("div", { css: [
|
|
47
|
+
return _jsxs(_Fragment, { children: [_jsxs("div", { css: [relative, border && borderLeftCss, stickyHeader], children: [_jsxs("div", { css: avatarContainer, children: [_jsx(Avatar, { playerId: playerId, css: avatarCss }), rank !== undefined && _jsx(Medal, { rank: rank, css: medalCss })] }), _jsx("span", { children: playerName })] }), gameMode === GameMode.TOURNAMENT &&
|
|
48
|
+
_jsx("div", { css: [borderLeftCss, borderTopCss, centered], children: tournamentPoints !== undefined && _jsxs(_Fragment, { children: [_jsx(FontAwesomeIcon, { icon: faTrophy, css: trophyIconCss }), _jsxs("span", { children: ["+", tournamentPoints] })] }) }), (gameMode === GameMode.TOURNAMENT || gameMode === GameMode.COMPETITIVE) &&
|
|
49
|
+
_jsx("div", { css: [borderLeftCss, borderTopCss, centered], children: _jsx(GamePoints, { playerId: playerId }) }), playerData.map((cell, index) => (_jsx("div", { css: [borderLeftCss, borderTopCss], children: cell }, index)))] });
|
|
49
50
|
};
|
|
50
51
|
const centered = css `
|
|
51
52
|
> * {
|
|
@@ -53,23 +54,37 @@ const centered = css `
|
|
|
53
54
|
}
|
|
54
55
|
`;
|
|
55
56
|
const style = css `
|
|
56
|
-
font-size: 3.2em;
|
|
57
|
+
font-size: calc(3.2em * var(--gp-scale));
|
|
57
58
|
text-align: center;
|
|
58
59
|
max-height: 90vh;
|
|
59
60
|
max-height: 90dvh;
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
62
63
|
|
|
63
64
|
> h2 {
|
|
64
65
|
margin: 0 1em 0.5em;
|
|
65
66
|
}
|
|
66
67
|
`;
|
|
68
|
+
const scrollableContent = css `
|
|
69
|
+
overflow-y: auto;
|
|
70
|
+
flex: 1;
|
|
71
|
+
min-height: 0;
|
|
72
|
+
`;
|
|
67
73
|
const closeIcon = css `
|
|
68
74
|
position: absolute;
|
|
69
75
|
right: 0.8em;
|
|
70
76
|
top: 0.6em;
|
|
71
77
|
font-size: 1.3em;
|
|
72
78
|
cursor: pointer;
|
|
79
|
+
z-index: 1;
|
|
80
|
+
`;
|
|
81
|
+
const stickyHeader = css `
|
|
82
|
+
position: sticky;
|
|
83
|
+
top: 0;
|
|
84
|
+
background-color: var(--gp-dialog-bg);
|
|
85
|
+
z-index: 1;
|
|
86
|
+
padding-top: 0.3em;
|
|
87
|
+
padding-bottom: 0.3em;
|
|
73
88
|
`;
|
|
74
89
|
const buttonLine = css `
|
|
75
90
|
display: flex;
|
|
@@ -106,7 +121,7 @@ const avatarCss = css `
|
|
|
106
121
|
const medalCss = css `
|
|
107
122
|
width: 1.3em;
|
|
108
123
|
height: 1.6em;
|
|
109
|
-
fill:
|
|
124
|
+
fill: var(--gp-result-icon);
|
|
110
125
|
position: absolute;
|
|
111
126
|
top: -0.5em;
|
|
112
127
|
left: -0.8em;
|
|
@@ -114,14 +129,14 @@ const medalCss = css `
|
|
|
114
129
|
const relative = css `
|
|
115
130
|
position: relative;
|
|
116
131
|
`;
|
|
117
|
-
const
|
|
118
|
-
border-left: 0.1em solid
|
|
132
|
+
const borderLeftCss = css `
|
|
133
|
+
border-left: 0.1em solid var(--gp-result-border);
|
|
119
134
|
`;
|
|
120
|
-
const
|
|
121
|
-
border-top: 0.1em solid
|
|
135
|
+
const borderTopCss = css `
|
|
136
|
+
border-top: 0.1em solid var(--gp-result-border);
|
|
122
137
|
`;
|
|
123
|
-
const
|
|
124
|
-
color:
|
|
138
|
+
const trophyIconCss = css `
|
|
139
|
+
color: var(--gp-result-border);
|
|
125
140
|
`;
|
|
126
141
|
const left = css `
|
|
127
142
|
text-align: left;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultDialog.js","sourceRoot":"","sources":["../../../../src/components/dialogs/ResultDialog/ResultDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"ResultDialog.js","sourceRoot":"","sources":["../../../../src/components/dialogs/ResultDialog/ResultDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,c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O,GAAG,GAAG,CAAA;;;;;;;;CAQlB,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,IAAY,EAAE,EAAE,CAAC,GAAG,CAAA;uCACjB,OAAO;+BACf,IAAI;CAClC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,CAAA;kCACR,OAAO;;CAExC,CAAA;AAED,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;CAK1B,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,CAAA;;;;CAIpB,CAAA;AAED,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;CAOnB,CAAA;AAED,MAAM,QAAQ,GAAG,GAAG,CAAA;;CAEnB,CAAA;AAED,MAAM,aAAa,GAAG,GAAG,CAAA;;CAExB,CAAA;AAED,MAAM,YAAY,GAAG,GAAG,CAAA;;CAEvB,CAAA;AAED,MAAM,aAAa,GAAG,GAAG,CAAA;;CAExB,CAAA;AAED,MAAM,IAAI,GAAG,GAAG,CAAA;;CAEf,CAAA;AAED,MAAM,WAAW,GAAG,GAAG,CAAA;;;;CAItB,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { MaterialHelpDisplayProps } from '../../material';
|
|
2
|
+
export declare const DefaultHelpDisplay: <P extends number = number, M extends number = number, L extends number = number>({ item, itemType, itemIndex, displayIndex }: MaterialHelpDisplayProps<P, M, L>) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { fontSizeCss } from '../../../css';
|
|
4
|
+
import { useMaterialContext, useMaterialDescription } from '../../../hooks';
|
|
5
|
+
import { MaterialComponent } from '../../material';
|
|
6
|
+
import { LocationDisplay } from '../../material/locations/LocationDisplay';
|
|
7
|
+
export const DefaultHelpDisplay = ({ item, itemType, itemIndex, displayIndex }) => {
|
|
8
|
+
const context = useMaterialContext();
|
|
9
|
+
const description = useMaterialDescription(itemType);
|
|
10
|
+
if (!description)
|
|
11
|
+
return null;
|
|
12
|
+
const itemContext = { ...context, type: itemType, index: itemIndex, displayIndex: displayIndex };
|
|
13
|
+
const { width, height } = description.getSize(item.id);
|
|
14
|
+
const locations = item.location ? context.material[itemType]?.getLocations(item, itemContext) ?? [] : [];
|
|
15
|
+
return (_jsx("div", { css: css `position: relative; flex-shrink: 0;`, children: _jsx(MaterialComponent, { type: itemType, itemId: item.id, itemIndex: itemIndex, css: [
|
|
16
|
+
fontSizeCss(Math.min(75 / height, 75 / width, 10)),
|
|
17
|
+
description.getHelpDisplayExtraCss(item, itemContext)
|
|
18
|
+
], children: locations.map((location) => {
|
|
19
|
+
const locationDescription = context.locators[location.type]?.getLocationDescription(location, context);
|
|
20
|
+
if (!locationDescription || !locationDescription.displayInParentItemHelp)
|
|
21
|
+
return null;
|
|
22
|
+
return _jsx(LocationDisplay, { location: location, description: locationDescription }, JSON.stringify(location));
|
|
23
|
+
}) }) }));
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=DefaultHelpDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultHelpDisplay.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/DefaultHelpDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAE3E,OAAO,EAAE,iBAAiB,EAA4B,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAq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AAe,IAAgC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAA0B,IAArF,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAgE,CAAA;YACvH,CAAC,CAAC,GACgB,GAChB,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, useTheme } from '@emotion/react';
|
|
3
3
|
import { MaterialMoveBuilder } from '@gamepark/rules-api';
|
|
4
4
|
import { fontSizeCss } from '../../../css';
|
|
5
5
|
import { useItemLocator, useMaterialContext, usePlay } from '../../../hooks';
|
|
@@ -7,6 +7,7 @@ import { helpDialogContentCss } from './RulesHelpDialogContent';
|
|
|
7
7
|
var displayHelp = MaterialMoveBuilder.displayHelp;
|
|
8
8
|
export const LocationRulesDialogContent = ({ helpDisplay: { location } }) => {
|
|
9
9
|
const play = usePlay();
|
|
10
|
+
const theme = useTheme();
|
|
10
11
|
const context = useMaterialContext();
|
|
11
12
|
const locator = useItemLocator(location.type);
|
|
12
13
|
const description = locator?.getLocationDescription(location, context);
|
|
@@ -16,7 +17,7 @@ export const LocationRulesDialogContent = ({ helpDisplay: { location } }) => {
|
|
|
16
17
|
const image = description?.getHelpImage(location, context);
|
|
17
18
|
const { width, height } = description?.getLocationSize(location, context) ?? { width: 0, height: 0 };
|
|
18
19
|
return _jsxs("div", { css: flex, children: [!!image &&
|
|
19
|
-
_jsx("div", { css: [noShrink, fontSizeCss(Math.min(75 / height, 75 / width, 10)), backgroundImage(image, height, width)] }), _jsx("div", { css: helpDialogContentCss, children: _jsx(Help, { location: location, closeDialog: () => play(displayHelp(undefined), { transient: true }) }) })] });
|
|
20
|
+
_jsx("div", { css: [noShrink, fontSizeCss(Math.min(75 / height, 75 / width, 10)), backgroundImage(image, height, width)] }), _jsx("div", { css: [helpDialogContentCss, theme.dialog.content], children: _jsx(Help, { location: location, closeDialog: () => play(displayHelp(undefined), { transient: true }) }) })] });
|
|
20
21
|
};
|
|
21
22
|
const flex = css `
|
|
22
23
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationRulesDialogContent.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/LocationRulesDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"LocationRulesDialogContent.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/LocationRulesDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAuB,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,IAAO,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAA;AAMpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAyC,EACpE,EAAE;IACF,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;IACtB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,OAAO,GAAG,kBAAkB,EAAW,CAAA;IAC7C,MAAM,OAAO,GAAG,cAAc,CAAU,QAAQ,CAAC,IAAI,CAAC,CAAA;IACtD,MAAM,WAAW,GAAG,OAAO,EAAE,sBAAsB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACtE,MAAM,IAAI,GAAG,WAAW,EAAE,IAAI,IAAI,OAAO,EAAE,IAAI,CAAA;IAC/C,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,MAAM,KAAK,GAAG,WAAW,EAAE,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC1D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAA;IACpG,OAAO,eAAK,GAAG,EAAE,IAAI,aAClB,CAAC,CAAC,KAAK;gBACN,cAAK,GAAG,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,GAAG,EAEpH,cAAK,GAAG,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,YACpD,KAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,GAAG,GAC7F,IACF,CAAA;AACR,CAAC,CAAA;AAED,MAAM,IAAI,GAAG,GAAG,CAAA;;;;;CAKf,CAAA;AAED,MAAM,QAAQ,GAAG,GAAG,CAAA;;CAEnB,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,MAAc,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,CAAA;0BACnD,KAAK;;YAEnB,MAAM;WACP,KAAK;CACf,CAAA"}
|
|
@@ -5,11 +5,8 @@ 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 { fontSizeCss } from '../../../css';
|
|
9
8
|
import { useKeyDown, useMaterialContext, useMaterialDescription, usePlay, useRules } from '../../../hooks';
|
|
10
9
|
import { useLocators } from '../../../hooks/useLocators';
|
|
11
|
-
import { MaterialComponent } from '../../material';
|
|
12
|
-
import { LocationDisplay } from '../../material/locations/LocationDisplay';
|
|
13
10
|
import { helpDialogContentCss } from './RulesHelpDialogContent';
|
|
14
11
|
var displayHelp = MaterialMoveBuilder.displayHelp;
|
|
15
12
|
var displayMaterialHelp = MaterialMoveBuilder.displayMaterialHelp;
|
|
@@ -47,6 +44,7 @@ const useMaterialNavigation = (helpDisplay, context) => {
|
|
|
47
44
|
};
|
|
48
45
|
export const MaterialRulesDialogContent = ({ helpDisplay }) => {
|
|
49
46
|
const play = usePlay();
|
|
47
|
+
const theme = useTheme();
|
|
50
48
|
const context = useMaterialContext();
|
|
51
49
|
const description = useMaterialDescription(helpDisplay.itemType);
|
|
52
50
|
const itemContext = { ...context, type: helpDisplay.itemType, index: helpDisplay.itemIndex, displayIndex: helpDisplay.displayIndex };
|
|
@@ -56,37 +54,25 @@ export const MaterialRulesDialogContent = ({ helpDisplay }) => {
|
|
|
56
54
|
if (!description)
|
|
57
55
|
return null;
|
|
58
56
|
const item = helpDisplay.item;
|
|
59
|
-
const { width, height } = description.getSize(item.id);
|
|
60
57
|
const hasNavigation = previous || next;
|
|
61
|
-
|
|
62
|
-
return _jsxs(_Fragment, { children: [_jsxs("div", { css: [flex, hasNavigation && fullSize], children: [_jsx(MaterialComponent, { type: helpDisplay.itemType, itemId: item.id, itemIndex: helpDisplay.itemIndex, css: [
|
|
63
|
-
noShrink, fontSizeCss(Math.min(75 / height, 75 / width, 10)),
|
|
64
|
-
description.getHelpDisplayExtraCss(item, itemContext)
|
|
65
|
-
], children: locations.map((location) => {
|
|
66
|
-
const locationDescription = context.locators[location.type]?.getLocationDescription(location, context);
|
|
67
|
-
if (!locationDescription || !locationDescription.displayInParentItemHelp)
|
|
68
|
-
return null;
|
|
69
|
-
return _jsx(LocationDisplay, { location: location, description: locationDescription }, JSON.stringify(location));
|
|
70
|
-
}) }), _jsx("div", { css: helpDialogContentCss, children: description.help && _jsx(description.help, { ...helpDisplay, closeDialog: closeDialog }) })] }), previous && _jsx(PreviousArrow, { onPrevious: () => play(previous, { transient: true }) }), next && _jsx(NextArrow, { onNext: () => play(next, { transient: true }) })] });
|
|
58
|
+
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 }) })] }), previous && _jsx(PreviousArrow, { onPrevious: () => play(previous, { transient: true }) }), next && _jsx(NextArrow, { onNext: () => play(next, { transient: true }) })] });
|
|
71
59
|
};
|
|
72
60
|
const NextArrow = (props) => {
|
|
73
61
|
const { onNext } = props;
|
|
74
|
-
|
|
75
|
-
return (_jsx("div", { tabIndex: 2, css: [navigationArrow(theme), nextArrow], onClick: onNext, children: _jsx(FontAwesomeIcon, { icon: faChevronRight }) }));
|
|
62
|
+
return (_jsx("div", { tabIndex: 2, css: [navigationArrow, nextArrow], onClick: onNext, children: _jsx(FontAwesomeIcon, { icon: faChevronRight }) }));
|
|
76
63
|
};
|
|
77
64
|
const PreviousArrow = (props) => {
|
|
78
65
|
const { onPrevious } = props;
|
|
79
|
-
|
|
80
|
-
return (_jsx("div", { tabIndex: 1, css: [navigationArrow(theme), previousArrow], onClick: onPrevious, children: _jsx(FontAwesomeIcon, { icon: faChevronLeft }) }));
|
|
66
|
+
return (_jsx("div", { tabIndex: 1, css: [navigationArrow, previousArrow], onClick: onPrevious, children: _jsx(FontAwesomeIcon, { icon: faChevronLeft }) }));
|
|
81
67
|
};
|
|
82
|
-
const navigationArrow =
|
|
68
|
+
const navigationArrow = css `
|
|
83
69
|
position: absolute;
|
|
84
70
|
top: 50%;
|
|
85
71
|
z-index: -1;
|
|
86
72
|
transform: translateY(-50%);
|
|
87
|
-
background-color:
|
|
88
|
-
color:
|
|
89
|
-
font-size:
|
|
73
|
+
background-color: var(--gp-dialog-bg);
|
|
74
|
+
color: var(--gp-dialog-color);
|
|
75
|
+
font-size: 3.2em;
|
|
90
76
|
display: flex;
|
|
91
77
|
align-items: center;
|
|
92
78
|
border-radius: 1.4em;
|
|
@@ -133,9 +119,6 @@ const flex = css `
|
|
|
133
119
|
max-width: inherit;
|
|
134
120
|
max-height: inherit;
|
|
135
121
|
`;
|
|
136
|
-
const noShrink = css `
|
|
137
|
-
flex-shrink: 0;
|
|
138
|
-
`;
|
|
139
122
|
const fullSize = css `
|
|
140
123
|
width: 80vw;
|
|
141
124
|
width: 80dvw;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialRulesDialogContent.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/MaterialRulesDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"MaterialRulesDialogContent.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/MaterialRulesDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAuB,mBAAmB,EAAiB,MAAM,qBAAqB,CAAA;AACjH,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAA;AACn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AE,aAAa,CAAC,EAAE,OAAO,EAAE,UAAU,YAC1E,KAAC,eAAe,IAAC,IAAI,EAAE,aAAa,GAAG,GACnC,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;CAe1B,CAAA;AAED,MAAM,iBAAiB,GAAG,SAAS,CAAA;;;;;;;CAOlC,CAAA;AAED,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;iBAKR,iBAAiB;;CAEjC,CAAA;AACD,MAAM,aAAa,GAAG,SAAS,CAAA;;;;;;;CAO9B,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;iBAKJ,aAAa;;CAE7B,CAAA;AAED,MAAM,IAAI,GAAG,GAAG,CAAA;;;;;CAKf,CAAA;AAED,MAAM,QAAQ,GAAG,GAAG,CAAA;;;CAGnB,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css, ThemeProvider } from '@emotion/react';
|
|
2
|
+
import { css, ThemeProvider, useTheme } from '@emotion/react';
|
|
3
3
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
4
4
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
-
import {
|
|
5
|
+
import { onSurfaceButtonCss } from '../../../css';
|
|
6
6
|
import { Dialog } from '../index';
|
|
7
7
|
export const RulesDialog = ({ close, children, ...props }) => {
|
|
8
|
-
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
return (_jsxs(Dialog, { onBackdropClick: close, css: dialogCss, ...props, children: [close && _jsx(FontAwesomeIcon, { icon: faXmark, css: [dialogCloseIcon, theme.dialog.closeIcon], onClick: close }), _jsx(ThemeProvider, { theme: theme => ({ ...theme, buttons: onSurfaceButtonCss }), children: children })] }));
|
|
9
10
|
};
|
|
10
11
|
const dialogCss = css `
|
|
11
12
|
max-width: 90vw;
|
|
@@ -18,7 +19,7 @@ const dialogCloseIcon = css `
|
|
|
18
19
|
position: absolute;
|
|
19
20
|
right: 0.5em;
|
|
20
21
|
top: 0.3em;
|
|
21
|
-
font-size: 4em;
|
|
22
|
+
font-size: calc(4em * var(--gp-scale));
|
|
22
23
|
cursor: pointer;
|
|
23
24
|
z-index: 100;
|
|
24
25
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesDialog.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/RulesDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"RulesDialog.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/RulesDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAA;AAM9C,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB,EAAE,EAAE;IACnG,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,OAAO,CACL,MAAC,MAAM,IAAC,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,KAAM,KAAK,aACtD,KAAK,IAAI,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,GAAG,EAC3G,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,YACvE,QAAQ,GACK,IACT,CACV,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;CAMpB,CAAA;AAED,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;CAO1B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, useTheme } from '@emotion/react';
|
|
3
3
|
import { MaterialMoveBuilder } from '@gamepark/rules-api';
|
|
4
4
|
import { useContext } from 'react';
|
|
5
5
|
import { usePlay } from '../../../hooks';
|
|
@@ -7,9 +7,10 @@ import { gameContext } from '../../GameProvider';
|
|
|
7
7
|
var displayHelp = MaterialMoveBuilder.displayHelp;
|
|
8
8
|
export const RulesHelpDialogContent = ({ helpDisplay }) => {
|
|
9
9
|
const play = usePlay();
|
|
10
|
+
const theme = useTheme();
|
|
10
11
|
const context = useContext(gameContext);
|
|
11
12
|
const RulesHelp = context.rulesHelp?.[helpDisplay.ruleId];
|
|
12
|
-
return _jsx("div", { css: helpDialogCss, children: _jsx("div", { css: helpDialogContentCss, children: RulesHelp ?
|
|
13
|
+
return _jsx("div", { css: helpDialogCss, children: _jsx("div", { css: [helpDialogContentCss, theme.dialog.content], children: RulesHelp ?
|
|
13
14
|
_jsx(RulesHelp, { close: () => play(displayHelp(undefined), { transient: true }) })
|
|
14
15
|
: _jsxs(_Fragment, { children: [_jsx("h2", { children: "Missing help" }), _jsxs("p", { children: ["Please provide some text to explain rule #", helpDisplay.ruleId] })] }) }) });
|
|
15
16
|
};
|
|
@@ -22,7 +23,7 @@ const helpDialogCss = css `
|
|
|
22
23
|
export const helpDialogContentCss = css `
|
|
23
24
|
margin: 0 0.5em;
|
|
24
25
|
padding: 0 0.5em;
|
|
25
|
-
font-size:
|
|
26
|
+
font-size: 2.4em;
|
|
26
27
|
overflow: auto;
|
|
27
28
|
flex: 1;
|
|
28
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesHelpDialogContent.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/RulesHelpDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"RulesHelpDialogContent.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/RulesHelpDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAoB,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,IAAO,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAA;AAMpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,EAAE,WAAW,EAA+B,EAC5C,EAAE;IACF,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;IACtB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IACvC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IACzD,OAAO,cAAK,GAAG,EAAE,aAAa,YAC5B,cAAK,GAAG,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,YACnD,SAAS,CAAC,CAAC;gBACV,KAAC,SAAS,IAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,GAAG;gBAC5E,CAAC,CAAC,8BACA,wCAAqB,EACrB,sEAA8C,WAAW,CAAC,MAAM,IAAK,IACpE,GAED,GACF,CAAA;AACR,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;CAKxB,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;CAetC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/dialogs/RulesDialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,eAAe,CAAA"}
|
|
@@ -8,6 +8,13 @@ import { ItemButtonProps } from './ItemMenuButton';
|
|
|
8
8
|
export type MaterialHelpProps<P extends number = number, M extends number = number, L extends number = number> = {
|
|
9
9
|
closeDialog: () => void;
|
|
10
10
|
} & Omit<MaterialHelpDisplay<P, M, L>, 'type'>;
|
|
11
|
+
export type MaterialHelpDisplayProps<P extends number = number, M extends number = number, L extends number = number> = {
|
|
12
|
+
item: Partial<MaterialItem<P, L>>;
|
|
13
|
+
itemType: M;
|
|
14
|
+
itemIndex?: number;
|
|
15
|
+
displayIndex?: number;
|
|
16
|
+
closeDialog: () => void;
|
|
17
|
+
};
|
|
11
18
|
export type MaterialContentProps<ItemId = any, M extends number = number> = {
|
|
12
19
|
itemId: ItemId;
|
|
13
20
|
itemIndex?: number;
|
|
@@ -24,6 +31,12 @@ export declare abstract class MaterialDescription<P extends number = number, M e
|
|
|
24
31
|
* Content of the help dialog opened when an item is clicked
|
|
25
32
|
*/
|
|
26
33
|
help?: ComponentType<MaterialHelpProps<P, M, L>>;
|
|
34
|
+
/**
|
|
35
|
+
* Custom component to render the item display area in the help dialog.
|
|
36
|
+
* Replaces the default item rendering (left side of the dialog).
|
|
37
|
+
* Use this to customize item positioning, show multiple items, add overlays, etc.
|
|
38
|
+
*/
|
|
39
|
+
helpDisplay: ComponentType<MaterialHelpDisplayProps<P, M, L>>;
|
|
27
40
|
/**
|
|
28
41
|
* The React component to display
|
|
29
42
|
*/
|