frontAnswerer/README.md
2024-05-31 19:41:18 +03:00

76 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Правила
- Запрещено использовать vh/vw css-юниты и их производные
## Виджет
### Сборка
```bash
yarn build:widget
```
### Использование
```html
<script type="module">
import widget from "https://hbpn.link/export/pub.js";
widget.create({
selector: "widget-container",
quizId: "...",
});
</script>
```
## Npm-пакет
### Перед использованием и публикацией
```bash
npm config set //penahub.gitlab.yandexcloud.net/api/v4/packages/npm/:_authToken=INSTANCE_TOKEN
npm config set //penahub.gitlab.yandexcloud.net/api/v4/projects/43/packages/npm/:_authToken=PROJECT_TOKEN
```
### Публикация
1. Инкрементировать версию в package.json
2.
```bash
yarn publish
```
3. Нажать enter при запросе версии
### Установка
Добавить в корень проекта файл .yarnrc с содержимым
```
"@frontend:registry" "https://penahub.gitlab.yandexcloud.net/api/v4/packages/npm/"
```
```bash
yarn add @frontend/squzanswerer
```
Peer dependencies:
```bash
yarn add @emoji-mart/data @emoji-mart/react @emotion/react @emotion/styled @mui/icons-material @mui/material @mui/x-date-pickers axios emoji-mart immer moment nanoid notistack react-dom react-error-boundary react-router-dom react swr use-debounce zustand
```
### Использование
```ts
import { QuizView } from "@frontend/squzanswerer";
export default function Component() {
// ...
return (
<QuizView quizId={quizId} />
}
}
```