playball 3.0.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -0
- package/bin/playball.js +1 -1
- package/dist/cli.js +31 -0
- package/dist/components/AllPlays.js +20 -60
- package/dist/components/App.js +19 -45
- package/dist/components/AtBat.js +8 -33
- package/dist/components/Bases.js +10 -25
- package/dist/components/Count.js +10 -25
- package/dist/components/FinishedGame.js +26 -60
- package/dist/components/Game.js +25 -57
- package/dist/components/GameList.js +32 -83
- package/dist/components/Grid.js +20 -47
- package/dist/components/HelpBar.js +6 -20
- package/dist/components/InningDisplay.js +6 -20
- package/dist/components/LineScore.js +10 -31
- package/dist/components/LiveGame.js +22 -41
- package/dist/components/LoadingSpinner.js +12 -34
- package/dist/components/Matchup.js +11 -29
- package/dist/components/PreviewGame.js +18 -40
- package/dist/components/Standings.js +23 -45
- package/dist/config.js +126 -0
- package/dist/features/games.js +32 -67
- package/dist/features/keys.js +10 -25
- package/dist/features/schedule.js +16 -31
- package/dist/features/standings.js +14 -28
- package/dist/hooks/useKey.js +8 -20
- package/dist/logger.js +9 -20
- package/dist/main.js +20 -28
- package/dist/package.js +5 -0
- package/dist/screen.js +16 -22
- package/dist/store/index.js +14 -27
- package/dist/style/index.js +2 -9
- package/dist/utils.js +8 -0
- package/package.json +14 -6
- package/.eslintrc.json +0 -33
- package/CODE_OF_CONDUCT.md +0 -76
- package/demo.cast +0 -95
- package/demo.gif +0 -0
- package/src/components/AllPlays.jsx +0 -107
- package/src/components/App.jsx +0 -43
- package/src/components/AtBat.jsx +0 -41
- package/src/components/Bases.jsx +0 -22
- package/src/components/Count.jsx +0 -24
- package/src/components/FinishedGame.jsx +0 -76
- package/src/components/Game.jsx +0 -60
- package/src/components/GameList.jsx +0 -166
- package/src/components/Grid.jsx +0 -91
- package/src/components/HelpBar.jsx +0 -19
- package/src/components/InningDisplay.jsx +0 -19
- package/src/components/LineScore.jsx +0 -52
- package/src/components/LiveGame.jsx +0 -47
- package/src/components/LoadingSpinner.jsx +0 -49
- package/src/components/Matchup.jsx +0 -41
- package/src/components/PreviewGame.jsx +0 -54
- package/src/components/Standings.jsx +0 -78
- package/src/features/games.js +0 -165
- package/src/features/keys.js +0 -38
- package/src/features/schedule.js +0 -59
- package/src/features/standings.js +0 -60
- package/src/hooks/useKey.js +0 -13
- package/src/logger.js +0 -16
- package/src/main.js +0 -23
- package/src/screen.js +0 -14
- package/src/store/index.js +0 -18
- package/src/style/index.js +0 -15
package/dist/store/index.js
CHANGED
|
@@ -1,32 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _schedule = _interopRequireDefault(require("../features/schedule"));
|
|
11
|
-
|
|
12
|
-
var _games = _interopRequireDefault(require("../features/games"));
|
|
13
|
-
|
|
14
|
-
var _keys = _interopRequireDefault(require("../features/keys"));
|
|
15
|
-
|
|
16
|
-
var _standings = _interopRequireDefault(require("../features/standings"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
var _default = (0, _toolkit.configureStore)({
|
|
1
|
+
import reduxjsToolkit from '@reduxjs/toolkit';
|
|
2
|
+
const {
|
|
3
|
+
configureStore
|
|
4
|
+
} = reduxjsToolkit;
|
|
5
|
+
import schedule from "../features/schedule.js";
|
|
6
|
+
import games from "../features/games.js";
|
|
7
|
+
import keys from "../features/keys.js";
|
|
8
|
+
import standings from "../features/standings.js";
|
|
9
|
+
export default configureStore({
|
|
21
10
|
reducer: {
|
|
22
|
-
schedule
|
|
23
|
-
games
|
|
24
|
-
keys
|
|
25
|
-
standings
|
|
11
|
+
schedule,
|
|
12
|
+
games,
|
|
13
|
+
keys,
|
|
14
|
+
standings
|
|
26
15
|
},
|
|
27
16
|
middleware: getDefaultMiddleware => getDefaultMiddleware({
|
|
28
17
|
serializableCheck: false
|
|
29
18
|
})
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
exports.default = _default;
|
|
19
|
+
});
|
package/dist/style/index.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
1
|
+
export default {
|
|
8
2
|
list: {
|
|
9
3
|
selected: {
|
|
10
4
|
bg: 'blue',
|
|
@@ -18,5 +12,4 @@ var _default = {
|
|
|
18
12
|
inverse: true
|
|
19
13
|
}
|
|
20
14
|
}
|
|
21
|
-
};
|
|
22
|
-
exports.default = _default;
|
|
15
|
+
};
|
package/dist/utils.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playball",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Watch MLB games from the comfort of your terminal",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MLB",
|
|
@@ -14,14 +14,17 @@
|
|
|
14
14
|
"clean": "rimraf ./dist",
|
|
15
15
|
"compile": "babel src --out-dir dist",
|
|
16
16
|
"lint": "eslint --ext .jsx,.js src",
|
|
17
|
-
"start": "babel-
|
|
17
|
+
"start": "babel src --out-dir dist --watch",
|
|
18
18
|
"prepublishOnly": "npm run build",
|
|
19
19
|
"react-devtools": "react-devtools"
|
|
20
20
|
},
|
|
21
|
-
"main": "dist/main.js",
|
|
22
21
|
"bin": {
|
|
23
22
|
"playball": "./bin/playball.js"
|
|
24
23
|
},
|
|
24
|
+
"files": [
|
|
25
|
+
"bin",
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
25
28
|
"repository": {
|
|
26
29
|
"type": "git",
|
|
27
30
|
"url": "https://github.com/paaatrick/playball.git"
|
|
@@ -37,6 +40,8 @@
|
|
|
37
40
|
"@reduxjs/toolkit": "^1.8.0",
|
|
38
41
|
"axios": "^0.26.1",
|
|
39
42
|
"blessed": "^0.1.81",
|
|
43
|
+
"commander": "^11.0.0",
|
|
44
|
+
"conf": "^11.0.1",
|
|
40
45
|
"date-fns": "^2.28.0",
|
|
41
46
|
"json-patch": "^0.7.0",
|
|
42
47
|
"prop-types": "^15.8.1",
|
|
@@ -46,6 +51,7 @@
|
|
|
46
51
|
"react-devtools-core": "^4.24.7",
|
|
47
52
|
"react-redux": "^7.2.6",
|
|
48
53
|
"redux": "^4.1.2",
|
|
54
|
+
"update-notifier": "^6.0.2",
|
|
49
55
|
"winston": "^3.7.2"
|
|
50
56
|
},
|
|
51
57
|
"devDependencies": {
|
|
@@ -61,14 +67,16 @@
|
|
|
61
67
|
"rimraf": "^2.6.3",
|
|
62
68
|
"ws": "^8.5.0"
|
|
63
69
|
},
|
|
70
|
+
"type": "module",
|
|
64
71
|
"babel": {
|
|
65
72
|
"presets": [
|
|
66
73
|
[
|
|
67
74
|
"@babel/preset-env",
|
|
68
75
|
{
|
|
69
76
|
"targets": {
|
|
70
|
-
"node": "
|
|
71
|
-
}
|
|
77
|
+
"node": "14"
|
|
78
|
+
},
|
|
79
|
+
"modules": false
|
|
72
80
|
}
|
|
73
81
|
],
|
|
74
82
|
"@babel/preset-react"
|
|
@@ -78,7 +86,7 @@
|
|
|
78
86
|
"module-resolver",
|
|
79
87
|
{
|
|
80
88
|
"alias": {
|
|
81
|
-
"react-redux": "react-redux/lib/alternate-renderers"
|
|
89
|
+
"react-redux": "react-redux/lib/alternate-renderers.js"
|
|
82
90
|
}
|
|
83
91
|
}
|
|
84
92
|
]
|
package/.eslintrc.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"es6": true,
|
|
4
|
-
"node": true
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"eslint:recommended",
|
|
8
|
-
"plugin:react/recommended"
|
|
9
|
-
],
|
|
10
|
-
"parserOptions": {
|
|
11
|
-
"ecmaFeatures": {
|
|
12
|
-
"jsx": true
|
|
13
|
-
},
|
|
14
|
-
"ecmaVersion": 2020,
|
|
15
|
-
"sourceType": "module"
|
|
16
|
-
},
|
|
17
|
-
"plugins": [
|
|
18
|
-
"react"
|
|
19
|
-
],
|
|
20
|
-
"rules": {
|
|
21
|
-
"indent": ["error", 2],
|
|
22
|
-
"linebreak-style": ["error", "unix"],
|
|
23
|
-
"quotes": ["error", "single"],
|
|
24
|
-
"semi": ["error", "always"],
|
|
25
|
-
"no-console": "warn"
|
|
26
|
-
},
|
|
27
|
-
"settings": {
|
|
28
|
-
"react": {
|
|
29
|
-
"pragma": "React",
|
|
30
|
-
"version": "17.0.2"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
-
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
|
9
|
-
level of experience, education, socio-economic status, nationality, personal
|
|
10
|
-
appearance, race, religion, or sexual identity and orientation.
|
|
11
|
-
|
|
12
|
-
## Our Standards
|
|
13
|
-
|
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
|
15
|
-
include:
|
|
16
|
-
|
|
17
|
-
* Using welcoming and inclusive language
|
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
|
19
|
-
* Gracefully accepting constructive criticism
|
|
20
|
-
* Focusing on what is best for the community
|
|
21
|
-
* Showing empathy towards other community members
|
|
22
|
-
|
|
23
|
-
Examples of unacceptable behavior by participants include:
|
|
24
|
-
|
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
-
advances
|
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
-
* Public or private harassment
|
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
|
30
|
-
address, without explicit permission
|
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
-
professional setting
|
|
33
|
-
|
|
34
|
-
## Our Responsibilities
|
|
35
|
-
|
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
-
response to any instances of unacceptable behavior.
|
|
39
|
-
|
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
-
threatening, offensive, or harmful.
|
|
45
|
-
|
|
46
|
-
## Scope
|
|
47
|
-
|
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
-
when an individual is representing the project or its community. Examples of
|
|
50
|
-
representing a project or community include using an official project e-mail
|
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
|
53
|
-
further defined and clarified by project maintainers.
|
|
54
|
-
|
|
55
|
-
## Enforcement
|
|
56
|
-
|
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting the project team at patrick.kalita@gmail.com. All
|
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
|
63
|
-
|
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
-
members of the project's leadership.
|
|
67
|
-
|
|
68
|
-
## Attribution
|
|
69
|
-
|
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
72
|
-
|
|
73
|
-
[homepage]: https://www.contributor-covenant.org
|
|
74
|
-
|
|
75
|
-
For answers to common questions about this code of conduct, see
|
|
76
|
-
https://www.contributor-covenant.org/faq
|
package/demo.cast
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
{"version": 2, "width": 118, "height": 36, "timestamp": 1654987630, "idle_time_limit": 2.0, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}
|
|
2
|
-
[0.159133, "o", "$ "]
|
|
3
|
-
[1.331166, "o", "p"]
|
|
4
|
-
[1.412778, "o", "l"]
|
|
5
|
-
[1.564842, "o", "a"]
|
|
6
|
-
[1.772299, "o", "y"]
|
|
7
|
-
[2.035449, "o", "b"]
|
|
8
|
-
[2.160659, "o", "a"]
|
|
9
|
-
[2.261186, "o", "l"]
|
|
10
|
-
[2.413437, "o", "l"]
|
|
11
|
-
[2.627466, "o", "\r\n"]
|
|
12
|
-
[3.043377, "o", "\u001b]0;Playball!\u0007\u001b[?1049h\u001b[?1h\u001b=\u001b[1;36r\u001b[?25l\u001b[1;1H\u001b[H\u001b[2J\u001b[?1002h\u001b[?1003h\u001b[?1006h"]
|
|
13
|
-
[3.068237, "o", "\u001b7\u001b[1;1H\u001b[47;30m Saturday, June 11th, 2022 \u001b[m\u001b[19;1H\u001b[54CLoading...\u001b[36;1H\u001b[36;1H⠙\u001b[2C\u001b[7mQ\u001b[m:Quit\u001b[2C\u001b[7mC\u001b[m:Schedule\u001b[2C\u001b[7mS\u001b[m:Standings\u001b[2C\u001b[7mP\u001b[m:Prev\u001b[1CDay\u001b[2C\u001b[7mN\u001b[m:Next\u001b[1CDay\u001b[2C\u001b[7mT\u001b[m:Today\u001b8"]
|
|
14
|
-
[3.117385, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠹\u001b8"]
|
|
15
|
-
[3.167954, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠸\u001b8"]
|
|
16
|
-
[3.215288, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠼\u001b8"]
|
|
17
|
-
[3.297623, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠴\u001b8"]
|
|
18
|
-
[3.31866, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠦\u001b8"]
|
|
19
|
-
[3.40441, "o", "\u001b7\u001b[3;1H\u001b[3;1H\u001b(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk\u001b[4;1H\u001b[4;1Hx\u001b[1C\u001b(BTop\u001b[1C9th\u001b[14CH\u001b[2CR\u001b[2CE\u001b[8C\u001b(0x\u001b[2C\u001b(BTop\u001b[1C9th\u001b[14CH\u001b[2CR\u001b[2CE\u001b[11CBottom\u001b[1C8th\u001b[11CH\u001b[2CR\u001b[2CE\u001b[5;1H\u001b[5;1H\u001b(0x\u001b[1C\u001b(BRockies\u001b[1C(25-33)\u001b[6C1\u001b[2C8\u001b[2C0\u001b[8C\u001b(0x\u001b[2C\u001b(BPirates\u001b[1C(24-32)\u001b[6C4\u001b[2C6\u001b[2C2\u001b[11CD-backs\u001b[1C(28-32)\u001b[6C0\u001b[2C4\u001b[2C1\u001b[6;1H\u001b[6;1H\u001b(0x\u001b[1C\u001b(BPadres\u001b[1C(36-22)\u001b[7C1\u001b[2C3\u001b[2C0\u001b[8C\u001b(0x\u001b[2C\u001b(BBraves\u001b[1C(32-27)\u001b[6C10\u001b[2C8\u001b[2C0\u001b[11CPhillies\u001b[1C(29-29)\u001b[5C4\u001b[2C9\u001b[2C0\u001b[7;1H\u001b[7;1H\u001b(0mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj\u001b[9;1H\u001b[9;3H\u001b(BTop\u001b[1C8th\u001b[14CH\u001b[2CR\u001b[2CE\u001b[11CBottom\u001b[1C8th\u001b[11CH\u001b[2CR\u001b[2CE\u001b[11CTop\u001b[1C8th\u001b[14CH\u001b[2CR\u001b[2CE\u001b[10;1H\u001b[10;3HBrewers\u001b[1C(33-27)\u001b[6C4\u001b[2C9\u001b[2C1\u001b[11COrioles\u001b[1C(24-35)\u001b[6C6\u001b[1C10\u001b[2C0\u001b[11CAthletics\u001b[1C(20-40)\u001b[4C8\u001b[1C11\u001b[2C1\u001b[11;1H\u001b[11;3HNationals\u001b[1C(22-38)\u001b[4C8\u001b[2C9\u001b[2C1\u001b[11CRoyals\u001b[1C(20-37)\u001b[7C3\u001b[2C6\u001b[2C1\u001b[11CGuardians\u001b[1C(28-26)\u001b[4C5\u001b[2C8\u001b[2C1\u001b[14;1H\u001b[14;3HBottom\u001b[1C8th\u001b[11CH\u001b[2CR\u001b[2CE\u001b[11CTop\u001b[1C8th\u001b[14CH\u001b[2CR\u001b[2CE\u001b[11C7:10\u001b[1CPM\u001b[15;1H\u001b[15;3HBlue\u001b[1CJays\u001b[1C(34-23)\u001b[4C0\u001b[2C7\u001b[2C1\u001b[11CMarl"]
|
|
20
|
-
[3.404479, "o", "ins\u001b[1C(26-30)\u001b[6C4\u001b[2C4\u001b[2C2\u001b[11CRockies\u001b[1C(25-33)\u001b[16;1H\u001b[16;3HTigers\u001b[1C(23-34)\u001b[7C3\u001b[2C8\u001b[2C1\u001b[11CAstros\u001b[1C(36-22)\u001b[7C1\u001b[2C7\u001b[2C1\u001b[11CPadres\u001b[1C(36-22)\u001b[19;1H\u001b[19;3H4:15\u001b[1CPM\u001b[32C4:15\u001b[1CPM\u001b[6C \u001b[16C7:07\u001b[1CPM\u001b[20;1H\u001b[20;3HDodgers\u001b[1C(37-21)\u001b[24CCubs\u001b[1C(23-34)\u001b[27CMets\u001b[1C(39-21)\u001b[21;1H\u001b[21;3HGiants\u001b[1C(31-26)\u001b[25CYankees\u001b[1C(42-16)\u001b[24CAngels\u001b[1C(28-32)\u001b[24;1H\u001b[24;3H7:10\u001b[1CPM\u001b[32CFinal\u001b[16CH\u001b[2CR\u001b[2CE\u001b[11CFinal/10\u001b[13CH\u001b[2CR\u001b[2CE\u001b[25;1H\u001b[25;3HRed\u001b[1CSox\u001b[1C(31-28)\u001b[24CRays\u001b[1C(34-25)\u001b[9C5\u001b[1C13\u001b[2C0\u001b[11C\u001b[1mRangers (27-31) 11 15 1\u001b[m\u001b[26;1H\u001b[26;3HMariners\u001b[1C(26-32)\u001b[23C\u001b[1mTwins (35-26) 6 11 2\u001b[11C\u001b[mWhite\u001b[1CSox\u001b[1C(27-30)\u001b[4C9\u001b[1C15\u001b[2C2\u001b[29;1H\u001b[29;3HFinal\u001b[16CH\u001b[2CR\u001b[2CE\u001b[30;1H\u001b[30;3HReds\u001b[1C(20-39)\u001b[9C4\u001b[1C12\u001b[2C2\u001b[31;1H\u001b[31;3H\u001b[1mCardinals (34-26) 5 7 0\u001b[m\u001b[36;1H\u001b[36;1H⠧\u001b8"]
|
|
21
|
-
[3.441761, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠇\u001b8"]
|
|
22
|
-
[3.513144, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠏\u001b8"]
|
|
23
|
-
[3.545197, "o", "\u001b7\u001b[36;1H\u001b[36;1H \u001b8"]
|
|
24
|
-
[5.677285, "o", "\u001b7\u001b[3;1H\u001b[3;1H \u001b(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk\u001b[4;1H\u001b[4;1H\u001b(B \u001b[37C \u001b(0x\u001b[37Cx\u001b[5;1H\u001b[5;1H\u001b(B \u001b[37C \u001b(0x\u001b[37Cx\u001b[6;1H\u001b[6;1H\u001b(B \u001b[37C \u001b(0x\u001b[37Cx\u001b[7;1H\u001b[7;1H\u001b(B \u001b(0mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj\u001b(B\u001b8"]
|
|
25
|
-
[5.845659, "o", "\u001b7\u001b[3;1H\u001b[3;40H \u001b(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk\u001b[4;1H\u001b[4;40H\u001b(B \u001b[37C \u001b(0x\u001b[37Cx\u001b[5;1H\u001b[5;40H\u001b(B \u001b[37C \u001b(0x\u001b[37Cx\u001b[6;1H\u001b[6;40H\u001b(B \u001b[37C \u001b(0x\u001b[37Cx\u001b[7;1H\u001b[7;40H\u001b(B \u001b(0mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj\u001b(B\u001b8"]
|
|
26
|
-
[7.016135, "o", "\u001b7\u001b[1;1H \u001b[3;1H\u001b[78C \u001b[4;1H\u001b[4;3H \u001b[1C \u001b[14C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[14C \u001b[2C \u001b[2C \u001b[9C \u001b[1C \u001b[1C \u001b[11C \u001b[2C \u001b[2C \u001b[8C \u001b[5;1H\u001b[5;3H \u001b[1C \u001b[6C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[6C \u001b[2C \u001b[2C \u001b[9C \u001b[1C \u001b[1C \u001b[6C \u001b[2C \u001b[2C \u001b[8C \u001b[6;1H\u001b[6;3H \u001b[1C \u001b[7C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[6C \u001b[2C \u001b[2C \u001b[9C \u001b[1C \u001b[1C \u001b[5C \u001b[2C \u001b[2C \u001b[8C \u001b[7;1H\u001b[7;79H \u001b[9;1H\u001b[9;3H \u001b[1C \u001b[14C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[11C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[14C \u001b[2C \u001b[2C \u001b[10;1H\u001b[10;3H \u001b[1C \u001b[6C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[6C \u001b[1C \u001b[2C \u001b[11C \u001b[1C \u001b[4C \u001b[1C \u001b[2C \u001b[11;1H\u001b[11;3H \u001b[1C \u001b[4C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[7C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[4C \u001b[2C \u001b[2C \u001b[14;1H\u001b[14;3H \u001b[1C \u001b[11C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[14C \u001b[2C"]
|
|
27
|
-
[7.016312, "o", " \u001b[2C \u001b[11C \u001b[1C \u001b[15;1H\u001b[15;3H \u001b[1C \u001b[1C \u001b[4C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[6C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[16;1H\u001b[16;3H \u001b[1C \u001b[7C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[7C \u001b[2C \u001b[2C \u001b[11C \u001b[1C \u001b[19;1H\u001b[19;3H \u001b[1C \u001b[32C \u001b[1C \u001b[32C \u001b[1C \u001b[20;1H\u001b[20;3H \u001b[1C \u001b[24C \u001b[1C \u001b[27C \u001b[1C \u001b[21;1H\u001b[21;3H \u001b[1C \u001b[25C \u001b[1C \u001b[24C \u001b[1C \u001b[24;1H\u001b[24;3H \u001b[1C \u001b[32C \u001b[16C \u001b[2C \u001b[2C \u001b[11C \u001b[13C \u001b[2C \u001b[2C \u001b[25;1H\u001b[25;3H \u001b[1C \u001b[1C \u001b[24C \u001b[1C \u001b[9C \u001b[1C \u001b[2C \u001b[11C \u001b[26;1H\u001b[26;3H \u001b[1C \u001b[23C \u001b[11C \u001b[1C \u001b[1C \u001b[4C \u001b[1C \u001b[2C \u001b[29;1H\u001b[29;3H \u001b[16C \u001b[2C \u001b[2C \u001b[30;1H\u001b[30;3H \u001b[1C \u001b[9C \u001b[1C \u001b[2C \u001b[31;1H\u001b[31;3H \u001b[36;1H\u001b[36;1H⠙\u001b[35C \u001b[1C \u001b[2C \u001b[1C \u001b[2C \u001b8"]
|
|
28
|
-
[7.069271, "o", "\u001b7\u001b[36;1H⠹\u001b8"]
|
|
29
|
-
[7.120474, "o", "\u001b7\u001b[36;1H⠸\u001b8"]
|
|
30
|
-
[7.169237, "o", "\u001b7\u001b[36;1H⠼\u001b8"]
|
|
31
|
-
[7.220735, "o", "\u001b7\u001b[36;1H⠴\u001b8"]
|
|
32
|
-
[7.270481, "o", "\u001b7\u001b[36;1H⠦\u001b8"]
|
|
33
|
-
[7.320113, "o", "\u001b7\u001b[36;1H⠧\u001b8"]
|
|
34
|
-
[7.370402, "o", "\u001b7\u001b[36;1H⠇\u001b8"]
|
|
35
|
-
[7.419372, "o", "\u001b7\u001b[36;1H⠏\u001b8"]
|
|
36
|
-
[7.469781, "o", "\u001b7\u001b[36;1H⠋\u001b8"]
|
|
37
|
-
[7.520863, "o", "\u001b7\u001b[36;1H⠙\u001b8"]
|
|
38
|
-
[7.571275, "o", "\u001b7\u001b[36;1H⠹\u001b8"]
|
|
39
|
-
[7.626738, "o", "\u001b7\u001b[36;1H⠸\u001b8"]
|
|
40
|
-
[7.669718, "o", "\u001b7\u001b[36;1H⠼\u001b8"]
|
|
41
|
-
[7.721801, "o", "\u001b7\u001b[36;1H⠴\u001b8"]
|
|
42
|
-
[7.7709, "o", "\u001b7\u001b[36;1H⠦\u001b8"]
|
|
43
|
-
[7.821713, "o", "\u001b7\u001b[36;1H⠧\u001b8"]
|
|
44
|
-
[7.873451, "o", "\u001b7\u001b[36;1H⠇\u001b8"]
|
|
45
|
-
[7.922679, "o", "\u001b7\u001b[36;1H⠏\u001b8"]
|
|
46
|
-
[7.972914, "o", "\u001b7\u001b[36;1H⠋\u001b8"]
|
|
47
|
-
[8.022984, "o", "\u001b7\u001b[36;1H⠙\u001b8"]
|
|
48
|
-
[8.072782, "o", "\u001b7\u001b[36;1H⠹\u001b8"]
|
|
49
|
-
[8.122838, "o", "\u001b7\u001b[36;1H⠸\u001b8"]
|
|
50
|
-
[8.17296, "o", "\u001b7\u001b[36;1H⠼\u001b8"]
|
|
51
|
-
[8.222793, "o", "\u001b7\u001b[36;1H⠴\u001b8"]
|
|
52
|
-
[8.272494, "o", "\u001b7\u001b[36;1H⠦\u001b8"]
|
|
53
|
-
[8.324117, "o", "\u001b7\u001b[36;1H⠧\u001b8"]
|
|
54
|
-
[8.375222, "o", "\u001b7\u001b[36;1H⠇\u001b8"]
|
|
55
|
-
[8.423489, "o", "\u001b7\u001b[36;1H⠏\u001b8"]
|
|
56
|
-
[8.471642, "o", "\u001b7\u001b[36;1H⠋\u001b8"]
|
|
57
|
-
[8.522495, "o", "\u001b7\u001b[36;1H⠙\u001b8"]
|
|
58
|
-
[8.572956, "o", "\u001b7\u001b[36;1H⠹\u001b8"]
|
|
59
|
-
[8.62592, "o", "\u001b7\u001b[36;1H⠸\u001b8"]
|
|
60
|
-
[8.675946, "o", "\u001b7\u001b[36;1H⠼\u001b8"]
|
|
61
|
-
[8.726318, "o", "\u001b7\u001b[36;1H⠴\u001b8"]
|
|
62
|
-
[8.863595, "o", "\u001b7\u001b[1;1H\u001b[6CB:\u001b[1C\u001b[32m● ○ ○ ○ \u001b[16C\u001b[m\u001b[33m\u001b(0`\u001b[31C\u001b[m\u001b(B1\u001b[2C2\u001b[2C3\u001b[2C4\u001b[2C5\u001b[2C6\u001b[2C7\u001b[2C8\u001b[2C9\u001b[3C\u001b[1mR\u001b[2C\u001b[mH\u001b[2CE\u001b[2;1H\u001b[2;3H8\u001b[3CS:\u001b[1C\u001b[31m● ○ ○ \u001b[16C\u001b[m◇\u001b[3C◇\u001b[25CARI\u001b[1C0\u001b[2C0\u001b[2C0\u001b[2C0\u001b[2C0\u001b[2C0\u001b[2C0\u001b[2C0\u001b[4C\u001b[1m 0\u001b[2C\u001b[m4\u001b[2C1\u001b[3;1H\u001b[3;3H▼\u001b[3CO:\u001b[1C\u001b[31m○ ○ ○ \u001b[46C\u001b[mPHI\u001b[1C1\u001b[2C2\u001b[2C0\u001b[2C0\u001b[2C0\u001b[2C0\u001b[2C0\u001b[2C1\u001b[4C\u001b[1m 4\u001b[2C\u001b[m9\u001b[2C0\u001b[4;1H\u001b[4;1H\u001b(0qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq\u001b[5;1H\u001b[1C\u001b(BARI\u001b[1CPitching:\u001b[1C\u001b[1mCaleb Smith\u001b[1C\u001b[m1.0\u001b[1CIP,\u001b[1C17\u001b[1CP,\u001b[1C5.81\u001b[1CERA\u001b[10C\u001b(0x\u001b[1C\u001b[1m\u001b(B[BOTTOM 8]\u001b[45C\u001b[m\u001b[7;37m \u001b[m\u001b[6;1H\u001b[6;2HPHI\u001b[1CAt\u001b[1CBat:\u001b[3C\u001b[1mJ.T. Realmuto\u001b[1C\u001b[m0-2,\u001b[1C.239\u001b[1CAVG,\u001b[1C3\u001b[1CHR\u001b[11C\u001b(0x\u001b[1C\u001b[34m\u001b(B[Double]\u001b[1C\u001b[mNick\u001b[1CCastellanos\u001b[1Cdoubles\u001b[1C(14)\u001b[1Con\u001b[1Ca\u001b[1Cline\u001b[1Cdrive\u001b[7;1H\u001b[7;60H\u001b(0x\u001b[1C\u001b(Bto\u001b[1Cright\u001b[1Cfielder\u001b[1CJordan\u001b[1CLuplow.\u001b[3CBryce\u001b[1CHarper\u001b[1Cscores.\u001b[8;1H\u001b[8;2H[Ball]\u001b[1C92.3\u001b[1CMPH\u001b[1CFour-Seam\u001b[1CFastball\u001b[20C1-1\u001b[1C\u001b(0x\u001b[1C\u001b[1;47;3"]
|
|
63
|
-
[8.863739, "o", "0m\u001b(B ARI 0 - PHI 4 \u001b[m\u001b[9;1H\u001b[9;2H[Swinging\u001b[1CStrike]\u001b[1C82.9\u001b[1CMPH\u001b[1CChangeup\u001b[19C0-1\u001b[1C\u001b(0x\u001b[1C\u001b[34m\u001b(B[Single]\u001b[1C\u001b[mBryce\u001b[1CHarper\u001b[1Csingles\u001b[1Con\u001b[1Ca\u001b[1Cground\u001b[1Cball\u001b[1Cto\u001b[10;1H\u001b[10;60H\u001b(0x\u001b[1C\u001b(Bcenter\u001b[1Cfielder\u001b[1CAlek\u001b[1CThomas.\u001b[11;1H\u001b[11;60H\u001b(0x\u001b[1C\u001b(B[Defensive\u001b[1CSwitch]\u001b[1CCarson\u001b[1CKelly\u001b[1Cremains\u001b[1Cin\u001b[1Cthe\u001b[1Cgame\u001b[1Cas\u001b[12;1H\u001b[12;60H\u001b(0x\u001b[1C\u001b(Bthe\u001b[1Ccatcher.\u001b[13;1H\u001b[13;60H\u001b(0x\u001b[1C\u001b(B[Defensive\u001b[1CSwitch]\u001b[1CJordan\u001b[1CLuplow\u001b[1Cremains\u001b[1Cin\u001b[1Cthe\u001b[1Cgame\u001b[14;1H\u001b[14;60H\u001b(0x\u001b[1C\u001b(Bas\u001b[1Cthe\u001b[1Cright\u001b[1Cfielder.\u001b[15;1H\u001b[15;60H\u001b(0x\u001b[16;1H\u001b[16;60Hx\u001b[1C\u001b[1m\u001b(B[TOP 8]\u001b[m\u001b[17;1H\u001b[17;60H\u001b(0x\u001b[1C\u001b[37m\u001b(B[Pop Out]\u001b[1C\u001b[mJordan\u001b[1CLuplow\u001b[1Cpops\u001b[1Cout\u001b[1Cto\u001b[1Ccatcher\u001b[1CJ.\u001b[2CT.\u001b[18;1H\u001b[18;60H\u001b(0x\u001b[1C\u001b(BRealmuto\u001b[1Cin\u001b[1Cfoul\u001b[1Cterritory.\u001b[1C\u001b[1m3 out\u001b[m\u001b[19;1H\u001b[19;60H\u001b(0x\u001b[1C\u001b(B[Offensive\u001b[1CSubstitution]\u001b[1COffensive\u001b[1CSubstitution:\u001b[20;1H\u001b[20;60H\u001b(0x\u001b[1C\u001b(BPinch-hitter\u001b[1CJordan\u001b[1CLuplow\u001b[1Creplaces\u001b[1CPavin\u001b[1CSmith.\u001b[21;1H\u001b[21;60H\u001b(0x\u001b[1C\u001b[31m\u001b(B[Strikeout]\u001b[1C\u001b[mDaulton\u001b[1CVar"]
|
|
64
|
-
[8.863817, "o", "sho\u001b[1Ccalled\u001b[1Cout\u001b[1Con\u001b[1Cstrikes.\u001b[1C\u001b[1m2 \u001b[m\u001b[22;1H\u001b[22;60H\u001b(0x\u001b[1C\u001b[1m\u001b(Bout\u001b[m\u001b[23;1H\u001b[23;60H\u001b(0x\u001b[1C\u001b[37m\u001b(B[Flyout]\u001b[1C\u001b[mCarson\u001b[1CKelly\u001b[1Cflies\u001b[1Cout\u001b[1Cto\u001b[1Cright\u001b[1Cfielder\u001b[1CNick\u001b[24;1H\u001b[24;60H\u001b(0x\u001b[1C\u001b(BCastellanos.\u001b[1C\u001b[1m1 out\u001b[m\u001b[25;1H\u001b[25;60H\u001b(0x\u001b[1C\u001b(B[Offensive\u001b[1CSubstitution]\u001b[1COffensive\u001b[1CSubstitution:\u001b[26;1H\u001b[26;60H\u001b(0x\u001b[1C\u001b(BPinch-hitter\u001b[1CCarson\u001b[1CKelly\u001b[1Creplaces\u001b[1CJose\u001b[1CHerrera.\u001b[27;1H\u001b[27;60H\u001b(0x\u001b[1C\u001b(B[Pitching\u001b[1CSubstitution]\u001b[1CPitching\u001b[1CChange:\u001b[1CBrad\u001b[1CHand\u001b[28;1H\u001b[28;60H\u001b(0x\u001b[1C\u001b(Breplaces\u001b[1CAndrew\u001b[1CBellatti.\u001b[29;1H\u001b[29;60H\u001b(0x\u001b[30;1H\u001b[30;60Hx\u001b[1C\u001b[1m\u001b(B[BOTTOM 7]\u001b[m\u001b[31;1H\u001b[31;60H\u001b(0x\u001b[1C\u001b[37m\u001b(B[Flyout]\u001b[1C\u001b[mRhys\u001b[1CHoskins\u001b[1Cflies\u001b[1Cout\u001b[1Cto\u001b[1Cleft\u001b[1Cfielder\u001b[1CDavid\u001b[32;1H\u001b[32;60H\u001b(0x\u001b[1C\u001b(BPeralta.\u001b[1C\u001b[1m3 out\u001b[m\u001b[33;1H\u001b[33;60H\u001b(0x\u001b[1C\u001b[37m\u001b(B[Flyout]\u001b[1C\u001b[mKyle\u001b[1CSchwarber\u001b[1Cflies\u001b[1Cout\u001b[1Cto\u001b[1Cleft\u001b[1Cfielder\u001b[34;1H\u001b[34;60H\u001b(0x\u001b[1C\u001b(BDavid\u001b[1CPeralta.\u001b[1C\u001b[1m2 out\u001b[m\u001b[35;1H\u001b[35;60H\u001b(0x\u001b[1C\u001b[37m\u001b(B[Flyout]\u001b[1C\u001b[mBryson\u001b[1CStott\u001b[1C"]
|
|
65
|
-
[8.863918, "o", "flies\u001b[1Cout\u001b[1Cto\u001b[1Cleft\u001b[1Cfielder\u001b[1CDavid\u001b[36;1H\u001b[36;1H⠧\u001b8"]
|
|
66
|
-
[8.924124, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠇\u001b8"]
|
|
67
|
-
[8.9612, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠏\u001b8"]
|
|
68
|
-
[9.007753, "o", "\u001b7\u001b[36;1H\u001b[36;1H \u001b8"]
|
|
69
|
-
[12.88646, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠙\u001b8"]
|
|
70
|
-
[12.926627, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠹\u001b8"]
|
|
71
|
-
[12.963286, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠸\u001b8"]
|
|
72
|
-
[13.012915, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠼\u001b8"]
|
|
73
|
-
[13.067279, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠴\u001b8"]
|
|
74
|
-
[13.120957, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠦\u001b8"]
|
|
75
|
-
[13.166379, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠧\u001b8"]
|
|
76
|
-
[13.218225, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠇\u001b8"]
|
|
77
|
-
[13.26743, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠏\u001b8"]
|
|
78
|
-
[13.315387, "o", "\u001b7\u001b[36;1H\u001b[36;1H \u001b8"]
|
|
79
|
-
[15.120313, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠙\u001b8"]
|
|
80
|
-
[15.166934, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠹\u001b8"]
|
|
81
|
-
[15.219901, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠸\u001b8"]
|
|
82
|
-
[15.28849, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠼\u001b8"]
|
|
83
|
-
[15.319905, "o", "\u001b7\u001b[2;1H\u001b[2;12H\u001b[31m●\u001b[m\u001b[5;1H\u001b[5;37H8\u001b[8;1H\u001b[8;3HFou\u001b[3C83\u001b[1C8\u001b[5CChangeup \u001b[1C \u001b[22C2\u001b[9;1H\u001b[9;3HBall] 92.3 MPH Four-Seam Fastball \u001b[19C1\u001b[10;1H\u001b[10;2H[Swinging\u001b[1CStrike]\u001b[1C82.9\u001b[1CMPH\u001b[1CChangeup\u001b[19C0-1\u001b[36;1H\u001b[36;1H⠴\u001b8"]
|
|
84
|
-
[15.366276, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠦\u001b8"]
|
|
85
|
-
[15.410643, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠧\u001b8"]
|
|
86
|
-
[15.468101, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠇\u001b8"]
|
|
87
|
-
[15.52299, "o", "\u001b7\u001b[36;1H\u001b[36;1H⠏\u001b8"]
|
|
88
|
-
[15.568221, "o", "\u001b7\u001b[36;1H\u001b[36;1H \u001b8"]
|
|
89
|
-
[19.074182, "o", "\u001b[?1l\u001b>"]
|
|
90
|
-
[19.074493, "o", "\u001b[?12l\u001b[?25h"]
|
|
91
|
-
[19.078092, "o", "\u001b[H\u001b[2J"]
|
|
92
|
-
[19.078282, "o", "\u001b[?1002l\u001b[?1003l\u001b[?1006l"]
|
|
93
|
-
[19.078387, "o", "\u001b[?1049l"]
|
|
94
|
-
[19.093955, "o", "$ "]
|
|
95
|
-
[19.677325, "o", "exit\r\n"]
|
package/demo.gif
DELETED
|
Binary file
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSelector } from 'react-redux';
|
|
3
|
-
import { selectAllPlays, selectTeams } from '../features/games';
|
|
4
|
-
|
|
5
|
-
import style from '../style';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function getPlayResultColor(play) {
|
|
9
|
-
const lastPlay = play.playEvents[play.playEvents.length - 1]?.details;
|
|
10
|
-
if (!lastPlay) {
|
|
11
|
-
return 'white';
|
|
12
|
-
} else if (lastPlay.isBall) {
|
|
13
|
-
return 'green';
|
|
14
|
-
} else if (lastPlay.isStrike) {
|
|
15
|
-
return 'red';
|
|
16
|
-
} else if (lastPlay.isInPlay && !play.about.hasOut) {
|
|
17
|
-
return 'blue';
|
|
18
|
-
} else {
|
|
19
|
-
return 'white';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function formatOut(out) {
|
|
24
|
-
return ` {bold}${out} out{/bold}`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function AllPlays() {
|
|
29
|
-
const plays = useSelector(selectAllPlays);
|
|
30
|
-
const teams = useSelector(selectTeams);
|
|
31
|
-
|
|
32
|
-
const formatScoreDetail = (scoreObj) => (
|
|
33
|
-
' {bold}{white-bg}{black-fg} ' +
|
|
34
|
-
`${teams.away.abbreviation} ${scoreObj.awayScore} - ` +
|
|
35
|
-
`${teams.home.abbreviation} ${scoreObj.homeScore}` +
|
|
36
|
-
' {/black-fg}{/white-bg}{/bold}'
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
let inning = '';
|
|
40
|
-
const lines = [];
|
|
41
|
-
plays && plays.slice().reverse().forEach((play, playIdx, plays) => {
|
|
42
|
-
let lastPlay;
|
|
43
|
-
if (playIdx < plays.length - 1) {
|
|
44
|
-
lastPlay = plays[playIdx + 1];
|
|
45
|
-
}
|
|
46
|
-
const playInning = play.about.halfInning + ' ' + play.about.inning;
|
|
47
|
-
if (playInning !== inning) {
|
|
48
|
-
inning = playInning;
|
|
49
|
-
if (lines.length > 0) {
|
|
50
|
-
lines.push('');
|
|
51
|
-
}
|
|
52
|
-
lines.push(`{bold}[${inning.toUpperCase()}]{/bold}`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (play.about.isComplete) {
|
|
56
|
-
const color = getPlayResultColor(play);
|
|
57
|
-
let line = `{${color}-fg}[${play.result.event}]{/${color}-fg} ${play.result.description}`;
|
|
58
|
-
if (play.about.hasOut) {
|
|
59
|
-
const lastOut = play.playEvents[play.playEvents.length - 1].count.outs;
|
|
60
|
-
if (lastOut !== play.count.outs) {
|
|
61
|
-
line += formatOut(play.count.outs);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (play.about.isScoringPlay) {
|
|
65
|
-
line += formatScoreDetail(play.result);
|
|
66
|
-
}
|
|
67
|
-
lines.push(line);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
play.playEvents && play.playEvents.slice().reverse().forEach((event, eventIdx, events) => {
|
|
71
|
-
if (event.type === 'action') {
|
|
72
|
-
let line = '';
|
|
73
|
-
if (event.details.event) {
|
|
74
|
-
line += `[${event.details.event}] `;
|
|
75
|
-
}
|
|
76
|
-
line += event.details.description;
|
|
77
|
-
if (event.isScoringPlay || event.details.isScoringPlay) {
|
|
78
|
-
line += formatScoreDetail(event.details);
|
|
79
|
-
}
|
|
80
|
-
const currentOut = event.count?.outs;
|
|
81
|
-
let prevOut = lastPlay ? lastPlay.count.outs : 0;
|
|
82
|
-
if (eventIdx < events.length - 1) {
|
|
83
|
-
prevOut = events[eventIdx + 1].count?.outs;
|
|
84
|
-
}
|
|
85
|
-
if (currentOut > prevOut) {
|
|
86
|
-
line += formatOut(currentOut);
|
|
87
|
-
}
|
|
88
|
-
lines.push(line);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
return (
|
|
93
|
-
<box
|
|
94
|
-
content={lines.join('\n')}
|
|
95
|
-
focused
|
|
96
|
-
mouse
|
|
97
|
-
keys
|
|
98
|
-
vi
|
|
99
|
-
scrollable
|
|
100
|
-
scrollbar={style.scrollbar}
|
|
101
|
-
alwaysScroll
|
|
102
|
-
tags
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export default AllPlays;
|
package/src/components/App.jsx
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useDispatch } from 'react-redux';
|
|
3
|
-
import GameList from './GameList';
|
|
4
|
-
import HelpBar from './HelpBar';
|
|
5
|
-
import { setSelectedId } from '../features/games';
|
|
6
|
-
import Game from './Game';
|
|
7
|
-
import useKey from '../hooks/useKey';
|
|
8
|
-
import Standings from './Standings';
|
|
9
|
-
|
|
10
|
-
const SCHEDULE = 'schedule';
|
|
11
|
-
const STANDINGS = 'standings';
|
|
12
|
-
const GAME = 'game';
|
|
13
|
-
|
|
14
|
-
function App() {
|
|
15
|
-
const [view, setView] = useState(SCHEDULE);
|
|
16
|
-
const dispatch = useDispatch();
|
|
17
|
-
|
|
18
|
-
useKey('c', () => {
|
|
19
|
-
setView(SCHEDULE);
|
|
20
|
-
dispatch(setSelectedId(null));
|
|
21
|
-
}, { key: 'C', label: 'Schedule' });
|
|
22
|
-
useKey('s', () => setView(STANDINGS), { key: 'S', label: 'Standings'});
|
|
23
|
-
|
|
24
|
-
const handleGameSelect = (game) => {
|
|
25
|
-
dispatch(setSelectedId(game.gamePk));
|
|
26
|
-
setView(GAME);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<element>
|
|
31
|
-
<element top={0} left={0} height='100%-1'>
|
|
32
|
-
{view === STANDINGS && <Standings />}
|
|
33
|
-
{view === SCHEDULE && <GameList onGameSelect={handleGameSelect} />}
|
|
34
|
-
{view === GAME && <Game />}
|
|
35
|
-
</element>
|
|
36
|
-
<element top='100%-1' left={0} height={1}>
|
|
37
|
-
<HelpBar />
|
|
38
|
-
</element>
|
|
39
|
-
</element>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default App;
|
package/src/components/AtBat.jsx
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSelector } from 'react-redux';
|
|
3
|
-
import { selectCurrentPlay } from '../features/games';
|
|
4
|
-
|
|
5
|
-
function AtBat() {
|
|
6
|
-
const currentPlay = useSelector(selectCurrentPlay);
|
|
7
|
-
const playEvents = currentPlay.playEvents;
|
|
8
|
-
const playResult = currentPlay.about.isComplete ? currentPlay.result.description : '';
|
|
9
|
-
let content = '';
|
|
10
|
-
if (playResult) {
|
|
11
|
-
content += `${playResult}\n\n`;
|
|
12
|
-
}
|
|
13
|
-
if (playEvents && playEvents.length) {
|
|
14
|
-
content += playEvents.slice().reverse().map(event => {
|
|
15
|
-
let line = '';
|
|
16
|
-
if (event.isPitch) {
|
|
17
|
-
line = `[${event.details.description}] `;
|
|
18
|
-
if (event.pitchData?.startSpeed) {
|
|
19
|
-
line += `${event.pitchData.startSpeed} MPH `;
|
|
20
|
-
}
|
|
21
|
-
if (event.details?.type?.description) {
|
|
22
|
-
line += event.details.type.description;
|
|
23
|
-
}
|
|
24
|
-
if (!event.details?.isInPlay) {
|
|
25
|
-
line += `{|} ${event.count.balls}-${event.count.strikes}`;
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
if (event.details?.event) {
|
|
29
|
-
line += `[${event.details.event}] `;
|
|
30
|
-
}
|
|
31
|
-
line += event.details.description;
|
|
32
|
-
}
|
|
33
|
-
return line;
|
|
34
|
-
}).join('\n');
|
|
35
|
-
}
|
|
36
|
-
return (
|
|
37
|
-
<box content={content} tags />
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default AtBat;
|
package/src/components/Bases.jsx
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSelector } from 'react-redux';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { selectLineScore } from '../features/games';
|
|
5
|
-
|
|
6
|
-
const formatBase = (offense, base) => (base in offense) ? '{yellow-fg}◆{/yellow-fg}' : '◇';
|
|
7
|
-
|
|
8
|
-
function Bases({align}) {
|
|
9
|
-
const { offense } = useSelector(selectLineScore);
|
|
10
|
-
const content =
|
|
11
|
-
` ${formatBase(offense, 'second')}\n` +
|
|
12
|
-
`${formatBase(offense, 'third')} ${formatBase(offense, 'first')}`;
|
|
13
|
-
return (
|
|
14
|
-
<box align={align} content={content} tags />
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
Bases.propTypes = {
|
|
19
|
-
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default Bases;
|
package/src/components/Count.jsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSelector } from 'react-redux';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import { selectLineScore } from '../features/games';
|
|
6
|
-
|
|
7
|
-
const formatCount = (count, total) => '● '.repeat(count) + '○ '.repeat(total - count);
|
|
8
|
-
|
|
9
|
-
function Count({align}) {
|
|
10
|
-
const linescore = useSelector(selectLineScore);
|
|
11
|
-
const content =
|
|
12
|
-
`B: {green-fg}${formatCount(linescore.balls, 4)}{/green-fg}\n` +
|
|
13
|
-
`S: {red-fg}${formatCount(linescore.strikes, 3)}{/red-fg}\n` +
|
|
14
|
-
`O: {red-fg}${formatCount(linescore.outs, 3)}{/red-fg}`;
|
|
15
|
-
return (
|
|
16
|
-
<box align={align} content={content} tags />
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
Count.propTypes = {
|
|
21
|
-
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default Count;
|