Skip to content

Commit

Permalink
Merged PR 319: v1.33.1 - Support "emphasise", better vertical score l…
Browse files Browse the repository at this point in the history
…ayout (#315)

- Support "(emphasise)" as a reader directive
- Have a better layout for the vertical score view (better alignment)
- Update vite and vite settings
- Bump version to 1.33.1
  • Loading branch information
alopezlago authored Sep 30, 2024
1 parent 8b3e9fa commit 8160b17
Show file tree
Hide file tree
Showing 5 changed files with 762 additions and 586 deletions.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "modaq",
"version": "1.33.0",
"version": "1.33.1",
"description": "Quiz Bowl Reader using TypeScript, React, and MobX",
"repository": {
"type": "git",
Expand All @@ -19,7 +19,7 @@
"*"
],
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/core": "^7.25.2",
"@types/chai": "^4.2.15",
"@types/google.accounts": "^0.0.2",
"@types/gapi.client.sheets": "^4.0.20201030",
Expand All @@ -30,7 +30,7 @@
"@types/react-dom": "^17.0.2",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"@vitejs/plugin-react": "^1.3.2",
"@vitejs/plugin-react": "^4.3.2",
"chai": "^4.3.0",
"copyfiles": "^2.4.1",
"eslint": "^8.20.0",
Expand All @@ -43,7 +43,8 @@
"tsconfig-paths": "^3.9.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.3",
"vite": "^3.2.11"
"vite": "^5.4.8",
"vite-plugin-mkcert": "^1.17.6"
},
"dependencies": {
"@fluentui/react": "^8.64.2",
Expand All @@ -65,8 +66,8 @@
"lintFix": "eslint . --fix --ext .ts,.tsx",
"prepublish": "copyfiles package.json README.md LICENSE out",
"test": "mocha --recursive tests/**/*.ts --exit --check-leaks -r tests/TestInit.js -r ts-node/register -r tsconfig-paths/register",
"dev": "vite --https",
"dev": "vite",
"buildDemo": "tsc && vite build --mode production",
"serve": "vite preview --https"
"serve": "vite preview"
}
}
25 changes: 18 additions & 7 deletions src/components/Scoreboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const labelStyles: ILabelStyles = {
},
};

const scoreCellStyle: React.CSSProperties = {
paddingLeft: 5,
};

export const Scoreboard = observer(function Scoreboard() {
const appState: AppState = React.useContext(StateContext);
const classes: IScoreboardStyle = getClassNames();
Expand All @@ -20,13 +24,20 @@ export const Scoreboard = observer(function Scoreboard() {
let label: JSX.Element | undefined;
if (appState.uiState.isScoreVertical) {
label = (
<div>
{teamNames.map((teamName, index) => (
<Label styles={labelStyles} key={teamName}>
{teamName}: {scores[index]}
</Label>
))}
</div>
<table>
<tbody>
{teamNames.map((teamName, index) => (
<tr key={teamName}>
<td>
<Label styles={labelStyles}>{teamName}</Label>
</td>
<td style={scoreCellStyle}>
<Label styles={labelStyles}>{scores[index]}</Label>
</td>
</tr>
))}
</tbody>
</table>
);
} else {
label = (
Expand Down
2 changes: 2 additions & 0 deletions src/parser/FormattedTextParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ export const defaultPronunciationGuideMarkers: [string, string] = ["(", ")"];
*/
export const defaultReaderDirectives: string[] = [
"(emphasize)",
"(emphasise)",
"(pause)",
"(read slowly)",
"[emphasize]",
"[emphasise]",
"[pause]",
"[read slowly]",
];
Expand Down
16 changes: 14 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig, splitVendorChunkPlugin } from "vite";
import mkcert from "vite-plugin-mkcert";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
Expand All @@ -9,9 +10,20 @@ export default defineConfig(({ mode }) => {
return {
build: {
assetsDir: "out",
sourcemap: true,
sourcemap: true,
rollupOptions: {
output: {
manualChunks(id: string): string | void {
if (id.includes("react") || id.includes("mobx") || id === "he") {
return "vendor";
}

return;
},
},
},
},
plugins: [react(), splitVendorChunkPlugin()],
plugins: [react(), mkcert(), splitVendorChunkPlugin()],
define: {
__BUILD_VERSION__: JSON.stringify(`${mode.startsWith("production") ? "" : "dev_"}${version}`),
},
Expand Down
Loading

0 comments on commit 8160b17

Please sign in to comment.