@gravity-ui/blog-constructor 5.11.0 → 5.12.1-alpha.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 (40) hide show
  1. package/build/cjs/blocks/Author/schema.d.ts +12 -0
  2. package/build/cjs/blocks/Banner/schema.d.ts +12 -0
  3. package/build/cjs/blocks/CTA/schema.d.ts +12 -0
  4. package/build/cjs/blocks/ColoredText/schema.d.ts +12 -0
  5. package/build/cjs/blocks/Feed/schema.d.ts +12 -0
  6. package/build/cjs/blocks/Header/schema.d.ts +47 -0
  7. package/build/cjs/blocks/Layout/schema.d.ts +12 -0
  8. package/build/cjs/blocks/Media/schema.d.ts +47 -0
  9. package/build/cjs/blocks/Meta/schema.d.ts +12 -0
  10. package/build/cjs/blocks/Suggest/schema.d.ts +12 -0
  11. package/build/cjs/blocks/YFM/schema.d.ts +12 -0
  12. package/build/cjs/containers/BlogPage/BlogPage.d.ts +3 -2
  13. package/build/cjs/containers/BlogPage/BlogPage.js +4 -3
  14. package/build/cjs/containers/BlogPostPage/BlogPostPage.d.ts +3 -2
  15. package/build/cjs/containers/BlogPostPage/BlogPostPage.js +4 -3
  16. package/build/cjs/hooks/useExtendedComponentMap.d.ts +24 -0
  17. package/build/cjs/hooks/useExtendedComponentMap.js +9 -0
  18. package/build/cjs/models/blocks.d.ts +1 -1
  19. package/build/cjs/schema/index.d.ts +202 -0
  20. package/build/esm/blocks/Author/schema.d.ts +12 -0
  21. package/build/esm/blocks/Banner/schema.d.ts +12 -0
  22. package/build/esm/blocks/CTA/schema.d.ts +12 -0
  23. package/build/esm/blocks/ColoredText/schema.d.ts +12 -0
  24. package/build/esm/blocks/Feed/schema.d.ts +12 -0
  25. package/build/esm/blocks/Header/schema.d.ts +47 -0
  26. package/build/esm/blocks/Layout/schema.d.ts +12 -0
  27. package/build/esm/blocks/Media/schema.d.ts +47 -0
  28. package/build/esm/blocks/Meta/schema.d.ts +12 -0
  29. package/build/esm/blocks/Suggest/schema.d.ts +12 -0
  30. package/build/esm/blocks/YFM/schema.d.ts +12 -0
  31. package/build/esm/containers/BlogPage/BlogPage.d.ts +3 -2
  32. package/build/esm/containers/BlogPage/BlogPage.js +4 -3
  33. package/build/esm/containers/BlogPostPage/BlogPostPage.d.ts +3 -2
  34. package/build/esm/containers/BlogPostPage/BlogPostPage.js +4 -3
  35. package/build/esm/hooks/useExtendedComponentMap.d.ts +24 -0
  36. package/build/esm/hooks/useExtendedComponentMap.js +4 -0
  37. package/build/esm/models/blocks.d.ts +1 -1
  38. package/build/esm/schema/index.d.ts +202 -0
  39. package/package.json +5 -4
  40. package/server/models/blocks.d.ts +1 -1
