Skip to content

Commit 4f83611

Browse files
authored
Merge branch 'master' into patch-1
2 parents db5ea94 + 5093dbe commit 4f83611

File tree

20 files changed

+744
-302
lines changed

20 files changed

+744
-302
lines changed

backend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
"@vitest/coverage-v8": "4.0.15",
8181
"concurrently": "8.2.2",
8282
"openapi3-ts": "2.0.2",
83-
"oxlint": "1.33.0",
84-
"oxlint-tsgolint": "0.9.0",
83+
"oxlint": "1.34.0",
84+
"oxlint-tsgolint": "0.9.2",
8585
"readline-sync": "1.4.10",
8686
"supertest": "7.1.4",
8787
"testcontainers": "11.10.0",

frontend/package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@
2121
"tsc": "tsc",
2222
"docker": "docker compose -f docker/compose.dev.yml up"
2323
},
24-
"lint-staged": {
25-
"*": [
26-
"oxfmt --no-error-on-unmatched-pattern"
27-
],
28-
"*.{ts,js}": [
29-
"oxlint --type-aware --type-check"
30-
]
31-
},
3224
"dependencies": {
3325
"@date-fns/utc": "1.2.0",
3426
"@monkeytype/contracts": "workspace:*",
@@ -89,8 +81,8 @@
8981
"madge": "8.0.0",
9082
"magic-string": "0.30.17",
9183
"normalize.css": "8.0.1",
92-
"oxlint": "1.33.0",
93-
"oxlint-tsgolint": "0.9.0",
84+
"oxlint": "1.34.0",
85+
"oxlint-tsgolint": "0.9.2",
9486
"postcss": "8.4.31",
9587
"sass": "1.70.0",
9688
"subset-font": "2.3.0",
@@ -99,14 +91,21 @@
9991
"unplugin-inject-preload": "3.0.0",
10092
"vite": "7.1.12",
10193
"vite-bundle-visualizer": "1.2.1",
102-
"vite-plugin-checker": "0.11.0",
10394
"vite-plugin-filter-replace": "0.1.14",
10495
"vite-plugin-html-inject": "1.1.2",
10596
"vite-plugin-inspect": "11.3.3",
10697
"vite-plugin-minify": "2.1.0",
10798
"vite-plugin-pwa": "1.1.0",
10899
"vitest": "4.0.15"
109100
},
101+
"lint-staged": {
102+
"*": [
103+
"oxfmt --no-error-on-unmatched-pattern"
104+
],
105+
"*.{ts,js}": [
106+
"oxlint --type-aware --type-check"
107+
]
108+
},
110109
"browserslist": [
111110
"defaults",
112111
"not op_mini all",

frontend/src/html/pages/settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
<div class="buttons">
193193
<button data-config-value="false">off</button>
194194
<button data-config-value="true">
195-
195+
&ensp;
196196
<!-- On is missing on purpose. -->
197197
</button>
198198
</div>

frontend/src/ts/elements/input-validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from "@monkeytype/schemas/configs";
99
import Config, { setConfig } from "../config";
1010
import * as Notifications from "../elements/notifications";
11-
import { ElementWithUtils } from "../utils/dom";
11+
import { DomUtilsEvent, ElementWithUtils } from "../utils/dom";
1212

1313
export type ValidationResult = {
1414
status: "checking" | "success" | "failed" | "warning";
@@ -60,7 +60,7 @@ export function createInputEventHandler<T>(
6060
callback: (result: ValidationResult) => void,
6161
validation: Validation<T>,
6262
inputValueConvert?: (val: string) => T,
63-
): (e: Event) => Promise<void> {
63+
): (e: DomUtilsEvent) => Promise<void> {
6464
let callIsValid =
6565
validation.isValid !== undefined
6666
? debounceIfNeeded(

frontend/src/ts/modals/edit-preset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function show(action: string, id?: string, name?: string): void {
4848
$("#editPresetModal .modal .text").addClass("hidden");
4949
addCheckBoxes();
5050
presetNameEl ??= new ValidatedHtmlInputElement(
51-
qsr("#editPresetModal .modal input"),
51+
qsr("#editPresetModal .modal input[type=text]"),
5252
{
5353
schema: PresetNameSchema,
5454
},

frontend/src/ts/modals/simple-modals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ list.devGenerateData = new SimpleModal({
12121212
const span = document.querySelector(
12131213
"#devGenerateData_1 + span",
12141214
) as HTMLInputElement;
1215-
span.innerHTML = `if checked, user will be created with ${target.value}@example.com and password: password`;
1215+
span.innerText = `if checked, user will be created with ${target.value}@example.com and password: password`;
12161216
return;
12171217
},
12181218
validation: {

frontend/src/ts/test/british-english.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,33 @@ const replacementRules: BritishEnglishReplacements = {
652652
moisturizing: "moisturising",
653653
favoring: "favouring",
654654
marvelous: "marvellous",
655+
hematuria: "haematuria",
656+
hemoptysis: "haemoptysis",
657+
hemorrhoid: "haemorrhoid",
658+
hemorrhagic: "haemorrhagic",
659+
hypercalcemia: "hypercalcaemia",
660+
hyperglycemia: "hyperglycaemia",
661+
hypoglycemia: "hypoglycaemia",
662+
toxemia: "toxaemia",
663+
hypoxemia: "hypoxaemia",
664+
bacteremia: "bacteraemia",
665+
hypernatremia: "hypernatraemia",
666+
hyponatremia: "hyponatraemia",
667+
leukocytosis: "leucocytosis",
668+
leukocyte: "leucocyte",
669+
leukopenia: "leucopenia",
670+
apnea: "apnoea",
671+
bradypnea: "bradypnoea",
672+
tachypnea: "tachypnoea",
673+
orthopnea: "orthopnoea",
674+
ileocecal: "ileocaecal",
675+
metastasize: "metastasise",
676+
lymphedema: "lymphoedema",
677+
neuron: "neurone",
678+
hemianopsia: "hemianopia",
679+
galactorrhea: "galactorrhoea",
680+
nebulizer: "nebuliser",
681+
paresthesia: "paraesthesia",
655682
};
656683

657684
export async function replace(

frontend/src/ts/utils/caret.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export class Caret {
300300
if (options.letterIndex >= letters.length) {
301301
side = "afterLetter";
302302

303-
if (Config.blindMode) {
303+
if (Config.blindMode || Config.hideExtraLetters) {
304304
options.letterIndex = wordText?.length - 1;
305305
} else {
306306
options.letterIndex = letters.length - 1;

frontend/src/ts/utils/dom.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ type ElementWithValue =
105105
| HTMLTextAreaElement
106106
| HTMLSelectElement;
107107

108+
export type DomUtilsEvent<T extends Event = Event> = Omit<T, "currentTarget">;
109+
110+
type DomUtilsEventListenerOrEventListenerObject =
111+
| { (evt: DomUtilsEvent): void }
112+
| { handleEvent(object: DomUtilsEvent): void };
113+
108114
export class ElementWithUtils<T extends HTMLElement = HTMLElement> {
109115
/**
110116
* The native dom element
@@ -238,19 +244,19 @@ export class ElementWithUtils<T extends HTMLElement = HTMLElement> {
238244
*/
239245
on<K extends keyof HTMLElementEventMap>(
240246
event: K,
241-
handler: (this: T, ev: HTMLElementEventMap[K]) => void,
247+
handler: (this: T, ev: DomUtilsEvent<HTMLElementEventMap[K]>) => void,
242248
): this;
243-
on(event: string, handler: EventListenerOrEventListenerObject): this;
249+
on(event: string, handler: DomUtilsEventListenerOrEventListenerObject): this;
244250
on(
245251
event: keyof HTMLElementEventMap | string,
246252
handler:
247-
| EventListenerOrEventListenerObject
248-
| ((this: T, ev: Event) => void),
253+
| DomUtilsEventListenerOrEventListenerObject
254+
| ((this: T, ev: DomUtilsEvent) => void),
249255
): this {
250256
// this type was some AI magic but if it works it works
251257
this.native.addEventListener(
252258
event,
253-
handler as EventListenerOrEventListenerObject,
259+
handler as DomUtilsEventListenerOrEventListenerObject,
254260
);
255261
return this;
256262
}
@@ -262,19 +268,22 @@ export class ElementWithUtils<T extends HTMLElement = HTMLElement> {
262268
onChild<K extends keyof HTMLElementEventMap>(
263269
event: K,
264270
query: string,
265-
handler: (this: HTMLElement, ev: HTMLElementEventMap[K]) => void,
271+
handler: (
272+
this: HTMLElement,
273+
ev: DomUtilsEvent<HTMLElementEventMap[K]>,
274+
) => void,
266275
): this;
267276
onChild(
268277
event: string,
269278
query: string,
270-
handler: EventListenerOrEventListenerObject,
279+
handler: DomUtilsEventListenerOrEventListenerObject,
271280
): this;
272281
onChild(
273282
event: keyof HTMLElementEventMap | string,
274283
query: string,
275284
handler:
276-
| EventListenerOrEventListenerObject
277-
| ((this: HTMLElement, ev: Event) => void),
285+
| DomUtilsEventListenerOrEventListenerObject
286+
| ((this: HTMLElement, ev: DomUtilsEvent) => void),
278287
): this {
279288
// this type was some AI magic but if it works it works
280289
this.native.addEventListener(event, (e) => {
@@ -671,14 +680,14 @@ export class ElementsWithUtils<
671680
*/
672681
on<K extends keyof HTMLElementEventMap>(
673682
event: K,
674-
handler: (this: T, ev: HTMLElementEventMap[K]) => void,
683+
handler: (this: T, ev: DomUtilsEvent<HTMLElementEventMap[K]>) => void,
675684
): this;
676-
on(event: string, handler: EventListenerOrEventListenerObject): this;
685+
on(event: string, handler: DomUtilsEventListenerOrEventListenerObject): this;
677686
on(
678687
event: keyof HTMLElementEventMap | string,
679688
handler:
680-
| EventListenerOrEventListenerObject
681-
| ((this: T, ev: Event) => void),
689+
| DomUtilsEventListenerOrEventListenerObject
690+
| ((this: T, ev: DomUtilsEvent) => void),
682691
): this {
683692
for (const item of this) {
684693
item.on(event, handler);

0 commit comments

Comments
 (0)