diff --git a/README.md b/README.md index d503143..832c5d6 100644 --- a/README.md +++ b/README.md @@ -20,5 +20,5 @@ yarn publish ``` Установка ```bash -yarn add @frontend/kitui +yarn add @frontend/squzanswerer ``` diff --git a/src/api/quizRelase.ts b/lib/api/quizRelase.ts similarity index 100% rename from src/api/quizRelase.ts rename to lib/api/quizRelase.ts diff --git a/src/assets/icons/ArrowDownIcon.tsx b/lib/assets/icons/ArrowDownIcon.tsx old mode 100755 new mode 100644 similarity index 100% rename from src/assets/icons/ArrowDownIcon.tsx rename to lib/assets/icons/ArrowDownIcon.tsx diff --git a/src/assets/icons/BlankImage.tsx b/lib/assets/icons/BlankImage.tsx similarity index 100% rename from src/assets/icons/BlankImage.tsx rename to lib/assets/icons/BlankImage.tsx diff --git a/src/assets/icons/CalendarIcon.tsx b/lib/assets/icons/CalendarIcon.tsx similarity index 100% rename from src/assets/icons/CalendarIcon.tsx rename to lib/assets/icons/CalendarIcon.tsx diff --git a/src/assets/icons/Checkbox.tsx b/lib/assets/icons/Checkbox.tsx similarity index 100% rename from src/assets/icons/Checkbox.tsx rename to lib/assets/icons/Checkbox.tsx diff --git a/src/assets/icons/CloseBold.tsx b/lib/assets/icons/CloseBold.tsx similarity index 100% rename from src/assets/icons/CloseBold.tsx rename to lib/assets/icons/CloseBold.tsx diff --git a/src/assets/icons/ContactFormIcon/AddressIcon.tsx b/lib/assets/icons/ContactFormIcon/AddressIcon.tsx similarity index 100% rename from src/assets/icons/ContactFormIcon/AddressIcon.tsx rename to lib/assets/icons/ContactFormIcon/AddressIcon.tsx diff --git a/src/assets/icons/ContactFormIcon/EmailIcon.tsx b/lib/assets/icons/ContactFormIcon/EmailIcon.tsx similarity index 100% rename from src/assets/icons/ContactFormIcon/EmailIcon.tsx rename to lib/assets/icons/ContactFormIcon/EmailIcon.tsx diff --git a/src/assets/icons/ContactFormIcon/NameIcon.tsx b/lib/assets/icons/ContactFormIcon/NameIcon.tsx similarity index 100% rename from src/assets/icons/ContactFormIcon/NameIcon.tsx rename to lib/assets/icons/ContactFormIcon/NameIcon.tsx diff --git a/src/assets/icons/ContactFormIcon/PhoneIcon.tsx b/lib/assets/icons/ContactFormIcon/PhoneIcon.tsx similarity index 100% rename from src/assets/icons/ContactFormIcon/PhoneIcon.tsx rename to lib/assets/icons/ContactFormIcon/PhoneIcon.tsx diff --git a/src/assets/icons/ContactFormIcon/TextIcon.tsx b/lib/assets/icons/ContactFormIcon/TextIcon.tsx similarity index 100% rename from src/assets/icons/ContactFormIcon/TextIcon.tsx rename to lib/assets/icons/ContactFormIcon/TextIcon.tsx diff --git a/src/assets/icons/Info.tsx b/lib/assets/icons/Info.tsx similarity index 100% rename from src/assets/icons/Info.tsx rename to lib/assets/icons/Info.tsx diff --git a/src/assets/icons/NameplateLogo.tsx b/lib/assets/icons/NameplateLogo.tsx similarity index 100% rename from src/assets/icons/NameplateLogo.tsx rename to lib/assets/icons/NameplateLogo.tsx diff --git a/src/assets/icons/NameplateLogoFQ.tsx b/lib/assets/icons/NameplateLogoFQ.tsx similarity index 100% rename from src/assets/icons/NameplateLogoFQ.tsx rename to lib/assets/icons/NameplateLogoFQ.tsx diff --git a/src/assets/icons/NameplateLogoFQDark.tsx b/lib/assets/icons/NameplateLogoFQDark.tsx similarity index 100% rename from src/assets/icons/NameplateLogoFQDark.tsx rename to lib/assets/icons/NameplateLogoFQDark.tsx diff --git a/src/assets/icons/UploadIcon.tsx b/lib/assets/icons/UploadIcon.tsx old mode 100755 new mode 100644 similarity index 100% rename from src/assets/icons/UploadIcon.tsx rename to lib/assets/icons/UploadIcon.tsx diff --git a/src/assets/icons/questionsPage/FlagIcon.tsx b/lib/assets/icons/questionsPage/FlagIcon.tsx similarity index 100% rename from src/assets/icons/questionsPage/FlagIcon.tsx rename to lib/assets/icons/questionsPage/FlagIcon.tsx diff --git a/src/assets/icons/questionsPage/StarIconMini.tsx b/lib/assets/icons/questionsPage/StarIconMini.tsx similarity index 100% rename from src/assets/icons/questionsPage/StarIconMini.tsx rename to lib/assets/icons/questionsPage/StarIconMini.tsx diff --git a/src/assets/icons/questionsPage/hashtagIcon.tsx b/lib/assets/icons/questionsPage/hashtagIcon.tsx similarity index 100% rename from src/assets/icons/questionsPage/hashtagIcon.tsx rename to lib/assets/icons/questionsPage/hashtagIcon.tsx diff --git a/src/assets/icons/questionsPage/heartIcon.tsx b/lib/assets/icons/questionsPage/heartIcon.tsx similarity index 100% rename from src/assets/icons/questionsPage/heartIcon.tsx rename to lib/assets/icons/questionsPage/heartIcon.tsx diff --git a/src/assets/icons/questionsPage/lightbulbIcon.tsx b/lib/assets/icons/questionsPage/lightbulbIcon.tsx similarity index 100% rename from src/assets/icons/questionsPage/lightbulbIcon.tsx rename to lib/assets/icons/questionsPage/lightbulbIcon.tsx diff --git a/src/assets/icons/questionsPage/likeIcon.tsx b/lib/assets/icons/questionsPage/likeIcon.tsx similarity index 100% rename from src/assets/icons/questionsPage/likeIcon.tsx rename to lib/assets/icons/questionsPage/likeIcon.tsx diff --git a/src/assets/icons/questionsPage/tropfyIcon.tsx b/lib/assets/icons/questionsPage/tropfyIcon.tsx similarity index 100% rename from src/assets/icons/questionsPage/tropfyIcon.tsx rename to lib/assets/icons/questionsPage/tropfyIcon.tsx diff --git a/src/QuizAnswerer.tsx b/lib/components/QuizAnswerer.tsx similarity index 93% rename from src/QuizAnswerer.tsx rename to lib/components/QuizAnswerer.tsx index d39e206..50fa0cd 100644 --- a/src/QuizAnswerer.tsx +++ b/lib/components/QuizAnswerer.tsx @@ -10,8 +10,8 @@ import { SnackbarProvider } from 'notistack'; import { Suspense } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { SWRConfig } from "swr"; -import ViewPublicationPage from "./pages/ViewPublicationPage/ViewPublicationPage"; -import lightTheme from "./utils/themes/light"; +import ViewPublicationPage from "./ViewPublicationPage/ViewPublicationPage"; +import lightTheme from "@utils/themes/light"; moment.locale("ru"); diff --git a/src/pages/ViewPublicationPage/ApologyPage.tsx b/lib/components/ViewPublicationPage/ApologyPage.tsx similarity index 100% rename from src/pages/ViewPublicationPage/ApologyPage.tsx rename to lib/components/ViewPublicationPage/ApologyPage.tsx diff --git a/src/pages/ViewPublicationPage/ContactForm.tsx b/lib/components/ViewPublicationPage/ContactForm.tsx similarity index 100% rename from src/pages/ViewPublicationPage/ContactForm.tsx rename to lib/components/ViewPublicationPage/ContactForm.tsx diff --git a/src/pages/ViewPublicationPage/Footer.tsx b/lib/components/ViewPublicationPage/Footer.tsx similarity index 100% rename from src/pages/ViewPublicationPage/Footer.tsx rename to lib/components/ViewPublicationPage/Footer.tsx diff --git a/src/pages/ViewPublicationPage/Question.tsx b/lib/components/ViewPublicationPage/Question.tsx similarity index 100% rename from src/pages/ViewPublicationPage/Question.tsx rename to lib/components/ViewPublicationPage/Question.tsx diff --git a/src/pages/ViewPublicationPage/ResultForm.tsx b/lib/components/ViewPublicationPage/ResultForm.tsx similarity index 99% rename from src/pages/ViewPublicationPage/ResultForm.tsx rename to lib/components/ViewPublicationPage/ResultForm.tsx index 1f4b153..4d17df1 100644 --- a/src/pages/ViewPublicationPage/ResultForm.tsx +++ b/lib/components/ViewPublicationPage/ResultForm.tsx @@ -8,7 +8,7 @@ import { import { NameplateLogo } from "@icons/NameplateLogo"; import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; -import { setCurrentQuizStep } from "@stores/quizView/store"; +import { setCurrentQuizStep } from "@stores/quizView"; import { useQuizData } from "@utils/hooks/useQuizData"; import { quizThemes } from "@utils/themes/Publication/themePublication"; import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; diff --git a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx b/lib/components/ViewPublicationPage/StartPageViewPublication.tsx similarity index 99% rename from src/pages/ViewPublicationPage/StartPageViewPublication.tsx rename to lib/components/ViewPublicationPage/StartPageViewPublication.tsx index 4c47fd1..f2a5ed0 100644 --- a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx +++ b/lib/components/ViewPublicationPage/StartPageViewPublication.tsx @@ -8,7 +8,7 @@ import { QuizStartpageAlignType, QuizStartpageType } from "@model/settingsData"; import { useQuizData } from "@utils/hooks/useQuizData"; import { quizThemes } from "@utils/themes/Publication/themePublication"; import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; -import { setCurrentQuizStep } from "@stores/quizView/store"; +import { setCurrentQuizStep } from "@stores/quizView"; export const StartPageViewPublication = () => { diff --git a/src/pages/ViewPublicationPage/ViewPublicationPage.tsx b/lib/components/ViewPublicationPage/ViewPublicationPage.tsx similarity index 98% rename from src/pages/ViewPublicationPage/ViewPublicationPage.tsx rename to lib/components/ViewPublicationPage/ViewPublicationPage.tsx index 744036e..df59f71 100644 --- a/src/pages/ViewPublicationPage/ViewPublicationPage.tsx +++ b/lib/components/ViewPublicationPage/ViewPublicationPage.tsx @@ -1,5 +1,5 @@ import { Button, ThemeProvider } from "@mui/material"; -import { useQuizViewStore } from "@stores/quizView/store"; +import { useQuizViewStore } from "@stores/quizView"; import { useQuestionFlowControl } from "@utils/hooks/useQuestionFlowControl"; import { useQuizData } from "@utils/hooks/useQuizData"; import { notReachable } from "@utils/notReachable"; diff --git a/src/pages/ViewPublicationPage/questions/Date.tsx b/lib/components/ViewPublicationPage/questions/Date.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Date.tsx rename to lib/components/ViewPublicationPage/questions/Date.tsx index 401dd3a..ebbfc42 100644 --- a/src/pages/ViewPublicationPage/questions/Date.tsx +++ b/lib/components/ViewPublicationPage/questions/Date.tsx @@ -2,7 +2,7 @@ import moment from "moment"; import { DatePicker } from "@mui/x-date-pickers"; import { Box, Typography, useTheme } from "@mui/material"; -import { useQuizViewStore, updateAnswer } from "@stores/quizView/store"; +import { useQuizViewStore, updateAnswer } from "@stores/quizView"; import type { QuizQuestionDate } from "../../../model/questionTypes/date"; import CalendarIcon from "@icons/CalendarIcon"; diff --git a/src/pages/ViewPublicationPage/questions/Emoji.tsx b/lib/components/ViewPublicationPage/questions/Emoji.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Emoji.tsx rename to lib/components/ViewPublicationPage/questions/Emoji.tsx index 7a06047..0d4f838 100644 --- a/src/pages/ViewPublicationPage/questions/Emoji.tsx +++ b/lib/components/ViewPublicationPage/questions/Emoji.tsx @@ -8,7 +8,7 @@ import { useTheme } from "@mui/material"; -import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView/store"; +import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; diff --git a/src/pages/ViewPublicationPage/questions/File.tsx b/lib/components/ViewPublicationPage/questions/File.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/File.tsx rename to lib/components/ViewPublicationPage/questions/File.tsx index 0ac79b4..742699d 100644 --- a/src/pages/ViewPublicationPage/questions/File.tsx +++ b/lib/components/ViewPublicationPage/questions/File.tsx @@ -6,7 +6,7 @@ import { Typography, useTheme } from "@mui/material"; -import { updateAnswer, useQuizViewStore } from "@stores/quizView/store"; +import { updateAnswer, useQuizViewStore } from "@stores/quizView"; import CloseBold from "@icons/CloseBold"; import UploadIcon from "@icons/UploadIcon"; diff --git a/src/pages/ViewPublicationPage/questions/Images.tsx b/lib/components/ViewPublicationPage/questions/Images.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Images.tsx rename to lib/components/ViewPublicationPage/questions/Images.tsx index 0662a17..ff08b8f 100644 --- a/src/pages/ViewPublicationPage/questions/Images.tsx +++ b/lib/components/ViewPublicationPage/questions/Images.tsx @@ -7,7 +7,7 @@ import { useTheme } from "@mui/material"; -import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView/store"; +import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; diff --git a/src/pages/ViewPublicationPage/questions/Number.tsx b/lib/components/ViewPublicationPage/questions/Number.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Number.tsx rename to lib/components/ViewPublicationPage/questions/Number.tsx index 5201e2c..782bc46 100644 --- a/src/pages/ViewPublicationPage/questions/Number.tsx +++ b/lib/components/ViewPublicationPage/questions/Number.tsx @@ -5,7 +5,7 @@ import { useDebouncedCallback } from "use-debounce"; import { CustomSlider } from "@ui_kit/CustomSlider"; import CustomTextField from "@ui_kit/CustomTextField"; -import { updateAnswer, useQuizViewStore } from "@stores/quizView/store"; +import { updateAnswer, useQuizViewStore } from "@stores/quizView"; import { sendAnswer } from "@api/quizRelase"; import { enqueueSnackbar } from "notistack"; diff --git a/src/pages/ViewPublicationPage/questions/Page.tsx b/lib/components/ViewPublicationPage/questions/Page.tsx similarity index 100% rename from src/pages/ViewPublicationPage/questions/Page.tsx rename to lib/components/ViewPublicationPage/questions/Page.tsx diff --git a/src/pages/ViewPublicationPage/questions/Rating.tsx b/lib/components/ViewPublicationPage/questions/Rating.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Rating.tsx rename to lib/components/ViewPublicationPage/questions/Rating.tsx index bc753d4..ebcb3cb 100644 --- a/src/pages/ViewPublicationPage/questions/Rating.tsx +++ b/lib/components/ViewPublicationPage/questions/Rating.tsx @@ -5,7 +5,7 @@ import { useTheme } from "@mui/material"; -import { updateAnswer, useQuizViewStore } from "@stores/quizView/store"; +import { updateAnswer, useQuizViewStore } from "@stores/quizView"; import FlagIcon from "@icons/questionsPage/FlagIcon"; import StarIconMini from "@icons/questionsPage/StarIconMini"; diff --git a/src/pages/ViewPublicationPage/questions/Select.tsx b/lib/components/ViewPublicationPage/questions/Select.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Select.tsx rename to lib/components/ViewPublicationPage/questions/Select.tsx index 12426b9..290c64c 100644 --- a/src/pages/ViewPublicationPage/questions/Select.tsx +++ b/lib/components/ViewPublicationPage/questions/Select.tsx @@ -2,7 +2,7 @@ import { Box, Typography, useTheme } from "@mui/material"; import { Select as SelectComponent } from "../tools//Select"; -import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView/store"; +import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView"; import { sendAnswer } from "@api/quizRelase"; import { enqueueSnackbar } from "notistack"; diff --git a/src/pages/ViewPublicationPage/questions/Text.tsx b/lib/components/ViewPublicationPage/questions/Text.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Text.tsx rename to lib/components/ViewPublicationPage/questions/Text.tsx index 8459d04..ee04d2a 100644 --- a/src/pages/ViewPublicationPage/questions/Text.tsx +++ b/lib/components/ViewPublicationPage/questions/Text.tsx @@ -2,7 +2,7 @@ import { Box, Typography, useTheme } from "@mui/material"; import CustomTextField from "@ui_kit/CustomTextField"; -import { updateAnswer, useQuizViewStore } from "@stores/quizView/store"; +import { updateAnswer, useQuizViewStore } from "@stores/quizView"; import { sendAnswer } from "@api/quizRelase"; import { enqueueSnackbar } from "notistack"; diff --git a/src/pages/ViewPublicationPage/questions/Variant.tsx b/lib/components/ViewPublicationPage/questions/Variant.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Variant.tsx rename to lib/components/ViewPublicationPage/questions/Variant.tsx index 4930050..6d125a0 100644 --- a/src/pages/ViewPublicationPage/questions/Variant.tsx +++ b/lib/components/ViewPublicationPage/questions/Variant.tsx @@ -17,7 +17,7 @@ import { updateAnswer, updateOwnVariant, useQuizViewStore -} from "@stores/quizView/store"; +} from "@stores/quizView"; import { CheckboxIcon } from "@icons/Checkbox"; import RadioCheck from "@ui_kit/RadioCheck"; diff --git a/src/pages/ViewPublicationPage/questions/Varimg.tsx b/lib/components/ViewPublicationPage/questions/Varimg.tsx similarity index 99% rename from src/pages/ViewPublicationPage/questions/Varimg.tsx rename to lib/components/ViewPublicationPage/questions/Varimg.tsx index b85fb34..f382cff 100644 --- a/src/pages/ViewPublicationPage/questions/Varimg.tsx +++ b/lib/components/ViewPublicationPage/questions/Varimg.tsx @@ -6,7 +6,7 @@ import { Typography, useTheme } from "@mui/material"; -import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView/store"; +import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; diff --git a/src/pages/ViewPublicationPage/tools/File.tsx b/lib/components/ViewPublicationPage/tools/File.tsx similarity index 100% rename from src/pages/ViewPublicationPage/tools/File.tsx rename to lib/components/ViewPublicationPage/tools/File.tsx diff --git a/src/pages/ViewPublicationPage/tools/Select.tsx b/lib/components/ViewPublicationPage/tools/Select.tsx similarity index 100% rename from src/pages/ViewPublicationPage/tools/Select.tsx rename to lib/components/ViewPublicationPage/tools/Select.tsx diff --git a/src/pages/ViewPublicationPage/tools/YoutubeEmbedIframe.tsx b/lib/components/ViewPublicationPage/tools/YoutubeEmbedIframe.tsx similarity index 100% rename from src/pages/ViewPublicationPage/tools/YoutubeEmbedIframe.tsx rename to lib/components/ViewPublicationPage/tools/YoutubeEmbedIframe.tsx diff --git a/src/pages/ViewPublicationPage/tools/checkEmptyData.ts b/lib/components/ViewPublicationPage/tools/checkEmptyData.ts similarity index 100% rename from src/pages/ViewPublicationPage/tools/checkEmptyData.ts rename to lib/components/ViewPublicationPage/tools/checkEmptyData.ts diff --git a/src/pages/ViewPublicationPage/tools/replaceSpacesToEmptyLines.ts b/lib/components/ViewPublicationPage/tools/replaceSpacesToEmptyLines.ts similarity index 100% rename from src/pages/ViewPublicationPage/tools/replaceSpacesToEmptyLines.ts rename to lib/components/ViewPublicationPage/tools/replaceSpacesToEmptyLines.ts diff --git a/src/contexts/QuizIdContext.ts b/lib/contexts/QuizIdContext.ts similarity index 100% rename from src/contexts/QuizIdContext.ts rename to lib/contexts/QuizIdContext.ts diff --git a/src/contexts/RootContainerWidthContext.ts b/lib/contexts/RootContainerWidthContext.ts similarity index 100% rename from src/contexts/RootContainerWidthContext.ts rename to lib/contexts/RootContainerWidthContext.ts diff --git a/src/stores/quizView/actions.ts b/lib/index.ts similarity index 100% rename from src/stores/quizView/actions.ts rename to lib/index.ts diff --git a/src/model/api/getQuizData.ts b/lib/model/api/getQuizData.ts similarity index 100% rename from src/model/api/getQuizData.ts rename to lib/model/api/getQuizData.ts diff --git a/src/model/questionTypes/date.ts b/lib/model/questionTypes/date.ts similarity index 100% rename from src/model/questionTypes/date.ts rename to lib/model/questionTypes/date.ts diff --git a/src/model/questionTypes/emoji.ts b/lib/model/questionTypes/emoji.ts similarity index 100% rename from src/model/questionTypes/emoji.ts rename to lib/model/questionTypes/emoji.ts diff --git a/src/model/questionTypes/file.ts b/lib/model/questionTypes/file.ts similarity index 100% rename from src/model/questionTypes/file.ts rename to lib/model/questionTypes/file.ts diff --git a/src/model/questionTypes/images.ts b/lib/model/questionTypes/images.ts similarity index 100% rename from src/model/questionTypes/images.ts rename to lib/model/questionTypes/images.ts diff --git a/src/model/questionTypes/number.ts b/lib/model/questionTypes/number.ts similarity index 100% rename from src/model/questionTypes/number.ts rename to lib/model/questionTypes/number.ts diff --git a/src/model/questionTypes/page.ts b/lib/model/questionTypes/page.ts similarity index 100% rename from src/model/questionTypes/page.ts rename to lib/model/questionTypes/page.ts diff --git a/src/model/questionTypes/rating.ts b/lib/model/questionTypes/rating.ts similarity index 100% rename from src/model/questionTypes/rating.ts rename to lib/model/questionTypes/rating.ts diff --git a/src/model/questionTypes/result.ts b/lib/model/questionTypes/result.ts similarity index 100% rename from src/model/questionTypes/result.ts rename to lib/model/questionTypes/result.ts diff --git a/src/model/questionTypes/select.ts b/lib/model/questionTypes/select.ts similarity index 100% rename from src/model/questionTypes/select.ts rename to lib/model/questionTypes/select.ts diff --git a/src/model/questionTypes/shared.ts b/lib/model/questionTypes/shared.ts similarity index 100% rename from src/model/questionTypes/shared.ts rename to lib/model/questionTypes/shared.ts diff --git a/src/model/questionTypes/text.ts b/lib/model/questionTypes/text.ts similarity index 100% rename from src/model/questionTypes/text.ts rename to lib/model/questionTypes/text.ts diff --git a/src/model/questionTypes/variant.ts b/lib/model/questionTypes/variant.ts similarity index 100% rename from src/model/questionTypes/variant.ts rename to lib/model/questionTypes/variant.ts diff --git a/src/model/questionTypes/varimg.ts b/lib/model/questionTypes/varimg.ts similarity index 100% rename from src/model/questionTypes/varimg.ts rename to lib/model/questionTypes/varimg.ts diff --git a/src/model/settingsData.ts b/lib/model/settingsData.ts similarity index 100% rename from src/model/settingsData.ts rename to lib/model/settingsData.ts diff --git a/src/stores/quizView/store.ts b/lib/stores/quizView.ts similarity index 100% rename from src/stores/quizView/store.ts rename to lib/stores/quizView.ts diff --git a/src/ui_kit/CustomCheckbox.tsx b/lib/ui_kit/CustomCheckbox.tsx old mode 100755 new mode 100644 similarity index 100% rename from src/ui_kit/CustomCheckbox.tsx rename to lib/ui_kit/CustomCheckbox.tsx diff --git a/src/ui_kit/CustomSlider.tsx b/lib/ui_kit/CustomSlider.tsx similarity index 100% rename from src/ui_kit/CustomSlider.tsx rename to lib/ui_kit/CustomSlider.tsx diff --git a/src/ui_kit/CustomTextField.tsx b/lib/ui_kit/CustomTextField.tsx old mode 100755 new mode 100644 similarity index 100% rename from src/ui_kit/CustomTextField.tsx rename to lib/ui_kit/CustomTextField.tsx diff --git a/src/ui_kit/ErrorBoundaryFallback.tsx b/lib/ui_kit/ErrorBoundaryFallback.tsx similarity index 100% rename from src/ui_kit/ErrorBoundaryFallback.tsx rename to lib/ui_kit/ErrorBoundaryFallback.tsx diff --git a/src/ui_kit/LabeledDatePicker.tsx b/lib/ui_kit/LabeledDatePicker.tsx similarity index 100% rename from src/ui_kit/LabeledDatePicker.tsx rename to lib/ui_kit/LabeledDatePicker.tsx diff --git a/src/ui_kit/LoadingSkeleton.tsx b/lib/ui_kit/LoadingSkeleton.tsx similarity index 100% rename from src/ui_kit/LoadingSkeleton.tsx rename to lib/ui_kit/LoadingSkeleton.tsx diff --git a/src/ui_kit/RadioCheck.tsx b/lib/ui_kit/RadioCheck.tsx similarity index 100% rename from src/ui_kit/RadioCheck.tsx rename to lib/ui_kit/RadioCheck.tsx diff --git a/src/ui_kit/RadioIcon.tsx b/lib/ui_kit/RadioIcon.tsx similarity index 100% rename from src/ui_kit/RadioIcon.tsx rename to lib/ui_kit/RadioIcon.tsx diff --git a/src/utils/handleComponentError.ts b/lib/utils/handleComponentError.ts similarity index 100% rename from src/utils/handleComponentError.ts rename to lib/utils/handleComponentError.ts diff --git a/src/utils/hooks/useQuestionFlowControl.ts b/lib/utils/hooks/useQuestionFlowControl.ts similarity index 98% rename from src/utils/hooks/useQuestionFlowControl.ts rename to lib/utils/hooks/useQuestionFlowControl.ts index 0f80843..894d476 100644 --- a/src/utils/hooks/useQuestionFlowControl.ts +++ b/lib/utils/hooks/useQuestionFlowControl.ts @@ -1,7 +1,7 @@ import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; -import { setCurrentQuizStep, useQuizViewStore } from "@stores/quizView/store"; +import { setCurrentQuizStep, useQuizViewStore } from "@stores/quizView"; import { useCallback, useDebugValue, useMemo, useState } from "react"; -import { isResultQuestionEmpty } from "../../pages/ViewPublicationPage/tools/checkEmptyData"; +import { isResultQuestionEmpty } from "../../components/ViewPublicationPage/tools/checkEmptyData"; import { useQuizData } from "./useQuizData"; import moment from "moment"; diff --git a/src/utils/hooks/useQuizData.ts b/lib/utils/hooks/useQuizData.ts similarity index 91% rename from src/utils/hooks/useQuizData.ts rename to lib/utils/hooks/useQuizData.ts index c42948a..befa783 100644 --- a/src/utils/hooks/useQuizData.ts +++ b/lib/utils/hooks/useQuizData.ts @@ -3,7 +3,7 @@ import { parseQuizData } from "@model/api/getQuizData"; import { QuizSettings } from "@model/settingsData"; import useSWR from "swr"; import { useQuizId } from "../../contexts/QuizIdContext"; -import { replaceSpacesToEmptyLines } from "../../pages/ViewPublicationPage/tools/replaceSpacesToEmptyLines"; +import { replaceSpacesToEmptyLines } from "../../components/ViewPublicationPage/tools/replaceSpacesToEmptyLines"; export function useQuizData() { diff --git a/src/utils/hooks/useUADevice.ts b/lib/utils/hooks/useUADevice.ts similarity index 100% rename from src/utils/hooks/useUADevice.ts rename to lib/utils/hooks/useUADevice.ts diff --git a/src/utils/notReachable.ts b/lib/utils/notReachable.ts similarity index 100% rename from src/utils/notReachable.ts rename to lib/utils/notReachable.ts diff --git a/src/utils/parse-error.ts b/lib/utils/parse-error.ts similarity index 100% rename from src/utils/parse-error.ts rename to lib/utils/parse-error.ts diff --git a/src/utils/themes/Publication/genericPublication.ts b/lib/utils/themes/Publication/genericPublication.ts similarity index 100% rename from src/utils/themes/Publication/genericPublication.ts rename to lib/utils/themes/Publication/genericPublication.ts diff --git a/src/utils/themes/Publication/themePublication.ts b/lib/utils/themes/Publication/themePublication.ts similarity index 100% rename from src/utils/themes/Publication/themePublication.ts rename to lib/utils/themes/Publication/themePublication.ts diff --git a/src/utils/themes/dark.ts b/lib/utils/themes/dark.ts old mode 100755 new mode 100644 similarity index 100% rename from src/utils/themes/dark.ts rename to lib/utils/themes/dark.ts diff --git a/src/utils/themes/generic.ts b/lib/utils/themes/generic.ts old mode 100755 new mode 100644 similarity index 100% rename from src/utils/themes/generic.ts rename to lib/utils/themes/generic.ts diff --git a/src/utils/themes/light.ts b/lib/utils/themes/light.ts old mode 100755 new mode 100644 similarity index 100% rename from src/utils/themes/light.ts rename to lib/utils/themes/light.ts diff --git a/package.json b/package.json index 215d411..c886670 100755 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", - "@frontend/kitui": "^1.0.54", "@mui/icons-material": "^5.10.14", "@mui/material": "^5.10.14", "@mui/x-date-pickers": "^6.16.1", diff --git a/src/App.tsx b/src/App.tsx index d592c74..8d44a55 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,11 +1,11 @@ import { Box } from "@mui/material"; import { startTransition, useEffect, useState } from "react"; import { useParams } from "react-router-dom"; -import QuizAnswerer from "./QuizAnswerer"; -import { QuizIdContext } from "./contexts/QuizIdContext"; -import { RootContainerWidthContext } from "./contexts/RootContainerWidthContext"; +import { QuizIdContext } from "@contexts/QuizIdContext"; +import { RootContainerWidthContext } from "@contexts/RootContainerWidthContext"; +import QuizAnswerer from "../lib/components/QuizAnswerer"; - const defaultQuizId = "9ed8d0e9-d355-4fc1-8b89-4f962e3efc52"; // branching +const defaultQuizId = "9ed8d0e9-d355-4fc1-8b89-4f962e3efc52"; // branching //const defaultQuizId = "9ed8d0e9-d355-4fc1-8b89-4f962e3efc52"; //looooong header // const defaultQuizId = "a9d31460-132a-4479-a3f0-90241498b6f9"; // linear diff --git a/src/WidgetApp.tsx b/src/WidgetApp.tsx index f04d727..043a7c1 100644 --- a/src/WidgetApp.tsx +++ b/src/WidgetApp.tsx @@ -1,8 +1,8 @@ import { Box } from "@mui/material"; import { startTransition, useEffect, useRef, useState } from "react"; -import QuizAnswerer from "./QuizAnswerer"; -import { QuizIdContext } from "./contexts/QuizIdContext"; -import { RootContainerWidthContext } from "./contexts/RootContainerWidthContext"; +import { QuizIdContext } from "@contexts/QuizIdContext"; +import { RootContainerWidthContext } from "@contexts/RootContainerWidthContext"; +import QuizAnswerer from "../lib/components/QuizAnswerer"; interface Props { diff --git a/src/stores/quizView/hooks.ts b/src/stores/quizView/hooks.ts deleted file mode 100644 index e69de29..0000000 diff --git a/tsconfig.json b/tsconfig.json index 111cf9e..6d55215 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,26 +21,30 @@ "noFallthroughCasesInSwitch": true, "paths": { "@ui_kit/*": [ - "./src/ui_kit/*" + "./lib/ui_kit/*" ], "@icons/*": [ - "./src/assets/icons/*" + "./lib/assets/icons/*" ], "@stores/*": [ - "./src/stores/*" + "./lib/stores/*" ], "@api/*": [ - "./src/api/*" + "./lib/api/*" ], "@model/*": [ - "./src/model/*" + "./lib/model/*" ], "@utils/*": [ - "./src/utils/*" + "./lib/utils/*" + ], + "@contexts/*": [ + "./lib/contexts/*" ] } }, "include": [ + "lib", "src" ], "exclude": [ diff --git a/vite.config.ts b/vite.config.ts index f8ccd79..a3214be 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,12 +3,13 @@ import { resolve } from "path"; import { defineConfig } from "vite"; export const alias = { - "@ui_kit": resolve(__dirname, "./src/ui_kit"), - "@icons": resolve(__dirname, "./src/assets/icons"), - "@stores": resolve(__dirname, "./src/stores"), - "@api": resolve(__dirname, "./src/api"), - "@model": resolve(__dirname, "./src/model"), - "@utils": resolve(__dirname, "./src/utils"), + "@ui_kit": resolve(__dirname, "./lib/ui_kit"), + "@icons": resolve(__dirname, "./lib/assets/icons"), + "@stores": resolve(__dirname, "./lib/stores"), + "@api": resolve(__dirname, "./lib/api"), + "@model": resolve(__dirname, "./lib/model"), + "@utils": resolve(__dirname, "./lib/utils"), + "@contexts": resolve(__dirname, "./lib/contexts"), }; // https://vitejs.dev/config/ diff --git a/yarn.lock b/yarn.lock index 0146f62..fbe71e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -553,14 +553,6 @@ resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2" integrity sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q== -"@frontend/kitui@^1.0.54": - version "1.0.62" - resolved "https://penahub.gitlab.yandexcloud.net/api/v4/projects/21/packages/npm/@frontend/kitui/-/@frontend/kitui-1.0.62.tgz#212185a0a19a9b9948a85e9d4c71e002ad7f8b27" - integrity sha1-ISGFoKGam5lIqF6dTHHgAq1/iyc= - dependencies: - immer "^10.0.2" - reconnecting-eventsource "^1.6.2" - "@humanwhocodes/config-array@^0.11.13": version "0.11.14" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" @@ -2303,7 +2295,7 @@ ignore@^5.2.0, ignore@^5.2.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== -immer@^10.0.2, immer@^10.0.3: +immer@^10.0.3: version "10.0.3" resolved "https://registry.yarnpkg.com/immer/-/immer-10.0.3.tgz#a8de42065e964aa3edf6afc282dfc7f7f34ae3c9" integrity sha512-pwupu3eWfouuaowscykeckFmVTpqbzW+rXFCX8rQLkZzM9ftBmU/++Ra+o+L27mz03zJTlyV4UUr+fdKNffo4A== @@ -3014,11 +3006,6 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" -reconnecting-eventsource@^1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/reconnecting-eventsource/-/reconnecting-eventsource-1.6.2.tgz#b7f5b03b1c76291f6fbcb0203004892a57ae253b" - integrity sha512-vHhoxVLbA2YcfljWMKEbgR1KVTgwIrnyh/bzVJc+gfQbGcUIToLL6jNhkUL4E+9FbnAcfUVNLIw2YCiliTg/4g== - regenerator-runtime@^0.14.0: version "0.14.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"