add analytics, v 1.2.1

main
Yuriy Evdokimov 2023-12-13 15:05:17 +05:00
parent 008eb07567
commit 6aac4f7727
5 changed files with 22 additions and 29 deletions

View File

@ -1,27 +1,10 @@
# React + TypeScript + Vite
# Pinyin Dictation
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
this is a source code repository for pinyin.wst74.ru site
Currently, two official plugins are available:
## version history
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level `parserOptions` property like this:
```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
v 1.2.1
added analytics script call
this README instead of default vitejs
begin of multivoice

View File

@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script async src="https://anl.wst74.ru/script.js" data-website-id="88168e43-88d4-4c29-bcb0-4c0cc878e7bb"></script>
<title>Pinyin dictation</title>
</head>
<body>

View File

@ -2,7 +2,7 @@
"name": "pinyindictation",
"author": {"email": "rurik19@yandex.ru", "name": "Юрий Евдокимов"},
"private": true,
"version": "1.2.0",
"version": "1.2.1",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -1,6 +1,6 @@
import { Context, createContext, Dispatch, useContext } from "react";
import { Action, ToggleType } from "./reducer"
import { Syllable, SylPart, Tone } from "./types";
import { SoundPackName, Syllable, SylPart, Tone } from "./types";
import { isEnabled } from "./utils";
export interface IState {
@ -17,7 +17,8 @@ export interface IState {
allEnabled: (type: ToggleType) => false,
isEnabled: (type: ToggleType, index: string) => false,
isFound: () => false,
isToneChecked: (toneNo: number) => false
isToneChecked: (toneNo: number) => false,
soundPackName: SoundPackName
}
export interface IStore {
@ -48,7 +49,8 @@ export const defaultState:object = {
},
isFound: function():boolean { return (this as IState).foundSyllables!.length > 0 && (this as IState).toneChecks!.length > 0}
,
isToneChecked: function(toneNo: number):boolean{ return (this as IState).toneChecks.includes(toneNo) }
isToneChecked: function(toneNo: number):boolean{ return (this as IState).toneChecks.includes(toneNo) },
soundPackName: SoundPackName.archchinese
}
export const AppContext:Context<IStore> = createContext<IStore>({ state: defaultState as IState, dispatch: () => null })

View File

@ -34,4 +34,11 @@ export enum BtnColor {
green = "success"
}
export enum Status {params, prepare, playing, plaied, showlist}
export enum Status {params, prepare, playing, plaied, showlist}
export enum SoundPackName { archchinese, dongchinesea, dongchineseb, dongchinesec }
export type SoundPack = {
name: SoundPackName,
audioPath: string
}