Skip to content

Commit d73017b

Browse files
committed
Merge branch 'master' into feat/fix_table_text
2 parents 6ab5968 + da83f1f commit d73017b

File tree

123 files changed

+11796
-15714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+11796
-15714
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
BASE_URL: /${{ steps.pr_number.outputs.pr }}/
107107
run: |
108108
npm run generateDictionary
109-
npx webpack
109+
npx webpack --config webpack.config.prod.js
110110
111111
- name: Deploy
112112
uses: peaceiris/actions-gh-pages@v3

.github/workflows/update-dictionary.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
env:
3434
CLOUDFLARE_ZONE: ${{ secrets.CF_ZONE_ID }}
3535
CLOUDFLARE_TOKEN: ${{ secrets.CF_AUTH_TOKEN }}
36-
PURGE_URLS: '["https://interslavic-dictionary.com/data.txt"]'
36+
PURGE_URLS: '["https://interslavic-dictionary.com/data/*"]'

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
/node_modules
55

66
.DS_Store
7-
/static/data.txt
7+
/static/data/*

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1>
22
<img src="src/components/Header/images/logo-icon.svg" alt="Logo" height="32" width="48">
33
Interslavic language dictionary
4-
<a href='https://coveralls.io/github/scherebedov/interslavic?branch=master'><img src='https://coveralls.io/repos/github/scherebedov/interslavic/badge.svg?branch=master' alt='Coverage Status' /></a>
4+
<a href='https://coveralls.io/github/sonic16x/interslavic?branch=master'><img src='https://coveralls.io/repos/github/scherebedov/interslavic/badge.svg?branch=master' alt='Coverage Status' /></a>
55
</h1>
66

77
[https://interslavic-dictionary.com](https://interslavic-dictionary.com)

package-lock.json

+7,943-14,358
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+48-48
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "interslavic",
3-
"version": "1.2.1",
3+
"version": "1.5.0",
44
"license": "MIT",
55
"description": "Interslavic dictionary",
66
"author": "Sergey Cherebedov",
77
"scripts": {
88
"start": "npm run dev",
99
"test": "jest --logHeapUsage --coverage",
10-
"dev": "cross-env NODE_ENV=development webpack-dev-server",
10+
"dev": "cross-env NODE_ENV=development webpack serve --config webpack.config.dev.js --progress",
1111
"lint": "tslint -c tslint.json '{src,tests}/**/*.{ts,tsx}' -t stylish --fix",
1212
"updateTestSnapshot": "ts-node -r tsconfig-paths/register ./tests/updateTestSnapshot.ts",
1313
"generateDictionary": "ts-node -r tsconfig-paths/register ./src/services/generateDictionary.ts",
14-
"build": "cross-env NODE_ENV=production webpack"
14+
"build": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js"
1515
},
1616
"jest": {
1717
"transform": {
@@ -41,62 +41,62 @@
4141
},
4242
"main": "",
4343
"pre-commit": [
44-
"lint",
45-
"test"
44+
"lint"
4645
],
4746
"dependencies": {
48-
"classnames": "^2.2.6",
49-
"lodash": "^4.17.19",
50-
"react": "^16.13.1",
51-
"react-dom": "^16.13.1",
52-
"react-redux": "^7.2.0",
53-
"redux": "^4.0.5"
47+
"@ag-grid-community/client-side-row-model": "^25.2.0",
48+
"@ag-grid-community/core": "^25.2.0",
49+
"classnames": "^2.3.1",
50+
"lodash": "^4.17.21",
51+
"node-fetch": "^2.6.1",
52+
"react": "^17.0.2",
53+
"react-dom": "^17.0.2",
54+
"react-redux": "^7.2.4",
55+
"redux": "^4.1.0"
5456
},
5557
"devDependencies": {
56-
"@svgr/webpack": "^5.4.0",
57-
"@types/classnames": "^2.2.10",
58+
"@svgr/webpack": "^5.5.0",
5859
"@types/dialog-polyfill": "^0.5.0",
59-
"@types/jest": "^24.9.1",
60-
"@types/lodash": "^4.14.152",
61-
"@types/node": "^11.15.14",
62-
"@types/react": "^16.9.35",
63-
"@types/react-dom": "16.0.9",
64-
"@types/request": "^2.48.5",
65-
"acorn": "^6.4.1",
66-
"autoprefixer": "^9.8.0",
60+
"@types/jest": "^26.0.23",
61+
"@types/lodash": "^4.14.168",
62+
"@types/node": "^15.0.1",
63+
"@types/node-fetch": "^2.5.10",
64+
"@types/react": "^17.0.4",
65+
"@types/react-dom": "17.0.3",
66+
"@types/react-redux": "^7.1.16",
67+
"acorn": "^8.2.4",
68+
"autoprefixer": "^10.2.5",
6769
"clean-webpack-plugin": "^3.0.0",
68-
"concurrently": "^4.1.2",
69-
"copy-webpack-plugin": "^5.1.1",
70+
"concurrently": "^6.0.2",
71+
"copy-webpack-plugin": "^8.1.1",
7072
"coveralls": "^3.1.0",
71-
"cross-env": "^5.1.1",
72-
"css-loader": "^0.28.7",
73-
"cssnano": "^4.1.10",
74-
"extract-text-webpack-plugin": "^4.0.0-beta.0",
75-
"file-loader": "^1.1.5",
76-
"html-webpack-plugin": "^3.2.0",
77-
"jest": "^24.9.0",
78-
"jsdom": "8.5.0",
79-
"node-sass": "^4.14.1",
80-
"optimize-css-assets-webpack-plugin": "^5.0.3",
81-
"postcss-loader": "^3.0.0",
73+
"cross-env": "^7.0.3",
74+
"css-loader": "^5.2.4",
75+
"css-minimizer-webpack-plugin": "^2.0.0",
76+
"cssnano": "^5.0.2",
77+
"file-loader": "^6.2.0",
78+
"html-webpack-plugin": "^5.3.1",
79+
"jest": "^26.6.3",
80+
"jsdom": "16.5.3",
81+
"mini-css-extract-plugin": "^1.6.0",
82+
"node-sass": "^5.0.0",
83+
"postcss-loader": "^5.2.0",
8284
"pre-commit": "^1.2.2",
8385
"react-transform-hmr": "^1.0.4",
8486
"request": "^2.88.2",
85-
"sass-loader": "^6.0.6",
86-
"style-loader": "^0.19.0",
87-
"ts-jest": "^24.3.0",
88-
"ts-loader": "^5.3.3",
89-
"ts-node": "^8.10.1",
87+
"sass-loader": "^11.0.1",
88+
"style-loader": "^2.0.0",
89+
"ts-jest": "^26.5.5",
90+
"ts-loader": "^9.1.1",
91+
"ts-node": "^9.1.1",
9092
"tsconfig-paths": "^3.9.0",
91-
"tslint": "^5.14.0",
92-
"tslint-react": "^4.0.0",
93-
"typescript": "^3.9.3",
94-
"typings": "^2.1.1",
95-
"url-loader": "^0.6.2",
96-
"webpack": "^4.43.0",
97-
"webpack-cli": "^3.3.11",
98-
"webpack-dev-server": "^3.11.0",
99-
"webpack-hot-middleware": "^2.20.0",
93+
"tslint": "^5.20.1",
94+
"tslint-react": "^4.1.0",
95+
"typescript": "^4.2.4",
96+
"webpack": "^5.36.2",
97+
"webpack-cli": "^4.6.0",
98+
"webpack-dev-server": "^3.11.2",
99+
"webpack-hot-middleware": "^2.25.0",
100100
"write-file-webpack-plugin": "^4.5.1"
101101
}
102102
}

