@gravity-ui/blog-constructor 8.3.0 → 8.5.0

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.
Files changed (100) hide show
  1. package/build/cjs/blocks/Feed/Feed.d.ts +1 -1
  2. package/build/cjs/blocks/Feed/Feed.js +2 -2
  3. package/build/cjs/blocks/Feed/Feed.js.map +1 -1
  4. package/build/cjs/blocks/Feed/schema.d.ts +1 -30
  5. package/build/cjs/blocks/Feed/schema.js +4 -8
  6. package/build/cjs/blocks/Feed/schema.js.map +1 -1
  7. package/build/cjs/blocks/SideCardList/SideCardList.css +47 -0
  8. package/build/cjs/blocks/SideCardList/SideCardList.d.ts +3 -0
  9. package/build/cjs/blocks/SideCardList/SideCardList.js +21 -0
  10. package/build/cjs/blocks/SideCardList/SideCardList.js.map +1 -0
  11. package/build/cjs/blocks/SideCardList/schema.d.ts +94 -0
  12. package/build/cjs/blocks/SideCardList/schema.js +37 -0
  13. package/build/cjs/blocks/SideCardList/schema.js.map +1 -0
  14. package/build/cjs/blocks/Take/Take.css +70 -0
  15. package/build/cjs/blocks/Take/Take.d.ts +2 -0
  16. package/build/cjs/blocks/Take/Take.js +28 -0
  17. package/build/cjs/blocks/Take/Take.js.map +1 -0
  18. package/build/cjs/blocks/Take/schema.d.ts +96 -0
  19. package/build/cjs/blocks/Take/schema.js +26 -0
  20. package/build/cjs/blocks/Take/schema.js.map +1 -0
  21. package/build/cjs/components/FeedHeader/FeedHeader.d.ts +1 -1
  22. package/build/cjs/components/FeedHeader/FeedHeader.js +2 -2
  23. package/build/cjs/components/FeedHeader/FeedHeader.js.map +1 -1
  24. package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +2 -1
  25. package/build/cjs/components/FeedHeader/components/Controls/Controls.js +2 -2
  26. package/build/cjs/components/FeedHeader/components/Controls/Controls.js.map +1 -1
  27. package/build/cjs/components/Wrapper/Wrapper.css +42 -0
  28. package/build/cjs/components/Wrapper/Wrapper.d.ts +1 -0
  29. package/build/cjs/components/Wrapper/Wrapper.js +2 -2
  30. package/build/cjs/components/Wrapper/Wrapper.js.map +1 -1
  31. package/build/cjs/constructor/blocksMap.d.ts +3 -1
  32. package/build/cjs/constructor/blocksMap.js +4 -0
  33. package/build/cjs/constructor/blocksMap.js.map +1 -1
  34. package/build/cjs/hooks/useExtendedComponentMap.d.ts +3 -1
  35. package/build/cjs/models/blocks.d.ts +22 -2
  36. package/build/cjs/models/blocks.js.map +1 -1
  37. package/build/cjs/models/common.d.ts +3 -1
  38. package/build/cjs/models/common.js +2 -0
  39. package/build/cjs/models/common.js.map +1 -1
  40. package/build/cjs/models/paddings.d.ts +1 -1
  41. package/build/cjs/models/paddings.js.map +1 -1
  42. package/build/cjs/schema/blocks.d.ts +1 -0
  43. package/build/cjs/schema/blocks.js +1 -0
  44. package/build/cjs/schema/blocks.js.map +1 -1
  45. package/build/cjs/schema/index.d.ts +97 -30
  46. package/build/cjs/schema/index.js +2 -1
  47. package/build/cjs/schema/index.js.map +1 -1
  48. package/build/esm/blocks/Feed/Feed.d.ts +1 -1
  49. package/build/esm/blocks/Feed/Feed.js +2 -2
  50. package/build/esm/blocks/Feed/Feed.js.map +1 -1
  51. package/build/esm/blocks/Feed/schema.d.ts +1 -30
  52. package/build/esm/blocks/Feed/schema.js +4 -8
  53. package/build/esm/blocks/Feed/schema.js.map +1 -1
  54. package/build/esm/blocks/SideCardList/SideCardList.css +47 -0
  55. package/build/esm/blocks/SideCardList/SideCardList.d.ts +4 -0
  56. package/build/esm/blocks/SideCardList/SideCardList.js +18 -0
  57. package/build/esm/blocks/SideCardList/SideCardList.js.map +1 -0
  58. package/build/esm/blocks/SideCardList/schema.d.ts +94 -0
  59. package/build/esm/blocks/SideCardList/schema.js +34 -0
  60. package/build/esm/blocks/SideCardList/schema.js.map +1 -0
  61. package/build/esm/blocks/Take/Take.css +70 -0
  62. package/build/esm/blocks/Take/Take.d.ts +3 -0
  63. package/build/esm/blocks/Take/Take.js +24 -0
  64. package/build/esm/blocks/Take/Take.js.map +1 -0
  65. package/build/esm/blocks/Take/schema.d.ts +96 -0
  66. package/build/esm/blocks/Take/schema.js +23 -0
  67. package/build/esm/blocks/Take/schema.js.map +1 -0
  68. package/build/esm/components/FeedHeader/FeedHeader.d.ts +1 -1
  69. package/build/esm/components/FeedHeader/FeedHeader.js +2 -2
  70. package/build/esm/components/FeedHeader/FeedHeader.js.map +1 -1
  71. package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +2 -1
  72. package/build/esm/components/FeedHeader/components/Controls/Controls.js +2 -2
  73. package/build/esm/components/FeedHeader/components/Controls/Controls.js.map +1 -1
  74. package/build/esm/components/Wrapper/Wrapper.css +42 -0
  75. package/build/esm/components/Wrapper/Wrapper.d.ts +1 -0
  76. package/build/esm/components/Wrapper/Wrapper.js +2 -2
  77. package/build/esm/components/Wrapper/Wrapper.js.map +1 -1
  78. package/build/esm/constructor/blocksMap.d.ts +3 -1
  79. package/build/esm/constructor/blocksMap.js +4 -0
  80. package/build/esm/constructor/blocksMap.js.map +1 -1
  81. package/build/esm/hooks/useExtendedComponentMap.d.ts +3 -1
  82. package/build/esm/models/blocks.d.ts +22 -2
  83. package/build/esm/models/blocks.js.map +1 -1
  84. package/build/esm/models/common.d.ts +3 -1
  85. package/build/esm/models/common.js +2 -0
  86. package/build/esm/models/common.js.map +1 -1
  87. package/build/esm/models/paddings.d.ts +1 -1
  88. package/build/esm/models/paddings.js.map +1 -1
  89. package/build/esm/schema/blocks.d.ts +1 -0
  90. package/build/esm/schema/blocks.js +1 -0
  91. package/build/esm/schema/blocks.js.map +1 -1
  92. package/build/esm/schema/index.d.ts +97 -30
  93. package/build/esm/schema/index.js +2 -1
  94. package/build/esm/schema/index.js.map +1 -1
  95. package/package.json +1 -1
  96. package/server/models/blocks.d.ts +22 -2
  97. package/server/models/common.d.ts +3 -1
  98. package/server/models/common.js +2 -0
  99. package/server/models/paddings.d.ts +1 -1
  100. package/styles/mixins.scss +60 -0
