@gravity-ui/page-constructor 1.0.0 → 1.0.2
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/CHANGELOG.md +17 -40
- package/README.md +9 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,63 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 1.0.0 (2022-10-
|
|
3
|
+
## [1.0.2](https://github.com/gravity-ui/page-constructor/compare/v1.0.1...v1.0.2) (2022-10-04)
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
###
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* readme ([be265cd](https://github.com/gravity-ui/page-constructor/commit/be265cd6cdc3a9212ba5a7f6ad4b7b4073dcf7fb))
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
* add commitlint ([dfbbf83](https://github.com/gravity-ui/page-constructor/commit/dfbbf83ea435978a1926c3038e965fd48797919f))
|
|
10
|
-
* add github workflow ([bd204ec](https://github.com/gravity-ui/page-constructor/commit/bd204eca48c204138ef78c202986683d78a84840))
|
|
11
|
-
* add react 18 types supporting ([cd4d1b0](https://github.com/gravity-ui/page-constructor/commit/cd4d1b0f2d075ddcd44adb998bbbeef7fb75117e))
|
|
12
|
-
* add translations for blocks ([64e0999](https://github.com/gravity-ui/page-constructor/commit/64e0999ed166a66294b44a81082a00f366e7d53f))
|
|
13
|
-
* add translations for components and sub blocks stories ([b8d8125](https://github.com/gravity-ui/page-constructor/commit/b8d8125cf9cab76b225e41159a5613fe75b56416))
|
|
14
|
-
* migrate from yandex-cloud to gravity-ui ([3509b63](https://github.com/gravity-ui/page-constructor/commit/3509b63fe1b9507115ff5a3078322dfa39701450))
|
|
15
|
-
* **PageConstructor:** add serviceId loadable [CLOUDFRONT-9364] ([#64](https://github.com/gravity-ui/page-constructor/issues/64)) ([4cc16cd](https://github.com/gravity-ui/page-constructor/commit/4cc16cd1a1dcfc0c17d38b92619456b22f3cf078))
|
|
16
|
-
* prepare to publishing ([a259f69](https://github.com/gravity-ui/page-constructor/commit/a259f693c581bc34519d73063182c880dfcdb78d))
|
|
17
|
-
* translate chapter names ([e922e27](https://github.com/gravity-ui/page-constructor/commit/e922e27657f12aebcd7bb62acb23a783f8a349ba))
|
|
18
|
-
* translate components cards urls ([05382bd](https://github.com/gravity-ui/page-constructor/commit/05382bd3038c6aa0fad98bc2270f6869d2b62ca8))
|
|
19
|
-
* translate englisht pt.1 ([945423a](https://github.com/gravity-ui/page-constructor/commit/945423a73807fdb0d8f29bba9210f94e6d3185dd))
|
|
20
|
-
* translate questions readme ([4da6a8f](https://github.com/gravity-ui/page-constructor/commit/4da6a8fdab85ca68a35a182cd6b841bba6ab3334))
|
|
21
|
-
* update hs form CLOUDFRONT-11339 ([478e762](https://github.com/gravity-ui/page-constructor/commit/478e762457cee318e3a9f1e9b27623def80f0603))
|
|
10
|
+
## [1.0.1](https://github.com/gravity-ui/page-constructor/compare/v1.0.0...v1.0.1) (2022-10-03)
|
|
22
11
|
|
|
23
12
|
|
|
24
13
|
### Bug Fixes
|
|
25
14
|
|
|
26
|
-
* add
|
|
27
|
-
* add card-with image schema ([#85](https://github.com/gravity-ui/page-constructor/issues/85)) ([82af438](https://github.com/gravity-ui/page-constructor/commit/82af4382fd9bb37089f3ffc00b4bc8b3ddb36d7a))
|
|
28
|
-
* add CHANGELOG and CONTRIBUTING to prettier ignore ([d3def9c](https://github.com/gravity-ui/page-constructor/commit/d3def9c6557f51de330dbcaca64dc56dbc84ce04))
|
|
29
|
-
* add dummy test ([9e5e769](https://github.com/gravity-ui/page-constructor/commit/9e5e76901cbd8b3b7b6cac2e757351e58f022bad))
|
|
30
|
-
* add paddings to submited message block NOTICKET ([54665d1](https://github.com/gravity-ui/page-constructor/commit/54665d1818f5c63988ae5e5d485a3b10cf5f88ae))
|
|
31
|
-
* children types ([dee1176](https://github.com/gravity-ui/page-constructor/commit/dee11769e2058f552e77612450a08790e8c28ba5))
|
|
32
|
-
* lint ([3d448fa](https://github.com/gravity-ui/page-constructor/commit/3d448fa879fa20e00e0b9b89ba952ef0b3588184))
|
|
33
|
-
* lint fix comand ([5533ab4](https://github.com/gravity-ui/page-constructor/commit/5533ab433aeb2d209913ddeef9364518f84ef882))
|
|
34
|
-
* lint prettier ([c57092c](https://github.com/gravity-ui/page-constructor/commit/c57092c9e7c63b5d15a1037598253adc0e578129))
|
|
35
|
-
* remove hekpers and sources ([49f9220](https://github.com/gravity-ui/page-constructor/commit/49f9220c094b70e0d86df9552bf6a81e316a3796))
|
|
36
|
-
* remove helper decorator ([c512a17](https://github.com/gravity-ui/page-constructor/commit/c512a17abe63be6802e8d6ba82a153e132f8bec7))
|
|
37
|
-
* remove withThemeValueContext ([339bbb4](https://github.com/gravity-ui/page-constructor/commit/339bbb418bfb60f82c84e9da0bf0eb6981186dae))
|
|
38
|
-
* reword handlers disclamer comments & extend HubspotEventHandlers in HubspotFormProps NOTICKET ([f254205](https://github.com/gravity-ui/page-constructor/commit/f254205a6cf8487a59ed8b3759681e40650760d7))
|
|
39
|
-
* storybook launch ([65254de](https://github.com/gravity-ui/page-constructor/commit/65254ded6c23f5f5951e4e8fa18474c0ec154b18))
|
|
40
|
-
* turn main readme back to english ([e30267c](https://github.com/gravity-ui/page-constructor/commit/e30267ca710898fd5996341e8315f128c95ca609))
|
|
15
|
+
* add repository links to readme ([a6ed8b9](https://github.com/gravity-ui/page-constructor/commit/a6ed8b9af5f71e8b0eed3bb52f3309a715c5a48b))
|
|
41
16
|
|
|
42
17
|
## 1.0.0
|
|
43
18
|
|
|
44
|
-
-
|
|
19
|
+
- V1 blocks support was discontinued.
|
|
20
|
+
|
|
21
|
+
- `@yandex-data-ui/common`, `@yandex-data-ui/cloud-schemas`, and `@yandex-data-ui/cloud-components` was deleted from dependencies.
|
|
45
22
|
|
|
46
|
-
-
|
|
23
|
+
- All the constructor elements was grouped into blocks, sub-blocks and components.
|
|
47
24
|
|
|
48
|
-
-
|
|
25
|
+
- PageConstructor component was refactored.
|
|
49
26
|
|
|
50
|
-
-
|
|
27
|
+
- Validators was Refactored.
|
|
51
28
|
|
|
52
|
-
-
|
|
29
|
+
- Project build engine was moved from `@yandex-data-ui/ui-core` to `gulp`.
|
|
53
30
|
|
|
54
|
-
-
|
|
31
|
+
- Storybook was updated.
|
|
55
32
|
|
|
56
|
-
-
|
|
33
|
+
- Project was moved to @gravity-ui.
|
|
57
34
|
|
|
58
|
-
-
|
|
35
|
+
- LICENSE.md and CONTRIBUTING.md was added
|
|
59
36
|
|
|
60
|
-
-
|
|
37
|
+
- Translate all docs and stories to english
|
|
61
38
|
|
|
62
39
|
## 0.60.5
|
|
63
40
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gravity-ui/page-constructor · [](https://www.npmjs.com/package/@gravity-ui/page-constructor) [](https://github.com/gravity-ui/page-constructor/actions/workflows/ci.yml?query=branch:main) [](https://preview.yandexcloud.dev/page-constructor/)
|
|
2
2
|
|
|
3
3
|
## Install
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ npm install @gravity-ui/page-constructor
|
|
|
12
12
|
|
|
13
13
|
When creating pages, component-based approach is used: a page is built using a set of ready-made blocks that can be placed in any order. Each block has a certain type and set of input data parameters.
|
|
14
14
|
|
|
15
|
-
For the format of input data and list of available blocks, see the [documentation](
|
|
15
|
+
For the format of input data and list of available blocks, see the [documentation](https://preview.yandexcloud.dev/page-constructor/?path=/story/information--blocks).
|
|
16
16
|
|
|
17
17
|
### Getting started
|
|
18
18
|
|
|
@@ -32,8 +32,8 @@ const Page: WithChildren<PageProps> = ({content}) => (
|
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
34
|
interface PageConstructorProps {
|
|
35
|
-
content: PageContent; //
|
|
36
|
-
shouldRenderBlock?: ShouldRenderBlock; // A function that is invoked when rendering each block and
|
|
35
|
+
content: PageContent; //Blocks data in JSON format.
|
|
36
|
+
shouldRenderBlock?: ShouldRenderBlock; // A function that is invoked when rendering each block and lets you set conditions for its display.
|
|
37
37
|
custom?: Custom; //Custom blocks (see `Customization`).
|
|
38
38
|
renderMenu?: () => React.ReactNode; //A function that renders the page menu with navigation (we plan to add rendering for the default menu version).
|
|
39
39
|
}
|
|
@@ -97,7 +97,7 @@ To pass custom blocks to the constructor:
|
|
|
97
97
|
|
|
98
98
|
2. In your code, create an object with the block type (string) as a key and an imported block component as a value.
|
|
99
99
|
|
|
100
|
-
3. Pass the object you created to the `custom.blocks` or `custom.
|
|
100
|
+
3. Pass the object you created to the `custom.blocks`, `custom.headers` or `custom.subBlocks` parameter of the `PageConstructor` component (`custom.headers` specifies the block headers to be rendered separately above general content).
|
|
101
101
|
|
|
102
102
|
4. Now you can use the created block in input data (the `content` parameter) by specifying its type and data.
|
|
103
103
|
|
|
@@ -150,21 +150,22 @@ Sub-blocks are components that can be used in the block `children` property. In
|
|
|
150
150
|
|
|
151
151
|
### How to add a new block to the `page-constructor`
|
|
152
152
|
|
|
153
|
-
1. In the `src/blocks` or `src/sub-blocks` directory, create a folder with the block
|
|
153
|
+
1. In the `src/blocks` or `src/sub-blocks` directory, create a folder with the block or sub-block code.
|
|
154
154
|
|
|
155
155
|
2. Add the block or sub-block name to enum `BlockType` or`SubBlockType` and describe its properties in the `src/models/blocks.ts` or `src/models/sub-blocks.ts` file in a similar way to the existing ones.
|
|
156
156
|
|
|
157
|
-
3. Add export for the block in the `src/blocks/index.ts` file and for the sub-block in the `src/
|
|
157
|
+
3. Add export for the block in the `src/blocks/index.ts` file and for the sub-block in the `src/sub-blocks/index.ts` file.
|
|
158
158
|
|
|
159
159
|
4. Add a new component or block to mapping in `src/constructor-items.ts`.
|
|
160
160
|
|
|
161
161
|
5. Add a validator for the new block:
|
|
162
162
|
|
|
163
|
-
- Add a `schema.ts` file to the block
|
|
163
|
+
- Add a `schema.ts` file to the block or sub-block directory. In this file, describe a parameter validator for the component in [`json-schema`](http://json-schema.org/) format.
|
|
164
164
|
- Export it in the `schema/validators/blocks.ts` or `schema/validators/sub-blocks.ts` file.
|
|
165
165
|
- Add it to `enum` or `selectCases` in the `schema/index.ts` file.
|
|
166
166
|
|
|
167
167
|
6. In the block directory, add the `README.md` file with a description of input parameters.
|
|
168
|
+
7. In the block directory add storybook demo in `__stories__` folder. (All demo content for story should be placed in `data.json` at story dir)
|
|
168
169
|
|
|
169
170
|
### Themes
|
|
170
171
|
|