Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import type { Config } from "jest";
const config: Config = {
testMatch: ["**/tests/*test*"],
testEnvironment: "jsdom",
extensionsToTreatAsEsm: [".ts"],
transform: {
"^.+\\.tsx?$": "ts-jest",
"^.+\\.tsx?$": ["ts-jest", { useESM: true }],
},
};

Expand Down
2,706 changes: 1,185 additions & 1,521 deletions package-lock.json

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fluenttyper",
"version": "2025.7.5",
"version": "2026.0.0",
"description": "Type less, do more. Get smart autocomplete, spell check, and text expansion to boost your productivity on any website.",
"type": "module",
"scripts": {
Expand All @@ -26,35 +26,35 @@
},
"homepage": "https://github.com/bartekplus/FluentTyper#readme",
"devDependencies": {
"@eslint/js": "^9.30.0",
"@types/chrome": "^0.0.328",
"@types/dom-navigation": "^1.0.5",
"@eslint/js": "^9.0.0",
"@types/chrome": "^0.1.36",
"@types/dom-navigation": "^1.0.6",
"@types/jest": "^30.0.0",
"@types/luxon": "^3.6.2",
"copy-webpack-plugin": "^13.0.0",
"eslint": "^9.30.0",
"glob": "^11.0.3",
"globals": "^16.2.0",
"jest": "^30.0.3",
"jest-environment-jsdom": "^30.0.2",
"@types/luxon": "^3.7.1",
"copy-webpack-plugin": "^13.0.1",
"eslint": "^9.0.0",
"glob": "^13.0.1",
"globals": "^17.3.0",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"jest-puppeteer": "^11.0.0",
"npm-check-updates": "latest",
"prettier": "^3.6.2",
"puppeteer": "^24.11.1",
"rimraf": "^6.0.1",
"terser-webpack-plugin": "^5.3.14",
"ts-jest": "^29.4.0",
"ts-loader": "^9.5.2",
"typescript": "^5.8.3",
"typescript-eslint": "^8.35.1",
"webpack": "^5.99.9",
"prettier": "^3.8.1",
"puppeteer": "^24.37.2",
"rimraf": "^6.1.2",
"terser-webpack-plugin": "^5.3.16",
"ts-jest": "^29.4.6",
"ts-loader": "^9.5.4",
"typescript": "^5.9.3",
"typescript-eslint": "^8.54.0",
"webpack": "^5.105.0",
"webpack-cli": "^6.0.1",
"webpack-merge": "^6.0.1"
},
"dependencies": {
"buffer": "^6.0.3",
"csv-parse": "^5.6.0",
"csv-stringify": "^6.5.2",
"luxon": "^3.6.1"
"csv-parse": "^6.1.0",
"csv-stringify": "^6.6.0",
"luxon": "^3.7.2"
}
}
2 changes: 1 addition & 1 deletion platform/chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"activeTab"
],
"update_url": "https://clients2.google.com/service/update2/crx",
"version": "2025.7.5",
"version": "2026.0.0",
"manifest_version": 3,
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
Expand Down
2 changes: 1 addition & 1 deletion platform/edge/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"storage",
"activeTab"
],
"version": "2025.7.5",
"version": "2026.0.0",
"manifest_version": 3,
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
Expand Down
2 changes: 1 addition & 1 deletion platform/firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"tabs",
"<all_urls>"
],
"version": "2025.7.5",
"version": "2026.0.0",
"manifest_version": 2,
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"commands": {
Expand Down
9 changes: 8 additions & 1 deletion public/new_installation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,14 @@ <h2 class="title is-2 has-text-centered mb-5">See It in Action</h2>
class="has-ratio"
src="https://www.youtube.com/embed/96B54kSd0mU"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allow="
accelerometer;
autoplay;
clipboard-write;
encrypted-media;
gyroscope;
picture-in-picture;
"
allowfullscreen
></iframe>
</figure>
Expand Down
11 changes: 8 additions & 3 deletions public/third_party/tribute/tribute.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
--tribute-highlight-text-dark: #ffffff;
--tribute-border-color-dark: #4a5568;
--tribute-shadow-color-dark: rgba(0, 0, 0, 0.4);

/* --- Typography Variables --- */
--tribute-font-size: 0.9rem;
--tribute-padding-vertical: 0.6rem;
--tribute-padding-horizontal: 0.8rem;
}