@@ -1,2 +1,2 @@
1
1
  import { FeedProps } from "../../models/blocks.js";
2
- export declare const Feed: ({ image }: FeedProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Feed: ({ image, title }: FeedProps) => import("react/jsx-runtime").JSX.Element;
@@ -20,7 +20,7 @@ const reducer_1 = require("./reducer.js");
20
20
  const CONTAINER_ID = 'blog-cards';
21
21
  const PAGE_QUERY = 'page';
22
22
  const FIRST_PAGE = 1;
23
- const Feed = ({ image }) => {
23
+ const Feed = ({ image, title }) => {
24
24
  var _a;
25
25
  const { posts, totalCount, tags, services, pinnedPost, getPosts, pageCountForShowSupportButtons, } = React.useContext(FeedContext_1.FeedContext);
26
26
  const router = React.useContext(RouterContext_1.RouterContext);
@@ -156,7 +156,7 @@ const Feed = ({ image }) => {
156
156
  fullWidth: true,
157
157
  url: image,
158
158
  disableCompress: true,
159
- } }), errorLoad ? ((0, jsx_runtime_1.jsx)(PostsError_1.PostsError, { onButtonClick: handleOnErrorReload })) : ((0, jsx_runtime_1.jsx)(Posts_1.Posts, { containerId: CONTAINER_ID, currentPage: currentPage, isShowMoreVisible: isShowMoreVisible, errorShowMore: errorShowMore, postCountOnPage: postCountOnPage, perPageInQuery: perPageInQuery, handleShowMore: handleShowMore, handlePageChange: handlePageChange, postsOnPage: postsOnPage, pinnedPostOnPage: pinnedPostOnPage, isFetching: isFetching, queryParams: queryParams, pageCountForShowSupportButtons: pageCountForShowSupportButtons }))] }));
159
+ }, title: title }), errorLoad ? ((0, jsx_runtime_1.jsx)(PostsError_1.PostsError, { onButtonClick: handleOnErrorReload })) : ((0, jsx_runtime_1.jsx)(Posts_1.Posts, { containerId: CONTAINER_ID, currentPage: currentPage, isShowMoreVisible: isShowMoreVisible, errorShowMore: errorShowMore, postCountOnPage: postCountOnPage, perPageInQuery: perPageInQuery, handleShowMore: handleShowMore, handlePageChange: handlePageChange, postsOnPage: postsOnPage, pinnedPostOnPage: pinnedPostOnPage, isFetching: isFetching, queryParams: queryParams, pageCountForShowSupportButtons: pageCountForShowSupportButtons }))] }));
160
160
  };
161
161
  exports.Feed = Feed;