@@ -0,0 +1,24 @@
1
+ import { CustomConfig } from '@gravity-ui/page-constructor';
2
+ export declare const useExtendedComponentMap: (custom: CustomConfig | undefined) => {
3
+ blocks: {
4
+ "blog-yfm-block": (props: import("../models/blocks").YFMProps) => import("react").JSX.Element;
5
+ "blog-layout-block": ({ fullWidth, mobileOrder, children, paddingTop, paddingBottom, }: import("react").PropsWithChildren<import("../models/blocks").LayoutProps>) => import("react").JSX.Element;
6
+ "blog-media-block": ({ text, paddingTop, paddingBottom, ...mediaProps }: import("../models/blocks").MediaProps) => import("react").JSX.Element;
7
+ "blog-banner-block": ({ color, imageSize, image, paddingTop, paddingBottom, qa, ...content }: import("../models/blocks").BannerProps) => import("react").JSX.Element;
8
+ "blog-cta-block": ({ items, paddingTop, paddingBottom, qa }: import("../models/blocks").CTAProps) => import("react").JSX.Element;
9
+ "blog-colored-text-block": ({ background, paddingTop, paddingBottom, qa, ...content }: import("../models/blocks").ColoredTextProps) => import("react").JSX.Element;
10
+ "blog-author-block": (props: import("../models/blocks").AuthorProps) => import("react").JSX.Element | null;
11
+ "blog-suggest-block": ({ paddingTop, paddingBottom }: import("../models/blocks").SuggestProps) => import("react").JSX.Element | null;
12
+ "blog-meta-block": (props: import("../models/blocks").MetaProps) => import("react").JSX.Element;
13
+ "blog-feed-block": ({ image }: import("../models/blocks").FeedProps) => import("react").JSX.Element;
14
+ };
15
+ headers: {
16
+ "blog-header-block": (props: import("../models/blocks").HeaderProps) => import("react").JSX.Element;
17
+ };
18
+ subBlocks?: import("@gravity-ui/page-constructor").CustomItems | undefined;
19
+ navigation?: import("@gravity-ui/page-constructor").CustomItems | undefined;
20
+ loadable?: import("@gravity-ui/page-constructor").LoadableConfig | undefined;
21
+ decorators?: {
22
+ block?: ((props: import("@gravity-ui/page-constructor").BlockDecorationProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>)[] | undefined;
23
+ } | undefined;
24
+ };
@@ -0,0 +1,4 @@
1
+ import { useMemo } from 'react';
2
+ import { getCustomItems } from '@gravity-ui/page-constructor';
3
+ import componentMap from '../constructor/blocksMap';
4
+ export const useExtendedComponentMap = (custom) => useMemo(() => (Object.assign(Object.assign({}, custom), { blocks: Object.assign(Object.assign({}, componentMap.blocks), getCustomItems(['blocks'], custom)), headers: Object.assign(Object.assign({}, componentMap.headers), getCustomItems(['headers'], custom)) })), [custom]);
@@ -27,7 +27,7 @@ export type LayoutProps = {
27
27
  mobileOrder?: string;
28
28
  children: ReactElement[];
29
29
  } & PaddingsYFMProps;
30
- export type MediaProps = ClassNameProps & PaddingsYFMProps & Partial<Pick<PCMediaProps, 'youtube' | 'previewImg' | 'image' | 'video' | 'dataLens'>> & {
30
+ export type MediaProps = ClassNameProps & PaddingsYFMProps & Partial<Pick<PCMediaProps, 'youtube' | 'previewImg' | 'image' | 'video' | 'dataLens' | 'iframe' | 'margins'>> & {
31
31
  text?: string;
32
32
  };
33
33
  export type MetaProps = QAProps & {
@@ -443,6 +443,41 @@ export declare const schemasForCustom: {
443
443
  ratio: {
444
444
  type: string;
445
445
  };
446
+ iframe: {
447
+ type: string;
448
+ additionalProperties: boolean;
449
+ required: string[];
450
+ properties: {
451
+ src: {
452
+ type: string;
453
+ };
454
+ name: {
455
+ type: string;
456
+ };
457
+ title: {
458
+ type: string;
459
+ };
460
+ height: {
461
+ oneOf: ({
462
+ type: string;
463
+ enum?: undefined;
464
+ } | {
465
+ type: string;
466
+ enum: string[];
467
+ })[];
468
+ };
469
+ width: {
470
+ type: string;
471
+ };
472
+ justifyContent: {
473
+ type: string;
474
+ enum: string[];
475
+ };
476
+ };
477
+ };
478
+ margins: {
479
+ type: string;
480
+ };
446
481
  };
447
482
  } & {
448
483
  optionName: string;
@@ -534,6 +569,18 @@ export declare const schemasForCustom: {
534
569
  context: {
535
570
  type: string;
536
571
  };
572
+ indent: {
573
+ type: string;
574
+ additionalProperties: boolean;
575
+ properties: {
576
+ top: {
577
+ enum: string[];
578
+ };
579
+ bottom: {
580
+ enum: string[];
581
+ };
582
+ };
583
+ };
537
584
  type: {};
538
585
  when: {
539
586
  type: string;
@@ -597,6 +644,18 @@ export declare const schemasForCustom: {
597
644
  context: {
598
645
  type: string;
599
646
  };
647
+ indent: {
648
+ type: string;
649
+ additionalProperties: boolean;
650
+ properties: {
651
+ top: {
652
+ enum: string[];
653
+ };
654
+ bottom: {
655
+ enum: string[];
656
+ };
657
+ };
658
+ };
600
659
  type: {};
601
660
  when: {
602
661
  type: string;
@@ -747,6 +806,18 @@ export declare const schemasForCustom: {
747
806
  context: {
748
807
  type: string;
749
808
  };
809
+ indent: {
810
+ type: string;
811
+ additionalProperties: boolean;
812
+ properties: {
813
+ top: {
814
+ enum: string[];
815
+ };
816
+ bottom: {
817
+ enum: string[];
818
+ };
819
+ };
820
+ };
750
821
  type: {};
751
822
  when: {
752
823
  type: string;
@@ -914,6 +985,18 @@ export declare const schemasForCustom: {
914
985
  context: {
915
986
  type: string;
916
987
  };
988
+ indent: {
989
+ type: string;
990
+ additionalProperties: boolean;
991
+ properties: {
992
+ top: {
993
+ enum: string[];
994
+ };
995
+ bottom: {
996
+ enum: string[];
997
+ };
998
+ };
999
+ };
917
1000
  type: {};
918
1001
  when: {
919
1002
  type: string;
@@ -1064,6 +1147,18 @@ export declare const schemasForCustom: {
1064
1147
  context: {
1065
1148
  type: string;
1066
1149
  };
1150
+ indent: {
1151
+ type: string;
1152
+ additionalProperties: boolean;
1153
+ properties: {
1154
+ top: {
1155
+ enum: string[];
1156
+ };
1157
+ bottom: {
1158
+ enum: string[];
1159
+ };
1160
+ };
1161
+ };
1067
1162
  type: {};
1068
1163
  when: {
1069
1164
  type: string;
@@ -1138,6 +1233,18 @@ export declare const schemasForCustom: {
1138
1233
  context: {
1139
1234
  type: string;
1140
1235
  };
1236
+ indent: {
1237
+ type: string;
1238
+ additionalProperties: boolean;
1239
+ properties: {
1240
+ top: {
1241
+ enum: string[];
1242
+ };
1243
+ bottom: {
1244
+ enum: string[];
1245
+ };
1246
+ };
1247
+ };
1141
1248
  type: {};
1142
1249
  when: {
1143
1250
  type: string;
@@ -1206,6 +1313,18 @@ export declare const schemasForCustom: {
1206
1313
  context: {
1207
1314
  type: string;
1208
1315
  };
1316
+ indent: {
1317
+ type: string;
1318
+ additionalProperties: boolean;
1319
+ properties: {
1320
+ top: {
1321
+ enum: string[];
1322
+ };
1323
+ bottom: {
1324
+ enum: string[];
1325
+ };
1326
+ };
1327
+ };
1209
1328
  type: {};
1210
1329
  when: {
1211
1330
  type: string;
@@ -1464,6 +1583,41 @@ export declare const schemasForCustom: {
1464
1583
  ratio: {
1465
1584
  type: string;
1466
1585
  };
1586
+ iframe: {
1587
+ type: string;
1588
+ additionalProperties: boolean;
1589
+ required: string[];
1590
+ properties: {
1591
+ src: {
1592
+ type: string;
1593
+ };
1594
+ name: {
1595
+ type: string;
1596
+ };
1597
+ title: {
1598
+ type: string;
1599
+ };
1600
+ height: {
1601
+ oneOf: ({
1602
+ type: string;
1603
+ enum?: undefined;
1604
+ } | {
1605
+ type: string;
1606
+ enum: string[];
1607
+ })[];
1608
+ };
1609
+ width: {
1610
+ type: string;
1611
+ };
1612
+ justifyContent: {
1613
+ type: string;
1614
+ enum: string[];
1615
+ };
1616
+ };
1617
+ };
1618
+ margins: {
1619
+ type: string;
1620
+ };
1467
1621
  paddingTop: {
1468
1622
  type: string;
1469
1623
  enum: string[];
@@ -1509,6 +1663,18 @@ export declare const schemasForCustom: {
1509
1663
  context: {
1510
1664
  type: string;
1511
1665
  };
1666
+ indent: {
1667
+ type: string;
1668
+ additionalProperties: boolean;
1669
+ properties: {
1670
+ top: {
1671
+ enum: string[];
1672
+ };
1673
+ bottom: {
1674
+ enum: string[];
1675
+ };
1676
+ };
1677
+ };
1512
1678
  type: {};
1513
1679
  when: {
1514
1680
  type: string;
@@ -1566,6 +1732,18 @@ export declare const schemasForCustom: {
1566
1732
  context: {
1567
1733
  type: string;
1568
1734
  };
1735
+ indent: {
1736
+ type: string;
1737
+ additionalProperties: boolean;
1738
+ properties: {
1739
+ top: {
1740
+ enum: string[];
1741
+ };
1742
+ bottom: {
1743
+ enum: string[];
1744
+ };
1745
+ };
1746
+ };
1569
1747
  type: {};
1570
1748
  when: {
1571
1749
  type: string;
@@ -1623,6 +1801,18 @@ export declare const schemasForCustom: {
1623
1801
  context: {
1624
1802
  type: string;
1625
1803
  };
1804
+ indent: {
1805
+ type: string;
1806
+ additionalProperties: boolean;
1807
+ properties: {
1808
+ top: {
1809
+ enum: string[];
1810
+ };
1811
+ bottom: {
1812
+ enum: string[];
1813
+ };
1814
+ };
1815
+ };
1626
1816
  type: {};
1627
1817
  when: {
1628
1818
  type: string;
@@ -1685,6 +1875,18 @@ export declare const schemasForCustom: {
1685
1875
  context: {
1686
1876
  type: string;
1687
1877
  };
1878
+ indent: {
1879
+ type: string;
1880
+ additionalProperties: boolean;
1881
+ properties: {
1882
+ top: {
1883
+ enum: string[];
1884
+ };
1885
+ bottom: {
1886
+ enum: string[];
1887
+ };
1888
+ };
1889
+ };
1688
1890
  type: {};
1689
1891
  when: {
1690
1892
  type: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/blog-constructor",
3
- "version": "5.11.0",
3
+ "version": "5.12.1-alpha.0",
4
4
  "description": "Gravity UI Blog Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -62,15 +62,16 @@
62
62
  "@bem-react/classname": "^1.6.0",
63
63
  "@gravity-ui/components": "^2.8.0",
64
64
  "@gravity-ui/i18n": "^1.1.0",
65
+ "@gravity-ui/page-constructor": "^4.42.5-alpha.0",
65
66
  "lodash": "^4.17.21",
66
67
  "react-helmet": "^6.1.0",
67
68
  "ua-parser-js": "^0.7.28",
68
69
  "url": "^0.11.0",
69
- "utility-types": "^3.10.0"
70
+ "utility-types": "^3.10.0",
71
+ "uuid": "^9.0.1"
70
72
  },
71
73
  "peerDependencies": {
72
74
  "@doc-tools/transform": "^3.3.2",
73
- "@gravity-ui/page-constructor": "^4.31.0",
74
75
  "@gravity-ui/uikit": "^5.12.0",
75
76
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0"
76
77
  },
@@ -81,7 +82,6 @@
81
82
  "@commitlint/config-conventional": "^17.4.3",
82
83
  "@doc-tools/transform": "^3.11.0",
83
84
  "@gravity-ui/eslint-config": "^3.1.1",
84
- "@gravity-ui/page-constructor": "^4.37.2",
85
85
  "@gravity-ui/prettier-config": "^1.1.0",
86
86
  "@gravity-ui/stylelint-config": "^4.0.1",
87
87
  "@gravity-ui/tsconfig": "^1.0.0",
@@ -102,6 +102,7 @@
102
102
  "@types/react": "^18.0.26",
103
103
  "@types/react-helmet": "^6.1.5",
104
104
  "@types/ua-parser-js": "^0.7.36",
105
+ "@types/uuid": "^9.0.7",
105
106
  "eslint": "^8.34.0",
106
107
  "eslint-plugin-no-not-accumulator-reassign": "^0.1.0",
107
108
  "eslint-plugin-testing-library": "^5.9.1",
@@ -27,7 +27,7 @@ export type LayoutProps = {
27
27
  mobileOrder?: string;
28
28
  children: ReactElement[];
29
29
  } & PaddingsYFMProps;
30
- export type MediaProps = ClassNameProps & PaddingsYFMProps & Partial<Pick<PCMediaProps, 'youtube' | 'previewImg' | 'image' | 'video' | 'dataLens'>> & {
30
+ export type MediaProps = ClassNameProps & PaddingsYFMProps & Partial<Pick<PCMediaProps, 'youtube' | 'previewImg' | 'image' | 'video' | 'dataLens' | 'iframe' | 'margins'>> & {
31
31
  text?: string;
32
32
  };
33
33
  export type MetaProps = QAProps & {