.tribute-container {
Expand Down Expand Up @@ -59,8 +64,8 @@

/* --- General List Item Styling --- */
.tribute-container li {
padding: 0.6rem 0.8rem !important; /* Increased padding */
font-size: 0.9rem !important;
padding: var(--tribute-padding-vertical) var(--tribute-padding-horizontal) !important;
font-size: var(--tribute-font-size) !important;
cursor: pointer !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
Expand All @@ -71,7 +76,7 @@
/* --- List Header --- */
.tribute-container lh {
display: block !important;
padding: 0.6rem 0.8rem !important;
padding: var(--tribute-padding-vertical) var(--tribute-padding-horizontal) !important;
background-color: var(--tribute-header-bg-light) !important;
color: var(--tribute-header-text-light) !important;
font-size: 0.75rem !important;
Expand Down
50 changes: 34 additions & 16 deletions src/background/LanguageDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {
SUPPORTED_LANGUAGES,
SUPPORTED_LANGUAGES_SHORT_CODE,
resolveEnabledPredictionLanguages,
} from "../shared/lang";
import { SettingsManager } from "../shared/settingsManager";

Expand All @@ -11,42 +12,59 @@ export class LanguageDetector {
this.settings = settings;
}

async detectLanguage(text: string, tabId: number): Promise<string> {
const fallbackLanguage = (await this.settings.get(
async detectLanguage(
text: string,
tabId: number,
enabledLanguages?: string[],
): Promise<string> {
const fallbackLanguageRaw = (await this.settings.get(
"fallbackLanguage",
)) as string;
const allowedLanguages =
resolveEnabledPredictionLanguages(enabledLanguages);
const fallbackLanguage =
fallbackLanguageRaw && fallbackLanguageRaw !== "auto_detect"
? fallbackLanguageRaw
: allowedLanguages[0];
const allowedSet = new Set(allowedLanguages);
const globalAny = globalThis as { browser?: typeof chrome };
const api =
typeof (globalThis as any).browser === "undefined"
? chrome
: (globalThis as any).browser;
typeof globalAny.browser === "undefined" ? chrome : globalAny.browser;
const result = await api.i18n.detectLanguage(text);
let detectedLanguage: string | null = null;
let maxPercentage = -1;
for (const language of result.languages) {
let resolvedLanguage: string | null = null;
if (language.language in SUPPORTED_LANGUAGES) {
resolvedLanguage = language.language;
} else if (language.language in SUPPORTED_LANGUAGES_SHORT_CODE) {
resolvedLanguage = SUPPORTED_LANGUAGES_SHORT_CODE[language.language];
}
if (
language.language in SUPPORTED_LANGUAGES &&
resolvedLanguage &&
allowedSet.has(resolvedLanguage) &&
language.percentage > maxPercentage
) {
detectedLanguage = language.language;
maxPercentage = language.percentage;
} else if (
language.language in SUPPORTED_LANGUAGES_SHORT_CODE &&
language.percentage > maxPercentage
) {
detectedLanguage = SUPPORTED_LANGUAGES_SHORT_CODE[language.language];
detectedLanguage = resolvedLanguage;
maxPercentage = language.percentage;
}
}
if (detectedLanguage) {
return detectedLanguage;
}
const pageLang = await api.tabs.detectLanguage(tabId);
if (pageLang in SUPPORTED_LANGUAGES) {
if (pageLang in SUPPORTED_LANGUAGES && allowedSet.has(pageLang)) {
return pageLang;
}
if (pageLang in SUPPORTED_LANGUAGES_SHORT_CODE) {
if (
pageLang in SUPPORTED_LANGUAGES_SHORT_CODE &&
allowedSet.has(SUPPORTED_LANGUAGES_SHORT_CODE[pageLang])
) {
return SUPPORTED_LANGUAGES_SHORT_CODE[pageLang];
}
return fallbackLanguage;
if (allowedSet.has(fallbackLanguage)) {
return fallbackLanguage;
}
return allowedLanguages[0];
}
}
2 changes: 1 addition & 1 deletion src/background/Migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function migrateToLocalStore(lastVersion?: string): Promise<void> {
}) <= 0;

if (migrateStore) {
chrome.storage.sync.get(null, (result: { [key: string]: any }) => {
chrome.storage.sync.get(null, (result: { [key: string]: unknown }) => {
chrome.storage.local.set(result);
chrome.storage.local.set({ lastVersion: currentVersion });
});
Expand Down
Loading