162
162
  //# sourceMappingURL=Feed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Feed.js","sourceRoot":"../../../../src","sources":["blocks/Feed/Feed.tsx"],"names":[],"mappings":";;;;;AAAA,qDAA+B;AAE/B,mEAA0D;AAC1D,6CAAuC;AAEvC,0EAAkE;AAClE,2DAAmD;AACnD,0EAAkE;AAClE,kDAA+C;AAC/C,+DAAuD;AACvD,mEAA2D;AAC3D,mDAAsD;AAEtD,mDAA0F;AAC1F,kDAAiG;AACjG,+CAAiE;AAEjE,0CAA+C;AAE/C,MAAM,YAAY,GAAG,YAAY,CAAC;AAClC,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,UAAU,GAAG,CAAC,CAAC;AAEd,MAAM,IAAI,GAAG,CAAC,EAAC,KAAK,EAAY,EAAE,EAAE;;IACvC,MAAM,EACF,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,8BAA8B,GACjC,GAAG,KAAK,CAAC,UAAU,CAAC,yBAAW,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,6BAAa,CAAC,CAAC;IAC/C,MAAM,eAAe,GAAG,IAAA,+BAAY,EAAC,0BAAiB,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,wBAAwB,GAAG,IAAA,8BAAqB,EAAC;QACnD,IAAI,EAAE,0BAAc,CAAC,QAAQ;QAC7B,OAAO,EAAE,wBAAgB,CAAC,SAAS;KACtC,CAAC,CAAC;IAEH,MAAM,CACF,EACI,SAAS,EACT,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,WAAW,GACd,EACD,QAAQ,EACX,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAO,EAAE;QAC1B,SAAS,EAAE,KAAK;Q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AE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,8BAA8B,EAAE,8BAA8B,GAChE,CACL,IACC,CACT,CAAC;AACN,CAAC,CAAC;AAhPW,QAAA,IAAI,QAgPf","sourcesContent":["import * as React from 'react';\n\nimport {useAnalytics} from '@gravity-ui/page-constructor';\nimport {Icon} from '@gravity-ui/uikit';\n\nimport {FeedHeader} from '../../components/FeedHeader/FeedHeader';\nimport {Posts} from '../../components/Posts/Posts';\nimport {PostsError} from '../../components/PostsError/PostsError';\nimport {DefaultGoalIds} from '../../constants';\nimport {FeedContext} from '../../contexts/FeedContext';\nimport {RouterContext} from '../../contexts/RouterContext';\nimport {AnalyticsCounter} from '../../counters/utils';\nimport {FeedProps} from '../../models/blocks';\nimport {DefaultEventNames, FetchArgs, HandleChangeQueryParams} from '../../models/common';\nimport {getFeedQueryParams, prepareAnalyticsEvent, scrollOnPageChange} from '../../utils/common';\nimport {DEFAULT_PAGE, DEFAULT_ROWS_PER_PAGE} from '../constants';\n\nimport {ActionTypes, reducer} from './reducer';\n\nconst CONTAINER_ID = 'blog-cards';\nconst PAGE_QUERY = 'page';\nconst FIRST_PAGE = 1;\n\nexport const Feed = ({image}: FeedProps) => {\n const {\n posts,\n totalCount,\n tags,\n services,\n pinnedPost,\n getPosts,\n pageCountForShowSupportButtons,\n } = React.useContext(FeedContext);\n const router = React.useContext(RouterContext);\n const handleAnalytics = useAnalytics(DefaultEventNames.ShowMore);\n const additionalAnalyticsEvent = prepareAnalyticsEvent({\n name: DefaultGoalIds.showMore,\n counter: AnalyticsCounter.CrossSite,\n });\n\n const [\n {\n errorLoad,\n errorShowMore,\n isFetching,\n isShowMoreVisible,\n lastLoadedCount,\n postCountOnPage,\n postsOnPage,\n pinnedPostOnPage,\n currentPage,\n queryParams,\n },\n dispatch,\n ] = React.useReducer(reducer, {\n errorLoad: false,\n errorShowMore: false,\n isFetching: false,\n isShowMoreVisible: true,\n lastLoadedCount: posts?.length || 0,\n postCountOnPage: totalCount || 0,\n postsOnPage: posts,\n pinnedPostOnPage: pinnedPost,\n currentPage: router?.query?.page ? Number(router.query.page) : DEFAULT_PAGE,\n queryParams: router.query || {},\n });\n\n const perPageInQuery = queryParams?.perPage\n ? Number(queryParams.perPage)\n : DEFAULT_ROWS_PER_PAGE;\n\n const pageChange = (value: number) => {\n dispatch({type: ActionTypes.PageChange, payload: value});\n };\n\n const setIsFetching = (value: boolean) => {\n dispatch({type: ActionTypes.SetIsFetching, payload: value});\n };\n\n const setErrorLoad = (value: boolean) => {\n dispatch({type: ActionTypes.SetErrorLoad, payload: value});\n };\n\n const handleChangeQueryParams: HandleChangeQueryParams = React.useCallback(\n (value) => {\n dispatch({type: ActionTypes.QueryParamsChange, payload: value});\n\n const hasFirstPageQuery = Object.keys(value).some(\n (queryKey) => queryKey === PAGE_QUERY && value[queryKey] === FIRST_PAGE,\n );\n\n const result = hasFirstPageQuery\n ? {\n ...value,\n [PAGE_QUERY]: null,\n }\n : {\n ...value,\n };\n\n router.updateQueryCallback(result);\n },\n [router],\n );\n\n const fetchData = React.useCallback(\n async ({page, query}: FetchArgs) => {\n if (query && getPosts) {\n const queryParamsForRequest = getFeedQueryParams({...queryParams, ...query}, page);\n const data = await getPosts(queryParamsForRequest);\n\n return data;\n } else {\n throw new Error('cant get request');\n }\n },\n [getPosts, queryParams],\n );\n\n const handleLoad = React.useCallback(\n async ({page, query}: FetchArgs) => {\n const pageNumber = Number(page || queryParams.page || DEFAULT_PAGE);\n\n handleChangeQueryParams(query);\n\n try {\n setErrorLoad(false);\n setIsFetching(true);\n\n const fetchedData = await fetchData({page: pageNumber, query});\n\n if (fetchedData) {\n dispatch({\n type: ActionTypes.SetPosts,\n payload: {\n posts: fetchedData.posts,\n pinnedPost: fetchedData.pinnedPost,\n count: fetchedData.count,\n page: pageNumber,\n },\n });\n }\n } catch (err) {\n setErrorLoad(true);\n }\n\n scrollOnPageChange(CONTAINER_ID);\n\n setIsFetching(false);\n },\n [fetchData, handleChangeQueryParams, queryParams],\n );\n\n const handlePageChange = async (value: number) => {\n pageChange(value);\n handleLoad({\n page: value,\n query: {...queryParams, page: value},\n });\n };\n\n const handleShowMore = async () => {\n handleAnalytics(additionalAnalyticsEvent);\n\n const nextPage = currentPage + 1;\n\n try {\n setIsFetching(true);\n const fetchedData = await fetchData({\n page: nextPage,\n query: {\n page: nextPage,\n },\n });\n\n handleChangeQueryParams({\n page: nextPage,\n });\n\n if (fetchedData) {\n dispatch({\n type: ActionTypes.SetShowMore,\n payload: {\n posts: (postsOnPage ?? []).concat(fetchedData.posts),\n count: fetchedData.count,\n currentPage: nextPage,\n lastLoadedCount: fetchedData.posts.length,\n },\n });\n }\n } catch (err) {\n dispatch({type: ActionTypes.SetErrorShowMore, payload: true});\n }\n\n setIsFetching(false);\n };\n\n const handleOnErrorReload = React.useCallback(() => {\n handleLoad({page: currentPage, query: queryParams});\n }, [currentPage, handleLoad, queryParams]);\n\n React.useEffect(() => {\n const loadedPostsCount = currentPage * perPageInQuery;\n dispatch({\n type: ActionTypes.SetIsShowMoreVisible,\n payload: loadedPostsCount < postCountOnPage,\n });\n }, [currentPage, lastLoadedCount, perPageInQuery, postCountOnPage]);\n\n const serviceItems = React.useMemo(\n () =>\n services?.map((service) => ({\n content: service.name,\n value: `${service.id}`,\n })),\n [services],\n );\n\n const tagItems = React.useMemo(\n () =>\n tags?.map((tag) => ({\n content: tag.name,\n value: tag.slug,\n icon: tag.icon && <Icon data={tag.icon} />,\n })),\n [tags],\n );\n\n return (\n <div>\n <FeedHeader\n verticalOffset=\"s\"\n tags={tagItems}\n services={serviceItems}\n handleLoadData={handleLoad}\n queryParams={queryParams}\n background={{\n fullWidth: true,\n url: image,\n disableCompress: true,\n }}\n />\n {errorLoad ? (\n <PostsError onButtonClick={handleOnErrorReload} />\n ) : (\n <Posts\n containerId={CONTAINER_ID}\n currentPage={currentPage}\n isShowMoreVisible={isShowMoreVisible}\n errorShowMore={errorShowMore}\n postCountOnPage={postCountOnPage}\n perPageInQuery={perPageInQuery}\n handleShowMore={handleShowMore}\n handlePageChange={handlePageChange}\n postsOnPage={postsOnPage}\n pinnedPostOnPage={pinnedPostOnPage}\n isFetching={isFetching}\n queryParams={queryParams}\n pageCountForShowSupportButtons={pageCountForShowSupportButtons}\n />\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"Feed.js","sourceRoot":"../../../../src","sources":["blocks/Feed/Feed.tsx"],"names":[],"mappings":";;;;;AAAA,qDAA+B;AAE/B,mEAA0D;AAC1D,6CAAuC;AAEvC,0EAAkE;AAClE,2DAAmD;AACnD,0EAAkE;AAClE,kDAA+C;AAC/C,+DAAuD;AACvD,mEAA2D;AAC3D,mDAAsD;AAEtD,mDAA0F;AAC1F,kDAAiG;AACjG,+CAAiE;AAEjE,0CAA+C;AAE/C,MAAM,YAAY,GAAG,YAAY,CAAC;AAClC,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,UAAU,GAAG,CAAC,CAAC;AAEd,MAAM,IAAI,GAAG,CAAC,EAAC,KAAK,EAAE,KAAK,EAAY,EAAE,EAAE;;IAC9C,MAAM,EACF,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,8BAA8B,GACjC,GAAG,KAAK,CAAC,UAAU,CAAC,yBAAW,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,6BAAa,CAAC,CAAC;IAC/C,MAAM,eAAe,GAAG,IAAA,+BAAY,EAAC,0BAAiB,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,wBAAwB,GAAG,IAAA,8BAAqB,EAAC;QACnD,IAAI,EAAE,0BAAc,CAAC,QAAQ;QAC7B,OAAO,EAAE,wBAAgB,CAAC,SAAS;KACtC,CAAC,CAAC;IAEH,MAAM,CACF,EACI,SAAS,EACT,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,WAAW,EACX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,EAC5B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,8BAA8B,EAAE,8BAA8B,GAChE,CACL,IACC,CACT,CAAC;AACN,CAAC,CAAC;AAjPW,QAAA,IAAI,QAiPf","sourcesContent":["import * as React from 'react';\n\nimport {useAnalytics} from '@gravity-ui/page-constructor';\nimport {Icon} from '@gravity-ui/uikit';\n\nimport {FeedHeader} from '../../components/FeedHeader/FeedHeader';\nimport {Posts} from '../../components/Posts/Posts';\nimport {PostsError} from '../../components/PostsError/PostsError';\nimport {DefaultGoalIds} from '../../constants';\nimport {FeedContext} from '../../contexts/FeedContext';\nimport {RouterContext} from '../../contexts/RouterContext';\nimport {AnalyticsCounter} from '../../counters/utils';\nimport {FeedProps} from '../../models/blocks';\nimport {DefaultEventNames, FetchArgs, HandleChangeQueryParams} from '../../models/common';\nimport {getFeedQueryParams, prepareAnalyticsEvent, scrollOnPageChange} from '../../utils/common';\nimport {DEFAULT_PAGE, DEFAULT_ROWS_PER_PAGE} from '../constants';\n\nimport {ActionTypes, reducer} from './reducer';\n\nconst CONTAINER_ID = 'blog-cards';\nconst PAGE_QUERY = 'page';\nconst FIRST_PAGE = 1;\n\nexport const Feed = ({image, title}: FeedProps) => {\n const {\n posts,\n totalCount,\n tags,\n services,\n pinnedPost,\n getPosts,\n pageCountForShowSupportButtons,\n } = React.useContext(FeedContext);\n const router = React.useContext(RouterContext);\n const handleAnalytics = useAnalytics(DefaultEventNames.ShowMore);\n const additionalAnalyticsEvent = prepareAnalyticsEvent({\n name: DefaultGoalIds.showMore,\n counter: AnalyticsCounter.CrossSite,\n });\n\n const [\n {\n errorLoad,\n errorShowMore,\n isFetching,\n isShowMoreVisible,\n lastLoadedCount,\n postCountOnPage,\n postsOnPage,\n pinnedPostOnPage,\n currentPage,\n queryParams,\n },\n dispatch,\n ] = React.useReducer(reducer, {\n errorLoad: false,\n errorShowMore: false,\n isFetching: false,\n isShowMoreVisible: true,\n lastLoadedCount: posts?.length || 0,\n postCountOnPage: totalCount || 0,\n postsOnPage: posts,\n pinnedPostOnPage: pinnedPost,\n currentPage: router?.query?.page ? Number(router.query.page) : DEFAULT_PAGE,\n queryParams: router.query || {},\n });\n\n const perPageInQuery = queryParams?.perPage\n ? Number(queryParams.perPage)\n : DEFAULT_ROWS_PER_PAGE;\n\n const pageChange = (value: number) => {\n dispatch({type: ActionTypes.PageChange, payload: value});\n };\n\n const setIsFetching = (value: boolean) => {\n dispatch({type: ActionTypes.SetIsFetching, payload: value});\n };\n\n const setErrorLoad = (value: boolean) => {\n dispatch({type: ActionTypes.SetErrorLoad, payload: value});\n };\n\n const handleChangeQueryParams: HandleChangeQueryParams = React.useCallback(\n (value) => {\n dispatch({type: ActionTypes.QueryParamsChange, payload: value});\n\n const hasFirstPageQuery = Object.keys(value).some(\n (queryKey) => queryKey === PAGE_QUERY && value[queryKey] === FIRST_PAGE,\n );\n\n const result = hasFirstPageQuery\n ? {\n ...value,\n [PAGE_QUERY]: null,\n }\n : {\n ...value,\n };\n\n router.updateQueryCallback(result);\n },\n [router],\n );\n\n const fetchData = React.useCallback(\n async ({page, query}: FetchArgs) => {\n if (query && getPosts) {\n const queryParamsForRequest = getFeedQueryParams({...queryParams, ...query}, page);\n const data = await getPosts(queryParamsForRequest);\n\n return data;\n } else {\n throw new Error('cant get request');\n }\n },\n [getPosts, queryParams],\n );\n\n const handleLoad = React.useCallback(\n async ({page, query}: FetchArgs) => {\n const pageNumber = Number(page || queryParams.page || DEFAULT_PAGE);\n\n handleChangeQueryParams(query);\n\n try {\n setErrorLoad(false);\n setIsFetching(true);\n\n const fetchedData = await fetchData({page: pageNumber, query});\n\n if (fetchedData) {\n dispatch({\n type: ActionTypes.SetPosts,\n payload: {\n posts: fetchedData.posts,\n pinnedPost: fetchedData.pinnedPost,\n count: fetchedData.count,\n page: pageNumber,\n },\n });\n }\n } catch (err) {\n setErrorLoad(true);\n }\n\n scrollOnPageChange(CONTAINER_ID);\n\n setIsFetching(false);\n },\n [fetchData, handleChangeQueryParams, queryParams],\n );\n\n const handlePageChange = async (value: number) => {\n pageChange(value);\n handleLoad({\n page: value,\n query: {...queryParams, page: value},\n });\n };\n\n const handleShowMore = async () => {\n handleAnalytics(additionalAnalyticsEvent);\n\n const nextPage = currentPage + 1;\n\n try {\n setIsFetching(true);\n const fetchedData = await fetchData({\n page: nextPage,\n query: {\n page: nextPage,\n },\n });\n\n handleChangeQueryParams({\n page: nextPage,\n });\n\n if (fetchedData) {\n dispatch({\n type: ActionTypes.SetShowMore,\n payload: {\n posts: (postsOnPage ?? []).concat(fetchedData.posts),\n count: fetchedData.count,\n currentPage: nextPage,\n lastLoadedCount: fetchedData.posts.length,\n },\n });\n }\n } catch (err) {\n dispatch({type: ActionTypes.SetErrorShowMore, payload: true});\n }\n\n setIsFetching(false);\n };\n\n const handleOnErrorReload = React.useCallback(() => {\n handleLoad({page: currentPage, query: queryParams});\n }, [currentPage, handleLoad, queryParams]);\n\n React.useEffect(() => {\n const loadedPostsCount = currentPage * perPageInQuery;\n dispatch({\n type: ActionTypes.SetIsShowMoreVisible,\n payload: loadedPostsCount < postCountOnPage,\n });\n }, [currentPage, lastLoadedCount, perPageInQuery, postCountOnPage]);\n\n const serviceItems = React.useMemo(\n () =>\n services?.map((service) => ({\n content: service.name,\n value: `${service.id}`,\n })),\n [services],\n );\n\n const tagItems = React.useMemo(\n () =>\n tags?.map((tag) => ({\n content: tag.name,\n value: tag.slug,\n icon: tag.icon && <Icon data={tag.icon} />,\n })),\n [tags],\n );\n\n return (\n <div>\n <FeedHeader\n verticalOffset=\"s\"\n tags={tagItems}\n services={serviceItems}\n handleLoadData={handleLoad}\n queryParams={queryParams}\n background={{\n fullWidth: true,\n url: image,\n disableCompress: true,\n }}\n title={title}\n />\n {errorLoad ? (\n <PostsError onButtonClick={handleOnErrorReload} />\n ) : (\n <Posts\n containerId={CONTAINER_ID}\n currentPage={currentPage}\n isShowMoreVisible={isShowMoreVisible}\n errorShowMore={errorShowMore}\n postCountOnPage={postCountOnPage}\n perPageInQuery={perPageInQuery}\n handleShowMore={handleShowMore}\n handlePageChange={handlePageChange}\n postsOnPage={postsOnPage}\n pinnedPostOnPage={pinnedPostOnPage}\n isFetching={isFetching}\n queryParams={queryParams}\n pageCountForShowSupportButtons={pageCountForShowSupportButtons}\n />\n )}\n </div>\n );\n};\n"]}
