@gamepark/react-game 7.4.0 → 7.5.0
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 +34 -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/DraggableMaterial.js +0 -3
- package/dist/components/material/DraggableMaterial.js.map +1 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.js +2 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameTableNavigation.js +1 -1
- package/dist/components/material/MaterialDescription.d.ts +13 -8
- package/dist/components/material/MaterialDescription.js +7 -10
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/animations/CreateItemAnimations.js +36 -18
- package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAnimations.d.ts +1 -7
- package/dist/components/material/animations/DeleteItemAnimations.js +8 -10
- package/dist/components/material/animations/DeleteItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ItemAnimations.d.ts +11 -0
- package/dist/components/material/animations/ItemAnimations.js +12 -0
- package/dist/components/material/animations/ItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAnimations.js +23 -4
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js +13 -3
- package/dist/components/material/animations/MoveItemAtOnceAnimations.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":"SoundButton.js","sourceRoot":"","sources":["../../../../src/components/menus/SoundButton/SoundButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY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AAC,CAAC,CAAC,YAAY,CAAC,IACrC,CACV,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 { faClock } from '@fortawesome/free-solid-svg-icons/faClock';
|
|
4
4
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
5
5
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
8
8
|
import { Dialog } from '../../dialogs';
|
|
9
9
|
import { Avatar } from '../../Avatar';
|
|
10
10
|
import { usePlayerName, usePlayers } from '../../../hooks';
|
|
11
|
-
import { menuButtonCss, menuDialogCss } from '../menuCss';
|
|
11
|
+
import { menuButtonCss, menuDialogCss, paletteMenuButtonCss } from '../menuCss';
|
|
12
12
|
import dayjs from 'dayjs';
|
|
13
13
|
import duration from 'dayjs/plugin/duration';
|
|
14
14
|
import utc from 'dayjs/plugin/utc';
|
|
@@ -16,9 +16,10 @@ dayjs.extend(duration);
|
|
|
16
16
|
dayjs.extend(utc);
|
|
17
17
|
export const TimeStatsButton = () => {
|
|
18
18
|
const { t } = useTranslation('common');
|
|
19
|
+
const theme = useTheme();
|
|
19
20
|
const [displayPopup, setDisplayPopup] = useState(false);
|
|
20
21
|
const players = usePlayers();
|
|
21
|
-
return (_jsxs(_Fragment, { children: [_jsxs("button", { css: menuButtonCss, onClick: () => setDisplayPopup(true), children: [_jsx(FontAwesomeIcon, { icon: faClock }), t('time.button')] }), _jsxs(Dialog, { open: displayPopup, css: menuDialogCss, onBackdropClick: () => setDisplayPopup(false), children: [_jsx(FontAwesomeIcon, { icon: faXmark, css: closeIcon, onClick: () => setDisplayPopup(false) }), _jsx("h2", { children: t('time.title') }), _jsxs("div", { css: gridCss(players.length), children: [_jsx("div", {}), _jsx("div", { css: [
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { css: [menuButtonCss, paletteMenuButtonCss, theme.menu?.button], onClick: () => setDisplayPopup(true), children: [_jsx(FontAwesomeIcon, { icon: faClock }), t('time.button')] }), _jsxs(Dialog, { open: displayPopup, css: [menuDialogCss, theme.timeStats?.container], onBackdropClick: () => setDisplayPopup(false), children: [_jsx(FontAwesomeIcon, { icon: faXmark, css: closeIcon, onClick: () => setDisplayPopup(false) }), _jsx("h2", { children: t('time.title') }), _jsxs("div", { css: gridCss(players.length), children: [_jsx("div", {}), _jsx("div", { css: [borderTopCss, thinkBgCss], children: t('time.think.total') }), _jsx("div", { css: [borderTopCss, waitBgCss], children: t('time.wait.total') }), _jsx("div", { css: [borderTopCss, thinkBgCss], children: t('time.think.max') }), _jsx("div", { css: [borderTopCss, waitBgCss], children: t('time.wait.max') }), _jsx("div", { css: [borderTopCss, thinkBgCss], children: t('time.awaited') }), players.map((player, index) => _jsxs(Fragment, { children: [_jsxs("div", { css: [relative, borderLeftCss], children: [_jsx(Avatar, { playerId: player.id, css: avatarCss }), _jsx("span", { children: _jsx(PlayerName, { playerId: player.id }) })] }, index), _jsx("div", { css: [borderLeftCss, borderTopCss, thinkBgCss], children: humanize(player.time?.cumulatedPlayTime) }), _jsx("div", { css: [borderLeftCss, borderTopCss, waitBgCss], children: humanize(player.time?.cumulatedDownTime) }), _jsx("div", { css: [borderLeftCss, borderTopCss, thinkBgCss], children: humanize(player.time?.highestPlayTime) }), _jsx("div", { css: [borderLeftCss, borderTopCss, waitBgCss], children: humanize(player.time?.highestDownTime) }), _jsx("div", { css: [borderLeftCss, borderTopCss, thinkBgCss], children: humanize(player.time?.weightedWaitForMeTime) })] }, index))] })] })] }));
|
|
22
23
|
};
|
|
23
24
|
const PlayerName = ({ playerId }) => {
|
|
24
25
|
const name = usePlayerName(playerId);
|
|
@@ -50,17 +51,17 @@ const avatarCss = css `
|
|
|
50
51
|
const relative = css `
|
|
51
52
|
position: relative;
|
|
52
53
|
`;
|
|
53
|
-
const
|
|
54
|
-
border-left: 0.2em solid
|
|
54
|
+
const borderLeftCss = css `
|
|
55
|
+
border-left: 0.2em solid var(--gp-primary);
|
|
55
56
|
`;
|
|
56
|
-
const
|
|
57
|
-
border-top: 0.2em solid
|
|
57
|
+
const borderTopCss = css `
|
|
58
|
+
border-top: 0.2em solid var(--gp-primary);
|
|
58
59
|
`;
|
|
59
|
-
const
|
|
60
|
-
background-color:
|
|
60
|
+
const thinkBgCss = css `
|
|
61
|
+
background-color: var(--gp-timestats-think-bg);
|
|
61
62
|
`;
|
|
62
|
-
const
|
|
63
|
-
background-color:
|
|
63
|
+
const waitBgCss = css `
|
|
64
|
+
background-color: var(--gp-timestats-wait-bg);
|
|
64
65
|
`;
|
|
65
66
|
const oneDay = dayjs.duration(1, 'day');
|
|
66
67
|
const oneHour = dayjs.duration(1, 'hour');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeStatsButton.js","sourceRoot":"","sources":["../../../../src/components/menus/TimeStatsButton/TimeStatsButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"TimeStatsButton.js","sourceRoot":"","sources":["../../../../src/components/menus/TimeStatsButton/TimeStatsButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,MA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AC,QAAiB,EAAE,EAAE;IACrC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,GAAG,CAAA;IACtC,IAAI,QAAQ,IAAI,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAA;IAC5C,CAAC;SAAM,IAAI,QAAQ,IAAI,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IAC/C,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -3,11 +3,11 @@ import { faUndoAlt } from '@fortawesome/free-solid-svg-icons/faUndoAlt';
|
|
|
3
3
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { useUndo } from '../../../hooks';
|
|
6
|
-
import { menuButtonCss } from '../menuCss';
|
|
6
|
+
import { menuButtonCss, paletteMenuButtonCss } from '../menuCss';
|
|
7
7
|
export const UndoButton = () => {
|
|
8
8
|
const { t } = useTranslation('common');
|
|
9
9
|
const [undo, canUndo] = useUndo();
|
|
10
10
|
const canUndoLastMove = canUndo();
|
|
11
|
-
return (_jsxs("button", { css: menuButtonCss, disabled: !canUndoLastMove, onClick: () => undo(), children: [_jsx(FontAwesomeIcon, { icon: faUndoAlt }), t('Undo my last move')] }));
|
|
11
|
+
return (_jsxs("button", { css: [menuButtonCss, paletteMenuButtonCss], disabled: !canUndoLastMove, onClick: () => undo(), children: [_jsx(FontAwesomeIcon, { icon: faUndoAlt }), t('Undo my last move')] }));
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=UndoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UndoButton.js","sourceRoot":"","sources":["../../../../src/components/menus/UndoButton/UndoButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"UndoButton.js","sourceRoot":"","sources":["../../../../src/components/menus/UndoButton/UndoButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAA;IACjC,MAAM,eAAe,GAAG,OAAO,EAAE,CAAA;IAEjC,OAAO,CACL,kBAAQ,GAAG,EAAE,CAAC,aAAa,EAAE,oBAAoB,CAAC,EAAE,QAAQ,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,aACnG,KAAC,eAAe,IAAC,IAAI,EAAE,SAAS,GAAG,EAClC,CAAC,CAAC,mBAAmB,CAAC,IAChB,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import { css, useTheme } from '@emotion/react';
|
|
3
3
|
import { faUndoAlt } from '@fortawesome/free-solid-svg-icons/faUndoAlt';
|
|
4
4
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useUndo } from '../../../hooks';
|
|
7
|
+
import { palettePopButtonCss } from '../menuCss';
|
|
7
8
|
import { MenuPopButton } from '../Menu/MenuPopButton';
|
|
8
9
|
export const UndoPopButton = () => {
|
|
9
10
|
const { t } = useTranslation('common');
|
|
11
|
+
const theme = useTheme();
|
|
10
12
|
const [undo, canUndo] = useUndo();
|
|
11
13
|
const canUndoLastMove = canUndo();
|
|
12
|
-
return (_jsx(MenuPopButton, { pop: canUndoLastMove, onClick: () => undo(), css: style, title: t('Undo my last move'), children: _jsx(FontAwesomeIcon, { icon: faUndoAlt }) }));
|
|
14
|
+
return (_jsx(MenuPopButton, { pop: canUndoLastMove, onClick: () => undo(), css: [style, palettePopButtonCss, theme.menu?.popButton], title: t('Undo my last move'), children: _jsx(FontAwesomeIcon, { icon: faUndoAlt }) }));
|
|
13
15
|
};
|
|
14
16
|
const style = css `
|
|
15
17
|
background: white;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UndoPopButton.js","sourceRoot":"","sources":["../../../../src/components/menus/UndoButton/UndoPopButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"UndoPopButton.js","sourceRoot":"","sources":["../../../../src/components/menus/UndoButton/UndoPopButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAA;IACjC,MAAM,eAAe,GAAG,OAAO,EAAE,CAAA;IAEjC,OAAO,CACL,KAAC,aAAa,IAAC,GAAG,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,mBAAmB,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAE,YAClJ,KAAC,eAAe,IAAC,IAAI,EAAE,SAAS,GAAG,GACrB,CACjB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;CAWhB,CAAA"}
|
|
@@ -7,3 +7,8 @@ export declare const menuBaseCss: import("@emotion/utils").SerializedStyles;
|
|
|
7
7
|
export declare const hide: import("@emotion/utils").SerializedStyles;
|
|
8
8
|
export declare const backdrop: import("@emotion/utils").SerializedStyles;
|
|
9
9
|
export declare const displayBackdrop: import("@emotion/utils").SerializedStyles;
|
|
10
|
+
export declare const paletteMenuBaseCss: import("@emotion/utils").SerializedStyles;
|
|
11
|
+
export declare const paletteMenuButtonCss: import("@emotion/utils").SerializedStyles;
|
|
12
|
+
export declare const paletteDangerButtonCss: import("@emotion/utils").SerializedStyles;
|
|
13
|
+
export declare const palettePrimaryButtonCss: import("@emotion/utils").SerializedStyles;
|
|
14
|
+
export declare const palettePopButtonCss: import("@emotion/utils").SerializedStyles;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { buttonResetCss } from '../../css';
|
|
3
3
|
export const menuDialogCss = css `
|
|
4
|
-
font-size: 3.2em;
|
|
4
|
+
font-size: calc(3.2em * var(--gp-scale));
|
|
5
5
|
|
|
6
6
|
h2 {
|
|
7
7
|
margin: 0 0 0.5em;
|
|
@@ -12,10 +12,7 @@ export const menuDialogCss = css `
|
|
|
12
12
|
}
|
|
13
13
|
`;
|
|
14
14
|
export const menuFontSize = css `
|
|
15
|
-
font-size:
|
|
16
|
-
@media only screen and (min-width: 960px) {
|
|
17
|
-
font-size: 3.2em;
|
|
18
|
-
}
|
|
15
|
+
font-size: calc(3.2em * var(--gp-scale));
|
|
19
16
|
`;
|
|
20
17
|
export const floatingButtonCss = css `
|
|
21
18
|
${menuFontSize};
|
|
@@ -100,4 +97,60 @@ export const displayBackdrop = css `
|
|
|
100
97
|
opacity: 1;
|
|
101
98
|
pointer-events: auto;
|
|
102
99
|
`;
|
|
100
|
+
export const paletteMenuBaseCss = css `
|
|
101
|
+
background: var(--gp-surface);
|
|
102
|
+
color: var(--gp-on-surface);
|
|
103
|
+
font-family: var(--gp-font-family);
|
|
104
|
+
`;
|
|
105
|
+
export const paletteMenuButtonCss = css `
|
|
106
|
+
border-color: var(--gp-on-surface);
|
|
107
|
+
color: var(--gp-on-surface);
|
|
108
|
+
|
|
109
|
+
&:focus, &:hover {
|
|
110
|
+
background: var(--gp-on-surface-focus);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&:active {
|
|
114
|
+
background: var(--gp-on-surface-active);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&:disabled {
|
|
118
|
+
color: var(--gp-disabled);
|
|
119
|
+
border-color: var(--gp-disabled);
|
|
120
|
+
}
|
|
121
|
+
`;
|
|
122
|
+
export const paletteDangerButtonCss = css `
|
|
123
|
+
color: var(--gp-danger);
|
|
124
|
+
border-color: var(--gp-danger);
|
|
125
|
+
|
|
126
|
+
&:focus, &:hover {
|
|
127
|
+
background: var(--gp-danger-hover);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:active {
|
|
131
|
+
background: var(--gp-danger-active);
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
export const palettePrimaryButtonCss = css `
|
|
135
|
+
background: var(--gp-primary);
|
|
136
|
+
|
|
137
|
+
&:focus, &:hover {
|
|
138
|
+
background: var(--gp-primary-hover);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&:active {
|
|
142
|
+
background: var(--gp-primary-active);
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
export const palettePopButtonCss = css `
|
|
146
|
+
color: var(--gp-primary);
|
|
147
|
+
|
|
148
|
+
&:focus, &:hover {
|
|
149
|
+
background: var(--gp-primary-light);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&:active {
|
|
153
|
+
background: var(--gp-primary-lighter);
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
103
156
|
//# sourceMappingURL=menuCss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuCss.js","sourceRoot":"","sources":["../../../src/components/menus/menuCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;;;;;;CAU/B,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"menuCss.js","sourceRoot":"","sources":["../../../src/components/menus/menuCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAA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css, ThemeProvider } from '@emotion/react';
|
|
2
|
+
import { css, ThemeProvider, useTheme } from '@emotion/react';
|
|
3
3
|
import { faBackward } from '@fortawesome/free-solid-svg-icons/faBackward';
|
|
4
4
|
import { faForward } from '@fortawesome/free-solid-svg-icons/faForward';
|
|
5
5
|
import { faForwardFast } from '@fortawesome/free-solid-svg-icons/faForwardFast';
|
|
@@ -10,7 +10,7 @@ import { isCloseTutorialPopup, isSetTutorialStep } from '@gamepark/rules-api';
|
|
|
10
10
|
import { maxBy, minBy } from 'es-toolkit';
|
|
11
11
|
import { useEffect } from 'react';
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
13
|
-
import {
|
|
13
|
+
import { onSurfaceButtonCss, transformCss } from '../../css';
|
|
14
14
|
import { useLegalMove, useLegalMoves, useMaterialContext, useUndo } from '../../hooks';
|
|
15
15
|
import { useTutorialStep } from '../../hooks/useTutorialStep';
|
|
16
16
|
import { PlayMoveButton, ThemeButton } from '../buttons';
|
|
@@ -49,18 +49,20 @@ export const MaterialTutorialDisplay = () => {
|
|
|
49
49
|
setFocus(undefined, false);
|
|
50
50
|
}
|
|
51
51
|
}, [tutorialStep, game?.tutorial?.popupClosed]);
|
|
52
|
+
const theme = useTheme();
|
|
52
53
|
return (_jsx(Dialog, { open: popup !== undefined && !game?.tutorial?.popupClosed, css: [
|
|
53
54
|
tutorialDialogCss,
|
|
54
55
|
popup?.position && transformCss(`translate(${popup.position.x ?? 0}em, ${popup.position.y ?? 0}em)`),
|
|
55
|
-
sizeCss(popup?.size)
|
|
56
|
+
sizeCss(popup?.size),
|
|
57
|
+
theme.tutorial?.container
|
|
56
58
|
], backdropCss: backdropCss, children: popup &&
|
|
57
|
-
_jsx(ThemeProvider, { theme: theme => ({ ...theme, buttons:
|
|
59
|
+
_jsx(ThemeProvider, { theme: theme => ({ ...theme, buttons: onSurfaceButtonCss }), children: _jsxs("div", { css: [rules, theme.tutorial?.content], children: [passMove && _jsxs(PlayMoveButton, { move: passMove, css: passButton, children: [tCommon('Pass'), "\u00A0", _jsx(FontAwesomeIcon, { icon: faForwardFast })] }), _jsx("p", { children: popup.text(t, game) }), _jsxs("p", { css: buttonsLine, children: [_jsxs(ThemeButton, { disabled: !canUndoLastMove, onClick: () => undo(), children: [_jsx(FontAwesomeIcon, { icon: faBackward }), "\u00A0", tCommon('Previous')] }), closeTutorialPopup ?
|
|
58
60
|
_jsxs(PlayMoveButton, { move: closeTutorialPopup, children: [tCommon('OK'), "\u00A0", _jsx(FontAwesomeIcon, { icon: faPlay })] })
|
|
59
61
|
: _jsxs(PlayMoveButton, { move: nextStepMove, disabled: !nextStepMove, children: [tCommon('Next'), "\u00A0", _jsx(FontAwesomeIcon, { icon: faForward })] })] })] }) }) }));
|
|
60
62
|
};
|
|
61
63
|
const rules = css `
|
|
62
64
|
margin: 0 1em;
|
|
63
|
-
font-size: 3em;
|
|
65
|
+
font-size: calc(3em * var(--gp-scale));
|
|
64
66
|
padding-top: 1em;
|
|
65
67
|
|
|
66
68
|
> h2 {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialTutorialDisplay.js","sourceRoot":"","sources":["../../../src/components/tutorial/MaterialTutorialDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"MaterialTutorialDisplay.js","sourceRoot":"","sources":["../../../src/components/tutorial/MaterialTutorialDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAA;AACjE,OAAO,EAAE,eAAe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kBAAkB,CAAC,CAAC;oCACnB,MAAC,cAAc,IAAC,IAAI,EAAE,kBAAkB,aAAG,OAAO,CAAC,IAAI,CAAC,YAAO,KAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAG,IAAiB;oCAChH,CAAC,CAAC,MAAC,cAAc,IAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,aAAG,OAAO,CAAC,MAAM,CAAC,YAAO,KAAC,eAAe,IAAC,IAAI,EAAE,SAAS,GAAG,IAAiB,IAE1I,IACA,GACQ,GAEX,CACV,CAAA;AACH,CAAC,CAAA;AAED,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;CAahB,CAAA;AAED,MAAM,WAAW,GAAG,GAAG,CAAA;;;;CAItB,CAAA;AAED,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;CAKrB,CAAA;AAED,MAAM,WAAW,GAAG,GAAG,CAAA;;;CAGtB,CAAA;AAED,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;CAG5B,CAAA;AAED,MAAM,OAAO,GAAG,CAAC,IAA0C,EAAE,EAAE,CAAC,GAAG,CAAA;WACxD,IAAI,EAAE,KAAK,IAAI,EAAE;IACxB,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,EAAE;CAChE,CAAA"}
|
package/dist/css/GameTheme.d.ts
CHANGED
|
@@ -4,6 +4,14 @@ export interface GameTheme {
|
|
|
4
4
|
dialog: DialogTheme;
|
|
5
5
|
buttons?: Interpolation<GameTheme>;
|
|
6
6
|
dropArea?: DropAreaTheme;
|
|
7
|
+
palette: PaletteTheme;
|
|
8
|
+
menu?: MenuTheme;
|
|
9
|
+
journal?: JournalTheme;
|
|
10
|
+
result?: ResultTheme;
|
|
11
|
+
header?: HeaderTheme;
|
|
12
|
+
playerPanel?: PlayerPanelTheme;
|
|
13
|
+
tutorial?: TutorialTheme;
|
|
14
|
+
timeStats?: TimeStatsTheme;
|
|
7
15
|
}
|
|
8
16
|
export interface DropAreaTheme {
|
|
9
17
|
backgroundColor: string;
|
|
@@ -19,5 +27,61 @@ export interface BackgroundTheme {
|
|
|
19
27
|
export interface DialogTheme {
|
|
20
28
|
backgroundColor: string;
|
|
21
29
|
color: string;
|
|
30
|
+
container?: Interpolation<GameTheme>;
|
|
31
|
+
backdrop?: Interpolation<GameTheme>;
|
|
32
|
+
closeIcon?: Interpolation<GameTheme>;
|
|
33
|
+
content?: Interpolation<GameTheme>;
|
|
22
34
|
}
|
|
35
|
+
export interface PaletteTheme {
|
|
36
|
+
primary: string;
|
|
37
|
+
primaryHover: string;
|
|
38
|
+
primaryActive: string;
|
|
39
|
+
primaryLight: string;
|
|
40
|
+
primaryLighter: string;
|
|
41
|
+
surface: string;
|
|
42
|
+
onSurface: string;
|
|
43
|
+
onSurfaceFocus: string;
|
|
44
|
+
onSurfaceActive: string;
|
|
45
|
+
danger: string;
|
|
46
|
+
dangerHover: string;
|
|
47
|
+
dangerActive: string;
|
|
48
|
+
disabled: string;
|
|
49
|
+
}
|
|
50
|
+
export interface MenuTheme {
|
|
51
|
+
panel?: Interpolation<GameTheme>;
|
|
52
|
+
button?: Interpolation<GameTheme>;
|
|
53
|
+
mainButton?: Interpolation<GameTheme>;
|
|
54
|
+
popButton?: Interpolation<GameTheme>;
|
|
55
|
+
}
|
|
56
|
+
export interface JournalTheme {
|
|
57
|
+
tab?: Interpolation<GameTheme>;
|
|
58
|
+
tabSelected?: Interpolation<GameTheme>;
|
|
59
|
+
chatBar?: Interpolation<GameTheme>;
|
|
60
|
+
historyEntry?: Interpolation<GameTheme>;
|
|
61
|
+
}
|
|
62
|
+
export interface ResultTheme {
|
|
63
|
+
border?: string;
|
|
64
|
+
icon?: string;
|
|
65
|
+
container?: Interpolation<GameTheme>;
|
|
66
|
+
closeIcon?: Interpolation<GameTheme>;
|
|
67
|
+
}
|
|
68
|
+
export interface HeaderTheme {
|
|
69
|
+
bar?: Interpolation<GameTheme>;
|
|
70
|
+
buttons?: Interpolation<GameTheme>;
|
|
71
|
+
}
|
|
72
|
+
export interface PlayerPanelTheme {
|
|
73
|
+
activeRingColors?: [string, string];
|
|
74
|
+
panel?: Interpolation<GameTheme>;
|
|
75
|
+
dataBadge?: Interpolation<GameTheme>;
|
|
76
|
+
}
|
|
77
|
+
export interface TutorialTheme {
|
|
78
|
+
container?: Interpolation<GameTheme>;
|
|
79
|
+
content?: Interpolation<GameTheme>;
|
|
80
|
+
}
|
|
81
|
+
export interface TimeStatsTheme {
|
|
82
|
+
container?: Interpolation<GameTheme>;
|
|
83
|
+
thinkBackground?: string;
|
|
84
|
+
waitBackground?: string;
|
|
85
|
+
}
|
|
86
|
+
export declare const defaultPalette: PaletteTheme;
|
|
23
87
|
export declare const defaultTheme: GameTheme;
|
package/dist/css/GameTheme.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { addStylesheetUrl } from './addStylesheetUrl';
|
|
2
2
|
addStylesheetUrl('https://fonts.googleapis.com/css2?family=Mulish:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
|
|
3
|
+
export const defaultPalette = {
|
|
4
|
+
primary: '#28B8CE',
|
|
5
|
+
primaryHover: '#24a5b9',
|
|
6
|
+
primaryActive: '#2092a3',
|
|
7
|
+
primaryLight: '#f0fbfc',
|
|
8
|
+
primaryLighter: '#dbf5f8',
|
|
9
|
+
surface: '#F0FBFC',
|
|
10
|
+
onSurface: '#002448',
|
|
11
|
+
onSurfaceFocus: '#c2ebf1',
|
|
12
|
+
onSurfaceActive: '#ade4ec',
|
|
13
|
+
danger: 'darkred',
|
|
14
|
+
dangerHover: '#ffd7d7',
|
|
15
|
+
dangerActive: '#ffbebe',
|
|
16
|
+
disabled: '#555555'
|
|
17
|
+
};
|
|
3
18
|
export const defaultTheme = {
|
|
4
19
|
root: {
|
|
5
20
|
fontFamily: 'Mulish',
|
|
@@ -14,6 +29,7 @@ export const defaultTheme = {
|
|
|
14
29
|
},
|
|
15
30
|
dropArea: {
|
|
16
31
|
backgroundColor: 'rgba(0, 255, 0, 0.5)'
|
|
17
|
-
}
|
|
32
|
+
},
|
|
33
|
+
palette: defaultPalette
|
|
18
34
|
};
|
|
19
35
|
//# sourceMappingURL=GameTheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameTheme.js","sourceRoot":"","sources":["../../src/css/GameTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,gBAAgB,CAAC,wHAAwH,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"GameTheme.js","sourceRoot":"","sources":["../../src/css/GameTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,gBAAgB,CAAC,wHAAwH,CAAC,CAAA;AAmG1I,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,SAAS;IACvB,aAAa,EAAE,SAAS;IACxB,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,SAAS;IACzB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,SAAS;IACzB,eAAe,EAAE,SAAS;IAC1B,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,QAAQ,EAAE,SAAS;CACpB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAc;IACrC,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,UAAU,EAAE;YACV,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,oBAAoB;SAC9B;KACF;IACD,MAAM,EAAE;QACN,eAAe,EAAE,SAAS;QAC1B,KAAK,EAAE,SAAS;KACjB;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,sBAAsB;KACxC;IACD,OAAO,EAAE,cAAc;CACxB,CAAA"}
|
package/dist/css/buttonCss.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const buttonResetCss: import("@emotion/utils").SerializedStyles;
|
|
2
2
|
export declare const buttonCss: (color: string, focus: string, active: string) => import("@emotion/utils").SerializedStyles;
|
|
3
|
+
export declare const onSurfaceButtonCss: import("@emotion/utils").SerializedStyles;
|
|
3
4
|
export declare const linkButtonCss: import("@emotion/utils").SerializedStyles;
|
package/dist/css/buttonCss.js
CHANGED
|
@@ -32,6 +32,31 @@ export const buttonCss = (color, focus, active) => css `
|
|
|
32
32
|
opacity: 0.5;
|
|
33
33
|
}
|
|
34
34
|
`;
|
|
35
|
+
export const onSurfaceButtonCss = css `
|
|
36
|
+
${buttonResetCss};
|
|
37
|
+
|
|
38
|
+
padding: 0.2em 0.5em;
|
|
39
|
+
border-radius: 2em;
|
|
40
|
+
border: 0.05em solid var(--gp-on-surface);
|
|
41
|
+
color: var(--gp-on-surface);
|
|
42
|
+
background: transparent;
|
|
43
|
+
|
|
44
|
+
&:focus, &:hover {
|
|
45
|
+
background: var(--gp-on-surface-focus);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:active {
|
|
49
|
+
background: var(--gp-on-surface-active);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:disabled {
|
|
53
|
+
color: #555555;
|
|
54
|
+
border-color: #555555;
|
|
55
|
+
background: transparent;
|
|
56
|
+
cursor: auto;
|
|
57
|
+
opacity: 0.5;
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
35
60
|
export const linkButtonCss = css `
|
|
36
61
|
${buttonResetCss};
|
|
37
62
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonCss.js","sourceRoot":"","sources":["../../src/css/buttonCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;CAOhC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,MAAc,EAAE,EAAE,CAAC,GAAG,CAAA;IAC1E,cAAc;;;;yBAIO,KAAK;WACnB,KAAK;;;;kBAIE,KAAK;;;;kBAIL,MAAM;;;;;;;;;;CAUvB,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;IAC5B,cAAc;;;;;;;;;;CAUjB,CAAA"}
|
|
1
|
+
{"version":3,"file":"buttonCss.js","sourceRoot":"","sources":["../../src/css/buttonCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;CAOhC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,MAAc,EAAE,EAAE,CAAC,GAAG,CAAA;IAC1E,cAAc;;;;yBAIO,KAAK;WACnB,KAAK;;;;kBAIE,KAAK;;;;kBAIL,MAAM;;;;;;;;;;CAUvB,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;IACjC,cAAc;;;;;;;;;;;;;;;;;;;;;;;CAuBjB,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;IAC5B,cAAc;;;;;;;;;;CAUjB,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Coordinates, Location } from '@gamepark/rules-api';
|
|
2
|
+
import { Locator, MaterialContext } from './Locator';
|
|
3
|
+
/**
|
|
4
|
+
* Boundaries of items on the grid, in grid coordinates (not em).
|
|
5
|
+
*/
|
|
6
|
+
export type GridBoundaries = {
|
|
7
|
+
xMin: number;
|
|
8
|
+
xMax: number;
|
|
9
|
+
yMin: number;
|
|
10
|
+
yMax: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Dimensions of the visible grid window, in cells.
|
|
14
|
+
*/
|
|
15
|
+
export type GridSize = {
|
|
16
|
+
columns: number;
|
|
17
|
+
rows: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* This Locator places items on a rectangular grid with automatic panning.
|
|
21
|
+
*
|
|
22
|
+
* Items are positioned using their `location.x` and `location.y` as grid coordinates.
|
|
23
|
+
* The gap between cells is defined by {@link gap} (in em).
|
|
24
|
+
*
|
|
25
|
+
* When a {@link gridSize} is provided, the locator maintains a stable visible window:
|
|
26
|
+
* as long as all items fit inside, nothing moves. When items exceed the window,
|
|
27
|
+
* the view recenters on the barycentre.
|
|
28
|
+
*
|
|
29
|
+
* Without {@link gridSize}, the grid always centers on the barycentre of the items.
|
|
30
|
+
*
|
|
31
|
+
* Multiple independent grids are supported via {@link getGridId}, following the same
|
|
32
|
+
* pattern as {@link PileLocator.getPileId}.
|
|
33
|
+
*
|
|
34
|
+
* Override {@link getBoundaries} to provide custom boundaries (e.g. from a game helper).
|
|
35
|
+
*/
|
|
36
|
+
export declare class GridLocator<P extends number = number, M extends number = number, L extends number = number> extends Locator<P, M, L> {
|
|
37
|
+
constructor(clone?: Partial<GridLocator>);
|
|
38
|
+
/**
|
|
39
|
+
* The gap between two consecutive grid cells, in em.
|
|
40
|
+
*/
|
|
41
|
+
gap?: Partial<Coordinates>;
|
|
42
|
+
/**
|
|
43
|
+
* Function to override to provide a {@link gap} that depends on the context.
|
|
44
|
+
* @param _location Location to position
|
|
45
|
+
* @param _context Context of the game
|
|
46
|
+
* @returns The gap between two consecutive grid cells
|
|
47
|
+
*/
|
|
48
|
+
getGap(_location: Location<P, L>, _context: MaterialContext<P, M, L>): Partial<Coordinates>;
|
|
49
|
+
/**
|
|
50
|
+
* The size of the visible grid window, in cells.
|
|
51
|
+
* When items fit inside the window, the view does not move.
|
|
52
|
+
* When items exceed it, the view recenters on the barycentre.
|
|
53
|
+
* Without gridSize, the view always centers on the barycentre.
|
|
54
|
+
*/
|
|
55
|
+
gridSize?: GridSize;
|
|
56
|
+
/**
|
|
57
|
+
* Function to override to provide a {@link gridSize} that depends on the context.
|
|
58
|
+
* @param _location Location to position
|
|
59
|
+
* @param _context Context of the game
|
|
60
|
+
* @returns The grid size
|
|
61
|
+
*/
|
|
62
|
+
getGridSize(_location: Location<P, L>, _context: MaterialContext<P, M, L>): GridSize | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Identifier for the grid. By default, distinct location areas (different player, id or parent) form distinct grids.
|
|
65
|
+
* @param location Location in the grid
|
|
66
|
+
* @param _context Context of the game
|
|
67
|
+
* @returns A unique identifier for the grid this location belongs to
|
|
68
|
+
*/
|
|
69
|
+
getGridId(location: Location<P, L>, _context: MaterialContext<P, M, L>): string;
|
|
70
|
+
/**
|
|
71
|
+
* Compute the boundaries of all items on this grid, in grid coordinates.
|
|
72
|
+
* Override this to provide custom boundaries (e.g. from a game helper).
|
|
73
|
+
*
|
|
74
|
+
* Default implementation scans all item types placed by this locator.
|
|
75
|
+
*
|
|
76
|
+
* @param location A location in the grid area
|
|
77
|
+
* @param context Context of the game
|
|
78
|
+
* @returns The grid boundaries, or undefined if no items exist
|
|
79
|
+
*/
|
|
80
|
+
getBoundaries(location: Location<P, L>, context: MaterialContext<P, M, L>): GridBoundaries | undefined;
|
|
81
|
+
private deltas;
|
|
82
|
+
private game?;
|
|
83
|
+
private refreshedGrids;
|
|
84
|
+
private refreshDelta;
|
|
85
|
+
private ensureRefreshed;
|
|
86
|
+
getCoordinates(location: Location<P, L>, context: MaterialContext<P, M, L>): Partial<Coordinates>;
|
|
87
|
+
getPositionDependencies(location: Location<P, L>, context: MaterialContext<P, M, L>): unknown;
|
|
88
|
+
}
|