@gamepark/react-game 7.7.24 → 7.7.26
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/ExtensionInfoDialog.d.ts +29 -0
- package/dist/components/dialogs/ExtensionInfoDialog.js +182 -0
- package/dist/components/dialogs/ExtensionInfoDialog.js.map +1 -0
- package/dist/components/dialogs/FailuresDialog.js +11 -11
- package/dist/components/dialogs/index.d.ts +1 -0
- package/dist/components/dialogs/index.js +1 -0
- package/dist/components/dialogs/index.js.map +1 -1
- package/dist/components/material/Dices/OctahedralDiceDescription.d.ts +48 -0
- package/dist/components/material/Dices/OctahedralDiceDescription.js +142 -0
- package/dist/components/material/Dices/OctahedralDiceDescription.js.map +1 -0
- package/dist/components/material/GameTable/DevToolEntry.d.ts +17 -0
- package/dist/components/material/GameTable/DevToolEntry.js +13 -0
- package/dist/components/material/GameTable/DevToolEntry.js.map +1 -0
- package/dist/components/material/GameTable/DevTools/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/locations/MaterialListHelp.d.ts +44 -0
- package/dist/components/material/locations/MaterialListHelp.js +70 -0
- package/dist/components/material/locations/MaterialListHelp.js.map +1 -0
- package/dist/components/material/locations/index.d.ts +1 -0
- package/dist/components/material/locations/index.js +1 -0
- package/dist/components/material/locations/index.js.map +1 -1
- 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/GameTheme.d.ts +4 -0
- package/dist/css/GameTheme.js.map +1 -1
- package/dist/css/backgroundCss.js +3 -3
- package/dist/css/cursorCss.js +6 -6
- package/dist/css/fadeIn.js +6 -6
- package/dist/css/shineEffect.js +28 -28
- package/dist/css/transformCss.js +4 -4
- package/dist/hooks/LogHistoryContext.d.ts +6 -0
- package/dist/hooks/LogHistoryContext.js +4 -0
- package/dist/hooks/LogHistoryContext.js.map +1 -0
- package/dist/hooks/useBackgroundTabHandler.d.ts +1 -0
- package/dist/hooks/useBackgroundTabHandler.js +38 -0
- package/dist/hooks/useBackgroundTabHandler.js.map +1 -0
- package/dist/hooks/useFastAnimationsOnReturn.d.ts +1 -0
- package/dist/hooks/useFastAnimationsOnReturn.js +38 -0
- package/dist/hooks/useFastAnimationsOnReturn.js.map +1 -0
- package/package.json +1 -1
- package/dist/components/GameProvider/GameLoadingErrorScreen.d.ts +0 -1
- package/dist/components/GameProvider/GameLoadingErrorScreen.js +0 -82
- package/dist/components/GameProvider/GameLoadingErrorScreen.js.map +0 -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/dist/vite.d.ts +0 -3
- package/dist/vite.js +0 -34
- package/dist/vite.js.map +0 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css, useTheme } from '@emotion/react';
|
|
4
|
+
import { faChevronLeft } from '@fortawesome/free-solid-svg-icons/faChevronLeft';
|
|
5
|
+
import { faChevronRight } from '@fortawesome/free-solid-svg-icons/faChevronRight';
|
|
6
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
+
import { useCallback, useContext, useState } from 'react';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { gameContext } from '../GameProvider';
|
|
10
|
+
import { RulesDialog } from './RulesDialog';
|
|
11
|
+
const isDismissed = (key) => {
|
|
12
|
+
try {
|
|
13
|
+
return sessionStorage.getItem(key) === 'true';
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const markDismissed = (key) => {
|
|
20
|
+
try {
|
|
21
|
+
sessionStorage.setItem(key, 'true');
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// ignore (private mode, quota, …)
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Generic carousel-style "you are playing with extension(s)" popup.
|
|
29
|
+
*
|
|
30
|
+
* The framework handles:
|
|
31
|
+
* - the dialog/modal wrapper (close button via `theme.dialog.closeButton`/`closeIcon`)
|
|
32
|
+
* - a dedicated navigation bar tailored to this dialog (see ExtensionNav below):
|
|
33
|
+
* * single popup → just a centered "Close" button (no useless Previous/Next)
|
|
34
|
+
* * multiple popups → Previous + dots + Next as long as we're not on the last page;
|
|
35
|
+
* on the last page Next becomes "Close" (still keeps Previous)
|
|
36
|
+
* - the `sessionStorage` gate ("show once per tab session", F5-safe)
|
|
37
|
+
*
|
|
38
|
+
* The game just passes:
|
|
39
|
+
* - `popups`: a ReactNode per extension, fully self-rendered (title, body, cards…)
|
|
40
|
+
* - `storageKey`: a stable identifier whose composition encodes the active extension combo
|
|
41
|
+
*
|
|
42
|
+
* Pass an empty `popups` array (or omit the component) when no extension is active.
|
|
43
|
+
*/
|
|
44
|
+
export const ExtensionInfoDialog = ({ popups, storageKey }) => {
|
|
45
|
+
const theme = useTheme();
|
|
46
|
+
// Default storage key derives from the active game id (e.g. "faraway-extensions").
|
|
47
|
+
// The GameProvider always sets `game` in its context, so this is safe to use as a
|
|
48
|
+
// fallback when the consumer doesn't pass an explicit storageKey.
|
|
49
|
+
const { game } = useContext(gameContext);
|
|
50
|
+
const effectiveStorageKey = storageKey ?? `${game}-extensions`;
|
|
51
|
+
const [open, setOpen] = useState(() => popups.length > 0 && !isDismissed(effectiveStorageKey));
|
|
52
|
+
const [index, setIndex] = useState(0);
|
|
53
|
+
const total = popups.length;
|
|
54
|
+
const safeIndex = Math.min(Math.max(0, index), Math.max(0, total - 1));
|
|
55
|
+
const close = useCallback(() => {
|
|
56
|
+
markDismissed(effectiveStorageKey);
|
|
57
|
+
setOpen(false);
|
|
58
|
+
}, [effectiveStorageKey]);
|
|
59
|
+
if (total === 0)
|
|
60
|
+
return null;
|
|
61
|
+
/* CSS cascade for the dialog container:
|
|
62
|
+
* 1. <Dialog> applies `theme.dialog.container` automatically — that's
|
|
63
|
+
* the game-wide chrome (background, padding, dotted outline, fonts…).
|
|
64
|
+
* It lands by default, we don't re-apply it here.
|
|
65
|
+
* 2. `containerCss` below adds the extension-flavour defaults (sane
|
|
66
|
+
* width / max-height for a card carousel).
|
|
67
|
+
* 3. `theme.extensionDialog.container` (if any) lands last and wins —
|
|
68
|
+
* games override width, max-height, etc. through the theme rather
|
|
69
|
+
* than props. Emotion's array stacking handles precedence, no flag
|
|
70
|
+
* needed.
|
|
71
|
+
*/
|
|
72
|
+
return (_jsx(RulesDialog, { open: open, close: close, css: [containerCss, theme.extensionDialog?.container], children: _jsxs("div", { css: layoutCss, children: [_jsx("div", { css: contentCss, children: popups[safeIndex] }), _jsx(ExtensionNav, { total: total, currentIndex: safeIndex, onPrevious: safeIndex > 0 ? () => setIndex(i => i - 1) : undefined, onNext: safeIndex < total - 1 ? () => setIndex(i => i + 1) : undefined, onClose: close })] }) }));
|
|
73
|
+
};
|
|
74
|
+
const ExtensionNav = ({ total, currentIndex, onPrevious, onNext, onClose }) => {
|
|
75
|
+
const { t } = useTranslation();
|
|
76
|
+
const theme = useTheme();
|
|
77
|
+
const primary = theme.palette.primary;
|
|
78
|
+
if (total === 1) {
|
|
79
|
+
return (_jsx("div", { css: [barCss(primary), singleSlideBarCss, theme.dialog.navigationCss], children: _jsx("button", { css: btnCss(primary), onClick: onClose, children: _jsx("span", { children: t('Close', { ns: 'common' }) }) }) }));
|
|
80
|
+
}
|
|
81
|
+
const isLast = currentIndex === total - 1;
|
|
82
|
+
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] })] }), isLast ? (_jsx("button", { css: btnCss(primary), onClick: onClose, children: _jsx("span", { children: t('Close', { ns: 'common' }) }) })) : (_jsxs("button", { css: btnCss(primary), onClick: onNext, disabled: !onNext, children: [_jsx("span", { children: t('Next', { ns: 'common' }) }), _jsx(FontAwesomeIcon, { icon: faChevronRight, css: iconCss })] }))] }));
|
|
83
|
+
};
|
|
84
|
+
const containerCss = css `
|
|
85
|
+
/* Default sizing for the extension carousel — comfortably fits a 4-card
|
|
86
|
+
grid plus prose. Games widen / shrink / switch to width: auto via
|
|
87
|
+
theme.extensionDialog.container, which lands after this in the
|
|
88
|
+
Emotion cascade. */
|
|
89
|
+
width: min(90vw, 70em);
|
|
90
|
+
width: min(90dvw, 70em);
|
|
91
|
+
`;
|
|
92
|
+
const layoutCss = css `
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
max-height: 90vh;
|
|
96
|
+
max-height: 90dvh;
|
|
97
|
+
`;
|
|
98
|
+
/* Same em base as the framework's help dialogs (helpDialogContentCss) so the popup body
|
|
99
|
+
reads at the same scale as the rest of the rules UI, and the navigation (its own 2.4em)
|
|
100
|
+
lands at the expected size right below. */
|
|
101
|
+
const contentCss = css `
|
|
102
|
+
font-size: 2.4em;
|
|
103
|
+
overflow-y: auto;
|
|
104
|
+
padding: 0.6em 0.7em 0.5em;
|
|
105
|
+
flex: 1;
|
|
106
|
+
min-height: 0;
|
|
107
|
+
`;
|
|
108
|
+
/* Visual recipe copied (intentionally) from BottomBarNavigation so the
|
|
109
|
+
ExtensionNav and the standard help-dialog bottom bar feel like
|
|
110
|
+
siblings. Keep them in sync if you tweak the look on one side. */
|
|
111
|
+
const barCss = (primary) => css `
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
font-size: 2.4em;
|
|
116
|
+
padding: 0.3em 1em;
|
|
117
|
+
border-top: 1px solid color-mix(in srgb, ${primary} 8%, transparent);
|
|
118
|
+
background: linear-gradient(to top, color-mix(in srgb, ${primary} 4%, transparent), transparent);
|
|
119
|
+
`;
|
|
120
|
+
const singleSlideBarCss = css `
|
|
121
|
+
/* Single-slide variant: just a centered Close button, no Previous/Next
|
|
122
|
+
to surround. justify-content: center collapses the bar around it. */
|
|
123
|
+
justify-content: center;
|
|
124
|
+
`;
|
|
125
|
+
const btnCss = (primary) => css `
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 0.4em;
|
|
129
|
+
padding: 0.4em 0.9em;
|
|
130
|
+
border-radius: 2em;
|
|
131
|
+
font-size: 0.78em;
|
|
132
|
+
font-weight: 600;
|
|
133
|
+
font-family: inherit;
|
|
134
|
+
color: ${primary};
|
|
135
|
+
background: transparent;
|
|
136
|
+
border: 1.5px solid color-mix(in srgb, ${primary} 25%, transparent);
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
transition: all 0.15s;
|
|
139
|
+
|
|
140
|
+
&:hover:not(:disabled) {
|
|
141
|
+
background: color-mix(in srgb, ${primary} 10%, transparent);
|
|
142
|
+
border-color: ${primary};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&:active:not(:disabled) {
|
|
146
|
+
background: color-mix(in srgb, ${primary} 18%, transparent);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&:disabled {
|
|
150
|
+
opacity: 0.25;
|
|
151
|
+
cursor: default;
|
|
152
|
+
}
|
|
153
|
+
`;
|
|
154
|
+
const iconCss = css `
|
|
155
|
+
font-size: 0.9em;
|
|
156
|
+
`;
|
|
157
|
+
const counterCss = css `
|
|
158
|
+
font-size: 0.75em;
|
|
159
|
+
color: inherit;
|
|
160
|
+
opacity: 0.7;
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
gap: 0.5em;
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
`;
|
|
166
|
+
const dotsCss = css `
|
|
167
|
+
display: flex;
|
|
168
|
+
gap: 0.3em;
|
|
169
|
+
`;
|
|
170
|
+
const dotCss = (primary) => css `
|
|
171
|
+
width: 0.35em;
|
|
172
|
+
height: 0.35em;
|
|
173
|
+
border-radius: 50%;
|
|
174
|
+
background: color-mix(in srgb, ${primary} 35%, transparent);
|
|
175
|
+
transition: all 0.2s;
|
|
176
|
+
`;
|
|
177
|
+
const activeDotCss = (primary) => css `
|
|
178
|
+
background: ${primary};
|
|
179
|
+
width: 1em;
|
|
180
|
+
border-radius: 0.2em;
|
|
181
|
+
`;
|
|
182
|
+
//# sourceMappingURL=ExtensionInfoDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionInfoDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/ExtensionInfoDialog.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;AAChE,OAAO,EAAiB,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAa3C,MAAM,WAAW,GAAG,CAAC,GAAW,EAAW,EAAE;IAC3C,IAAI,CAAC;QACH,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAA;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA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= (failure) => ({
|
|
|
65
65
|
title: (t) => t('Unknown error:'),
|
|
66
66
|
text: () => failure
|
|
67
67
|
});
|
|
68
|
-
const aboveLoadingScreenCss = css `
|
|
69
|
-
z-index: 1600;
|
|
68
|
+
const aboveLoadingScreenCss = css `
|
|
69
|
+
z-index: 1600;
|
|
70
70
|
`;
|
|
71
|
-
const titleCss = css `
|
|
72
|
-
display: flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
gap: 0.4em;
|
|
71
|
+
const titleCss = css `
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: 0.4em;
|
|
75
75
|
`;
|
|
76
|
-
const iconCss = css `
|
|
77
|
-
color: #28B8CE;
|
|
76
|
+
const iconCss = css `
|
|
77
|
+
color: #28B8CE;
|
|
78
78
|
`;
|
|
79
|
-
const inDialogButton = css `
|
|
80
|
-
margin: 0 0 0 auto;
|
|
81
|
-
font-size: 1.125em;
|
|
79
|
+
const inDialogButton = css `
|
|
80
|
+
margin: 0 0 0 auto;
|
|
81
|
+
font-size: 1.125em;
|
|
82
82
|
`;
|
|
83
83
|
//# sourceMappingURL=FailuresDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/dialogs/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/dialogs/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
3
|
+
import { MaterialItem } from '@gamepark/rules-api';
|
|
4
|
+
import { ItemContext } from '../../../locators';
|
|
5
|
+
import { MaterialContentProps } from '../MaterialDescription';
|
|
6
|
+
import { MobileMaterialDescription } from '../MobileMaterialDescription';
|
|
7
|
+
/**
|
|
8
|
+
* 8-faced (octahedral) dice with CSS 3D transforms.
|
|
9
|
+
*
|
|
10
|
+
* The `images` array must contain exactly 8 images, one per face:
|
|
11
|
+
*
|
|
12
|
+
* - **images[0–3]**: top faces (triangles pointing up)
|
|
13
|
+
* - **images[4–7]**: bottom faces (triangles pointing down)
|
|
14
|
+
*
|
|
15
|
+
* Within each half, faces are arranged by cardinal direction:
|
|
16
|
+
*
|
|
17
|
+
* | Index | Half | Direction |
|
|
18
|
+
* |-------|--------|-----------|
|
|
19
|
+
* | 0 | top | front |
|
|
20
|
+
* | 1 | top | right |
|
|
21
|
+
* | 2 | top | back |
|
|
22
|
+
* | 3 | top | left |
|
|
23
|
+
* | 4 | bottom | front |
|
|
24
|
+
* | 5 | bottom | right |
|
|
25
|
+
* | 6 | bottom | back |
|
|
26
|
+
* | 7 | bottom | left |
|
|
27
|
+
*
|
|
28
|
+
* `location.rotation` (0–7) selects which face is shown on top.
|
|
29
|
+
* Top face images should have their symbol shifted toward the base of the triangle (centroid offset).
|
|
30
|
+
* Bottom face images should be rotated 180° with the symbol shifted the opposite way.
|
|
31
|
+
*/
|
|
32
|
+
export declare abstract class OctahedralDiceDescription<P extends number = number, M extends number = number, L extends number = number, ItemId = any> extends MobileMaterialDescription<P, M, L, ItemId> {
|
|
33
|
+
width: number;
|
|
34
|
+
ratio: number;
|
|
35
|
+
borderRadius: number;
|
|
36
|
+
color: string;
|
|
37
|
+
abstract images: string[] | Record<any, string[]>;
|
|
38
|
+
/** Set to true to display face index labels (0-7) for debugging */
|
|
39
|
+
debugFaceLabels: boolean;
|
|
40
|
+
private get tz();
|
|
41
|
+
getImages(): string[];
|
|
42
|
+
getDiceImages(itemId: ItemId): string[];
|
|
43
|
+
getColor(_itemId: ItemId): string;
|
|
44
|
+
content: ({ itemId, highlight, preview, playDown }: MaterialContentProps<ItemId>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
|
+
getItemTransform(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string[];
|
|
46
|
+
getRotations(item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): string[];
|
|
47
|
+
getHelpDisplayExtraCss(item: Partial<MaterialItem<P, L>>, context: ItemContext<P, M, L>): Interpolation<Theme>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { range } from 'es-toolkit';
|
|
5
|
+
import { backgroundCss, shadowEffect, shineEffect, transformCss } from '../../../css';
|
|
6
|
+
import { MobileMaterialDescription } from '../MobileMaterialDescription';
|
|
7
|
+
const TILT = 35.26; // 90 - arctan(sqrt(2)) in degrees
|
|
8
|
+
const TZ_RATIO = 0.2562; // translateZ / width ratio for octahedron
|
|
9
|
+
/**
|
|
10
|
+
* 8-faced (octahedral) dice with CSS 3D transforms.
|
|
11
|
+
*
|
|
12
|
+
* The `images` array must contain exactly 8 images, one per face:
|
|
13
|
+
*
|
|
14
|
+
* - **images[0–3]**: top faces (triangles pointing up)
|
|
15
|
+
* - **images[4–7]**: bottom faces (triangles pointing down)
|
|
16
|
+
*
|
|
17
|
+
* Within each half, faces are arranged by cardinal direction:
|
|
18
|
+
*
|
|
19
|
+
* | Index | Half | Direction |
|
|
20
|
+
* |-------|--------|-----------|
|
|
21
|
+
* | 0 | top | front |
|
|
22
|
+
* | 1 | top | right |
|
|
23
|
+
* | 2 | top | back |
|
|
24
|
+
* | 3 | top | left |
|
|
25
|
+
* | 4 | bottom | front |
|
|
26
|
+
* | 5 | bottom | right |
|
|
27
|
+
* | 6 | bottom | back |
|
|
28
|
+
* | 7 | bottom | left |
|
|
29
|
+
*
|
|
30
|
+
* `location.rotation` (0–7) selects which face is shown on top.
|
|
31
|
+
* Top face images should have their symbol shifted toward the base of the triangle (centroid offset).
|
|
32
|
+
* Bottom face images should be rotated 180° with the symbol shifted the opposite way.
|
|
33
|
+
*/
|
|
34
|
+
export class OctahedralDiceDescription extends MobileMaterialDescription {
|
|
35
|
+
width = 2;
|
|
36
|
+
ratio = 1;
|
|
37
|
+
borderRadius = 0;
|
|
38
|
+
color = '#222222';
|
|
39
|
+
/** Set to true to display face index labels (0-7) for debugging */
|
|
40
|
+
debugFaceLabels = false;
|
|
41
|
+
get tz() { return this.width * TZ_RATIO; }
|
|
42
|
+
getImages() {
|
|
43
|
+
return Array.isArray(this.images) ? this.images : Object.values(this.images).flat();
|
|
44
|
+
}
|
|
45
|
+
getDiceImages(itemId) {
|
|
46
|
+
return Array.isArray(this.images) ? this.images : this.images[itemId];
|
|
47
|
+
}
|
|
48
|
+
getColor(_itemId) {
|
|
49
|
+
return this.color;
|
|
50
|
+
}
|
|
51
|
+
content = ({ itemId, highlight, preview, playDown = preview }) => {
|
|
52
|
+
const images = this.getDiceImages(itemId);
|
|
53
|
+
const w = this.width;
|
|
54
|
+
const tz = this.tz;
|
|
55
|
+
const sideCss = css `
|
|
56
|
+
position: absolute;
|
|
57
|
+
width: ${w}em;
|
|
58
|
+
height: ${w}em;
|
|
59
|
+
backface-visibility: hidden;
|
|
60
|
+
`;
|
|
61
|
+
const diamondTopCss = css `
|
|
62
|
+
display: block;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
backface-visibility: hidden;
|
|
67
|
+
transform: translateY(50%) rotate(30deg) skewY(30deg) scaleX(0.866);
|
|
68
|
+
filter: drop-shadow(0 0 0.03em rgba(0, 0, 0, 0.5));
|
|
69
|
+
`;
|
|
70
|
+
const diamondBottomCss = css `
|
|
71
|
+
display: block;
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
backface-visibility: hidden;
|
|
76
|
+
transform: translateY(-50%) rotate(30deg) skewY(30deg) scaleX(0.866);
|
|
77
|
+
filter: drop-shadow(0 0 0.03em rgba(0, 0, 0, 0.5));
|
|
78
|
+
`;
|
|
79
|
+
const contentTopCss = css `
|
|
80
|
+
display: block;
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
backface-visibility: hidden;
|
|
84
|
+
background-color: ${this.getColor(itemId)};
|
|
85
|
+
transform: scaleX(1.155) skewY(-30deg) rotate(-30deg) translateY(-50%);
|
|
86
|
+
`;
|
|
87
|
+
const contentBottomCss = css `
|
|
88
|
+
display: block;
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 100%;
|
|
91
|
+
backface-visibility: hidden;
|
|
92
|
+
background-color: ${this.getColor(itemId)};
|
|
93
|
+
transform: scaleX(1.155) skewY(-30deg) rotate(-30deg) translateY(50%);
|
|
94
|
+
`;
|
|
95
|
+
const faceLabelCss = this.debugFaceLabels ? css `
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 50%;
|
|
98
|
+
left: 50%;
|
|
99
|
+
transform: translate(-50%, -50%);
|
|
100
|
+
font-size: ${w * 0.3}em;
|
|
101
|
+
font-weight: bold;
|
|
102
|
+
color: red;
|
|
103
|
+
pointer-events: none;
|
|
104
|
+
z-index: 1;
|
|
105
|
+
` : undefined;
|
|
106
|
+
return _jsx(_Fragment, { children: range(8).map((_, index) => {
|
|
107
|
+
const yRot = (index % 4) * 90;
|
|
108
|
+
// Bottom faces are offset by 180° so that rotateX(180deg) brings face N to the top
|
|
109
|
+
const bottomYRot = ((index % 4) * 90 + 180) % 360;
|
|
110
|
+
const sideTransform = index < 4
|
|
111
|
+
? transformCss(index > 0 ? `rotateY(${yRot}deg)` : undefined, `rotateX(${TILT}deg)`, `translateZ(${tz}em)`)
|
|
112
|
+
: transformCss(`translateY(52%)`, bottomYRot > 0 ? `rotateY(${bottomYRot}deg)` : undefined, `rotateX(${-TILT}deg)`, `translateZ(${tz}em)`);
|
|
113
|
+
return _jsx("div", { css: [sideCss, sideTransform], children: _jsx("div", { css: index < 4 ? diamondTopCss : diamondBottomCss, children: _jsx("div", { css: [
|
|
114
|
+
index < 4 ? contentTopCss : contentBottomCss,
|
|
115
|
+
backgroundCss(images[index]),
|
|
116
|
+
highlight ? shineEffect : playDown && shadowEffect
|
|
117
|
+
], children: faceLabelCss && _jsx("span", { css: faceLabelCss, children: index }) }) }) }, index);
|
|
118
|
+
}) });
|
|
119
|
+
};
|
|
120
|
+
getItemTransform(item, context) {
|
|
121
|
+
return super.getItemTransform(item, context).concat(`translateZ(${this.tz}em)`, ...this.getRotations(item, context));
|
|
122
|
+
}
|
|
123
|
+
getRotations(item, _context) {
|
|
124
|
+
switch (item.location.rotation) {
|
|
125
|
+
case 0: return [];
|
|
126
|
+
case 1: return ['rotateY(-90deg)'];
|
|
127
|
+
case 2: return ['rotateY(-180deg)'];
|
|
128
|
+
case 3: return ['rotateY(90deg)'];
|
|
129
|
+
case 4: return ['rotateX(180deg)'];
|
|
130
|
+
case 5: return ['rotateX(180deg)', 'rotateY(90deg)'];
|
|
131
|
+
case 6: return ['rotateX(180deg)', 'rotateY(180deg)'];
|
|
132
|
+
case 7: return ['rotateX(180deg)', 'rotateY(-90deg)'];
|
|
133
|
+
default: return [];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
getHelpDisplayExtraCss(item, context) {
|
|
137
|
+
return item.location && [transformCss(...this.getRotations(item, context)), css `
|
|
138
|
+
margin: ${this.width / 4}em;
|
|
139
|
+
`];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=OctahedralDiceDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OctahedralDiceDescription.js","sourceRoot":"","sources":["../../../../src/components/material/Dices/OctahedralDiceDescription.tsx"],"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A;YACnC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;YACjC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;YAClC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAA;YACpD,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;YACrD,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;YACrD,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;QACpB,CAAC;IACH,CAAC;IAED,sBAAsB,CAAC,IAAiC,EAAE,OAA6B;QACrF,OAAO,IAAI,CAAC,QAAQ,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAA0B,EAAE,OAAO,CAAC,CAAC,EAAE,GAAG,CAAA;gBACzF,IAAI,CAAC,KAAK,GAAG,CAAC;KACzB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { FC, ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* A single entry in the DevToolsHub panel.
|
|
5
|
+
* Use this instead of raw `<button>` when adding custom tools via `children`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <DevToolsHub>
|
|
9
|
+
* <DevToolEntry icon="✦" label="Card Viewer" desc="Browse agents" onClick={() => setShowCards(true)} />
|
|
10
|
+
* </DevToolsHub>
|
|
11
|
+
*/
|
|
12
|
+
export declare const DevToolEntry: FC<{
|
|
13
|
+
icon: ReactNode;
|
|
14
|
+
label: string;
|
|
15
|
+
desc?: string;
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { devToolBtnCss, devToolIconCss, devToolLabelCss, devToolDescCss } from './DevToolsStyles';
|
|
3
|
+
/**
|
|
4
|
+
* A single entry in the DevToolsHub panel.
|
|
5
|
+
* Use this instead of raw `<button>` when adding custom tools via `children`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <DevToolsHub>
|
|
9
|
+
* <DevToolEntry icon="✦" label="Card Viewer" desc="Browse agents" onClick={() => setShowCards(true)} />
|
|
10
|
+
* </DevToolsHub>
|
|
11
|
+
*/
|
|
12
|
+
export const DevToolEntry = ({ icon, label, desc, onClick }) => (_jsxs("button", { css: devToolBtnCss, onClick: onClick, children: [_jsx("span", { css: devToolIconCss, children: icon }), _jsx("span", { css: devToolLabelCss, children: label }), desc && _jsx("span", { css: devToolDescCss, children: desc })] }));
|
|
13
|
+
//# sourceMappingURL=DevToolEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevToolEntry.js","sourceRoot":"","sources":["../../../../src/components/material/GameTable/DevToolEntry.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjG;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAKpB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACvC,kBAAQ,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,aAC1C,eAAM,GAAG,EAAE,cAAc,YAAG,IAAI,GAAQ,EACxC,eAAM,GAAG,EAAE,eAAe,YAAG,KAAK,GAAQ,EACzC,IAAI,IAAI,eAAM,GAAG,EAAE,cAAc,YAAG,IAAI,GAAQ,IAC1C,CACV,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const GP_PRIMARY = "#28B8CE";
|
|
2
|
+
export declare const GP_DARK = "#002448";
|
|
3
|
+
export declare const GP_SURFACE = "#0a1929";
|
|
4
|
+
export declare const GP_ACCENT = "#9fe2f7";
|
|
5
|
+
export declare const fabCss: import("@emotion/utils").SerializedStyles;
|
|
6
|
+
export declare const logoCss: import("@emotion/utils").SerializedStyles;
|
|
7
|
+
export declare const hubContainerCss: import("@emotion/utils").SerializedStyles;
|
|
8
|
+
export declare const mainMenuCss: import("@emotion/utils").SerializedStyles;
|
|
9
|
+
export declare const subPanelCss: import("@emotion/utils").SerializedStyles;
|
|
10
|
+
export declare const subPanelHeaderCss: import("@emotion/utils").SerializedStyles;
|
|
11
|
+
export declare const subPanelTitleCss: import("@emotion/utils").SerializedStyles;
|
|
12
|
+
export declare const subPanelContentCss: import("@emotion/utils").SerializedStyles;
|
|
13
|
+
export declare const panelHeaderCss: import("@emotion/utils").SerializedStyles;
|
|
14
|
+
export declare const headerLogoCss: import("@emotion/utils").SerializedStyles;
|
|
15
|
+
export declare const panelTitleCss: import("@emotion/utils").SerializedStyles;
|
|
16
|
+
export declare const panelBadgeCss: import("@emotion/utils").SerializedStyles;
|
|
17
|
+
export declare const menuListCss: import("@emotion/utils").SerializedStyles;
|
|
18
|
+
export declare const menuItemCss: import("@emotion/utils").SerializedStyles;
|
|
19
|
+
export declare const menuItemActiveCss: import("@emotion/utils").SerializedStyles;
|
|
20
|
+
export declare const menuItemIconCss: import("@emotion/utils").SerializedStyles;
|
|
21
|
+
export declare const menuItemLabelCss: import("@emotion/utils").SerializedStyles;
|
|
22
|
+
export declare const menuChevronCss: import("@emotion/utils").SerializedStyles;
|
|
23
|
+
export declare const devToolBtnCss: import("@emotion/utils").SerializedStyles;
|
|
24
|
+
export declare const toolBtnActiveCss: import("@emotion/utils").SerializedStyles;
|
|
25
|
+
export declare const devToolIconCss: import("@emotion/utils").SerializedStyles;
|
|
26
|
+
export declare const devToolLabelCss: import("@emotion/utils").SerializedStyles;
|
|
27
|
+
export declare const devToolDescCss: import("@emotion/utils").SerializedStyles;
|
|
28
|
+
export declare const activeIndicatorCss: import("@emotion/utils").SerializedStyles;
|
|
29
|
+
export declare const dividerCss: import("@emotion/utils").SerializedStyles;
|
|
30
|
+
export declare const inlineRowCss: import("@emotion/utils").SerializedStyles;
|
|
31
|
+
export declare const stepBtnCss: import("@emotion/utils").SerializedStyles;
|
|
32
|
+
export declare const numberInputCss: import("@emotion/utils").SerializedStyles;
|
|
33
|
+
export declare const textInputCss: import("@emotion/utils").SerializedStyles;
|
|
34
|
+
export declare const goBtnCss: import("@emotion/utils").SerializedStyles;
|
|
35
|
+
export declare const playerBtnCss: import("@emotion/utils").SerializedStyles;
|
|
36
|
+
export declare const playerBtnActiveCss: import("@emotion/utils").SerializedStyles;
|
|
37
|
+
export declare const savedListCss: import("@emotion/utils").SerializedStyles;
|
|
38
|
+
export declare const savedEntryCss: import("@emotion/utils").SerializedStyles;
|
|
39
|
+
export declare const savedLabelCss: import("@emotion/utils").SerializedStyles;
|
|
40
|
+
export declare const savedActionsCss: import("@emotion/utils").SerializedStyles;
|
|
41
|
+
export declare const smallBtnCss: import("@emotion/utils").SerializedStyles;
|
|
42
|
+
export declare const smallBtnDangerCss: import("@emotion/utils").SerializedStyles;
|
|
43
|
+
export declare const backdropCss: import("@emotion/utils").SerializedStyles;
|
|
44
|
+
export declare const modalBackdropCss: import("@emotion/utils").SerializedStyles;
|
|
45
|
+
export declare const modalCss: import("@emotion/utils").SerializedStyles;
|
|
46
|
+
export declare const modalHeaderCss: import("@emotion/utils").SerializedStyles;
|
|
47
|
+
export declare const modalTitleCss: import("@emotion/utils").SerializedStyles;
|
|
48
|
+
export declare const modalCloseBtnCss: import("@emotion/utils").SerializedStyles;
|
|
49
|
+
export declare const modalBodyCss: import("@emotion/utils").SerializedStyles;
|
|
50
|
+
export declare const modalTextareaCss: import("@emotion/utils").SerializedStyles;
|
|
51
|
+
export declare const pasteErrorCss: import("@emotion/utils").SerializedStyles;
|
|
52
|
+
export declare const modalFooterCss: import("@emotion/utils").SerializedStyles;
|
|
53
|
+
export declare const modalCancelBtnCss: import("@emotion/utils").SerializedStyles;
|
|
54
|
+
export declare const modalLoadBtnCss: import("@emotion/utils").SerializedStyles;
|
|
55
|
+
export declare const flashCss: import("@emotion/utils").SerializedStyles;
|
|
56
|
+
export declare const toggleRowCss: import("@emotion/utils").SerializedStyles;
|
|
57
|
+
export declare const checkboxCss: import("@emotion/utils").SerializedStyles;
|
|
58
|
+
export declare const toggleLabelCss: import("@emotion/utils").SerializedStyles;
|