@@ -1,43 +1,14 @@
1
1
  export declare const Feed: {
2
2
  "blog-feed-block": {
3
3
  additionalProperties: boolean;
4
- required: never[];
4
+ required: string;
5
5
  properties: {
6
6
  title: {
7
7
  type: string;
8
- additionalProperties: boolean;
9
- required: string[];
10
- properties: {
11
- text: {
12
- type: string;
13
- contentType: string;
14
- };
15
- textSize: {
16
- type: string;
17
- enum: string[];
18
- };
19
- url: {
20
- type: string;
21
- };
22
- urlTitle: {
23
- type: string;
24
- };
25
- resetMargin: {
26
- type: string;
27
- };
28
- };
29
8
  };
30
9
  image: {
31
10
  type: string;
32
11
  };
33
- description: {
34
- type: string;
35
- contentType: string;
36
- };
37
- size: {
38
- type: string;
39
- enum: string[];
40
- };
41
12
  anchor: {
42
13
  type: string;
43
14
  additionalProperties: boolean;
@@ -2,20 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Feed = void 0;
4
4
  const page_constructor_1 = require("@gravity-ui/page-constructor");
5
- const { common: { TitleProps, BlockBaseProps }, } = page_constructor_1.validators;
5
+ const { common: { BlockBaseProps }, } = page_constructor_1.validators;
6
6
  const common_1 = require("../../models/common.js");
7
7
  exports.Feed = {
8
8
  [common_1.BlockType.Feed]: {
9
9
  additionalProperties: false,
10
- required: [],
11
- properties: Object.assign(Object.assign({}, BlockBaseProps), { title: TitleProps, image: {
10
+ required: 'image',
11
+ properties: Object.assign(Object.assign({}, BlockBaseProps), { title: {
12
12
  type: 'string',
13
- }, description: {
13
+ }, image: {
14
14
  type: 'string',
15
- contentType: 'text',
16
- }, size: {
17
- type: 'string',
18
- enum: ['s', 'm'],
19
15
  } }),
20
16
  },
21
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Feed/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,MAAM,EACF,MAAM,EAAE,EAAC,UAAU,EAAE,cAAc,EAAC,GACvC,GAAG,6BAAU,CAAC;AAEf,mDAA8C;AAEjC,QAAA,IAAI,GAAG;IAChB,CAAC,kBAAS,CAAC,IAAI,CAAC,EAAE;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,kCACH,cAAc,KACjB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB,EACD,WAAW,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,MAAM;aACtB,EACD,IAAI,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;aACnB,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import {validators} from '@gravity-ui/page-constructor';\n\nconst {\n common: {TitleProps, BlockBaseProps},\n} = validators;\n\nimport {BlockType} from '../../models/common';\n\nexport const Feed = {\n [BlockType.Feed]: {\n additionalProperties: false,\n required: [],\n properties: {\n ...BlockBaseProps,\n title: TitleProps,\n image: {\n type: 'string',\n },\n description: {\n type: 'string',\n contentType: 'text',\n },\n size: {\n type: 'string',\n enum: ['s', 'm'],\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Feed/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,MAAM,EACF,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,6BAAU,CAAC;AAEf,mDAA8C;AAEjC,QAAA,IAAI,GAAG;IAChB,CAAC,kBAAS,CAAC,IAAI,CAAC,EAAE;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,OAAO;QACjB,UAAU,kCACH,cAAc,KACjB,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB,EACD,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import {validators} from '@gravity-ui/page-constructor';\n\nconst {\n common: {BlockBaseProps},\n} = validators;\n\nimport {BlockType} from '../../models/common';\n\nexport const Feed = {\n [BlockType.Feed]: {\n additionalProperties: false,\n required: 'image',\n properties: {\n ...BlockBaseProps,\n title: {\n type: 'string',\n },\n image: {\n type: 'string',\n },\n },\n },\n};\n"]}
@@ -0,0 +1,47 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ .bc-side-card-list__container {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 24px;
7
+ max-width: 296px;
8
+ }
9
+ .bc-side-card-list__title {
10
+ font-size: var(--g-text-header-2-font-size);
11
+ line-height: var(--g-text-header-2-line-height);
12
+ font-weight: 500;
13
+ }
14
+ .bc-side-card-list__items {
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: 16px;
18
+ }
19
+ .bc-side-card-list__item.bc-side-card-list__item {
20
+ min-height: auto;
21
+ }
22
+
23
+ .bc-side-card-list__item-image {
24
+ object-fit: contain;
25
+ object-position: left;
26
+ max-height: 104px;
27
+ max-width: 232px;
28
+ width: auto;
29
+ }
30
+ .bc-side-card-list__item-media {
31
+ max-width: 232px;
32
+ padding: 0 0 16px;
33
+ }
34
+ .bc-side-card-list__item-description {
35
+ padding-bottom: 12px;
36
+ }
37
+ @media (max-width: 1081px) {
38
+ .bc-side-card-list__container {
39
+ max-width: none;
40
+ width: 50%;
41
+ }
42
+ }
43
+ @media (max-width: 577px) {
44
+ .bc-side-card-list__container {
45
+ width: 100%;
46
+ }
47
+ }
@@ -0,0 +1,3 @@
1
+ import { SideCardListProps } from "../../models/blocks.js";
2
+ export declare const SideCardList: ({ title, items, paddingTop, paddingBottom }: SideCardListProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default SideCardList;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SideCardList = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const page_constructor_1 = require("@gravity-ui/page-constructor");
6
+ const Wrapper_1 = require("../../components/Wrapper/Wrapper.js");
7
+ const paddings_1 = require("../../models/paddings.js");
8
+ const cn_1 = require("../../utils/cn.js");
9
+ const b = (0, cn_1.block)('side-card-list');
10
+ const SideCardList = ({ title, items, paddingTop, paddingBottom }) => {
11
+ return ((0, jsx_runtime_1.jsxs)(Wrapper_1.Wrapper, { paddings: {
12
+ [paddings_1.PaddingsDirections.top]: paddingTop,
13
+ [paddings_1.PaddingsDirections.bottom]: paddingBottom,
14
+ }, className: b('container'), children: [title && (0, jsx_runtime_1.jsx)("div", { className: b('title'), children: title }), (0, jsx_runtime_1.jsx)("div", { className: b('items'), children: items.map(({ url, description, image }, index) => ((0, jsx_runtime_1.jsx)(page_constructor_1.CardBase, { url: url, className: b('item'), children: (0, jsx_runtime_1.jsxs)(page_constructor_1.CardBase.Content, { children: [(0, jsx_runtime_1.jsx)(page_constructor_1.Media, { className: b('item-media'), imageClassName: b('item-image'), image: image }), description && ((0, jsx_runtime_1.jsx)("div", { className: b('item-description'), children: (0, jsx_runtime_1.jsx)(page_constructor_1.YFMWrapper, { content: description, modifiers: {
15
+ blog: true,
16
+ resetPaddings: true,
17
+ } }) }))] }) }, index))) })] }));
18
+ };
19
+ exports.SideCardList = SideCardList;
20
+ exports.default = exports.SideCardList;
21
+ //# sourceMappingURL=SideCardList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideCardList.js","sourceRoot":"../../../../src","sources":["bl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CW,QAAA,YAAY,gBAoCvB;AAEF,kBAAe,oBAAY,CAAC","sourcesContent":["import {CardBase, Media as PCMedia, YFMWrapper} from '@gravity-ui/page-constructor';\n\nimport {Wrapper} from '../../components/Wrapper/Wrapper';\nimport {SideCardListProps} from '../../models/blocks';\nimport {PaddingsDirections} from '../../models/paddings';\nimport {block} from '../../utils/cn';\n\nimport './SideCardList.scss';\n\nconst b = block('side-card-list');\n\nexport const SideCardList = ({title, items, paddingTop, paddingBottom}: SideCardListProps) => {\n return (\n <Wrapper\n paddings={{\n [PaddingsDirections.top]: paddingTop,\n [PaddingsDirections.bottom]: paddingBottom,\n }}\n className={b('container')}\n >\n {title && <div className={b('title')}>{title}</div>}\n <div className={b('items')}>\n {items.map(({url, description, image}, index) => (\n <CardBase key={index} url={url} className={b('item')}>\n <CardBase.Content>\n <PCMedia\n className={b('item-media')}\n imageClassName={b('item-image')}\n image={image}\n />\n {description && (\n <div className={b('item-description')}>\n <YFMWrapper\n content={description}\n modifiers={{\n blog: true,\n resetPaddings: true,\n }}\n />\n </div>\n )}\n </CardBase.Content>\n </CardBase>\n ))}\n </div>\n </Wrapper>\n );\n};\n\nexport default SideCardList;\n"]}
@@ -0,0 +1,94 @@
1
+ export declare const SideCardList: {
2
+ "blog-side-card-list-block": {
3
+ type: string;
4
+ additionalProperties: boolean;
5
+ required: string[];
6
+ properties: {
7
+ className: {
8
+ type: string;
9
+ };
10
+ title: {
11
+ type: string;
12
+ };
13
+ items: {
14
+ type: string;
15
+ items: {
16
+ type: string;
17
+ required: string[];
18
+ properties: {
19
+ image: {
20
+ type: string;
21
+ };
22
+ description: {
23
+ type: string;
24
+ };
25
+ url: {
26
+ type: string;
27
+ };
28
+ };
29
+ };
30
+ };
31
+ paddingTop: {
32
+ type: string;
33
+ enum: string[];
34
+ };
35
+ paddingBottom: {
36
+ type: string;
37
+ enum: string[];
38
+ };
39
+ fullWidth: {
40
+ type: string;
41
+ };
42
+ column: {
43
+ type: string;
44
+ enum: string[];
45
+ };
46
+ qa: {
47
+ type: string;
48
+ };
49
+ anchor: {
50
+ type: string;
51
+ additionalProperties: boolean;
52
+ required: string[];
53
+ properties: {
54
+ text: {
55
+ type: string;
56
+ contentType: string;
57
+ };
58
+ url: {
59
+ type: string;
60
+ };
61
+ urlTitle: {
62
+ type: string;
63
+ };
64
+ };
65
+ };
66
+ visible: {
67
+ type: string;
68
+ enum: string[];
69
+ };
70
+ resetPaddings: {
71
+ type: string;
72
+ };
73
+ context: {
74
+ type: string;
75
+ };
76
+ indent: {
77
+ type: string;
78
+ additionalProperties: boolean;
79
+ properties: {
80
+ top: {
81
+ enum: string[];
82
+ };
83
+ bottom: {
84
+ enum: string[];
85
+ };
86
+ };
87
+ };
88
+ type: {};
89
+ when: {
90
+ type: string;
91
+ };
92
+ };
93
+ };
94
+ };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SideCardList = void 0;
4
+ const page_constructor_1 = require("@gravity-ui/page-constructor");
5
+ const common_1 = require("../../models/common.js");
6
+ const common_2 = require("../../schema/common.js");
7
+ const { common: { BlockBaseProps }, } = page_constructor_1.validators;
8
+ exports.SideCardList = {
9
+ [common_1.BlockType.SideCardList]: {
10
+ type: 'object',
11
+ additionalProperties: false,
12
+ required: ['items'],
13
+ properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), common_2.BlogBlockBase), { className: {
14
+ type: 'string',
15
+ }, title: {
16
+ type: 'string',
17
+ }, items: {
18
+ type: 'array',
19
+ items: {
20
+ type: 'object',
21
+ required: ['image', 'description', 'url'],
22
+ properties: {
23
+ image: {
24
+ type: 'string',
25
+ },
26
+ description: {
27
+ type: 'string',
28
+ },
29
+ url: {
30
+ type: 'string',
31
+ },
32
+ },
33
+ },
34
+ } }),
35
+ },
36
+ };
37
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/SideCardList/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,mDAA8C;AAC9C,mDAAkD;AAElD,MAAM,EACF,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,6BAAU,CAAC;AAEF,QAAA,YAAY,GAAG;IACxB,CAAC,kBAAS,CAAC,YAAY,CAAC,EAAE;QACtB,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,gDACH,cAAc,GACd,sBAAa,KAChB,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;aACjB,EACD,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB,EACD,KAAK,EAAE;gBACH,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC;oBACzC,UAAU,EAAE;wBACR,KAAK,EAAE;4BACH,IAAI,EAAE,QAAQ;yBACjB;wBACD,WAAW,EAAE;4BACT,IAAI,EAAE,QAAQ;yBACjB;wBACD,GAAG,EAAE;4BACD,IAAI,EAAE,QAAQ;yBACjB;qBACJ;iBACJ;aACJ,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import {validators} from '@gravity-ui/page-constructor';\n\nimport {BlockType} from '../../models/common';\nimport {BlogBlockBase} from '../../schema/common';\n\nconst {\n common: {BlockBaseProps},\n} = validators;\n\nexport const SideCardList = {\n [BlockType.SideCardList]: {\n type: 'object',\n additionalProperties: false,\n required: ['items'],\n properties: {\n ...BlockBaseProps,\n ...BlogBlockBase,\n className: {\n type: 'string',\n },\n title: {\n type: 'string',\n },\n items: {\n type: 'array',\n items: {\n type: 'object',\n required: ['image', 'description', 'url'],\n properties: {\n image: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n },\n },\n },\n },\n },\n};\n"]}
@@ -0,0 +1,70 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ .bc-take__container {
4
+ --take-color: #d6e0e9;
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: flex-start;
8
+ align-self: stretch;
9
+ gap: 40px;
10
+ border-radius: 24px 0 0 24px;
11
+ border-left: 4px solid var(--take-color);
12
+ background: linear-gradient(90deg, color-mix(in sRGB, var(--take-color) 20%, transparent) 0%, rgba(255, 255, 255, 0.2) 100%);
13
+ font-family: "YS Text";
14
+ }
15
+ .bc-take__container_noBackground {
16
+ background: none;
17
+ }
18
+ .bc-take__text {
19
+ font-size: 24px;
20
+ line-height: 32px;
21
+ font-weight: var(--g-text-body-font-weight);
22
+ font-family: inherit;
23
+ }
24
+ .bc-take__author {
25
+ align-items: flex-start;
26
+ max-width: 402px;
27
+ }
28
+ .bc-take__author .pc-author__name {
29
+ font-weight: var(--g-text-accent-font-weight);
30
+ font-size: var(--g-text-header-1-font-size);
31
+ line-height: var(--g-text-header-1-line-height);
32
+ }
33
+ .bc-take__author .pc-author__description {
34
+ font-size: var(--g-text-body-3-font-size);
35
+ line-height: var(--g-text-body-3-line-height);
36
+ }
37
+ .bc-take__avatar {
38
+ width: 88px;
39
+ height: 88px;
40
+ }
41
+ .bc-take__avatar img {
42
+ width: 88px;
43
+ height: 88px;
44
+ }
45
+ @media (max-width: 577px) {
46
+ .bc-take__text {
47
+ font-size: 20px;
48
+ line-height: 28px;
49
+ }
50
+ .bc-take__author {
51
+ max-width: none;
52
+ }
53
+ .bc-take__author .pc-author__name {
54
+ font-weight: var(--g-text-accent-font-weight);
55
+ font-size: var(--g-text-subheader-3-font-size);
56
+ line-height: var(--g-text-subheader-3-line-height);
57
+ }
58
+ .bc-take__author .pc-author__description {
59
+ font-size: var(--g-text-body-2-font-size);
60
+ line-height: var(--g-text-body-2-line-height);
61
+ }
62
+ .bc-take__avatar {
63
+ width: 80px;
64
+ height: 80px;
65
+ }
66
+ .bc-take__avatar img {
67
+ width: 80px;
68
+ height: 80px;
69
+ }
70
+ }
@@ -0,0 +1,2 @@
1
+ import { TakeProps } from "../../models/blocks.js";
2
+ export declare const Take: (props: TakeProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Take = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const React = tslib_1.__importStar(require("react"));
7
+ const page_constructor_1 = require("@gravity-ui/page-constructor");
8
+ const Wrapper_1 = require("../../components/Wrapper/Wrapper.js");
9
+ const MobileContext_1 = require("../../contexts/MobileContext.js");
10
+ const paddings_1 = require("../../models/paddings.js");
11
+ const cn_1 = require("../../utils/cn.js");
12
+ const b = (0, cn_1.block)('take');
13
+ const Take = (props) => {
14
+ const { paddingTop, paddingBottom, paddingLeft, paddingRight, text, author, color, noBackground, } = props;
15
+ const isMobile = React.useContext(MobileContext_1.MobileContext);
16
+ const containerStyle = color ? { '--take-color': color } : undefined;
17
+ return ((0, jsx_runtime_1.jsxs)(Wrapper_1.Wrapper, { className: b('container', { noBackground }), paddings: {
18
+ [paddings_1.PaddingsDirections.top]: paddingTop,
19
+ [paddings_1.PaddingsDirections.bottom]: paddingBottom,
20
+ [paddings_1.PaddingsDirections.left]: paddingLeft,
21
+ [paddings_1.PaddingsDirections.right]: paddingRight,
22
+ }, style: containerStyle, children: [(0, jsx_runtime_1.jsx)(page_constructor_1.YFMWrapper, { content: text, contentClassName: b('text'), tagName: "div", modifiers: {
23
+ blog: true,
24
+ resetPaddings: true,
25
+ } }), (0, jsx_runtime_1.jsx)(page_constructor_1.Author, { type: isMobile ? page_constructor_1.AuthorType.Column : page_constructor_1.AuthorType.Line, author: author, className: b('author'), authorContainerClassName: b('avatar') })] }));
26
+ };
27
+ exports.Take = Take;
28
+ //# sourceMappingURL=Take.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Take.js","sourceRoot":"../../../../src","sources":["blocks/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,CAAC,CAAC,QAAQ,CAAC,EACtB,wBAAwB,EAAE,CAAC,CAAC,QAAQ,CAAC,GACvC,IACI,CACb,CAAC;AACN,CAAC,CAAC;AA5CW,QAAA,IAAI,QA4Cf","sourcesContent":["import * as React from 'react';\n\nimport {AuthorType, Author as PCAuthor, YFMWrapper} from '@gravity-ui/page-constructor';\n\nimport {Wrapper} from '../../components/Wrapper/Wrapper';\nimport {MobileContext} from '../../contexts/MobileContext';\nimport {TakeProps} from '../../models/blocks';\nimport {PaddingsDirections} from '../../models/paddings';\nimport {block} from '../../utils/cn';\n\nimport './Take.scss';\n\nconst b = block('take');\n\nexport const Take = (props: TakeProps) => {\n const {\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n text,\n author,\n color,\n noBackground,\n } = props;\n\n const isMobile = React.useContext(MobileContext);\n\n const containerStyle = color ? ({'--take-color': color} as React.CSSProperties) : undefined;\n\n return (\n <Wrapper\n className={b('container', {noBackground})}\n paddings={{\n [PaddingsDirections.top]: paddingTop,\n [PaddingsDirections.bottom]: paddingBottom,\n [PaddingsDirections.left]: paddingLeft,\n [PaddingsDirections.right]: paddingRight,\n }}\n style={containerStyle}\n >\n <YFMWrapper\n content={text}\n contentClassName={b('text')}\n tagName=\"div\"\n modifiers={{\n blog: true,\n resetPaddings: true,\n }}\n />\n <PCAuthor\n type={isMobile ? AuthorType.Column : AuthorType.Line}\n author={author}\n className={b('author')}\n authorContainerClassName={b('avatar')}\n />\n </Wrapper>\n );\n};\n"]}
@@ -0,0 +1,96 @@
1
+ export declare const Take: {
2
+ "blog-take-block": {
3
+ type: string;
4
+ additionalProperties: boolean;
5
+ required: string[];
6
+ properties: {
7
+ text: {
8
+ type: string;
9
+ contentType: string;
10
+ };
11
+ author: {
12
+ type: string;
13
+ additionalProperties: boolean;
14
+ required: string[];
15
+ properties: {
16
+ firstName: {
17
+ type: string;
18
+ contentType: string;
19
+ };
20
+ secondName: {
21
+ type: string;
22
+ contentType: string;
23
+ };
24
+ description: {
25
+ type: string;
26
+ contentType: string;
27
+ };
28
+ avatar: {
29
+ type: string;
30
+ };
31
+ };
32
+ };
33
+ paddingTop: {
34
+ type: string;
35
+ enum: string[];
36
+ };
37
+ paddingBottom: {
38
+ type: string;
39
+ enum: string[];
40
+ };
41
+ fullWidth: {
42
+ type: string;
43
+ };
44
+ column: {
45
+ type: string;
46
+ enum: string[];
47
+ };
48
+ qa: {
49
+ type: string;
50
+ };
51
+ anchor: {
52
+ type: string;
53
+ additionalProperties: boolean;
54
+ required: string[];
55
+ properties: {
56
+ text: {
57
+ type: string;
58
+ contentType: string;
59
+ };
60
+ url: {
61
+ type: string;
62
+ };
63
+ urlTitle: {
64
+ type: string;
65
+ };
66
+ };
67
+ };
68
+ visible: {
69
+ type: string;
70
+ enum: string[];
71
+ };
72
+ resetPaddings: {
73
+ type: string;
74
+ };
75
+ context: {
76
+ type: string;
77
+ };
78
+ indent: {
79
+ type: string;
80
+ additionalProperties: boolean;
81
+ properties: {
82
+ top: {
83
+ enum: string[];
84
+ };
85
+ bottom: {
86
+ enum: string[];
87
+ };
88
+ };
89
+ };
90
+ type: {};
91
+ when: {
92
+ type: string;
93
+ };
94
+ };
95
+ };
96
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Take = void 0;
4
+ const page_constructor_1 = require("@gravity-ui/page-constructor");
5
+ const common_1 = require("../../models/common.js");
6
+ const common_2 = require("../../schema/common.js");
7
+ const { common: { BlockBaseProps }, } = page_constructor_1.validators;
8
+ exports.Take = {
9
+ [common_1.BlockType.Take]: {
10
+ type: 'object',
11
+ additionalProperties: false,
12
+ required: ['text', 'author'],
13
+ properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), common_2.BlogBlockBase), { text: { type: 'string', contentType: 'text' }, author: {
14
+ type: 'object',
15
+ additionalProperties: false,
16
+ required: ['firstName', 'secondName'],
17
+ properties: {
18
+ firstName: { type: 'string', contentType: 'text' },
19
+ secondName: { type: 'string', contentType: 'text' },
20
+ description: { type: 'string', contentType: 'yfm' },
21
+ avatar: { type: 'string' },
22
+ },
23
+ } }),
24
+ },
25
+ };
26
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Take/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,mDAA8C;AAC9C,mDAAkD;AAElD,MAAM,EACF,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,6BAAU,CAAC;AAEF,QAAA,IAAI,GAAG;IAChB,CAAC,kBAAS,CAAC,IAAI,CAAC,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;QAC5B,UAAU,gDACH,cAAc,GACd,sBAAa,KAChB,IAAI,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAC,EAC3C,MAAM,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;gBACrC,UAAU,EAAE;oBACR,SAAS,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAC;oBAChD,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAC;oBACjD,WAAW,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAC;oBACjD,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;iBAC3B;aACJ,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import {validators} from '@gravity-ui/page-constructor';\n\nimport {BlockType} from '../../models/common';\nimport {BlogBlockBase} from '../../schema/common';\n\nconst {\n common: {BlockBaseProps},\n} = validators;\n\nexport const Take = {\n [BlockType.Take]: {\n type: 'object',\n additionalProperties: false,\n required: ['text', 'author'],\n properties: {\n ...BlockBaseProps,\n ...BlogBlockBase,\n text: {type: 'string', contentType: 'text'},\n author: {\n type: 'object',\n additionalProperties: false,\n required: ['firstName', 'secondName'],\n properties: {\n firstName: {type: 'string', contentType: 'text'},\n secondName: {type: 'string', contentType: 'text'},\n description: {type: 'string', contentType: 'yfm'},\n avatar: {type: 'string'},\n },\n },\n },\n },\n};\n"]}