Skip to content

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
k.golikov committed Jan 3, 2023
1 parent 04a7cf9 commit 35ce03b
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 33 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"package-win": "yarn package --platform=win32 --arch=x64; yarn package --platform=win32 --arch=ia32",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "eslint --ext .ts,.tsx --fix ."
Expand Down Expand Up @@ -39,6 +40,7 @@
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.0.0",
"electron": "22.0.0",
"electron-packager": "^17.1.1",
"eslint": "^8.0.1",
"eslint-plugin-import": "^2.25.0",
"file-loader": "^6.2.0",
Expand All @@ -50,12 +52,12 @@
"style-loader": "^3.0.0",
"ts-loader": "^9.2.2",
"ts-node": "^10.0.0",
"typescript": "~4.5.4"
"typescript": "~4.5.4",
"node-gyp": "^9.3.1"
},
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@electron/remote": "^2.0.9",
"@shopify/draggable": "^1.0.0-beta.12",
"antd": "^4.24.5",
"classnames": "^2.3.2",
"decompress": "^4.2.1",
Expand All @@ -66,12 +68,10 @@
"express": "^4.18.2",
"follow-redirects": "^1.15.2",
"font-list": "^1.4.5",
"immer": "^9.0.16",
"lodash": "^4.17.21",
"material-symbols": "^0.4.1",
"monaco-editor": "^0.34.1",
"monaco-editor-webpack-plugin": "^7.0.1",
"node-gyp": "^9.3.1",
"query-string": "^7.1.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions src/assets/loading-horiz.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/configuration/appearance/MainWindowAppearanceConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const defaultMainWindowAppearance: MainWindowAppearanceConfig = {
backgroundColor: '#000000',
backgroundOpacity: 80,
borderColor: '#C8C8C8',
borderOpacity: 0.15,
borderOpacity: 15,
borderThickness: 1,
borderRadius: 4,
windowDragMode: MainWindowDragMode.BACKGROUND,
Expand Down
9 changes: 5 additions & 4 deletions src/configuration/appearance/TextAppearanceConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ interface TextAppearanceConfig {
fontWeight: number;
isItalic: boolean;
isUnderlined: boolean;
lineHeight?: number;
lineHeight: number;
}

export default TextAppearanceConfig;

export const defaultOriginalTextAppearance: TextAppearanceConfig = {
textColor: undefined,
textOpacity: 92,
fontSize: 100,
fontSize: 85,
fontFamily: undefined,
fontWeight: 300,
isItalic: false,
isUnderlined: false,
lineHeight: undefined
lineHeight: 120
};