src/_mixins.scss

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@mixin changeState {
2+
transition:
3+
transform var(--animation-duration) linear,
4+
margin var(--animation-duration) linear,
5+
background-color var(--animation-duration) linear;
6+
}
7+
8+
@mixin custom-text {
9+
span {
10+
&.p {
11+
color: #9C27B0;
12+
}
13+
14+
&.r {
15+
color: #f44336;
16+
}
17+
18+
&.g {
19+
color: #4CAF50;
20+
}
21+
22+
&.b {
23+
color: #3F51B5;
24+
}
25+
26+
&.s {
27+
color: #9E9E9E;
28+
}
29+
30+
&.k {
31+
color: #a0522d;
32+
}
33+
34+
&.B {
35+
font-weight: bold;
36+
}
37+
38+
&.i {
39+
font-style: italic;
40+
}
41+
}
42+
}

src/actions/index.ts

+16
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export enum ActionTypes {
2222
SET_NOTIFICATION = 'SET_NOTIFICATION',
2323
CHANGE_CARD_VIEW = 'CHANGE_CARD_VIEW',
2424
CHANGE_ORDER_OF_CASES = 'CHANGE_ORDER_OF_CASES',
25+
DICTIONARY_LANGUAGES = 'DICTIONARY_LANGUAGES',
26+
TOGGLE_PAGE = 'TOGGLE_PAGE',
2527
}
2628

