@gamepark/react-game 7.7.4 → 7.7.6
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/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/History.js +52 -13
- package/dist/components/JournalTabs/History/History.js.map +1 -1
- package/dist/components/JournalTabs/History/LazyLogItem.d.ts +10 -0
- package/dist/components/JournalTabs/History/LazyLogItem.js +35 -0
- package/dist/components/JournalTabs/History/LazyLogItem.js.map +1 -0
- package/dist/components/JournalTabs/History/SetupLogItem.js +19 -19
- package/dist/components/JournalTabs/History/SharedIntersectionContext.d.ts +9 -0
- package/dist/components/JournalTabs/History/SharedIntersectionContext.js +36 -0
- package/dist/components/JournalTabs/History/SharedIntersectionContext.js.map +1 -0
- 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/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/BotTool.d.ts +8 -0
- package/dist/components/material/GameTable/DevTools/BotTool.js +13 -0
- package/dist/components/material/GameTable/DevTools/BotTool.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/DevTools/GamePanel.d.ts +1 -0
- package/dist/components/material/GameTable/DevTools/GamePanel.js +7 -179
- package/dist/components/material/GameTable/DevTools/GamePanel.js.map +1 -1
- package/dist/components/material/GameTable/DevTools/NewGameTool.d.ts +9 -0
- package/dist/components/material/GameTable/DevTools/NewGameTool.js +64 -0
- package/dist/components/material/GameTable/DevTools/NewGameTool.js.map +1 -0
- package/dist/components/material/GameTable/DevTools/SwitchPlayerTool.d.ts +8 -0
- package/dist/components/material/GameTable/DevTools/SwitchPlayerTool.js +9 -0
- package/dist/components/material/GameTable/DevTools/SwitchPlayerTool.js.map +1 -0
- package/dist/components/material/GameTable/DevTools/TutorialTool.d.ts +8 -0
- package/dist/components/material/GameTable/DevTools/TutorialTool.js +4 -0
- package/dist/components/material/GameTable/DevTools/TutorialTool.js.map +1 -0
- package/dist/components/material/GameTable/DevTools/UndoTool.d.ts +8 -0
- package/dist/components/material/GameTable/DevTools/UndoTool.js +9 -0
- package/dist/components/material/GameTable/DevTools/UndoTool.js.map +1 -0
- package/dist/components/material/GameTable/DevTools/devtools.css.d.ts +24 -0
- package/dist/components/material/GameTable/DevTools/devtools.css.js +183 -0
- package/dist/components/material/GameTable/DevTools/devtools.css.js.map +1 -0
- package/dist/components/material/GameTable/DevToolsHub.d.ts +4 -21
- package/dist/components/material/GameTable/DevToolsHub.js +24 -830
- package/dist/components/material/GameTable/DevToolsHub.js.map +1 -1
- package/dist/components/material/GameTable/DevToolsStyles.d.ts +67 -0
- package/dist/components/material/GameTable/DevToolsStyles.js +752 -0
- package/dist/components/material/GameTable/DevToolsStyles.js.map +1 -0
- package/dist/components/material/GameTable/JsonHighlighter.d.ts +3 -0
- package/dist/components/material/GameTable/JsonHighlighter.js +37 -0
- package/dist/components/material/GameTable/JsonHighlighter.js.map +1 -0
- package/dist/components/material/sound/bellSound.d.ts +1 -0
- package/dist/components/material/sound/bellSound.js +2 -0
- package/dist/components/material/sound/bellSound.js.map +1 -0
- package/dist/components/material/sound/useYourTurnSound.d.ts +4 -0
- package/dist/components/material/sound/useYourTurnSound.js +34 -0
- package/dist/components/material/sound/useYourTurnSound.js.map +1 -0
- package/dist/css/backgroundCss.js +3 -3
- package/dist/css/cursorCss.js +6 -6
- package/dist/css/fadeIn.js +6 -6
- package/dist/css/shineEffect.js +28 -28
- package/dist/css/transformCss.js +4 -4
- package/dist/hooks/LogHistoryContext.d.ts +6 -0
- package/dist/hooks/LogHistoryContext.js +4 -0
- package/dist/hooks/LogHistoryContext.js.map +1 -0
- package/dist/hooks/flatHistoryEngine.d.ts +37 -0
- package/dist/hooks/flatHistoryEngine.js +101 -0
- package/dist/hooks/flatHistoryEngine.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/dist/hooks/useFlatHistory.js +120 -44
- package/dist/hooks/useFlatHistory.js.map +1 -1
- package/dist/locators/PileLocator.d.ts +5 -0
- package/dist/locators/PileLocator.js +9 -1
- package/dist/locators/PileLocator.js.map +1 -1
- package/package.json +80 -79
- 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
|
@@ -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"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAwB,MAAM,gBAAgB,CAAA;AAE1D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAExE,MAAM,IAAI,GAAG,KAAK,CAAA,CAAC,kCAAkC;AACrD,MAAM,QAAQ,GAAG,MAAM,CAAA,CAAC,0CAA0C;AAElE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAgB,yBACpB,SAAQ,yBAA0C;IAClD,KAAK,GAAG,CAAC,CAAA;IACT,KAAK,GAAG,CAAC,CAAA;IACT,YAAY,GAAG,CAAC,CAAA;IAChB,KAAK,GAAG,SAAS,CAAA;IAEjB,mEAAmE;IACnE,eAAe,GAAG,KAAK,CAAA;IAEvB,IAAY,EAAE,KAAK,OAAO,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAA,CAAC,CAAC;IAEjD,SAAS;QACP,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IACrF,CAAC;IAED,aAAa,CAAC,MAAc;QAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CA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QAAQ,CAAC,QAAQ,EAAE,CAAC;YAC/B,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;YACjB,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;YAClC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;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,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { activeIndicatorCss, toolBtnActiveCss, toolBtnCss, toolDescCss, toolIconCss, toolLabelCss } from './devtools.css';
|
|
5
|
+
export const BotTool = ({ exec, g }) => {
|
|
6
|
+
const [botActive, setBotActive] = useState(false);
|
|
7
|
+
return (_jsxs("button", { css: [toolBtnCss, botActive && toolBtnActiveCss], onClick: () => {
|
|
8
|
+
const next = !botActive;
|
|
9
|
+
exec(() => g.bot(next), next ? 'Bots enabled' : 'Bots disabled');
|
|
10
|
+
setBotActive(next);
|
|
11
|
+
}, children: [_jsx("span", { css: toolIconCss, children: '\u2699' }), _jsx("span", { css: toolLabelCss, children: botActive ? 'Disable Bots' : 'Enable Bots' }), _jsx("span", { css: toolDescCss, children: botActive ? 'Stop auto-play' : 'Auto-play all moves' }), botActive && _jsx("span", { css: activeIndicatorCss })] }));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=BotTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BotTool.js","sourceRoot":"","sources":["../../../../../src/components/material/GameTable/DevTools/BotTool.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EACL,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EACzF,MAAM,gBAAgB,CAAA;AAOvB,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE;IACvD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEjD,OAAO,CACL,kBAAQ,GAAG,EAAE,CAAC,UAAU,EAAE,SAAS,IAAI,gBAAgB,CAAC,EACtD,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,IAAI,GAAG,CAAC,SAAS,CAAA;YACvB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;YAChE,YAAY,CAAC,IAAI,CAAC,CAAA;QACpB,CAAC,aACD,eAAM,GAAG,EAAE,WAAW,YAAG,QAAQ,GAAQ,EACzC,eAAM,GAAG,EAAE,YAAY,YAAG,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,GAAQ,EAC5E,eAAM,GAAG,EAAE,WAAW,YAAG,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,qBAAqB,GAAQ,EACpF,SAAS,IAAI,eAAM,GAAG,EAAE,kBAAkB,GAAI,IACxC,CACV,CAAA;AACH,CAAC,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;
|