exclude openssl and i18n from npm run format; + npm run format (#183)

This commit is contained in:
Aleksandr Iushmanov
2025-04-27 14:43:16 +01:00
committed by GitHub
parent b841469505
commit ccfb09e261
12 changed files with 31 additions and 30 deletions

View File

@@ -173,7 +173,6 @@
</footer>
<style lang="scss">
.sync-box {
display: flex;
align-items: center;

View File

@@ -165,7 +165,6 @@
}
}
.timeline {
flex-grow: 1;
}

View File

@@ -45,7 +45,6 @@
padding-inline: 16px;
}
.icon {
cursor: pointer;

View File

@@ -131,7 +131,7 @@
codes: Map<number, KeyInfo>,
): Promise<FlexSearch.Index> {
if (chords.length === 0 || !browser) return index;
index = new FlexSearch.Index({
tokenize: "full",
encode(phrase: string) {
@@ -149,36 +149,36 @@
});
},
});
let abort = false;
abortIndexing = () => {
abort = true;
};
const batchSize = 200;
const batches = Math.ceil(chords.length / batchSize);
for (let b = 0; b < batches; b++) {
if (abort) return index;
const start = b * batchSize;
const end = Math.min((b + 1) * batchSize, chords.length);
const batch = chords.slice(start, end);
const promises = batch.map((chord, i) => {
const chordIndex = start + i;
progress = chordIndex + 1;
if ("phrase" in chord) {
const encodedChord = encodeChord(chord, osLayout, codes);
return index.addAsync(chordIndex, encodedChord);
}
return Promise.resolve();
});
await Promise.all(promises);
}
return index;
}

View File

@@ -114,7 +114,6 @@
font-size: 24px;
}
section {
display: flex;
flex-direction: column;

View File

@@ -10,7 +10,10 @@ export const SENTENCE_TRAINER_PAGE_PARAMS: {
showDevTools: PageParam<boolean>;
textAreaDebounceInMillis: PageParam<number>;
} = {
sentence: { key: "sentence", default: "This text has been typed at the speed of thought" },
sentence: {
key: "sentence",
default: "This text has been typed at the speed of thought",
},
wpm: {
key: "wpm",
default: 250,