2729
export function langAction(data: {from: string, to: string}) {
@@ -167,3 +169,17 @@ export function changeOrderOfCases(data) {
167169
data,
168170
};
169171
}
172+
173+
export function changeDictionaryLangAction(data) {
174+
return {
175+
type: ActionTypes.DICTIONARY_LANGUAGES,
176+
data,
177+
};
178+
}
179+
180+
export function togglePage(data) {
181+
return {
182+
type: ActionTypes.TOGGLE_PAGE,
183+
data,
184+
};
185+
}

src/components/About/index.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import "src/index";
2-
31
.about-page {
42
width: 100%;
53
height: 100%;
@@ -13,6 +11,10 @@
1311
display: block;
1412
}
1513

14+
.no-wrap {
15+
white-space: nowrap;
16+
}
17+
1618
&__container {
1719
max-width: 1024px;
1820
margin: 0 auto;

src/components/About/index.tsx

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
import { worksheetUrl } from 'consts';
2-
import * as React from 'react';
1+
import { tablesData } from 'consts';
2+
33
import { t } from 'translations';
44
import './index.scss';
5+
import { getTablePublicUrl } from 'utils/getTablePublicUrl';
6+
7+
function boldify(s: string): React.ReactNode {
8+
const fragments = s.split('**');
9+
return fragments.map((substr, index) => {
10+
return index % 2 === 0 ? substr : <b>{substr}</b>;
11+
});
12+
}
513

614
export const About: React.FC =
715
() => {
16+
const worksheetUrl = getTablePublicUrl(tablesData[0].spreadsheetId, tablesData[0].sheetId);
817
const email = '[email protected]';
9-
const github = 'https://github.com/scherebedov/interslavic';
18+
const github = 'https://github.com/sonic16x/interslavic';
1019
const source = 'http://steen.free.fr/interslavic';
1120
let version = `v${VERSION}`;
1221
const trimmedBaseUrl = BASE_URL.replace('/', '');
@@ -30,7 +39,7 @@ export const About: React.FC =
3039
<h6>{t('aboutDeveloper')}</h6>
3140
<div className={'about-page__author'}>
3241
{t('aboutAuthorSergeyCherebedov')}:
33-
<a target={'_blank'} href={'https://github.com/scherebedov'}>GitHub</a>
42+
<a target={'_blank'} href={'https://github.com/sonic16x'}>GitHub</a>
3443
<a target={'_blank'} href={'https://www.linkedin.com/in/scherebedov/'}>LinkedIn</a>
3544
<a target={'_blank'} href={'https://www.facebook.com/profile.php?id=100009366550621'}>Facebook</a>
3645
<a target={'_blank'} href={`email:${email}`}>{email}</a>

src/components/Button/Button.scss

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.button {
2+
background: var(--primary-color);
3+
color: #fff;
4+
border-radius: var(--border-radius-m);
5+
padding: 5px 10px;
6+
border: none;
7+
outline: none;
8+
box-shadow: var(--shadow);
9+
cursor: pointer;
10+
text-decoration: none;
11+
12+
&:hover {
13+
text-decoration: none;
14+
}
15+
16+
&-m {
17+
font-size: var(--text-m);
18+
line-height: var(--text-m-line);
19+
}
20+
21+
&.disabled {
22+
pointer-events: none;
23+
opacity: .7;
24+
}
25+
}

src/components/Button/Button.tsx

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import './Button.scss';
2+
import classNames from 'classnames';
3+
4+
interface IButtonProps {
5+
size?: 'S' | 'M' | 'L';
6+
href?: string;
7+
target?: string;
8+
onClick?: () => void;
9+
title: string;
10+
disabled?: boolean;
11+
}
12+
13+
export const Button = (
14+
{
15+
size = 'M',
16+
href,
17+
target,
18+
onClick,
19+
title,
20+
disabled,
21+
}: IButtonProps,
22+
) => {
23+
if (href) {
24+
return (
25+
<a
26+
className={classNames(['button', `button-${size.toLowerCase()}`], { disabled })}
27+
href={href}
28+
target={target}
29+
onClick={onClick}
30+
>
31+
{title}
32+
</a>
33+
);
34+
}
35+
36+
return (
37+
<button
38+
className={classNames(['button', `button-${size.toLowerCase()}`], { disabled })}
39+
onClick={onClick}
40+
disabled={disabled}
41+
>
42+
{title}
43+
</button>
44+
);
45+
};

src/components/Card/index.scss

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import "src/index";
2-
31
.card {
42
border: var(--border);
53
border-radius: var(--border-radius-m);

src/components/Card/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
22
import './index.scss';
33
import classNames from 'classnames';
44

Loading
Loading

0 commit comments

Comments
 (0)