ecomlab-components-next 0.1.159 → 0.1.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/headers.js +2 -2
- package/dist/common/hooks/hooks.js +108 -0
- package/dist/common/hooks/useResetOnBaseURL.js +15 -0
- package/dist/common/img/icon-delete.svg +3 -0
- package/dist/common/img/icon-edit.svg +3 -0
- package/dist/common/img/noPhoto.png +0 -0
- package/dist/common/img/time_icon.svg +5 -0
- package/dist/common/img/view_icon.svg +5 -0
- package/dist/common/styles/svg_img.scss +290 -0
- package/dist/common/svg_img.js +238 -0
- package/dist/common/validationFunc.js +14 -0
- package/dist/components/ArticleComponent/Article.js +252 -0
- package/dist/components/ArticleComponent/Article.scss +289 -0
- package/dist/components/ArticleElements/ShortTileArticleBox/ShortTileArticleBox.stories.js +1 -1
- package/dist/components/ArticleMain/ArticleMain.js +451 -0
- package/dist/components/ArticleMain/ArticleMain.scss +220 -0
- package/dist/components/ArticleMain/img/table_icon.svg +3 -0
- package/dist/components/ArticleMain/img/tile-long_icon.svg +3 -0
- package/dist/components/ArticleMain/img/tile_icon.svg +3 -0
- package/dist/components/ButtonColumn/ButtonColumn.js +113 -0
- package/dist/components/ButtonColumn/ButtonColumn.scss +117 -0
- package/dist/components/ButtonColumn/img/column.svg +7 -0
- package/dist/components/ButtonCopy/ButtonCopy.js +37 -0
- package/dist/components/ButtonCopy/ButtonCopy.scss +43 -0
- package/dist/components/ButtonCopy/img/copy.svg +3 -0
- package/dist/components/ButtonExport/ButtonExport.js +83 -0
- package/dist/components/ButtonExport/ButtonExport.scss +111 -0
- package/dist/components/ButtonExport/img/export.svg +8 -0
- package/dist/components/ButtonExport/img/pdf.svg +12 -0
- package/dist/components/ButtonExport/img/xlc.svg +11 -0
- package/dist/components/ButtonUpload/ButtonUpload.js +24 -0
- package/dist/components/ButtonUpload/ButtonUpload.scss +45 -0
- package/dist/components/ButtonUpload/img/upload_icon.svg +8 -0
- package/dist/components/ConstructorComponents/Tariff/TariffPlan.js +8 -5
- package/dist/components/Page404/Page404.js +36 -0
- package/dist/components/Page404/Page404.scss +67 -0
- package/dist/components/Page404/img/banner-404.svg +16 -0
- package/dist/components/ShareComponent/ShareComponent.js +152 -0
- package/dist/components/ShareComponent/ShareComponent.scss +53 -0
- package/dist/components/ShareComponent/img/copy_icon.svg +5 -0
- package/dist/components/ShareComponent/img/facebook_icon.svg +5 -0
- package/dist/components/ShareComponent/img/linkedin_icon.svg +6 -0
- package/dist/components/ShareComponent/img/ok_icon.svg +5 -0
- package/dist/components/ShareComponent/img/share_icon.svg +5 -0
- package/dist/components/ShareComponent/img/tg_icon.svg +5 -0
- package/dist/components/ShareComponent/img/vk_icon.svg +5 -0
- package/dist/components/ShareComponent/img/whatsapp_icon.svg +5 -0
- package/dist/components/ShareComponent/img/x_icon.svg +5 -0
- package/dist/components/Table/TableBox/TableBox.stories.js +1 -1
- package/dist/components/TableInput/TableInput.js +103 -0
- package/dist/components/TableInput/TableInput.scss +35 -0
- package/dist/components/TableWithoutData/TableWithoutData.js +25 -0
- package/dist/components/TableWithoutData/TableWithoutData.scss +32 -0
- package/dist/components/TableWithoutData/img/doc_icon.png +0 -0
- package/dist/fonts/GolosText/GolosText-Black.ttf +0 -0
- package/dist/fonts/GolosText/GolosText-Bold.ttf +0 -0
- package/dist/fonts/GolosText/GolosText-ExtraBold.ttf +0 -0
- package/dist/fonts/GolosText/GolosText-Medium.ttf +0 -0
- package/dist/fonts/GolosText/GolosText-Regular.ttf +0 -0
- package/dist/fonts/GolosText/GolosText-SemiBold.ttf +0 -0
- package/dist/fonts/Inter/Inter-Bold.otf +0 -0
- package/dist/fonts/Inter/Inter-Light.otf +0 -0
- package/dist/fonts/Inter/Inter-Medium.otf +0 -0
- package/dist/fonts/Inter/Inter-Regular.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-Black.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-BlackItalic.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-BoldItalic.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-ExtraBold.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-ExtraBoldItalic.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-ExtraLight.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-ExtraLightItalic.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-Italic.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-Light.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-LightItalic.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-MediumItalic.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-SemiBoldItalic.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-Thin.ttf +0 -0
- package/dist/fonts/Montserrat/Montserrat-ThinItalic.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-Black.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-BlackItalic.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-Bold.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-BoldItalic.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-ExtraBold.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-ExtraBoldItalic.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-ExtraLight.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-ExtraLightItalic.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-Italic.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-Light.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-LightItalic.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-Regular.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-SemiBold.ttf +0 -0
- package/dist/fonts/Nunito_Sans/NunitoSans-SemiBoldItalic.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-Black.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-BlackItalic.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-Bold.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-BoldItalic.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-ExtraBold.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-ExtraBoldItalic.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-Italic.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-Light.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-LightItalic.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-Medium.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-MediumItalic.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-Regular.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-SemiBold.ttf +0 -0
- package/dist/fonts/Rubik/Rubik-SemiBoldItalic.ttf +0 -0
- package/dist/index.js +7 -0
- package/dist/main.js +14 -0
- package/dist/pages/_app.js +12 -0
- package/dist/pages/_document.js +12 -0
- package/dist/pages/index.js +92 -0
- package/dist/stories/Article/Article.scss +471 -0
- package/dist/stories/Article/ArticleElement.js +108 -0
- package/dist/stories/Article/ArticleStorybook.scss +6 -0
- package/dist/stories/Article/ArticleView.js +440 -0
- package/dist/stories/Article/ArticleView.stories.js +263 -0
- package/dist/stories/Article/Feedback/Feedback.js +58 -0
- package/dist/stories/Article/Feedback/Feedback.scss +86 -0
- package/dist/stories/Article/FormBtn/FormBtn.js +170 -0
- package/dist/stories/Article/FormBtn/FormBtn.scss +446 -0
- package/dist/stories/Article/FormBtn/img/clos_icon.svg +6 -0
- package/dist/stories/Article/FormBtn/img/close-icon.svg +3 -0
- package/dist/stories/Article/ImgArticle/ImgArticle.js +204 -0
- package/dist/stories/Article/ImgArticle/ImgArticle.scss +140 -0
- package/dist/stories/Article/ListOfContent/ListOfContent.js +41 -0
- package/dist/stories/Article/ListOfContent/ListOfContent.scss +83 -0
- package/dist/stories/Article/ListOfContent/ListOfContent.stories.js +66 -0
- package/dist/stories/Article/ListOfContent/img/time_icon.svg +3 -0
- package/dist/stories/Article/ListOfContent/img/view_icon.svg +3 -0
- package/dist/stories/Article/RecommendationList/RecommendationList.js +31 -0
- package/dist/stories/Article/RecommendationList/RecommendationList.scss +41 -0
- package/dist/stories/Article/TextArticle/TextArticle.js +129 -0
- package/dist/stories/Article/TextArticle/TextArticle.scss +43 -0
- package/dist/stories/Article/TitleText/TitleText.js +30 -0
- package/dist/stories/Article/TitleText/TitleText.scss +33 -0
- package/dist/stories/Article/YellowInformationBox/YellowInformationBox.js +30 -0
- package/dist/stories/Article/YellowInformationBox/YellowInformationBox.scss +46 -0
- package/dist/stories/Article/YellowInformationBox/img/bell.svg +9 -0
- package/dist/stories/Article/img/bell.svg +9 -0
- package/dist/stories/Article/img/btn-add-round.svg +4 -0
- package/dist/stories/Article/img/calendar_icon.svg +6 -0
- package/dist/stories/Article/img/close-round.svg +3 -0
- package/dist/stories/Article/img/close.svg +9 -0
- package/dist/stories/Article/img/copy_icon.svg +5 -0
- package/dist/stories/Article/img/info.svg +9 -0
- package/dist/stories/Article/img/ok_icon.svg +5 -0
- package/dist/stories/Article/img/share_icon.svg +5 -0
- package/dist/stories/Article/img/tg_icon.svg +5 -0
- package/dist/stories/Article/img/time_icon.svg +6 -0
- package/dist/stories/Article/img/view_icon.svg +6 -0
- package/dist/stories/Article/img/vk_icon.svg +5 -0
- package/dist/stories/Article/img/whatsapp_icon.svg +5 -0
- package/dist/stories/ArticleMainContainer/ArticleMainContainer.js +540 -0
- package/dist/stories/ArticleMainContainer/ArticleMainContainer.scss +377 -0
- package/dist/stories/ArticleMainContainer/ArticleMainContainer.stories.js +75 -0
- package/dist/stories/ArticleMainContainer/main/page.js +1 -0
- package/dist/stories/ArticleMinBox/ArticleMinBox.js +172 -0
- package/dist/stories/ArticleMinBox/ArticleMinBox.scss +38 -0
- package/dist/stories/ArticleMinBox/ArticleMinBox.stories.js +56 -0
- package/dist/stories/BasicSelection/BasicSelection.js +143 -0
- package/dist/stories/BasicSelection/BasicSelection.scss +97 -0
- package/dist/stories/BasicSelection/BasicSelection.stories.js +32 -0
- package/dist/stories/Breadcrumb/Breadcrumb.js +113 -0
- package/dist/stories/Breadcrumb/Breadcrumb.scss +92 -0
- package/dist/stories/Breadcrumb/Breadcrums.stories.js +31 -0
- package/dist/stories/Breadcrumb/img/drop-right.svg +3 -0
- package/dist/stories/Breadcrumb/img/home_icon.svg +5 -0
- package/dist/stories/ButtonBasic/ButtonBasic.js +70 -0
- package/dist/stories/ButtonBasic/ButtonBasic.scss +242 -0
- package/dist/stories/ButtonBasic/ButtonBasic.stories.js +60 -0
- package/dist/stories/Checkbox/Checkbox.js +70 -0
- package/dist/stories/Checkbox/Checkbox.scss +128 -0
- package/dist/stories/Checkbox/Checkbox.stories.js +49 -0
- package/dist/stories/Checkbox/img/check.svg +3 -0
- package/dist/stories/CheckboxToggle/CheckboxToggle.js +54 -0
- package/dist/stories/CheckboxToggle/CheckboxToggle.scss +117 -0
- package/dist/stories/CheckboxToggle/CheckboxToggle.stories.js +26 -0
- package/dist/stories/DropDownSelector/DownSelector.js +352 -0
- package/dist/stories/DropDownSelector/DownSelector.stories.js +161 -0
- package/dist/stories/DropDownSelector/DropdownSelector.scss +272 -0
- package/dist/stories/DropDownSelector/img/close_icon.svg +6 -0
- package/dist/stories/DropDownSelector/img/close_icon_disabled.svg +6 -0
- package/dist/stories/InputDinamycPlaceholder/InputDinamycPlaceholder.js +162 -0
- package/dist/stories/InputDinamycPlaceholder/InputDinamycPlaceholder.scss +475 -0
- package/dist/stories/InputDinamycPlaceholder/InputDinamycPlaceholder.stories.js +50 -0
- package/dist/stories/InputDinamycPlaceholder/img/close_grey.svg +5 -0
- package/dist/stories/InputDinamycPlaceholder/img/close_red.svg +5 -0
- package/dist/stories/InputDinamycPlaceholder/img/hide.svg +12 -0
- package/dist/stories/InputDinamycPlaceholder/img/info_tooltip.svg +12 -0
- package/dist/stories/InputDinamycPlaceholder/img/show.svg +3 -0
- package/dist/stories/InputDynamicWidth/InputDynamicWidth.js +85 -0
- package/dist/stories/InputDynamicWidth/InputDynamicWidth.scss +98 -0
- package/dist/stories/InputDynamicWidth/InputDynamicWidth.stories.js +32 -0
- package/dist/stories/InputDynamicWidth/img/close_icon.svg +3 -0
- package/dist/stories/InputDynamicWidth/img/search_icon.svg +6 -0
- package/dist/stories/LongTileArticleBox/LongTileArticleBox.js +168 -0
- package/dist/stories/LongTileArticleBox/LongTileArticleBox.scss +360 -0
- package/dist/stories/LongTileArticleBox/LongTileArticleBox.stories.js +39 -0
- package/dist/stories/LongTileArticleBox/img/arrow_blue.svg +6 -0
- package/dist/stories/LongTileArticleBox/img/calendar_icon.svg +6 -0
- package/dist/stories/LongTileArticleBox/img/copy_icon.svg +5 -0
- package/dist/stories/LongTileArticleBox/img/ok_icon.svg +5 -0
- package/dist/stories/LongTileArticleBox/img/share_icon.svg +5 -0
- package/dist/stories/LongTileArticleBox/img/tag_icon.svg +5 -0
- package/dist/stories/LongTileArticleBox/img/tg_icon.svg +5 -0
- package/dist/stories/LongTileArticleBox/img/time_icon.svg +6 -0
- package/dist/stories/LongTileArticleBox/img/view_icon.svg +6 -0
- package/dist/stories/LongTileArticleBox/img/vk_icon.svg +5 -0
- package/dist/stories/LongTileArticleBox/img/whatsapp_icon.svg +5 -0
- package/dist/stories/ModalArticleAddElement/ModalArticleAddElement.js +128 -0
- package/dist/stories/ModalArticleAddElement/ModalArticleAddElement.scss +124 -0
- package/dist/stories/ModalArticleAddElement/ModalArticleAddElement.stories.js +19 -0
- package/dist/stories/ModalBitrixForm/ModalBitrixForm.js +236 -0
- package/dist/stories/ModalBitrixForm/ModalBitrixForm.scss +167 -0
- package/dist/stories/ModalBitrixForm/ModalBitrixForm.stories.js +101 -0
- package/dist/stories/ModalBitrixForm/img/close_icon.svg +3 -0
- package/dist/stories/ModalBitrixForm/img/done_icon.svg +3 -0
- package/dist/stories/ModalBitrixForm/img/ozon.svg +9 -0
- package/dist/stories/ModalBitrixForm/img/ozon_bkg.svg +9 -0
- package/dist/stories/MultilevelSidebar/MultilevelSidebar.js +472 -0
- package/dist/stories/MultilevelSidebar/MultilevelSidebar.scss +237 -0
- package/dist/stories/MultilevelSidebar/MultilevelSidebar.stories.js +80 -0
- package/dist/stories/MultilevelSidebar/MultilevelSidebarStorybook.scss +7 -0
- package/dist/stories/MultilevelSidebar/img/drop.svg +3 -0
- package/dist/stories/MultilevelSidebar/img/settings.svg +4 -0
- package/dist/stories/NoArticles/NoArticles.js +29 -0
- package/dist/stories/NoArticles/NoArticles.scss +26 -0
- package/dist/stories/NoArticles/NoArticles.stories.js +20 -0
- package/dist/stories/NoArticles/img/banner.svg +266 -0
- package/dist/stories/Paginator/Paginator.js +254 -0
- package/dist/stories/Paginator/Paginator.scss +168 -0
- package/dist/stories/Paginator/Paginator.stories.js +56 -0
- package/dist/stories/Paginator/img/arrow_blue.svg +3 -0
- package/dist/stories/Paginator/img/arrow_next.svg +3 -0
- package/dist/stories/Paginator/img/arrow_prev.svg +3 -0
- package/dist/stories/ResultsFound/ResultsFound.js +269 -0
- package/dist/stories/ResultsFound/ResultsFound.scss +139 -0
- package/dist/stories/ResultsFound/ResultsFound.stories.js +25 -0
- package/dist/stories/ResultsFound/img/arrow_icon.svg +5 -0
- package/dist/stories/ResultsFound/img/no-data_img.svg +13 -0
- package/dist/stories/ShortTileArticleBox/ShortTileArticleBox.js +160 -0
- package/dist/stories/ShortTileArticleBox/ShortTileArticleBox.scss +827 -0
- package/dist/stories/ShortTileArticleBox/ShortTileArticleBox.stories.js +42 -0
- package/dist/stories/ShortTileArticleBox/img/arrow_blue.svg +6 -0
- package/dist/stories/ShortTileArticleBox/img/calendar_icon.svg +6 -0
- package/dist/stories/ShortTileArticleBox/img/copy_icon.svg +5 -0
- package/dist/stories/ShortTileArticleBox/img/ok_icon.svg +5 -0
- package/dist/stories/ShortTileArticleBox/img/share_icon.svg +5 -0
- package/dist/stories/ShortTileArticleBox/img/tag_icon.svg +5 -0
- package/dist/stories/ShortTileArticleBox/img/tg_icon.svg +5 -0
- package/dist/stories/ShortTileArticleBox/img/time_icon.svg +6 -0
- package/dist/stories/ShortTileArticleBox/img/view_icon.svg +6 -0
- package/dist/stories/ShortTileArticleBox/img/vk_icon.svg +5 -0
- package/dist/stories/ShortTileArticleBox/img/whatsapp_icon.svg +5 -0
- package/dist/stories/SliderCarousel/SliderCarousel.js +77 -0
- package/dist/stories/SliderCarousel/SliderCarousel.scss +85 -0
- package/dist/stories/SliderCarousel/SliderCarousel.stories.js +29 -0
- package/dist/stories/SliderCarousel/img/no_image.svg +3 -0
- package/dist/stories/Table/Filters/OptionsDate.js +208 -0
- package/dist/stories/Table/Filters/OptionsImage.js +92 -0
- package/dist/stories/Table/Filters/OptionsImage.scss +10 -0
- package/dist/stories/Table/Filters/OptionsList.js +244 -0
- package/dist/stories/Table/Filters/OptionsNumber.js +220 -0
- package/dist/stories/Table/Filters/OptionsNumber.scss +100 -0
- package/dist/stories/Table/Filters/OptionsText.js +165 -0
- package/dist/stories/Table/Filters/OptionsText.scss +71 -0
- package/dist/stories/Table/Filters/img/FilterDefault.js +26 -0
- package/dist/stories/Table/Filters/img/FilterReset.js +41 -0
- package/dist/stories/Table/Filters/img/dropFilters.png +0 -0
- package/dist/stories/Table/Filters/img/filterDefault.svg +3 -0
- package/dist/stories/Table/Filters/img/filter_blue.svg +3 -0
- package/dist/stories/Table/Filters/img/filter_blue_background.svg +5 -0
- package/dist/stories/Table/Filters/img/filter_reset.svg +7 -0
- package/dist/stories/Table/InputWithState/InputWithState.js +36 -0
- package/dist/stories/Table/RenderFiltersTh/RenderFiltersTh.js +140 -0
- package/dist/stories/Table/RenderTd/RenderTd.js +19 -0
- package/dist/stories/Table/RenderTh/RenderTh.js +112 -0
- package/dist/stories/Table/Table.js +1568 -0
- package/dist/stories/Table/Table.scss +1524 -0
- package/dist/stories/Table/Table.stories.js +83 -0
- package/dist/stories/Table/TableChartTd/TableChartTd.js +172 -0
- package/dist/stories/Table/TableChartTd/TableChartTd.scss +0 -0
- package/dist/stories/Table/TdDate/TdDate.js +36 -0
- package/dist/stories/Table/TdDate/TdDate.scss +0 -0
- package/dist/stories/Table/TdDate.js +34 -0
- package/dist/stories/Table/TypeTdImage.js +85 -0
- package/dist/stories/Table/img/Search.png +0 -0
- package/dist/stories/Table/img/SortArrow.js +12 -0
- package/dist/stories/Table/img/SortArrowUp.js +12 -0
- package/dist/stories/Table/img/SortTable.js +14 -0
- package/dist/stories/Table/img/close_icon.svg +7 -0
- package/dist/stories/Table/img/close_white.svg +3 -0
- package/dist/stories/Table/img/context-menu.svg +6 -0
- package/dist/stories/Table/img/contextMenuBtn.png +0 -0
- package/dist/stories/Table/img/delete_icon.svg +8 -0
- package/dist/stories/Table/img/dropFilters.png +0 -0
- package/dist/stories/Table/img/filter.png +0 -0
- package/dist/stories/Table/img/filterDefault.png +0 -0
- package/dist/stories/Table/img/filter_blue.svg +3 -0
- package/dist/stories/Table/img/filter_blue_background.svg +5 -0
- package/dist/stories/Table/img/imageNotFound.svg +3 -0
- package/dist/stories/Table/img/location.svg +3 -0
- package/dist/stories/Table/img/sort_arrow_down.svg +6 -0
- package/dist/stories/Table/img/sort_arrow_up.svg +4 -0
- package/dist/stories/Table/img/sort_table.svg +8 -0
- package/dist/stories/Table/svg_img.js +8 -0
- package/dist/stories/TableBox/TableBox.js +304 -0
- package/dist/stories/TableBox/TableBox.scss +418 -0
- package/dist/stories/TableBox/TableBox.stories.js +124 -0
- package/dist/stories/TableBox/img/delete_icon.svg +9 -0
- package/dist/stories/TableBox/img/forward_icon.svg +9 -0
- package/dist/stories/TableBox/img/more_icon.svg +10 -0
- package/dist/stories/TableBox/img_stories/tag_icon.svg +5 -0
- package/dist/stories/TextareaDynamicPlaceholder/TextareaDynamicPlaceholder.js +91 -0
- package/dist/stories/TextareaDynamicPlaceholder/TextareaDynamicPlaceholder.scss +124 -0
- package/dist/stories/TextareaDynamicPlaceholder/TextareaDynamicPlaceholder.stories.js +29 -0
- package/dist/stories/TitleContentEditable/TitleContentEditable.js +71 -0
- package/dist/stories/TitleContentEditable/TitleContentEditable.scss +69 -0
- package/dist/stories/TitleContentEditable/TitleContentEditable.stories.js +37 -0
- package/dist/stories/ViewSwitch/ViewSwitch.js +48 -0
- package/dist/stories/ViewSwitch/ViewSwitch.scss +135 -0
- package/dist/stories/ViewSwitch/ViewSwitch.stories.js +48 -0
- package/dist/stories/ViewSwitch/img/Chat.js +24 -0
- package/dist/stories/ViewSwitch/img/Table.js +21 -0
- package/dist/stories/ViewSwitch/img/Tile.js +20 -0
- package/dist/stories/ViewSwitch/img/TileLong.js +20 -0
- package/dist/styles/font.scss +93 -0
- package/dist/styles/globals.scss +66 -0
- package/package.json +1 -1
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _Feedback = _interopRequireDefault(require("./Feedback/Feedback"));
|
|
9
|
+
var _time_icon = _interopRequireDefault(require("./img/time_icon.svg"));
|
|
10
|
+
var _view_icon = _interopRequireDefault(require("./img/view_icon.svg"));
|
|
11
|
+
var _calendar_icon = _interopRequireDefault(require("./img/calendar_icon.svg"));
|
|
12
|
+
var _ListOfContent = _interopRequireDefault(require("./ListOfContent/ListOfContent"));
|
|
13
|
+
var _ShortTileArticleBox = _interopRequireDefault(require("../ShortTileArticleBox/ShortTileArticleBox"));
|
|
14
|
+
var _TitleContentEditable = _interopRequireDefault(require("../TitleContentEditable/TitleContentEditable"));
|
|
15
|
+
var _InputDinamycPlaceholder = _interopRequireDefault(require("../InputDinamycPlaceholder/InputDinamycPlaceholder"));
|
|
16
|
+
var _reactSpinners = require("react-spinners");
|
|
17
|
+
var _utils = require("../../common/utils");
|
|
18
|
+
var _reactDom = require("react-dom");
|
|
19
|
+
var _ShareComponent = require("../../components/ShareComponent/ShareComponent");
|
|
20
|
+
var _material = require("@mui/material");
|
|
21
|
+
var _ModalArticleAddElement = require("../ModalArticleAddElement/ModalArticleAddElement");
|
|
22
|
+
var _react = require("react");
|
|
23
|
+
var _ArticleElement = _interopRequireWildcard(require("./ArticleElement"));
|
|
24
|
+
require("./Article.scss");
|
|
25
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
26
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
27
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
28
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
29
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
30
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
31
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
33
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
34
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
35
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
36
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
37
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
38
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
39
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
40
|
+
var ArticleView = function ArticleView(_ref) {
|
|
41
|
+
var _apiData$author, _apiData$author2, _apiData$author$, _Date, _apiData$preview;
|
|
42
|
+
var loading = _ref.loading,
|
|
43
|
+
readonly = _ref.readonly,
|
|
44
|
+
apiData = _ref.apiData,
|
|
45
|
+
contentData = _ref.contentData,
|
|
46
|
+
setContentData = _ref.setContentData,
|
|
47
|
+
setListOfContent = _ref.setListOfContent,
|
|
48
|
+
publishEventSource = _ref.publishEventSource,
|
|
49
|
+
portalId = _ref.portalId,
|
|
50
|
+
setChanged = _ref.setChanged,
|
|
51
|
+
isNew = _ref.isNew,
|
|
52
|
+
articleTitle = _ref.articleTitle,
|
|
53
|
+
_ref$showTitle = _ref.showTitle,
|
|
54
|
+
showTitle = _ref$showTitle === void 0 ? true : _ref$showTitle,
|
|
55
|
+
setArticleTitle = _ref.setArticleTitle,
|
|
56
|
+
articleTitleRef = _ref.articleTitleRef,
|
|
57
|
+
setContentChanged = _ref.setContentChanged,
|
|
58
|
+
_ref$hideInfoPanel = _ref.hideInfoPanel,
|
|
59
|
+
hideInfoPanel = _ref$hideInfoPanel === void 0 ? false : _ref$hideInfoPanel,
|
|
60
|
+
_ref$hideRecommendati = _ref.hideRecommendation,
|
|
61
|
+
hideRecommendation = _ref$hideRecommendati === void 0 ? false : _ref$hideRecommendati,
|
|
62
|
+
contentLinks = _ref.contentLinks,
|
|
63
|
+
articlePath = _ref.articlePath,
|
|
64
|
+
articleId = _ref.articleId,
|
|
65
|
+
title = _ref.title,
|
|
66
|
+
_setTitle = _ref.setTitle,
|
|
67
|
+
description = _ref.description,
|
|
68
|
+
setDescription = _ref.setDescription;
|
|
69
|
+
var _useState = (0, _react.useState)(false),
|
|
70
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
71
|
+
showAddBlockPopup = _useState2[0],
|
|
72
|
+
setShowAddBlockPopup = _useState2[1];
|
|
73
|
+
var _useState3 = (0, _react.useState)(),
|
|
74
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
75
|
+
newElementPosition = _useState4[0],
|
|
76
|
+
setNewElementPosition = _useState4[1];
|
|
77
|
+
var id = (0, _react.useId)();
|
|
78
|
+
var _useState5 = (0, _react.useState)(id),
|
|
79
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
80
|
+
changeId = _useState6[0],
|
|
81
|
+
setChangeId = _useState6[1];
|
|
82
|
+
var _useState7 = (0, _react.useState)(function () {
|
|
83
|
+
var _localStorage$getItem;
|
|
84
|
+
return (_localStorage$getItem = localStorage.getItem('lang')) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : 'rus';
|
|
85
|
+
}),
|
|
86
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
87
|
+
activeLang = _useState8[0],
|
|
88
|
+
setActiveLang = _useState8[1];
|
|
89
|
+
var _useState9 = (0, _react.useState)(false),
|
|
90
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
91
|
+
isDropShare = _useState10[0],
|
|
92
|
+
setIsDropShare = _useState10[1];
|
|
93
|
+
var componentRefs = [];
|
|
94
|
+
var getSavedArray = function getSavedArray() {
|
|
95
|
+
var result = [];
|
|
96
|
+
componentRefs.forEach(function (element) {
|
|
97
|
+
result.push({
|
|
98
|
+
type: element.type,
|
|
99
|
+
data: element.getData(),
|
|
100
|
+
id: element.id
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
return result;
|
|
104
|
+
};
|
|
105
|
+
var translateAuthor = function translateAuthor() {
|
|
106
|
+
if (apiData !== null && apiData !== void 0 && apiData.author) {
|
|
107
|
+
if (activeLang == 'eng') return (0, _utils.transliter)(apiData === null || apiData === void 0 ? void 0 : apiData.author[0]);
|
|
108
|
+
if (activeLang == 'tur') return (0, _utils.transliter)(apiData === null || apiData === void 0 ? void 0 : apiData.author[0]);
|
|
109
|
+
} else {
|
|
110
|
+
if (activeLang == 'rus') return 'Неизвестный автор';
|
|
111
|
+
if (activeLang == 'tur') return 'Bilinmeyen Yazar';
|
|
112
|
+
if (activeLang == 'eng') return 'Unknown_author';
|
|
113
|
+
}
|
|
114
|
+
return (0, _utils.transliter)(apiData === null || apiData === void 0 ? void 0 : apiData.author[0]);
|
|
115
|
+
};
|
|
116
|
+
var translateMin = function translateMin() {
|
|
117
|
+
if (activeLang == 'eng') return 'min';
|
|
118
|
+
if (activeLang == 'tur') return 'dak';
|
|
119
|
+
return 'мин';
|
|
120
|
+
};
|
|
121
|
+
var translateNoViews = function translateNoViews() {
|
|
122
|
+
if (activeLang == 'eng') return 'Нет просмотров';
|
|
123
|
+
if (activeLang == 'tur') return 'Görüntüleme yok';
|
|
124
|
+
return 'Нет просмотров';
|
|
125
|
+
};
|
|
126
|
+
var translateRecommendations = function translateRecommendations() {
|
|
127
|
+
if (activeLang == 'eng') return 'This is going to be interesting';
|
|
128
|
+
if (activeLang == 'tur') return ' Ilginiz çeker';
|
|
129
|
+
return 'Будет интересно';
|
|
130
|
+
};
|
|
131
|
+
var applyRef = function applyRef(element) {
|
|
132
|
+
if (element) componentRefs.push(element);
|
|
133
|
+
};
|
|
134
|
+
var onChildElementChange = function onChildElementChange() {
|
|
135
|
+
computeContentList();
|
|
136
|
+
setChangeId(function (prev) {
|
|
137
|
+
return prev + 1;
|
|
138
|
+
});
|
|
139
|
+
if (typeof setChanged === 'function') {
|
|
140
|
+
setChanged(true);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
var noContent = Array.isArray(contentData) ? (contentData === null || contentData === void 0 ? void 0 : contentData.length) === 0 : 0;
|
|
144
|
+
var addNewBlock = function addNewBlock(type) {
|
|
145
|
+
// we have to collect changes from HTML here, otherwise all new blocks will be empty
|
|
146
|
+
// console.log(type);
|
|
147
|
+
var stateWithChanges = getSavedArray();
|
|
148
|
+
var stateCopy = [].concat(_toConsumableArray(stateWithChanges.slice(0, newElementPosition + 1)), [{
|
|
149
|
+
type: type,
|
|
150
|
+
data: ''
|
|
151
|
+
}], _toConsumableArray(stateWithChanges.slice(newElementPosition + 1)));
|
|
152
|
+
setContentData(stateCopy);
|
|
153
|
+
if (typeof setChanged === 'function') {
|
|
154
|
+
setChanged(true);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
var computeContentList = function computeContentList() {
|
|
158
|
+
return setListOfContent(componentRefs.filter(function (ref) {
|
|
159
|
+
return ref.type === _ArticleElement.ARTICLE_TYPES.header;
|
|
160
|
+
}).map(function (ref) {
|
|
161
|
+
return {
|
|
162
|
+
linkText: ref.getData(),
|
|
163
|
+
path: "".concat(ref.getId())
|
|
164
|
+
};
|
|
165
|
+
}));
|
|
166
|
+
};
|
|
167
|
+
var deleteBlock = function deleteBlock(position) {
|
|
168
|
+
// we have to collect changes from HTML here, otherwise all new blocks will be empty
|
|
169
|
+
var stateWithChanges = getSavedArray();
|
|
170
|
+
var stateCopy = _toConsumableArray(stateWithChanges);
|
|
171
|
+
stateCopy.splice(position, 1);
|
|
172
|
+
setContentData(stateCopy);
|
|
173
|
+
if (typeof setChanged === 'function') {
|
|
174
|
+
setChanged(true);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// подписываемся на click event кнопки, по которой вызывается паблишинг, чтобы на момент срабатывания в родительском компоненте были свежие данные
|
|
179
|
+
(0, _react.useEffect)(function () {
|
|
180
|
+
function updateContent() {
|
|
181
|
+
setContentData(getSavedArray());
|
|
182
|
+
}
|
|
183
|
+
if (publishEventSource) {
|
|
184
|
+
publishEventSource.addEventListener('click', updateContent);
|
|
185
|
+
}
|
|
186
|
+
return function () {
|
|
187
|
+
if (publishEventSource) {
|
|
188
|
+
publishEventSource.removeEventListener('click', updateContent);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
}, [changeId, contentData]);
|
|
192
|
+
(0, _react.useEffect)(function () {
|
|
193
|
+
if (!(apiData !== null && apiData !== void 0 && apiData.content)) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
var content = [];
|
|
197
|
+
var _iterator = _createForOfIteratorHelper(apiData.content.sort(function (a, b) {
|
|
198
|
+
return a.place - b.place;
|
|
199
|
+
})),
|
|
200
|
+
_step;
|
|
201
|
+
try {
|
|
202
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
203
|
+
var element = _step.value;
|
|
204
|
+
var articleElement = {
|
|
205
|
+
id: element.id
|
|
206
|
+
};
|
|
207
|
+
content.push(articleElement);
|
|
208
|
+
var keys = Object.keys(element);
|
|
209
|
+
if (keys.find(function (name) {
|
|
210
|
+
return name.startsWith('header');
|
|
211
|
+
})) {
|
|
212
|
+
articleElement.type = _ArticleElement.ARTICLE_TYPES.header;
|
|
213
|
+
articleElement.data = element.header_text;
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (keys.find(function (name) {
|
|
217
|
+
return name.startsWith('text');
|
|
218
|
+
})) {
|
|
219
|
+
articleElement.type = _ArticleElement.ARTICLE_TYPES.description;
|
|
220
|
+
articleElement.data = element.text;
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
if (keys.find(function (name) {
|
|
224
|
+
return name.startsWith('photo');
|
|
225
|
+
})) {
|
|
226
|
+
articleElement.type = _ArticleElement.ARTICLE_TYPES.image;
|
|
227
|
+
articleElement.data = {
|
|
228
|
+
value: element.value,
|
|
229
|
+
alt: element === null || element === void 0 ? void 0 : element.alt
|
|
230
|
+
};
|
|
231
|
+
articleElement.data = {
|
|
232
|
+
value: element.value,
|
|
233
|
+
alt: element === null || element === void 0 ? void 0 : element.alt
|
|
234
|
+
};
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (keys.find(function (name) {
|
|
238
|
+
return name.startsWith('notification');
|
|
239
|
+
})) {
|
|
240
|
+
articleElement.type = _ArticleElement.ARTICLE_TYPES.warningBlock;
|
|
241
|
+
articleElement.data = element.notification_text;
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
if (keys.find(function (name) {
|
|
245
|
+
return name.startsWith('formBtn');
|
|
246
|
+
})) {
|
|
247
|
+
articleElement.type = _ArticleElement.ARTICLE_TYPES.formBtn;
|
|
248
|
+
articleElement.data = element.formBtn;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
} catch (err) {
|
|
253
|
+
_iterator.e(err);
|
|
254
|
+
} finally {
|
|
255
|
+
_iterator.f();
|
|
256
|
+
}
|
|
257
|
+
setContentData(content);
|
|
258
|
+
}, [apiData]);
|
|
259
|
+
|
|
260
|
+
// эффект для обновления содержания
|
|
261
|
+
(0, _react.useEffect)(function () {
|
|
262
|
+
computeContentList();
|
|
263
|
+
}, [contentData]);
|
|
264
|
+
|
|
265
|
+
// Обработчик на клик вне элемента
|
|
266
|
+
(0, _react.useEffect)(function () {
|
|
267
|
+
var isDrop = function isDrop(e) {
|
|
268
|
+
var el = e.target;
|
|
269
|
+
if (!el.closest("#share")) {
|
|
270
|
+
setIsDropShare(false);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
document.addEventListener('click', isDrop);
|
|
274
|
+
return function () {
|
|
275
|
+
document.addEventListener('click', isDrop);
|
|
276
|
+
};
|
|
277
|
+
}, []);
|
|
278
|
+
var contentComponents = contentData === null || contentData === void 0 ? void 0 : contentData.map(function (articleElement, index) {
|
|
279
|
+
return /*#__PURE__*/React.createElement(_ArticleElement["default"], _extends({
|
|
280
|
+
isNew: isNew,
|
|
281
|
+
key: articleElement.id ? articleElement.id : articleElement.type + articleElement.data + index,
|
|
282
|
+
isFirstElement: index === 0
|
|
283
|
+
}, articleElement, {
|
|
284
|
+
setShowAddBlockPopup: setShowAddBlockPopup,
|
|
285
|
+
setNewElementPosition: setNewElementPosition,
|
|
286
|
+
position: index,
|
|
287
|
+
editMode: !readonly,
|
|
288
|
+
ref: applyRef,
|
|
289
|
+
onChange: onChildElementChange,
|
|
290
|
+
onDelete: deleteBlock
|
|
291
|
+
}));
|
|
292
|
+
});
|
|
293
|
+
(0, _react.useEffect)(function () {
|
|
294
|
+
window.scrollTo(0, 0);
|
|
295
|
+
}, []);
|
|
296
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
297
|
+
className: "article-view"
|
|
298
|
+
}, showAddBlockPopup && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/React.createElement(_ModalArticleAddElement.ModalArticleAddElement, {
|
|
299
|
+
onAddClick: function onAddClick(type) {
|
|
300
|
+
return addNewBlock(type);
|
|
301
|
+
},
|
|
302
|
+
setShowModal: setShowAddBlockPopup
|
|
303
|
+
}), document.getElementById(portalId)), /*#__PURE__*/React.createElement("section", {
|
|
304
|
+
className: "article-view__content"
|
|
305
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
306
|
+
className: "article"
|
|
307
|
+
}, loading ? /*#__PURE__*/React.createElement("div", {
|
|
308
|
+
className: "article-loader"
|
|
309
|
+
}, /*#__PURE__*/React.createElement(_reactSpinners.MoonLoader, {
|
|
310
|
+
color: "#7b7b7b",
|
|
311
|
+
speedMultiplier: 0.5
|
|
312
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, readonly ? showTitle ? /*#__PURE__*/React.createElement("div", {
|
|
313
|
+
className: "title-box"
|
|
314
|
+
}, /*#__PURE__*/React.createElement("h1", {
|
|
315
|
+
className: "title__big"
|
|
316
|
+
}, articleTitle)) : null : /*#__PURE__*/React.createElement("div", {
|
|
317
|
+
className: "title-box"
|
|
318
|
+
}, /*#__PURE__*/React.createElement(_material.TextareaAutosize, {
|
|
319
|
+
type: "text",
|
|
320
|
+
ref: articleTitleRef,
|
|
321
|
+
placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A",
|
|
322
|
+
className: "title__big title-input",
|
|
323
|
+
value: articleTitle,
|
|
324
|
+
onChange: function onChange(e) {
|
|
325
|
+
setContentChanged(true);
|
|
326
|
+
setArticleTitle(e.target.value);
|
|
327
|
+
},
|
|
328
|
+
autoFocus: true
|
|
329
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
330
|
+
className: "btn-group"
|
|
331
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
332
|
+
onClick: function onClick() {
|
|
333
|
+
return articleTitleRef.current.focus();
|
|
334
|
+
},
|
|
335
|
+
className: "btn__edit-light"
|
|
336
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
337
|
+
onClick: function onClick() {
|
|
338
|
+
return setArticleTitle("");
|
|
339
|
+
},
|
|
340
|
+
className: "btn__delete-light"
|
|
341
|
+
}))), !readonly && /*#__PURE__*/React.createElement("div", {
|
|
342
|
+
className: "article__input-group"
|
|
343
|
+
}, /*#__PURE__*/React.createElement(_TitleContentEditable["default"], {
|
|
344
|
+
titleStatic: "Title",
|
|
345
|
+
placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 title \u0434\u043B\u044F \u0441\u0442\u0430\u0442\u044C\u0438 (70 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432)",
|
|
346
|
+
title: title,
|
|
347
|
+
setTitle: function setTitle(e) {
|
|
348
|
+
return function (value) {
|
|
349
|
+
if (typeof _setTitle === 'function') {
|
|
350
|
+
_setTitle(value);
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
},
|
|
354
|
+
maxlength: 70
|
|
355
|
+
}), /*#__PURE__*/React.createElement(_TitleContentEditable["default"], {
|
|
356
|
+
titleStatic: "Description",
|
|
357
|
+
placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 description \u0434\u043B\u044F \u0441\u0442\u0430\u0442\u044C\u0438 (140 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432)",
|
|
358
|
+
title: description,
|
|
359
|
+
setTitle: function setTitle(value) {
|
|
360
|
+
if (typeof setDescription === 'function') {
|
|
361
|
+
setDescription(value);
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
maxlength: 140
|
|
365
|
+
})), apiData && !hideInfoPanel && readonly && /*#__PURE__*/React.createElement("div", {
|
|
366
|
+
className: "toolbar-bottom"
|
|
367
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
368
|
+
className: "author-box"
|
|
369
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
370
|
+
className: "author-avatar",
|
|
371
|
+
style: {
|
|
372
|
+
backgroundColor: Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.author) && (apiData === null || apiData === void 0 || (_apiData$author = apiData.author) === null || _apiData$author === void 0 ? void 0 : _apiData$author.length) > 1 ? apiData === null || apiData === void 0 ? void 0 : apiData.author[1] : ''
|
|
373
|
+
}
|
|
374
|
+
}, (Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.author) && (apiData === null || apiData === void 0 || (_apiData$author2 = apiData.author) === null || _apiData$author2 === void 0 ? void 0 : _apiData$author2.length) > 0) > 0 ? apiData === null || apiData === void 0 || (_apiData$author$ = apiData.author[0]) === null || _apiData$author$ === void 0 || (_apiData$author$ = _apiData$author$.split(' ').map(function (str) {
|
|
375
|
+
return str[0];
|
|
376
|
+
}).reduce(function (acc, current) {
|
|
377
|
+
return acc += current;
|
|
378
|
+
}, '')) === null || _apiData$author$ === void 0 ? void 0 : _apiData$author$.toUpperCase() : '-'), /*#__PURE__*/React.createElement("p", {
|
|
379
|
+
className: "text"
|
|
380
|
+
}, translateAuthor())), /*#__PURE__*/React.createElement("div", {
|
|
381
|
+
className: "right-content"
|
|
382
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
383
|
+
className: "date-box"
|
|
384
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
385
|
+
src: _calendar_icon["default"]
|
|
386
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
387
|
+
className: "text"
|
|
388
|
+
}, apiData !== null && apiData !== void 0 && apiData.date ? (_Date = new Date(apiData === null || apiData === void 0 ? void 0 : apiData.date)) === null || _Date === void 0 ? void 0 : _Date.toLocaleDateString('ru-ru') : 'Неизвестная дата')), /*#__PURE__*/React.createElement("div", {
|
|
389
|
+
className: "view-box"
|
|
390
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
391
|
+
className: "icon-box"
|
|
392
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
393
|
+
src: _view_icon["default"]
|
|
394
|
+
})), /*#__PURE__*/React.createElement("p", {
|
|
395
|
+
className: "text"
|
|
396
|
+
}, apiData !== null && apiData !== void 0 && apiData.views ? apiData === null || apiData === void 0 ? void 0 : apiData.views : translateNoViews())), /*#__PURE__*/React.createElement("div", {
|
|
397
|
+
className: "time-box"
|
|
398
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
399
|
+
className: "icon-box"
|
|
400
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
401
|
+
src: _time_icon["default"]
|
|
402
|
+
})), /*#__PURE__*/React.createElement("p", {
|
|
403
|
+
className: "text"
|
|
404
|
+
}, "".concat(apiData !== null && apiData !== void 0 && apiData.reading_time_min ? apiData === null || apiData === void 0 ? void 0 : apiData.reading_time_min : '-', " ").concat(translateMin()))), /*#__PURE__*/React.createElement(_ShareComponent.ShareComponent, {
|
|
405
|
+
activeLang: activeLang,
|
|
406
|
+
id: articleId,
|
|
407
|
+
articlePath: articlePath
|
|
408
|
+
}))), /*#__PURE__*/React.createElement(_ListOfContent["default"], {
|
|
409
|
+
readonly: true,
|
|
410
|
+
links: contentLinks,
|
|
411
|
+
lang: activeLang
|
|
412
|
+
}), contentComponents), !readonly && /*#__PURE__*/React.createElement("div", {
|
|
413
|
+
className: "btn-box"
|
|
414
|
+
}, noContent && /*#__PURE__*/React.createElement("button", {
|
|
415
|
+
className: "btn__round-blue",
|
|
416
|
+
onClick: function onClick(e) {
|
|
417
|
+
return setShowAddBlockPopup(true);
|
|
418
|
+
}
|
|
419
|
+
})), /*#__PURE__*/React.createElement(_Feedback["default"], null))), readonly && !hideRecommendation && /*#__PURE__*/React.createElement("div", {
|
|
420
|
+
className: "article-view__this-will-be-interesting"
|
|
421
|
+
}, /*#__PURE__*/React.createElement("h2", {
|
|
422
|
+
className: "title"
|
|
423
|
+
}, translateRecommendations()), /*#__PURE__*/React.createElement("div", {
|
|
424
|
+
className: "article-view__this-will-be-interesting__content"
|
|
425
|
+
}, apiData === null || apiData === void 0 || (_apiData$preview = apiData.preview) === null || _apiData$preview === void 0 ? void 0 : _apiData$preview.map(function (el) {
|
|
426
|
+
return /*#__PURE__*/React.createElement(_ShortTileArticleBox["default"], _extends({
|
|
427
|
+
key: el
|
|
428
|
+
}, el, {
|
|
429
|
+
id: el.id,
|
|
430
|
+
name: el === null || el === void 0 ? void 0 : el.cpu,
|
|
431
|
+
views: el === null || el === void 0 ? void 0 : el.clicks,
|
|
432
|
+
timeToRead: el === null || el === void 0 ? void 0 : el.reading_time_min,
|
|
433
|
+
photoPreview: el === null || el === void 0 ? void 0 : el.photo,
|
|
434
|
+
date: new Date(el === null || el === void 0 ? void 0 : el.date),
|
|
435
|
+
activeLang: activeLang,
|
|
436
|
+
fromArticle: true
|
|
437
|
+
}));
|
|
438
|
+
}))));
|
|
439
|
+
};
|
|
440
|
+
var _default = exports["default"] = ArticleView;
|