export const defaultTranslatedTextAppearance: TextAppearanceConfig = {
...defaultOriginalTextAppearance,
fontWeight: 500,
textOpacity: 100
textOpacity: 100,
fontSize: 100
};
3 changes: 2 additions & 1 deletion src/configuration/getProfileConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const getProfileConfig = (store: Store, profileId?: string): Configuration => {
const savedProfilesMap = indexArrayBy(savedProfiles.profiles, 'id');

const commonProfile = savedProfilesMap.get(COMMON_PROFILE_ID);
const activeProfile = savedProfilesMap.get(profileId ?? savedProfiles.activeProfileId);
const activeProfileId = profileId ?? savedProfiles.activeProfileId;
const activeProfile = activeProfileId ? savedProfilesMap.get(activeProfileId) : undefined;

return getConfiguration(commonProfile?.configSource, activeProfile?.configSource);
};
Expand Down
2 changes: 1 addition & 1 deletion src/translation/getTranslator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class IdentityTranslator implements Translator {

class NoneTranslator implements Translator {
translate(text: string, sourceLanguage: string, targetLanguage: string): Promise<string> {
return undefined;
return undefined as any;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/windows/main/logic/workTextractorServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const showSentence = (

const sentenceTranslatedElement = document.createElement('div');
sentenceTranslatedElement.classList.add('sentence-translated');
sentenceTranslatedElement.innerHTML = '<div class="loading-horiz"><img src="/assets/loading-horiz.svg" alt="Translating..."></div>';
sentenceTranslatedElement.innerHTML = '<div class="loading-horiz"><img src="../assets/loading-horiz.svg" alt="Translating..."></div>';

if (translatedTextPromise) {
translatedTextPromise
Expand Down
3 changes: 2 additions & 1 deletion src/windows/main/preload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ const initAppearanceSettingsHandling = () => {
readStoreStateLazy(electronStore, key, defaultConfig, (config) => {
styleElement.innerHTML = `
${styledSelector} {
color: ${config.textColor ? addColorAlpha(config.textColor, config.textOpacity / 100) : 'inherit'};
color: ${config.textColor || 'inherit'};
opacity: ${config.textOpacity == null ? 'inherit' : (config.textOpacity / 100)};
font-size: ${config.fontSize == null ? 'inherit' : config.fontSize + '%'};
font-family: ${config.fontFamily ? `"${config.fontFamily}"` : 'inherit'};
font-weight: ${config.fontWeight ?? 'inherit'};
Expand Down
2 changes: 1 addition & 1 deletion src/windows/settings/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const initTabs = (element: HTMLElement, initialTabs: ProfileTabs): TabsAp
}
if (tab.icon) {
const iconElement = document.createElement('div');
iconElement.classList.add('tab-icon', tab.icon.className);
iconElement.classList.add('tab-icon', tab.icon.className!);
iconElement.innerHTML = `<span class="material-symbols-rounded">${tab.icon.name}</span>`;
tabElement.append(iconElement);
}
Expand Down
2 changes: 1 addition & 1 deletion src/windows/settings/tabs/SettingsAbout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const SettingsAbout: FC = () => {
<span className="app-author-container">by <a href="https://github.com/MRGRD56/textractor-translator" target="_blank">MRGRD56</a></span>
</h1>

<img src="/assets/textractor-translator.png" alt="Textractor Translator" className="the-app-picture"/>
<img src="../assets/textractor-translator.png" alt="Textractor Translator" className="the-app-picture"/>
</Space>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,25 @@ const MainWindowAppearance: FC<Props> = ({appearance, onAppearanceChange}) => {
<Tooltip placement="bottom" title="Top indent">
<div className="flex-row-100-child flex-row-100">
<UpOutlined className="mwa__arrow-icon mwa__arrow-icon-vertical"/>
<InputNumber className="flex-row-100-child mwa__arrow-input" value={appearance.paddingTop} onChange={value => onAppearanceChange('paddingTop')(value ?? 0)} min={0} max={100}/>
<InputNumber className="flex-row-100-child mwa__arrow-input" value={appearance.paddingTop} onChange={value => onAppearanceChange('paddingTop')(value ?? 0)} min={0}/>
</div>
</Tooltip>
<Tooltip placement="bottom" title="Bottom indent">
<div className="flex-row-100-child flex-row-100">
<DownOutlined className="mwa__arrow-icon mwa__arrow-icon-vertical"/>
<InputNumber className="flex-row-100-child mwa__arrow-input" value={appearance.paddingBottom} onChange={value => onAppearanceChange('paddingBottom')(value ?? 0)} min={0} max={100}/>
<InputNumber className="flex-row-100-child mwa__arrow-input" value={appearance.paddingBottom} onChange={value => onAppearanceChange('paddingBottom')(value ?? 0)} min={0}/>
</div>
</Tooltip>
<Tooltip placement="bottom" title="Left indent">
<div className="flex-row-100-child flex-row-100">
<LeftOutlined className="mwa__arrow-icon mwa__arrow-icon-horizontal"/>
<InputNumber className="flex-row-100-child mwa__arrow-input" value={appearance.paddingLeft} onChange={value => onAppearanceChange('paddingLeft')(value ?? 0)} min={0} max={100}/>
<InputNumber className="flex-row-100-child mwa__arrow-input" value={appearance.paddingLeft} onChange={value => onAppearanceChange('paddingLeft')(value ?? 0)} min={0}/>
</div>
</Tooltip>
<Tooltip placement="bottom" title="Right indent">
<div className="flex-row-100-child flex-row-100">
<RightOutlined className="mwa__arrow-icon mwa__arrow-icon-horizontal"/>
<InputNumber className="flex-row-100-child mwa__arrow-input" value={appearance.paddingRight} onChange={value => onAppearanceChange('paddingRight')(value ?? 0)} min={0} max={100}/>
<InputNumber className="flex-row-100-child mwa__arrow-input" value={appearance.paddingRight} onChange={value => onAppearanceChange('paddingRight')(value ?? 0)} min={0}/>
</div>
</Tooltip>
</div>
Expand Down
12 changes: 1 addition & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,6 @@
node-addon-api "^4.0.0"
node-gyp "^8.1.0"

"@shopify/draggable@^1.0.0-beta.12":
version "1.0.0-beta.12"
resolved "https://registry.yarnpkg.com/@shopify/draggable/-/draggable-1.0.0-beta.12.tgz#483c7f691e8918868ec0c95eabcb83e244c2b49d"
integrity sha512-Un/Dn61sv2er9yjDXLGWMauCOWBb0BMbm0yzmmrD+oUX2/x50yhNJASTsCRdndUCpWlqYfZH8jEfaOgTPsKc/g==

"@sindresorhus/is@^4.0.0":
version "4.6.0"
resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz"
Expand Down Expand Up @@ -2382,7 +2377,7 @@ electron-installer-redhat@^3.2.0:

electron-packager@^17.1.1:
version "17.1.1"
resolved "https://registry.npmjs.org/electron-packager/-/electron-packager-17.1.1.tgz"
resolved "https://registry.yarnpkg.com/electron-packager/-/electron-packager-17.1.1.tgz#f156fc63d3a66f4e902e4b42992550a172982d59"
integrity sha512-r1NDtlajsq7gf2EXgjRfblCVPquvD2yeg+6XGErOKblvxOpDi0iulZLVhgYDP4AEF1P5/HgbX/vwjlkEv7PEIQ==
dependencies:
"@electron/asar" "^3.2.1"
Expand Down Expand Up @@ -3631,11 +3626,6 @@ ignore@^5.2.0:
resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz"
integrity sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==

immer@^9.0.16:
version "9.0.16"
resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.16.tgz#8e7caab80118c2b54b37ad43e05758cdefad0198"
integrity sha512-qenGE7CstVm1NrHQbMh8YaSzTZTFNP3zPqr3YU0S0UY441j4bJTg4A2Hh5KAhwgaiU6ZZ1Ar6y/2f4TblnMReQ==

immutable@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef"
Expand Down

0 comments on commit 35ce03b

Please sign in to comment.