@gravity-ui/blog-constructor 1.1.2 → 2.0.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,38 +1,231 @@
1
- # Changelog
1
+ # Change log
2
2
 
3
- ## [1.1.2](https://github.com/gravity-ui/blog-constructor/compare/v1.1.1...v1.1.2) (2023-03-28)
3
+ ## 0.20.1
4
4
 
5
+ - Rewrite storybook on ts
5
6
 
6
- ### Bug Fixes
7
+ ## 0.20.0
7
8
 
8
- * add info about release ([#19](https://github.com/gravity-ui/blog-constructor/issues/19)) ([8a5824f](https://github.com/gravity-ui/blog-constructor/commit/8a5824f24c4ad85f0f122111f8f5c1e7c36becc5))
9
+ - Install @gravity-ui linters
9
10
 
10
- ## [1.1.1](https://github.com/gravity-ui/blog-constructor/compare/v1.1.0...v1.1.1) (2023-03-28)
11
+ ## 0.19.0
11
12
 
13
+ ### Breaking changes
12
14
 
13
- ### Bug Fixes
15
+ - Refactor and rename types
16
+ - Update react to 18.2.0
17
+ - Update TS to 4.9.3
14
18
 
15
- * add info about ci in readme ([#17](https://github.com/gravity-ui/blog-constructor/issues/17)) ([b6cffaa](https://github.com/gravity-ui/blog-constructor/commit/b6cffaa1c255c53cd00d06d4fbe0330e117f42a0))
19
+ ## 0.18.1
16
20
 
17
- ## 1.1.0 (2023-03-28)
21
+ - Delete useless utils and small refactor
18
22
 
19
- ### Features
23
+ ## 0.18.0
20
24
 
21
- - add workflows, update @types/react, small refactors, update Select ([#2](https://github.com/gravity-ui/blog-constructor/issues/2)) ([326247a](https://github.com/gravity-ui/blog-constructor/commit/326247abe9411b50c82ed2cfa516ac6cd341bfa7))
22
- - Brush up stories, add content for CTA, Layout, Feed blocks. ([#4](https://github.com/gravity-ui/blog-constructor/issues/4)) ([0b73537](https://github.com/gravity-ui/blog-constructor/commit/0b73537b3bae35eca10610963369f3f5d8f9ecbd))
23
- - export author type ([9e5ee34](https://github.com/gravity-ui/blog-constructor/commit/9e5ee34c6b4d1b3288cda1258160e22073f9ad9d))
24
- - fix button savedOnly color ([#9](https://github.com/gravity-ui/blog-constructor/issues/9)) ([ef3b1ca](https://github.com/gravity-ui/blog-constructor/commit/ef3b1ca9048f1218817ec5c9c6a5b3e05492f062))
25
- - init tests ([#1](https://github.com/gravity-ui/blog-constructor/issues/1)) ([f8df32f](https://github.com/gravity-ui/blog-constructor/commit/f8df32f3eccb97abc7bfef222aca1ea56421619b))
26
- - **navigation:** pass the PageConstructor's navigation prop ([cb875ff](https://github.com/gravity-ui/blog-constructor/commit/cb875ff708832f5dd9e121d67cfccb387ae2499f))
27
- - uninstall doctools/components ([#14](https://github.com/gravity-ui/blog-constructor/issues/14)) ([16dc64c](https://github.com/gravity-ui/blog-constructor/commit/16dc64c3002b614831880dbe5b250c5637031c7d))
28
- - update license ([#3](https://github.com/gravity-ui/blog-constructor/issues/3)) ([aa4ee5b](https://github.com/gravity-ui/blog-constructor/commit/aa4ee5bdd01a7db5f6c6c457836658761eee1099))
29
- - update readme ([#15](https://github.com/gravity-ui/blog-constructor/issues/15)) ([3dbdf78](https://github.com/gravity-ui/blog-constructor/commit/3dbdf78b35f93024bebbcf64a6f06fb01509ae3e))
25
+ ### Breaking changes
30
26
 
31
- ### Bug Fixes
27
+ - Refactor naming
32
28
 
33
- - **general:** better deps ([8c22384](https://github.com/gravity-ui/blog-constructor/commit/8c223848e47faf8b9beee6700afce317359ee226))
34
- - search input width ([051c145](https://github.com/gravity-ui/blog-constructor/commit/051c14502110306964c4ec9a2bea47cea9364db5))
29
+ ## 0.17.1
35
30
 
36
- ## 1.0.0
31
+ - @gravity-ui/uikit 3.10.1 (fix share tooltip)
37
32
 
38
- Create public access for blog-constructor library for creating blog format web pages.
33
+ ## 0.17.0
34
+
35
+ - @gravity-ui/uikit 3.9.0
36
+
37
+ ## 0.16.1
38
+
39
+ - Fix for treating page number on fetch
40
+
41
+ ## 0.16.0
42
+
43
+ - Show "-" in filters selector switchers when only one broken filter provided in a query
44
+
45
+ ## 0.15.1
46
+
47
+ - Do not show pointer cursor on save button title hover when the button is not clickable
48
+
49
+ ## 0.15.0
50
+
51
+ - Prevent save button to be clickable when user is not logged in
52
+
53
+ ## 0.14.0
54
+
55
+ - Refactor metaProps in BlogPostPage
56
+
57
+ ## 0.13.0
58
+
59
+ - Remove temporal flag of icon selection
60
+
61
+ ## 0.12.4
62
+
63
+ - Prevent collapse of a custom switcher on a blog feed
64
+
65
+ ## 0.12.2
66
+
67
+ - Update types for getBlogPosts handler
68
+
69
+ ## 0.12.1
70
+
71
+ - Render post card title via dangerouslySetInnerHTML
72
+
73
+ ## 0.12.0
74
+
75
+ - Update page change logic when interactions with blog search panel
76
+
77
+ ## 0.11.1
78
+
79
+ - **BlogYFM**: add `yfm_no-list-reset` class
80
+
81
+ ## 0.11.0
82
+
83
+ - Refactor styles (kebab, prefix, variables)
84
+
85
+ ## 0.10.2
86
+
87
+ - Add teamcity publish
88
+
89
+ ## 0.10.1
90
+
91
+ - BlogPostTag types became Partial, BlogPostTagExtended is deleted
92
+
93
+ ## 0.10.0
94
+
95
+ - add props for show support buttons in paginator
96
+
97
+ ## 0.9.2
98
+
99
+ - added yfm headers weight style
100
+
101
+ ## 0.9.1
102
+
103
+ - add specificity for search input styles
104
+
105
+ ## 0.9.0
106
+
107
+ - add customization for sharing options in blog posts
108
+
109
+ ## 0.8.0
110
+
111
+ - add BlogPage with gravity-ui requirements
112
+
113
+ ## 0.7.1
114
+
115
+ - Add info about publish in readme
116
+
117
+ ## 0.7.0
118
+
119
+ - Change packages @yandex-cloud => @gravity-ui
120
+ - Remove i18n from peer dependencies
121
+
122
+ ## 0.6.30
123
+
124
+ - add BlogPage
125
+
126
+ ## 0.5.10
127
+
128
+ - fix yfm styles for table
129
+
130
+ ## 0.5.9
131
+
132
+ - fix yfm styles
133
+
134
+ ## 0.5.8
135
+
136
+ - delete selection of blog structure
137
+
138
+ ## 0.5.7
139
+
140
+ - color variables updates
141
+
142
+ ## 0.5.6
143
+
144
+ - change transformPostTags() routine
145
+
146
+ ## 0.5.5
147
+
148
+ - add page-constructor in peer-dependencies
149
+
150
+ ## 0.5.3
151
+
152
+ - fix yfm styles: add css variables to be able to redefine styles in projects
153
+
154
+ ## 0.5.2
155
+
156
+ - condition for likes in cards
157
+
158
+ ## 0.5.1
159
+
160
+ - refactor LocaleContext
161
+ - refactor RouterContext
162
+ - now likes is not required props
163
+
164
+ ## 0.4.3
165
+
166
+ - Back previously patch
167
+
168
+ ## 0.4.2
169
+
170
+ - Fix meta
171
+
172
+ ## 0.4.1
173
+
174
+ - Fix share button
175
+ - now region props is not required in TransformPageContentPropsType
176
+
177
+ ## 0.4.0
178
+
179
+ - Add likes state update conditions
180
+
181
+ ## 0.3.1
182
+
183
+ - Add metaData render condition
184
+
185
+ ## 0.3.0
186
+
187
+ - Update props metaData
188
+
189
+ ## 0.2.3
190
+
191
+ - Update types and namings
192
+
193
+ ## 0.2.2
194
+
195
+ - Update styles
196
+
197
+ ## 0.2.1
198
+
199
+ - Add default color for avatars (grey)
200
+
201
+ ## 0.2.0
202
+
203
+ - Custom hook for likes
204
+
205
+ - Change props for BlogPostPage
206
+ - delete:
207
+ - data
208
+ - add:
209
+ - likes
210
+ - content
211
+ - post
212
+
213
+ ## 0.1.0
214
+
215
+ - Refactor business-logic BlogSuggets
216
+
217
+ ## 0.0.4
218
+
219
+ - Delete extra requirements
220
+
221
+ ## 0.0.3
222
+
223
+ - Refactor BlogContextProvider
224
+
225
+ ## 0.0.2
226
+
227
+ - Meta fixes
228
+
229
+ ## 0.0.1
230
+
231
+ - Create first version including Blog Post Page
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @gravity-ui/blog-constructor · [![npm package](https://img.shields.io/npm/v/@gravity-ui/blog-constructor)](https://www.npmjs.com/package/@gravity-ui/blog-constructor) [![CI](https://img.shields.io/github/actions/workflow/status/gravity-ui/blog-constructor/ci.yml?branch=main&label=CI)](https://github.com/gravity-ui/blog-constructor/actions/workflows/ci.yml?query=branch:main) [![CI](https://img.shields.io/github/actions/workflow/status/gravity-ui/blog-constructor/release.yml?branch=main&label=Release)](https://github.com/gravity-ui/blog-constructor/actions/workflows/release.yml?query=branch:main) [![storybook](https://img.shields.io/badge/Storybook-deployed-ff4685)](https://preview.yandexcloud.dev/blog-constructor/)
1
+ # @gravity-ui/blog-constructor ·
2
2
 
3
3
  ## Install
4
4
 
@@ -6,68 +6,6 @@
6
6
  npm install @gravity-ui/blog-constructor
7
7
  ```
8
8
 
9
- ## Blog-constructor
10
-
11
- `Blog-constructor` is a library based on the [Page-constructor](https://github.com/gravity-ui/page-constructor) library for creating blog format web pages. Blog-constructor uses the [`custom`](https://github.com/gravity-ui/page-constructor#custom-blocks) prop from page-constructor to add the components needed for the blog.
12
-
13
- ### Documentation - [storybook](https://preview.yandexcloud.dev/blog-constructor/)
14
-
15
- ### Getting started
16
-
17
- The blog-constructor has both client components and server components for import. The blog pages is imported as a React component. To make sure it runs properly, wrap it in `BlogConstructorProvider`:
18
-
19
- ```jsx
20
- import {BlogPage, BlogConstructorProvider} from '@gravity-ui/blog-constructor';
21
-
22
- // Main blog page
23
- <BlogConstructorProvider {...providerProps}>
24
- <BlogPage
25
- content={content}
26
- posts={posts}
27
- tags={tags}
28
- getPosts={handleGetPosts}
29
- settings={settings}
30
- />
31
- </BlogConstructorProvider>
32
-
33
- ---
34
-
35
- import {BlogPostPage, BlogConstructorProvider} from '@gravity-ui/blog-constructor';
36
-
37
- // Post page
38
- <BlogConstructorProvider {...providerProps}>
39
- <BlogPostPage
40
- content={content}
41
- post={post}
42
- suggestedPosts={suggestedPosts}
43
- settings={settings}
44
- shareOptions={shareOptions}
45
- />
46
- </BlogConstructorProvider>
47
-
48
- ```
49
-
50
- Also blog-constructor have server components to help you transform your data if you need
51
-
52
- ```jsx
53
- import {
54
- transformPost,
55
- sanitizeMeta,
56
- createReadableContent,
57
- transformPageContent,
58
- } from '@gravity-ui/blog-constructor/server';
59
- ```
60
-
61
- ## i18n
62
-
63
- To make sure the i18n library used in your project runs properly, perform its initialization and set the project's current locale value in `lang`. For example:
64
-
65
- ```typescript
66
- import {configure, Lang} from '@gravity-ui/blog-constructor';
67
-
68
- configure({lang: Lang.En});
69
- ```
70
-
71
9
  ## Development
72
10
 
73
11
  ```bash
@@ -34,24 +34,27 @@ unpredictable css rules order in build */
34
34
  width: 100%;
35
35
  }
36
36
  .bc-feed-controls__popup.bc-feed-controls__popup {
37
+ max-height: 500px;
37
38
  border-radius: 12px;
38
39
  }
39
- .bc-feed-controls__popup.bc-feed-controls__popup .yc-select-filter + .yc-select-list {
40
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-filter + .g-select-list {
40
41
  margin-top: 0;
41
42
  }
42
- .bc-feed-controls__popup.bc-feed-controls__popup .yc-select-filter + .yc-select-list::-webkit-scrollbar {
43
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-list {
44
+ overflow: scroll;
45
+ }
46
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-list::-webkit-scrollbar {
43
47
  display: none;
44
48
  }
45
49
  .bc-feed-controls__popup.bc-feed-controls__popup .yc-list__item {
46
50
  margin: 4px;
47
51
  border-radius: 8px;
48
52
  }
49
- .bc-feed-controls__popup.bc-feed-controls__popup .yc-select-filter {
50
- margin-top: 4px;
53
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-filter {
51
54
  padding: 4px;
52
55
  border-bottom: 1px solid var(--yc-color-line-generic);
53
56
  }
54
- .bc-feed-controls__popup.bc-feed-controls__popup .yc-select-filter .yc-text-input__control.yc-text-input__control_type_input {
57
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-filter .yc-text-input__control.yc-text-input__control_type_input {
55
58
  border: none;
56
59
  }
57
60
 
@@ -71,14 +74,12 @@ unpredictable css rules order in build */
71
74
  border-radius: 10px;
72
75
  }
73
76
  .bc-feed-controls__saved-only-button_savedOnly {
74
- --yc-button-background-color: var(--pc-monochrome-button-background-color);
75
- --yc-button-background-color-hover: var(--pc-monochrome-button-background-color-hover);
76
- }
77
- .bc-feed-controls__saved-only-button_savedOnly, .bc-feed-controls__saved-only-button_savedOnly:link, .bc-feed-controls__saved-only-button_savedOnly:visited, .bc-feed-controls__saved-only-button_savedOnly:active, .bc-feed-controls__saved-only-button_savedOnly:focus {
78
- color: var(--pc-monochrome-button-color);
77
+ --yc-button-background-color: var(--pc-monochrome-button);
78
+ --yc-button-background-color-hover: var(--pc-monochrome-button-hover);
79
+ color: var(--yc-color-text-light-primary);
79
80
  }
80
81
  .bc-feed-controls__saved-only-button_savedOnly:hover {
81
- color: var(--pc-monochrome-button-color);
82
+ color: var(--yc-color-text-light-primary);
82
83
  }
83
84
  .bc-feed-controls__saved-only-button_savedOnly:focus {
84
85
  color: var(--yc-color-base-background);
@@ -91,9 +91,9 @@ const Controls = ({ setIsFetching, tags = [], services = [], handleChangeQuery,
91
91
  initial: [tagInitial],
92
92
  list: tagsItems,
93
93
  defaultLabel: (0, i18n_1.i18)(i18n_1.Keyset.AllTags),
94
- }), renderOption: customRenders_1.renderOption })),
94
+ }), disablePortal: true, renderOption: customRenders_1.renderOption })),
95
95
  services.length > 0 ? (react_1.default.createElement("div", { className: b('filter-item') },
96
- react_1.default.createElement(uikit_1.Select, { className: b('select'), size: "xl", multiple: true, filterable: true, options: services, defaultValue: servicesItems, popupClassName: b('popup'), onUpdate: handleServicesSelect, placeholder: (0, i18n_1.i18)(i18n_1.Keyset.AllServices), renderControl: (0, customRenders_1.renderSwitcher)({
96
+ react_1.default.createElement(uikit_1.Select, { className: b('select'), size: "xl", multiple: true, filterable: true, disablePortal: true, options: services, defaultValue: servicesItems, popupClassName: b('popup'), onUpdate: handleServicesSelect, placeholder: (0, i18n_1.i18)(i18n_1.Keyset.AllServices), renderControl: (0, customRenders_1.renderSwitcher)({
97
97
  initial: servicesItems,
98
98
  list: services,
99
99
  defaultLabel: (0, i18n_1.i18)(i18n_1.Keyset.AllServices),
@@ -49,6 +49,6 @@ const Sharing = ({ theme, metrikaGoal }) => {
49
49
  };
50
50
  return (react_1.default.createElement("div", { className: b('item') },
51
51
  react_1.default.createElement("span", { className: b('icon') },
52
- react_1.default.createElement(uikit_1.ShareTooltip, { url: (0, common_1.getAbsolutePath)(router), className: b('share'), iconClass: b('share-icon'), switcherClassName: b('switcher', { theme }), tooltipClassName: b('popup'), useWebShareApi: isMobile, direction: 'column', buttonTitle: (0, i18n_1.i18)(i18n_1.Keyset.ActionShare), customIcon: ShareArrowUp_1.ShareArrowUp, placement: "bottom", openByHover: false, socialNets: shareOptions, handleMetrika: handleMetrika }))));
52
+ react_1.default.createElement(uikit_1.SharePopover, { url: (0, common_1.getAbsolutePath)(router), className: b('share'), iconClass: b('share-icon'), switcherClassName: b('switcher', { theme }), tooltipClassName: b('popup'), useWebShareApi: isMobile, direction: 'column', buttonTitle: (0, i18n_1.i18)(i18n_1.Keyset.ActionShare), customIcon: ShareArrowUp_1.ShareArrowUp, placement: "bottom", openByHover: false, shareOptions: shareOptions, handleMetrika: handleMetrika }))));
53
53
  };
54
54
  exports.Sharing = Sharing;
@@ -7,6 +7,7 @@ export type AuthorProps = ClassNameProps & {
7
7
  image: string;
8
8
  } & PaddingsYFMProps;
9
9
  export type BannerProps = ContentBlockProps & {
10
+ background?: string;
10
11
  color?: string;
11
12
  image?: string;
12
13
  imageSize?: 's' | 'm';
@@ -34,24 +34,27 @@ unpredictable css rules order in build */
34
34
  width: 100%;
35
35
  }
36
36
  .bc-feed-controls__popup.bc-feed-controls__popup {
37
+ max-height: 500px;
37
38
  border-radius: 12px;
38
39
  }
39
- .bc-feed-controls__popup.bc-feed-controls__popup .yc-select-filter + .yc-select-list {
40
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-filter + .g-select-list {
40
41
  margin-top: 0;
41
42
  }
42
- .bc-feed-controls__popup.bc-feed-controls__popup .yc-select-filter + .yc-select-list::-webkit-scrollbar {
43
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-list {
44
+ overflow: scroll;
45
+ }
46
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-list::-webkit-scrollbar {
43
47
  display: none;
44
48
  }
45
49
  .bc-feed-controls__popup.bc-feed-controls__popup .yc-list__item {
46
50
  margin: 4px;
47
51
  border-radius: 8px;
48
52
  }
49
- .bc-feed-controls__popup.bc-feed-controls__popup .yc-select-filter {
50
- margin-top: 4px;
53
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-filter {
51
54
  padding: 4px;
52
55
  border-bottom: 1px solid var(--yc-color-line-generic);
53
56
  }
54
- .bc-feed-controls__popup.bc-feed-controls__popup .yc-select-filter .yc-text-input__control.yc-text-input__control_type_input {
57
+ .bc-feed-controls__popup.bc-feed-controls__popup .g-select-filter .yc-text-input__control.yc-text-input__control_type_input {
55
58
  border: none;
56
59
  }
57
60
 
@@ -71,14 +74,12 @@ unpredictable css rules order in build */
71
74
  border-radius: 10px;
72
75
  }
73
76
  .bc-feed-controls__saved-only-button_savedOnly {
74
- --yc-button-background-color: var(--pc-monochrome-button-background-color);
75
- --yc-button-background-color-hover: var(--pc-monochrome-button-background-color-hover);
76
- }
77
- .bc-feed-controls__saved-only-button_savedOnly, .bc-feed-controls__saved-only-button_savedOnly:link, .bc-feed-controls__saved-only-button_savedOnly:visited, .bc-feed-controls__saved-only-button_savedOnly:active, .bc-feed-controls__saved-only-button_savedOnly:focus {
78
- color: var(--pc-monochrome-button-color);
77
+ --yc-button-background-color: var(--pc-monochrome-button);
78
+ --yc-button-background-color-hover: var(--pc-monochrome-button-hover);
79
+ color: var(--yc-color-text-light-primary);
79
80
  }
80
81
  .bc-feed-controls__saved-only-button_savedOnly:hover {
81
- color: var(--pc-monochrome-button-color);
82
+ color: var(--yc-color-text-light-primary);
82
83
  }
83
84
  .bc-feed-controls__saved-only-button_savedOnly:focus {
84
85
  color: var(--yc-color-base-background);
@@ -63,9 +63,9 @@ export const Controls = ({ setIsFetching, tags = [], services = [], handleChange
63
63
  initial: [tagInitial],
64
64
  list: tagsItems,
65
65
  defaultLabel: i18(Keyset.AllTags),
66
- }), renderOption: renderOption })),
66
+ }), disablePortal: true, renderOption: renderOption })),
67
67
  services.length > 0 ? (React.createElement("div", { className: b('filter-item') },
68
- React.createElement(Select, { className: b('select'), size: "xl", multiple: true, filterable: true, options: services, defaultValue: servicesItems, popupClassName: b('popup'), onUpdate: handleServicesSelect, placeholder: i18(Keyset.AllServices), renderControl: renderSwitcher({
68
+ React.createElement(Select, { className: b('select'), size: "xl", multiple: true, filterable: true, disablePortal: true, options: services, defaultValue: servicesItems, popupClassName: b('popup'), onUpdate: handleServicesSelect, placeholder: i18(Keyset.AllServices), renderControl: renderSwitcher({
69
69
  initial: servicesItems,
70
70
  list: services,
71
71
  defaultLabel: i18(Keyset.AllServices),
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { ShareTooltip } from '@gravity-ui/uikit';
2
+ import { SharePopover } from '@gravity-ui/uikit';
3
3
  import { MobileContext } from '../../../contexts/MobileContext';
4
4
  import { RouterContext } from '../../../contexts/RouterContext';
5
5
  import { PostPageContext } from '../../../contexts/PostPageContext';
@@ -21,5 +21,5 @@ export const Sharing = ({ theme, metrikaGoal }) => {
21
21
  };
22
22
  return (React.createElement("div", { className: b('item') },
23
23
  React.createElement("span", { className: b('icon') },
24
- React.createElement(ShareTooltip, { url: getAbsolutePath(router), className: b('share'), iconClass: b('share-icon'), switcherClassName: b('switcher', { theme }), tooltipClassName: b('popup'), useWebShareApi: isMobile, direction: 'column', buttonTitle: i18(Keyset.ActionShare), customIcon: ShareArrowUp, placement: "bottom", openByHover: false, socialNets: shareOptions, handleMetrika: handleMetrika }))));
24
+ React.createElement(SharePopover, { url: getAbsolutePath(router), className: b('share'), iconClass: b('share-icon'), switcherClassName: b('switcher', { theme }), tooltipClassName: b('popup'), useWebShareApi: isMobile, direction: 'column', buttonTitle: i18(Keyset.ActionShare), customIcon: ShareArrowUp, placement: "bottom", openByHover: false, shareOptions: shareOptions, handleMetrika: handleMetrika }))));
25
25
  };
@@ -7,6 +7,7 @@ export type AuthorProps = ClassNameProps & {
7
7
  image: string;
8
8
  } & PaddingsYFMProps;
9
9
  export type BannerProps = ContentBlockProps & {
10
+ background?: string;
10
11
  color?: string;
11
12
  image?: string;
12
13
  imageSize?: 's' | 'm';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/blog-constructor",
3
- "version": "1.1.2",
3
+ "version": "2.0.0-alpha.1",
4
4
  "description": "Gravity UI Blog Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,57 +40,62 @@
40
40
  "prepublishOnly": "npm run lint && npm run build",
41
41
  "prepare": "husky install",
42
42
  "svgo": "svgo --config svgo.config.js",
43
- "svgo:all": "svgo --config svgo.config.js -r -f assets",
44
- "test": "jest --maxWorkers=50%",
45
- "test:coverage": "jest --coverage",
46
- "test:watch": "jest --watchAll --maxWorkers=25%"
43
+ "svgo:all": "svgo --config svgo.config.js -r -f assets"
47
44
  },
48
45
  "dependencies": {
49
46
  "@gravity-ui/i18n": "^1.0.0",
47
+ "@gravity-ui/uikit": "^4.1.0",
48
+ "@types/fast-html-parser": "^1.0.2",
49
+ "@types/recompose": "^0.30.10",
50
50
  "bem-cn-lite": "^4.0.0",
51
51
  "fast-html-parser": "^1.0.1",
52
+ "gulp": "^4.0.2",
53
+ "gulp-dart-sass": "^1.0.2",
54
+ "gulp-rename": "^2.0.0",
55
+ "gulp-replace": "^1.1.3",
56
+ "gulp-typescript": "^6.0.0-alpha.1",
57
+ "html-loader": "^1.3.2",
52
58
  "isomorphic-dompurify": "^0.20.0",
53
59
  "lodash": "^4.17.21",
60
+ "markdown-loader": "^6.0.0",
54
61
  "react-helmet": "^6.1.0",
55
62
  "react-player": "^2.9.0",
56
63
  "react-slick": "^0.28.1",
57
- "react-spring": "~9.6.0",
64
+ "react-spring": "^9.3.0",
58
65
  "react-transition-group": "^4.4.2",
59
66
  "react-waypoint": "^10.1.0",
67
+ "recompose": "^0.30.0",
68
+ "rimraf": "^3.0.2",
60
69
  "sanitize-html": "^2.6.1",
70
+ "sass": "^1.54.4",
61
71
  "snakecase-keys": "^5.1.0",
62
72
  "typograf": "^6.14.0",
63
73
  "ua-parser-js": "^0.7.28",
64
74
  "url": "^0.11.0",
65
- "url-join": "^5.0.0"
75
+ "url-join": "^5.0.0",
76
+ "webpack": "^4.46.0"
66
77
  },
67
78
  "peerDependencies": {
68
- "@doc-tools/transform": "^2.9.0",
69
- "@gravity-ui/uikit": "^3.20.0",
70
- "@gravity-ui/page-constructor": "^1.22.0",
79
+ "@doc-tools/components": "^2.0.0",
80
+ "@doc-tools/transform": "^2.6.1",
81
+ "@gravity-ui/page-constructor": "^1.1.0",
71
82
  "react": "^16.0.0 || ^17.0.0"
72
83
  },
73
84
  "devDependencies": {
74
85
  "@babel/core": "^7.15.8",
75
- "@commitlint/config-conventional": "^17.4.3",
86
+ "@doc-tools/components": "^2.1.0",
76
87
  "@doc-tools/transform": "^2.9.0",
77
88
  "@gravity-ui/eslint-config": "^1.0.2",
78
- "@gravity-ui/page-constructor": "^1.23.0",
89
+ "@gravity-ui/page-constructor": "^1.4.1",
79
90
  "@gravity-ui/prettier-config": "^1.0.1",
80
91
  "@gravity-ui/stylelint-config": "^1.0.0",
81
92
  "@gravity-ui/tsconfig": "^1.0.0",
82
- "@gravity-ui/uikit": "^3.20.0",
83
93
  "@storybook/addon-actions": "^6.3.12",
84
94
  "@storybook/addon-essentials": "^6.5.10",
85
95
  "@storybook/addon-knobs": "^6.3.1",
86
96
  "@storybook/addon-viewport": "^6.3.12",
87
97
  "@storybook/preset-scss": "^1.0.3",
88
98
  "@storybook/react": "^6.5.10",
89
- "@testing-library/jest-dom": "^5.16.5",
90
- "@testing-library/react": "^12.1.5",
91
- "@testing-library/user-event": "^14.4.3",
92
- "@types/fast-html-parser": "^1.0.2",
93
- "@types/jest": "^29.2.5",
94
99
  "@types/js-yaml": "^4.0.5",
95
100
  "@types/lodash": "^4.14.176",
96
101
  "@types/react": "^18.0.26",
@@ -99,37 +104,22 @@
99
104
  "@types/react-transition-group": "^4.4.4",
100
105
  "@types/sanitize-html": "^2.6.0",
101
106
  "@types/ua-parser-js": "^0.7.36",
102
- "eslint": "^8.0.0",
107
+ "eslint": "^7.32.0",
103
108
  "eslint-plugin-local": "./eslint-plugin-local",
104
- "eslint-plugin-testing-library": "^5.9.1",
105
- "gulp": "^4.0.2",
106
- "gulp-dart-sass": "^1.0.2",
107
- "gulp-rename": "^2.0.0",
108
- "gulp-replace": "^1.1.3",
109
- "gulp-typescript": "^6.0.0-alpha.1",
110
- "html-loader": "^1.3.2",
111
109
  "husky": "^7.0.4",
112
- "jest": "^29.3.1",
113
- "jest-environment-jsdom": "^29.3.1",
114
- "jest-transform-css": "^6.0.1",
115
110
  "js-yaml": "^3.14.1",
116
111
  "lint-staged": "^11.2.6",
117
- "markdown-loader": "^6.0.0",
118
112
  "move-file-cli": "^3.0.0",
119
113
  "npm-run-all": "^4.1.5",
120
114
  "postcss": "^8.4.14",
121
115
  "prettier": "2.4.1",
122
- "react": "^17.0.0",
123
- "react-dom": "^17.0.0",
124
- "rimraf": "^3.0.2",
125
- "sass": "^1.54.4",
116
+ "react": "^18.2.0",
117
+ "react-dom": "^18.2.0",
126
118
  "sass-loader": "^10.3.1",
127
119
  "stylelint": "^14.11.0",
128
- "stylelint-scss": "^4.0.0",
120
+ "stylelint-scss": "^3.21.0",
129
121
  "svg-sprite-loader": "^6.0.11",
130
- "ts-jest": "^29.0.5",
131
- "typescript": "^4.9.3",
132
- "webpack": "^4.46.0"
122
+ "typescript": "^4.9.3"
133
123
  },
134
124
  "lint-staged": {
135
125
  "*.{css,scss}": [
@@ -143,5 +133,8 @@
143
133
  "*.{json,yaml,yml,md}": [
144
134
  "prettier --write"
145
135
  ]
136
+ },
137
+ "publishConfig": {
138
+ "tag": "alpha"
146
139
  }
147
140
  }
@@ -7,6 +7,7 @@ export type AuthorProps = ClassNameProps & {
7
7
  image: string;
8
8
  } & PaddingsYFMProps;
9
9
  export type BannerProps = ContentBlockProps & {
10
+ background?: string;
10
11
  color?: string;
11
12
  image?: string;
12
13
  imageSize?: 's' | 'm';
@@ -47,3 +47,13 @@
47
47
  }
48
48
  }
49
49
  }
50
+
51
+ @mixin monochromeButton() {
52
+ --yc-button-background-color: var(--pc-monochrome-button);
53
+ --yc-button-background-color-hover: var(--pc-monochrome-button-hover);
54
+ color: var(--yc-color-text-light-primary);
55
+
56
+ &:hover {
57
+ color: var(--yc-color-text-light-primary);
58
+ }
59
+ }
@@ -16,6 +16,6 @@
16
16
  }
17
17
 
18
18
  .docs-story {
19
- // without this in docs objects with z-index < 0 dissapear
19
+ // без этого в docs пропадают объекты с z-index меньше 0
20
20
  z-index: 0 !important;
21
21
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const react_2 = require("@testing-library/react");
8
- const YFM_1 = require("../YFM");
9
- const text = 'YFM block';
10
- describe('YFM', () => {
11
- test('Has id', async () => {
12
- (0, react_2.render)(react_1.default.createElement(YFM_1.YFM, { text: text }));
13
- const yfm = react_2.screen.getByText(text);
14
- expect(yfm).toHaveClass('yfm');
15
- });
16
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { YFM } from '../YFM';
4
- const text = 'YFM block';
5
- describe('YFM', () => {
6
- test('Has id', async () => {
7
- render(React.createElement(YFM, { text: text }));
8
- const yfm = screen.getByText(text);
9
- expect(yfm).toHaveClass('yfm');
10
- });
11
- });