@redneckz/wildless-cms-uni-blocks 0.5.15 → 0.6.15
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/bin/migration-scripts/0.5.14.js +27 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +44 -40
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Blocks.d.ts +1 -0
- package/bundle/components/ContactsBlock/ContactsBlock.d.ts +5 -0
- package/bundle/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
- package/bundle/components/ContentPage/renderContentPageHead.d.ts +3 -0
- package/bundle/components/Gallery/GalleryContent.d.ts +3 -1
- package/bundle/components/Headline/constants.d.ts +0 -2
- package/bundle/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
- package/bundle/model/AlignText.d.ts +2 -0
- package/bundle/model/HeadlineType.d.ts +2 -2
- package/dist/components/Accordion/Accordion.js +2 -6
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ContactsBlock/ContactsBlock.d.ts +5 -0
- package/dist/components/ContactsBlock/ContactsBlock.js +19 -0
- package/dist/components/ContactsBlock/ContactsBlock.js.map +1 -0
- package/dist/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
- package/dist/components/ContactsBlock/ContactsBlockContent.js +2 -0
- package/dist/components/ContactsBlock/ContactsBlockContent.js.map +1 -0
- package/dist/components/ContentPage/renderContentPageHead.d.ts +3 -0
- package/dist/components/ContentPage/renderContentPageHead.js +30 -0
- package/dist/components/ContentPage/renderContentPageHead.js.map +1 -0
- package/dist/components/Gallery/Gallery.mobile.js +2 -1
- package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
- package/dist/components/Gallery/GalleryCardInner.js +6 -11
- package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/dist/components/Gallery/GalleryContainer.js +2 -2
- package/dist/components/Gallery/GalleryContainer.js.map +1 -1
- package/dist/components/Gallery/GalleryContent.d.ts +3 -1
- package/dist/components/Gallery/GalleryInner.js +4 -3
- package/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/dist/components/Headline/Headline.js +2 -1
- package/dist/components/Headline/Headline.js.map +1 -1
- package/dist/components/Headline/Headline.mobile.js +2 -1
- package/dist/components/Headline/Headline.mobile.js.map +1 -1
- package/dist/components/Headline/constants.d.ts +0 -2
- package/dist/components/Headline/constants.js +2 -6
- package/dist/components/Headline/constants.js.map +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js +5 -3
- package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/dist/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
- package/dist/components/StepsBlock/StepsBlock.js +1 -1
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/Tile/Tile.js +1 -1
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/model/AlignText.d.ts +2 -0
- package/dist/model/AlignText.js +8 -0
- package/dist/model/AlignText.js.map +1 -0
- package/dist/model/HeadlineType.d.ts +2 -2
- package/dist/ui-kit/List/ListItem.js +4 -4
- package/dist/ui-kit/List/ListItem.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Accordion/Accordion.js +2 -6
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ContactsBlock/ContactsBlock.d.ts +5 -0
- package/lib/components/ContactsBlock/ContactsBlock.fixture.d.ts +5 -0
- package/lib/components/ContactsBlock/ContactsBlock.js +17 -0
- package/lib/components/ContactsBlock/ContactsBlock.js.map +1 -0
- package/lib/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
- package/lib/components/ContactsBlock/ContactsBlockContent.js +2 -0
- package/lib/components/ContactsBlock/ContactsBlockContent.js.map +1 -0
- package/lib/components/ContentPage/renderContentPageHead.d.ts +3 -0
- package/lib/components/ContentPage/renderContentPageHead.js +27 -0
- package/lib/components/ContentPage/renderContentPageHead.js.map +1 -0
- package/lib/components/Gallery/Gallery.mobile.js +2 -1
- package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
- package/lib/components/Gallery/GalleryCardInner.js +6 -11
- package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/lib/components/Gallery/GalleryContainer.js +2 -2
- package/lib/components/Gallery/GalleryContainer.js.map +1 -1
- package/lib/components/Gallery/GalleryContent.d.ts +3 -1
- package/lib/components/Gallery/GalleryInner.js +4 -3
- package/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/lib/components/Headline/Headline.js +3 -2
- package/lib/components/Headline/Headline.js.map +1 -1
- package/lib/components/Headline/Headline.mobile.js +3 -2
- package/lib/components/Headline/Headline.mobile.js.map +1 -1
- package/lib/components/Headline/constants.d.ts +0 -2
- package/lib/components/Headline/constants.js +1 -5
- package/lib/components/Headline/constants.js.map +1 -1
- package/lib/components/MiniGallery/MiniGallery.fixture.d.ts +2 -1
- package/lib/components/MobileAppTile/MobileAppTile.js +5 -3
- package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/lib/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
- package/lib/components/StepsBlock/StepsBlock.js +1 -1
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/Tile/Tile.js +1 -1
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/model/AlignText.d.ts +2 -0
- package/lib/model/AlignText.js +6 -0
- package/lib/model/AlignText.js.map +1 -0
- package/lib/model/HeadlineType.d.ts +2 -2
- package/lib/ui-kit/List/ListItem.js +4 -4
- package/lib/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +10 -8
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ContactsBlock/ContactsBlock.d.ts +5 -0
- package/mobile/bundle/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
- package/mobile/bundle/components/ContentPage/renderContentPageHead.d.ts +3 -0
- package/mobile/bundle/components/Gallery/GalleryContent.d.ts +3 -1
- package/mobile/bundle/components/Headline/constants.d.ts +0 -2
- package/mobile/bundle/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
- package/mobile/bundle/model/AlignText.d.ts +2 -0
- package/mobile/bundle/model/HeadlineType.d.ts +2 -2
- package/mobile/dist/components/ContactsBlock/ContactsBlock.d.ts +5 -0
- package/mobile/dist/components/ContactsBlock/ContactsBlock.js +19 -0
- package/mobile/dist/components/ContactsBlock/ContactsBlock.js.map +1 -0
- package/mobile/dist/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
- package/mobile/dist/components/ContactsBlock/ContactsBlockContent.js +2 -0
- package/mobile/dist/components/ContactsBlock/ContactsBlockContent.js.map +1 -0
- package/mobile/dist/components/ContentPage/renderContentPageHead.d.ts +3 -0
- package/mobile/dist/components/ContentPage/renderContentPageHead.js +30 -0
- package/mobile/dist/components/ContentPage/renderContentPageHead.js.map +1 -0
- package/mobile/dist/components/Gallery/Gallery.js +2 -1
- package/mobile/dist/components/Gallery/Gallery.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryCardInner.js +6 -11
- package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryContainer.js +2 -2
- package/mobile/dist/components/Gallery/GalleryContainer.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryContent.d.ts +3 -1
- package/mobile/dist/components/Gallery/GalleryInner.js +4 -3
- package/mobile/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/mobile/dist/components/Headline/Headline.js +2 -1
- package/mobile/dist/components/Headline/Headline.js.map +1 -1
- package/mobile/dist/components/Headline/constants.d.ts +0 -2
- package/mobile/dist/components/Headline/constants.js +2 -6
- package/mobile/dist/components/Headline/constants.js.map +1 -1
- package/mobile/dist/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
- package/mobile/dist/components/Tile/Tile.js +1 -1
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/model/AlignText.d.ts +2 -0
- package/mobile/dist/model/AlignText.js +8 -0
- package/mobile/dist/model/AlignText.js.map +1 -0
- package/mobile/dist/model/HeadlineType.d.ts +2 -2
- package/mobile/dist/ui-kit/List/ListItem.js +4 -4
- package/mobile/dist/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/lib/components/ContactsBlock/ContactsBlock.d.ts +5 -0
- package/mobile/lib/components/ContactsBlock/ContactsBlock.js +17 -0
- package/mobile/lib/components/ContactsBlock/ContactsBlock.js.map +1 -0
- package/mobile/lib/components/ContactsBlock/ContactsBlockContent.d.ts +36 -0
- package/mobile/lib/components/ContactsBlock/ContactsBlockContent.js +2 -0
- package/mobile/lib/components/ContactsBlock/ContactsBlockContent.js.map +1 -0
- package/mobile/lib/components/ContentPage/renderContentPageHead.d.ts +3 -0
- package/mobile/lib/components/ContentPage/renderContentPageHead.js +27 -0
- package/mobile/lib/components/ContentPage/renderContentPageHead.js.map +1 -0
- package/mobile/lib/components/Gallery/Gallery.js +2 -1
- package/mobile/lib/components/Gallery/Gallery.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryCardInner.js +6 -11
- package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryContainer.js +2 -2
- package/mobile/lib/components/Gallery/GalleryContainer.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryContent.d.ts +3 -1
- package/mobile/lib/components/Gallery/GalleryInner.js +4 -3
- package/mobile/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/mobile/lib/components/Headline/Headline.js +3 -2
- package/mobile/lib/components/Headline/Headline.js.map +1 -1
- package/mobile/lib/components/Headline/constants.d.ts +0 -2
- package/mobile/lib/components/Headline/constants.js +1 -5
- package/mobile/lib/components/Headline/constants.js.map +1 -1
- package/mobile/lib/components/MobileAppTile/MobileAppTileContent.d.ts +6 -0
- package/mobile/lib/components/Tile/Tile.js +1 -1
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/model/AlignText.d.ts +2 -0
- package/mobile/lib/model/AlignText.js +6 -0
- package/mobile/lib/model/AlignText.js.map +1 -0
- package/mobile/lib/model/HeadlineType.d.ts +2 -2
- package/mobile/lib/ui-kit/List/ListItem.js +4 -4
- package/mobile/lib/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/src/components/ContactsBlock/ContactsBlock.example.json +51 -0
- package/mobile/src/components/ContactsBlock/ContactsBlock.tsx +70 -0
- package/mobile/src/components/ContactsBlock/ContactsBlock.ui.json +8 -0
- package/mobile/src/components/ContactsBlock/ContactsBlockContent.ts +39 -0
- package/mobile/src/components/ContentPage/renderContentPageHead.tsx +34 -0
- package/mobile/src/components/Gallery/Gallery.example.json +2 -2
- package/mobile/src/components/Gallery/Gallery.tsx +9 -5
- package/mobile/src/components/Gallery/Gallery.ui.json +11 -1
- package/mobile/src/components/Gallery/GalleryCardInner.tsx +17 -26
- package/mobile/src/components/Gallery/GalleryContainer.tsx +1 -2
- package/mobile/src/components/Gallery/GalleryContent.ts +3 -1
- package/mobile/src/components/Gallery/GalleryInner.tsx +11 -4
- package/mobile/src/components/Headline/Headline.tsx +4 -3
- package/mobile/src/components/Headline/constants.ts +1 -7
- package/mobile/src/components/MobileAppTile/MobileAppTileContent.ts +6 -0
- package/mobile/src/components/Tile/Tile.tsx +1 -1
- package/mobile/src/model/AlignText.ts +7 -0
- package/mobile/src/model/HeadlineType.ts +2 -2
- package/mobile/src/ui-kit/List/ListItem.tsx +10 -7
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +2 -8
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContactsBlock/ContactsBlock.example.json +51 -0
- package/src/components/ContactsBlock/ContactsBlock.fixture.tsx +57 -0
- package/src/components/ContactsBlock/ContactsBlock.tsx +70 -0
- package/src/components/ContactsBlock/ContactsBlock.ui.json +8 -0
- package/src/components/ContactsBlock/ContactsBlockContent.ts +39 -0
- package/src/components/ContentPage/renderContentPageHead.tsx +34 -0
- package/src/components/Gallery/Gallery.example.json +2 -2
- package/src/components/Gallery/Gallery.fixture.mobile.tsx +3 -3
- package/src/components/Gallery/Gallery.fixture.tsx +20 -24
- package/src/components/Gallery/Gallery.mobile.tsx +9 -5
- package/src/components/Gallery/Gallery.ui.json +11 -1
- package/src/components/Gallery/GalleryCardInner.tsx +17 -26
- package/src/components/Gallery/GalleryContainer.tsx +1 -2
- package/src/components/Gallery/GalleryContent.ts +3 -1
- package/src/components/Gallery/GalleryInner.tsx +11 -4
- package/src/components/Headline/Headline.mobile.tsx +4 -3
- package/src/components/Headline/Headline.tsx +4 -3
- package/src/components/Headline/constants.ts +1 -7
- package/src/components/MiniGallery/MiniGallery.fixture.tsx +72 -44
- package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +1 -0
- package/src/components/MobileAppTile/MobileAppTile.tsx +8 -1
- package/src/components/MobileAppTile/MobileAppTileContent.ts +6 -0
- package/src/components/StepsBlock/StepsBlock.tsx +1 -1
- package/src/components/Tile/Tile.tsx +1 -1
- package/src/model/AlignText.ts +7 -0
- package/src/model/HeadlineType.ts +2 -2
- package/src/ui-kit/List/ListItem.tsx +10 -7
- package/bundle/components/ContentPage/ContentPageHead.d.ts +0 -7
- package/dist/components/ContentPage/ContentPageHead.d.ts +0 -7
- package/dist/components/ContentPage/ContentPageHead.js +0 -20
- package/dist/components/ContentPage/ContentPageHead.js.map +0 -1
- package/lib/components/ContentPage/ContentPageHead.d.ts +0 -7
- package/lib/components/ContentPage/ContentPageHead.js +0 -18
- package/lib/components/ContentPage/ContentPageHead.js.map +0 -1
- package/mobile/bundle/components/ContentPage/ContentPageHead.d.ts +0 -7
- package/mobile/dist/components/ContentPage/ContentPageHead.d.ts +0 -7
- package/mobile/dist/components/ContentPage/ContentPageHead.js +0 -20
- package/mobile/dist/components/ContentPage/ContentPageHead.js.map +0 -1
- package/mobile/lib/components/ContentPage/ContentPageHead.d.ts +0 -7
- package/mobile/lib/components/ContentPage/ContentPageHead.js +0 -18
- package/mobile/lib/components/ContentPage/ContentPageHead.js.map +0 -1
- package/mobile/src/components/ContentPage/ContentPageHead.tsx +0 -43
- package/src/components/ContentPage/ContentPageHead.tsx +0 -43
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import
|
|
2
|
+
import { AlignText } from '../../model/AlignText';
|
|
3
3
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
4
4
|
import type { Picture } from '../../model/Picture';
|
|
5
5
|
import { Button } from '../../ui-kit/Button/Button';
|
|
6
|
-
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
7
6
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
7
|
import { List } from '../../ui-kit/List/List';
|
|
9
8
|
import { HEADLINE_SMALL_VERSION } from '../Headline/constants';
|
|
10
9
|
import type { GalleryCardProps, GalleryItemProps } from './GalleryContent';
|
|
11
10
|
|
|
12
|
-
const ALIGN_TITLE: Record<AlignType, string> = {
|
|
13
|
-
left: 'text-left',
|
|
14
|
-
center: 'text-center',
|
|
15
|
-
right: 'text-right',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
11
|
export const GalleryCardInner = JSX<GalleryCardProps>(
|
|
19
12
|
({
|
|
20
13
|
title,
|
|
21
|
-
headlineSmallVersion = '
|
|
14
|
+
headlineSmallVersion = 'H6',
|
|
22
15
|
description,
|
|
23
16
|
additionalDescription,
|
|
24
|
-
|
|
17
|
+
icon,
|
|
25
18
|
items,
|
|
26
19
|
button,
|
|
27
20
|
version,
|
|
@@ -29,42 +22,40 @@ export const GalleryCardInner = JSX<GalleryCardProps>(
|
|
|
29
22
|
align = 'center',
|
|
30
23
|
}) => {
|
|
31
24
|
return (
|
|
32
|
-
<div className={`h-full flex flex-col justify-between ${
|
|
25
|
+
<div className={`h-full flex flex-col justify-between ${AlignText[align]}`}>
|
|
33
26
|
<div className="flex flex-col h-full">
|
|
34
|
-
{renderImage(
|
|
27
|
+
{renderImage(icon)}
|
|
35
28
|
{renderCardTitle(headlineSmallVersion, title)}
|
|
36
29
|
{renderDescription(description, title)}
|
|
37
|
-
{renderAdditionalDescription(additionalDescription)}
|
|
38
30
|
{items?.length ? renderItems(items, isDotted, version) : null}
|
|
31
|
+
{renderAdditionalDescription(additionalDescription)}
|
|
39
32
|
</div>
|
|
40
|
-
{button ?
|
|
33
|
+
{button?.text ? <Button className="mt-6" {...button} /> : null}
|
|
41
34
|
</div>
|
|
42
35
|
);
|
|
43
36
|
},
|
|
44
37
|
);
|
|
45
38
|
|
|
46
|
-
const renderImage = (image?: Picture) =>
|
|
47
|
-
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
const renderImage = (image?: Picture) => (
|
|
40
|
+
<div className="flex justify-center">
|
|
41
|
+
{image?.src ? <Img className="mb-5" image={image} /> : null}
|
|
42
|
+
{image?.icon ? (
|
|
43
|
+
<Img className={`w-[32px] h-[32px] min-w-[32px] mb-5 rounded-full`} image={image} asSVG />
|
|
44
|
+
) : null}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
52
47
|
|
|
53
48
|
const renderCardTitle = (headlineSmallVersion: string, title?: string) =>
|
|
54
49
|
title ? <div className={HEADLINE_SMALL_VERSION[headlineSmallVersion]}>{title}</div> : null;
|
|
55
50
|
|
|
56
51
|
const renderDescription = (description?: string, title?: string) =>
|
|
57
|
-
description ? <div className={`text-
|
|
52
|
+
description ? <div className={`text-l ${title ? 'mt-2' : ''}`}>{description}</div> : null;
|
|
58
53
|
|
|
59
54
|
const renderAdditionalDescription = (additionalDescription?: string) =>
|
|
60
55
|
additionalDescription ? (
|
|
61
56
|
<div className="text-m-light text-secondary-text mt-auto">{additionalDescription}</div>
|
|
62
57
|
) : null;
|
|
63
58
|
|
|
64
|
-
const renderButton = (button: ButtonWithIconProps) => (
|
|
65
|
-
<Button className="mt-6 w-full" {...button} />
|
|
66
|
-
);
|
|
67
|
-
|
|
68
59
|
const renderItems = (
|
|
69
60
|
items: GalleryItemProps[],
|
|
70
61
|
isDotted: boolean,
|
|
@@ -72,7 +63,7 @@ const renderItems = (
|
|
|
72
63
|
) => (
|
|
73
64
|
<List
|
|
74
65
|
className={`max-w-[308px] mt-2 text-s ${version === 'primary' ? '!text-secondary-text' : ''}`}
|
|
75
|
-
itemClassName="
|
|
66
|
+
itemClassName="text-left"
|
|
76
67
|
items={items.filter((item) => item?.text).map((item) => item.text as string)}
|
|
77
68
|
isDotted={isDotted}
|
|
78
69
|
version={version}
|
|
@@ -22,7 +22,7 @@ export const GalleryContainer = JSX<GalleryContainerProps>(
|
|
|
22
22
|
({
|
|
23
23
|
context,
|
|
24
24
|
title,
|
|
25
|
-
headlineVersion = '
|
|
25
|
+
headlineVersion = 'M',
|
|
26
26
|
description,
|
|
27
27
|
cards = [],
|
|
28
28
|
version = 'normal',
|
|
@@ -30,7 +30,6 @@ export const GalleryContainer = JSX<GalleryContainerProps>(
|
|
|
30
30
|
}) => {
|
|
31
31
|
return (
|
|
32
32
|
<div>
|
|
33
|
-
<div className="absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent" />
|
|
34
33
|
<Headline
|
|
35
34
|
context={context}
|
|
36
35
|
className="!p-0"
|
|
@@ -20,6 +20,7 @@ export interface GalleryItemProps {
|
|
|
20
20
|
* @default {"headlineSmallVersion": "XL_L"}
|
|
21
21
|
*/
|
|
22
22
|
export type GalleryCardProps = HeadlineSmallProps & {
|
|
23
|
+
/** @title Дополнительное описание */
|
|
23
24
|
additionalDescription?: string;
|
|
24
25
|
/**
|
|
25
26
|
* @default {
|
|
@@ -35,7 +36,7 @@ export type GalleryCardProps = HeadlineSmallProps & {
|
|
|
35
36
|
* }]
|
|
36
37
|
* }
|
|
37
38
|
*/
|
|
38
|
-
|
|
39
|
+
icon?: Picture;
|
|
39
40
|
/** @title Кнопка */
|
|
40
41
|
button?: ButtonWithIconProps;
|
|
41
42
|
/**
|
|
@@ -64,4 +65,5 @@ export type GalleryContent = HeadlineProps & {
|
|
|
64
65
|
cards?: GalleryCardProps[];
|
|
65
66
|
/** @title Отображать элементы в моб. версии (прокрутка shift+mouseScroll) */
|
|
66
67
|
orientation?: ListOrientation; //TODO: for mobile
|
|
68
|
+
button?: ButtonWithIconProps;
|
|
67
69
|
};
|
|
@@ -7,13 +7,14 @@ import { renderArrows } from '../../ui-kit/Button/renderArrows';
|
|
|
7
7
|
import { galleryLengthForScrollMap } from './constants';
|
|
8
8
|
import { GalleryContainer } from './GalleryContainer';
|
|
9
9
|
import type { GalleryContent } from './GalleryContent';
|
|
10
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
10
11
|
|
|
11
12
|
export interface GalleryInnerProps extends GalleryContent, UniBlockProps {
|
|
12
13
|
version?: GalleryVersion;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const GalleryInner = JSX<GalleryInnerProps>(
|
|
16
|
-
({ context, cards = [], className = '', version = 'normal', ...rest }) => {
|
|
17
|
+
({ context, cards = [], className = '', version = 'normal', button, ...rest }) => {
|
|
17
18
|
const [activeCardIndex, setActiveCardIndex] = useState(0);
|
|
18
19
|
|
|
19
20
|
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
@@ -30,7 +31,7 @@ export const GalleryInner = JSX<GalleryInnerProps>(
|
|
|
30
31
|
return (
|
|
31
32
|
<BlockWrapper
|
|
32
33
|
context={context}
|
|
33
|
-
className={`relative font-sans text-primary-text bg-white p-[42px] overflow-hidden ${className}`}
|
|
34
|
+
className={`relative font-sans text-primary-text bg-white p-[42px] overflow-hidden flex flex-col ${className}`}
|
|
34
35
|
{...rest}
|
|
35
36
|
>
|
|
36
37
|
<GalleryContainer
|
|
@@ -46,8 +47,14 @@ export const GalleryInner = JSX<GalleryInnerProps>(
|
|
|
46
47
|
btnClass: ['left-8', 'right-8'],
|
|
47
48
|
className: 'top-1/2',
|
|
48
49
|
})}
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
{isGalleryScrollAvailable ? (
|
|
51
|
+
<div>
|
|
52
|
+
<div className="absolute top-0 left-0 bottom-0 w-[82px] bg-opacity-from-white" />
|
|
53
|
+
<div className="absolute top-0 right-0 bottom-0 w-[82px] bg-opacity-to-white" />
|
|
54
|
+
</div>
|
|
55
|
+
) : null}
|
|
56
|
+
|
|
57
|
+
{button ? <Button className="mt-8 mx-auto" {...button} /> : null}
|
|
51
58
|
</BlockWrapper>
|
|
52
59
|
);
|
|
53
60
|
},
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { AlignText } from '../../model/AlignText';
|
|
2
3
|
|
|
3
4
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
5
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
6
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
-
import {
|
|
7
|
+
import { HEADLINE_BLOCK_STYLE_MAPS } from './constants';
|
|
7
8
|
import type { HeadlineContent } from './HeadlineContent';
|
|
8
9
|
|
|
9
10
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
@@ -24,12 +25,12 @@ export const Headline = JSX<HeadlineProps>(
|
|
|
24
25
|
{title ? (
|
|
25
26
|
<Heading
|
|
26
27
|
headingType="h2"
|
|
27
|
-
className={`${STYLE_MAPS.text} ${
|
|
28
|
+
className={`${STYLE_MAPS.text} ${AlignText[align]}`}
|
|
28
29
|
title={title}
|
|
29
30
|
/>
|
|
30
31
|
) : null}
|
|
31
32
|
{description ? (
|
|
32
|
-
<p className={`text-m ${STYLE_MAPS.description} ${
|
|
33
|
+
<p className={`text-m ${STYLE_MAPS.description} ${AlignText[align]}`}>{description}</p>
|
|
33
34
|
) : null}
|
|
34
35
|
{image?.src && (
|
|
35
36
|
<div className="mt-2.5 mx-auto flex justify-center">
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { AlignText } from '../../model/AlignText';
|
|
2
3
|
|
|
3
4
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
6
|
import { Description } from '../../ui-kit/Description/Description';
|
|
6
7
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
|
-
import {
|
|
8
|
+
import { HEADLINE_BLOCK_STYLE_MAPS, HEADLINE_VERSION } from './constants';
|
|
8
9
|
import type { HeadlineContent } from './HeadlineContent';
|
|
9
10
|
|
|
10
11
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
@@ -32,13 +33,13 @@ export const Headline = JSX<HeadlineProps>(
|
|
|
32
33
|
<Heading
|
|
33
34
|
headingType={SIZE_MAPS?.headingType}
|
|
34
35
|
as={as || SIZE_MAPS?.as}
|
|
35
|
-
className={`whitespace-pre-wrap ${STYLE_MAPS.text} ${
|
|
36
|
+
className={`whitespace-pre-wrap ${STYLE_MAPS.text} ${AlignText[align]}`}
|
|
36
37
|
title={title}
|
|
37
38
|
/>
|
|
38
39
|
) : null}
|
|
39
40
|
{description ? (
|
|
40
41
|
<Description
|
|
41
|
-
className={`${SIZE_MAPS.descriptionFont} ${STYLE_MAPS.text} ${
|
|
42
|
+
className={`${SIZE_MAPS.descriptionFont} ${STYLE_MAPS.text} ${AlignText[align]}`}
|
|
42
43
|
description={description}
|
|
43
44
|
/>
|
|
44
45
|
) : null}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import type { AlignType } from '../../model/AlignType';
|
|
2
1
|
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
3
2
|
import type { HeadlineSmallVersion, HeadlineVersion } from '../../model/HeadlineType';
|
|
4
3
|
import type { HeadingTagType, HeadingType } from '../../ui-kit/Heading/HeadingProps';
|
|
5
4
|
|
|
6
|
-
export const ALIGN_TEXT: Record<AlignType, string> = {
|
|
7
|
-
left: 'text-left',
|
|
8
|
-
center: 'text-center',
|
|
9
|
-
right: 'text-right',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
5
|
type StyleType = {
|
|
13
6
|
background: string;
|
|
14
7
|
text: string;
|
|
@@ -74,6 +67,7 @@ export const HEADLINE_VERSION: Record<HeadlineVersion, VersionStyleType> = {
|
|
|
74
67
|
};
|
|
75
68
|
|
|
76
69
|
export const HEADLINE_SMALL_VERSION: Record<HeadlineSmallVersion, string> = {
|
|
70
|
+
H6: 'text-h6',
|
|
77
71
|
XL_L: 'text-xl-light',
|
|
78
72
|
XL_R: 'text-xl',
|
|
79
73
|
L_L: 'text-l-light',
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
2
|
import { context } from '../../react/setup-fixture';
|
|
3
|
-
import { MiniGallery
|
|
3
|
+
import { MiniGallery } from './MiniGallery';
|
|
4
|
+
import type { MiniGalleryProps } from './MiniGallery';
|
|
5
|
+
import type { GalleryCardProps } from '../Gallery/GalleryContent';
|
|
6
|
+
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
4
7
|
|
|
5
8
|
const image: Picture = {
|
|
6
9
|
src: 'domovoj-kupon.png',
|
|
@@ -21,28 +24,28 @@ export const defaultProps: MiniGalleryProps = {
|
|
|
21
24
|
title: 'Более 5000 товаров',
|
|
22
25
|
description:
|
|
23
26
|
'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
|
|
24
|
-
image,
|
|
27
|
+
icon: image,
|
|
25
28
|
},
|
|
26
29
|
{
|
|
27
30
|
title: 'Более 1000 развлечений',
|
|
28
31
|
description: 'Порядок и условия предоставления в соответствии с 106 ФЗ',
|
|
29
|
-
image,
|
|
32
|
+
icon: image,
|
|
30
33
|
},
|
|
31
34
|
{
|
|
32
35
|
title: 'Фермерские продукты',
|
|
33
36
|
description: 'Высокий процент даже при небольшой сумме денежных средств',
|
|
34
|
-
image,
|
|
37
|
+
icon: image,
|
|
35
38
|
},
|
|
36
39
|
{
|
|
37
40
|
title: '«Моя выгода»',
|
|
38
41
|
description:
|
|
39
42
|
'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
|
|
40
|
-
image,
|
|
43
|
+
icon: image,
|
|
41
44
|
},
|
|
42
45
|
{
|
|
43
46
|
title: 'Более 8888 развлечений',
|
|
44
47
|
description: 'Порядок и условия предоставления в соответствии с 106 ФЗ',
|
|
45
|
-
image,
|
|
48
|
+
icon: image,
|
|
46
49
|
},
|
|
47
50
|
],
|
|
48
51
|
};
|
|
@@ -54,61 +57,81 @@ const onlyTitleProps: MiniGalleryProps = {
|
|
|
54
57
|
cards: [
|
|
55
58
|
{
|
|
56
59
|
title: 'Более 5000 товаров',
|
|
57
|
-
image,
|
|
60
|
+
icon: image,
|
|
58
61
|
},
|
|
59
62
|
{
|
|
60
63
|
title: 'Более 1000 развлечений',
|
|
61
|
-
image,
|
|
64
|
+
icon: image,
|
|
62
65
|
},
|
|
63
66
|
{
|
|
64
67
|
title: 'Фермерские продукты',
|
|
65
|
-
image,
|
|
68
|
+
icon: image,
|
|
66
69
|
},
|
|
67
70
|
{
|
|
68
71
|
title: '«Моя выгода»',
|
|
69
|
-
image,
|
|
72
|
+
icon: image,
|
|
70
73
|
},
|
|
71
74
|
],
|
|
72
75
|
};
|
|
73
76
|
|
|
77
|
+
const additionalDescriptionCards: GalleryCardProps[] = [
|
|
78
|
+
{
|
|
79
|
+
title: 'Более 5000 товаров',
|
|
80
|
+
description: 'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
|
|
81
|
+
additionalDescription: '01 января 2022',
|
|
82
|
+
icon: image,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: 'Более 1000 развлечений',
|
|
86
|
+
description: 'Порядок и условия предоставления в соответствии с 106 ФЗ',
|
|
87
|
+
additionalDescription: '02 февраля 2022',
|
|
88
|
+
icon: image,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
title: 'Фермерские продукты',
|
|
92
|
+
description: 'Высокий процент даже при небольшой сумме денежных средств',
|
|
93
|
+
additionalDescription: '03 марта 2022',
|
|
94
|
+
icon: image,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
title: '«Моя выгода»',
|
|
98
|
+
description: 'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
|
|
99
|
+
additionalDescription: '04 апреля 2022',
|
|
100
|
+
icon: image,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: 'Более 8888 развлечений',
|
|
104
|
+
description: 'Порядок и условия предоставления в соответствии с 106 ФЗ',
|
|
105
|
+
additionalDescription: '05 мая 2022',
|
|
106
|
+
icon: image,
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
|
|
74
110
|
const additionalDescriptionProps: MiniGalleryProps = {
|
|
75
111
|
title: 'Вы можете оплатить бонусными баллами',
|
|
76
112
|
description: 'Удобный каталог с большим ассортиментом товаров и сервисов',
|
|
77
113
|
context,
|
|
78
|
-
cards:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
title: '«Моя выгода»',
|
|
100
|
-
description:
|
|
101
|
-
'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
|
|
102
|
-
additionalDescription: '04 апреля 2022',
|
|
103
|
-
image,
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
title: 'Более 8888 развлечений',
|
|
107
|
-
description: 'Порядок и условия предоставления в соответствии с 106 ФЗ',
|
|
108
|
-
additionalDescription: '05 мая 2022',
|
|
109
|
-
image,
|
|
110
|
-
},
|
|
111
|
-
],
|
|
114
|
+
cards: additionalDescriptionCards,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const button: ButtonWithIconProps = {
|
|
118
|
+
href: '/credit-cards',
|
|
119
|
+
text: 'Подробнее',
|
|
120
|
+
target: '_blank',
|
|
121
|
+
version: 'secondary',
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const list = [{ text: 'Item 1' }, { text: 'Item 2' }, { text: 'Item 3' }];
|
|
125
|
+
|
|
126
|
+
const combinedProps: MiniGalleryProps = {
|
|
127
|
+
title: 'Вы можете оплатить бонусными баллами',
|
|
128
|
+
description: 'Удобный каталог с большим ассортиментом товаров и сервисов',
|
|
129
|
+
context,
|
|
130
|
+
cards: additionalDescriptionCards.map((card, i) => ({
|
|
131
|
+
...card,
|
|
132
|
+
button: button,
|
|
133
|
+
items: i % 2 ? list : undefined,
|
|
134
|
+
})),
|
|
112
135
|
};
|
|
113
136
|
|
|
114
137
|
export default {
|
|
@@ -127,4 +150,9 @@ export default {
|
|
|
127
150
|
<MiniGallery className="col-span-12" {...additionalDescriptionProps} />
|
|
128
151
|
</div>
|
|
129
152
|
),
|
|
153
|
+
'button, list, additional description': (
|
|
154
|
+
<div className="container grid grid-cols-12">
|
|
155
|
+
<MiniGallery className="col-span-12" {...combinedProps} />
|
|
156
|
+
</div>
|
|
157
|
+
),
|
|
130
158
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { AlignText } from '../../model/AlignText';
|
|
2
3
|
import { VersionStyleMap } from '../../model/BlockVersion';
|
|
3
4
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
@@ -24,6 +25,8 @@ export const MobileAppTile = JSX<MobileAppTileProps>(
|
|
|
24
25
|
items,
|
|
25
26
|
image,
|
|
26
27
|
headingType = 'h4',
|
|
28
|
+
alignTitle = 'left',
|
|
29
|
+
description,
|
|
27
30
|
...rest
|
|
28
31
|
}) => {
|
|
29
32
|
const textColorClass = version === 'primary' ? 'text-primary-text' : '';
|
|
@@ -49,7 +52,7 @@ export const MobileAppTile = JSX<MobileAppTileProps>(
|
|
|
49
52
|
as="h3"
|
|
50
53
|
title={title}
|
|
51
54
|
className={`whitespace-pre-wrap max-w-[509px] mb-6
|
|
52
|
-
${textColorClass}`}
|
|
55
|
+
${textColorClass} ${AlignText[alignTitle]}`}
|
|
53
56
|
/>
|
|
54
57
|
) : null
|
|
55
58
|
}
|
|
@@ -59,6 +62,7 @@ export const MobileAppTile = JSX<MobileAppTileProps>(
|
|
|
59
62
|
) : null
|
|
60
63
|
}
|
|
61
64
|
>
|
|
65
|
+
{renderDescription(description)}
|
|
62
66
|
<div className="flex flex-1 items-center">
|
|
63
67
|
{qr?.src ? (
|
|
64
68
|
<div className={`flex justify-center mr-5 bg-white rounded-md ${containerStyle}`}>
|
|
@@ -87,3 +91,6 @@ const renderList = (version: ListItemVersion, items?: string[]) => {
|
|
|
87
91
|
</span>
|
|
88
92
|
);
|
|
89
93
|
};
|
|
94
|
+
|
|
95
|
+
const renderDescription = (description?: string) =>
|
|
96
|
+
description ? <p className="text-xl-light mb-5">{description}</p> : null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AlignType } from '../../model/AlignType';
|
|
1
2
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
3
|
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { Picture } from '../../model/Picture';
|
|
@@ -12,6 +13,11 @@ export type MobileAppTileContent = HeadlineCommonProps &
|
|
|
12
13
|
HeadingCommonProps &
|
|
13
14
|
ButtonContent &
|
|
14
15
|
ListContent & {
|
|
16
|
+
/**
|
|
17
|
+
* @title Выравнивание заголовка
|
|
18
|
+
* @default left
|
|
19
|
+
*/
|
|
20
|
+
alignTitle?: AlignType;
|
|
15
21
|
// TODO: description для мобильной версии
|
|
16
22
|
/** @title QR-код */
|
|
17
23
|
qr?: Picture;
|
|
@@ -59,7 +59,7 @@ export const Tile = JSX<TileProps>((props) => {
|
|
|
59
59
|
buttons?.length ? (
|
|
60
60
|
<ButtonSection
|
|
61
61
|
context={context}
|
|
62
|
-
buttons={buttons.map((button) => ({ ...button, className: 'w-[158px]' }))}
|
|
62
|
+
buttons={buttons.map((button) => ({ ...button, className: 'min-w-[158px]' }))}
|
|
63
63
|
className="flex mt-8 gap-3"
|
|
64
64
|
/>
|
|
65
65
|
) : null
|
|
@@ -6,9 +6,9 @@ export type HeadlineVersion = 'XXL' | 'XL' | 'L' | 'M' | 'S';
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @title Размер заголовка
|
|
9
|
-
* @enumNames ["Самый большой тонкий", "Самый большой", "Очень большой тонкий", "Очень большой", "Большой", "Средний", "Маленький"]
|
|
9
|
+
* @enumNames ["Заголовок", "Самый большой тонкий", "Самый большой", "Очень большой тонкий", "Очень большой", "Большой", "Средний", "Маленький"]
|
|
10
10
|
*/
|
|
11
|
-
export type HeadlineSmallVersion = 'XL_L' | 'XL_R' | 'L_L' | 'L_R' | 'M' | 'S' | 'XS';
|
|
11
|
+
export type HeadlineSmallVersion = 'H6' | 'XL_L' | 'XL_R' | 'L_L' | 'L_R' | 'M' | 'S' | 'XS';
|
|
12
12
|
|
|
13
13
|
export type TitleProps = {
|
|
14
14
|
/** @title Заголовок */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { ListItemSize, ListItemVersion } from './ListProps';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* @title Параметры элемента списка
|
|
5
6
|
*/
|
|
@@ -18,19 +19,21 @@ const LIST_DOT_STYLE_MAP: Record<ListItemVersion, string> = {
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const DOT_SIZE_MAP = {
|
|
21
|
-
L: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-4
|
|
22
|
-
M: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-3
|
|
23
|
-
S: 'w-1 h-1 min-w-1 min-h-1 mr-2
|
|
22
|
+
L: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-4',
|
|
23
|
+
M: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-3',
|
|
24
|
+
S: 'w-1 h-1 min-w-1 min-h-1 mr-2',
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export const ListItem = JSX<ListItemProps>(
|
|
27
28
|
({ className = '', isDotted = true, children, version = 'primary', size = 'M' }) => {
|
|
28
29
|
return (
|
|
29
|
-
<div className={`font-sans flex items-
|
|
30
|
+
<div className={`font-sans flex items-baseline ${className}`} role="listitem">
|
|
30
31
|
{isDotted ? (
|
|
31
|
-
<div
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
<div>
|
|
33
|
+
<div
|
|
34
|
+
className={`rounded-full align-middle inline-block ${LIST_DOT_STYLE_MAP[version]} ${DOT_SIZE_MAP[size]}`}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
34
37
|
) : null}
|
|
35
38
|
<span>{children}</span>
|
|
36
39
|
</div>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ContentPageMeta } from '../../model/ContentPageDef';
|
|
2
|
-
import { VNode as _VNode } from '../../model/VNode';
|
|
3
|
-
export interface ContentPageHeadProps {
|
|
4
|
-
HeadComponent: <Props, Context, VNode = _VNode>(props: Props, context?: Context) => VNode;
|
|
5
|
-
data: ContentPageMeta;
|
|
6
|
-
}
|
|
7
|
-
export declare const ContentPageHead: import("@redneckz/uni-jsx").UNIComponent<ContentPageHeadProps, any, any>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ContentPageMeta } from '../../model/ContentPageDef';
|
|
2
|
-
import { VNode as _VNode } from '../../model/VNode';
|
|
3
|
-
export interface ContentPageHeadProps {
|
|
4
|
-
HeadComponent: <Props, Context, VNode = _VNode>(props: Props, context?: Context) => VNode;
|
|
5
|
-
data: ContentPageMeta;
|
|
6
|
-
}
|
|
7
|
-
export declare const ContentPageHead: import("@redneckz/uni-jsx").UNIComponent<ContentPageHeadProps, any, any>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.ContentPageHead = void 0;
|
|
3
|
-
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
-
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
exports.ContentPageHead = (0, uni_jsx_1.JSX)(({ HeadComponent, data, children }) => {
|
|
6
|
-
const { title, main, og, twitter, jsonLd } = data;
|
|
7
|
-
const { description, keywords, canonical, robots } = main || {};
|
|
8
|
-
return ((0, jsx_runtime_1.jsxs)(HeadComponent, { children: [(0, jsx_runtime_1.jsx)("title", { children: title }), (0, jsx_runtime_1.jsx)("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description ? (0, jsx_runtime_1.jsx)("meta", { name: "description", content: description }) : null, keywords ? (0, jsx_runtime_1.jsx)("meta", { name: "keywords", content: keywords.join(',') }) : null, robots ? (0, jsx_runtime_1.jsx)("meta", { name: "robots", content: robots.join(',') }) : null, renderOpenGraph(og), renderTwitter(twitter), canonical ? (0, jsx_runtime_1.jsx)("link", { rel: "canonical", href: canonical }) : null, jsonLd ? (0, jsx_runtime_1.jsx)("script", { type: "application/ld+json", children: jsonLd }) : null, children] }));
|
|
9
|
-
});
|
|
10
|
-
function renderOpenGraph(og) {
|
|
11
|
-
return og
|
|
12
|
-
? Object.entries(og).map(([key, value]) => ((0, jsx_runtime_1.jsx)("meta", { property: `og:${key}`, content: value }, key)))
|
|
13
|
-
: null;
|
|
14
|
-
}
|
|
15
|
-
function renderTwitter(twitter) {
|
|
16
|
-
return twitter
|
|
17
|
-
? Object.entries(twitter).map(([key, value]) => ((0, jsx_runtime_1.jsx)("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
18
|
-
: null;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=ContentPageHead.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAQ3B,QAAA,eAAe,GAAG,IAAA,aAAG,EAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;IAEhE,OAAO,CACL,wBAAC,aAAa,eACZ,4CAAQ,KAAK,GAAS,EACtB,iCAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,qCAAqC,GAAG,EACrE,WAAW,CAAC,CAAC,CAAC,iCAAM,IAAI,EAAC,aAAa,EAAC,OAAO,EAAE,WAAW,GAAI,CAAC,CAAC,CAAC,IAAI,EACtE,QAAQ,CAAC,CAAC,CAAC,iCAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI,EACvE,MAAM,CAAC,CAAC,CAAC,iCAAM,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI,EACjE,eAAe,CAAC,EAAE,CAAC,EACnB,aAAa,CAAC,OAAO,CAAC,EACtB,SAAS,CAAC,CAAC,CAAC,iCAAM,GAAG,EAAC,WAAW,EAAC,IAAI,EAAE,SAAS,GAAI,CAAC,CAAC,CAAC,IAAI,EAC5D,MAAM,CAAC,CAAC,CAAC,mCAAQ,IAAI,EAAC,qBAAqB,YAAE,MAAM,GAAU,CAAC,CAAC,CAAC,IAAI,EACpE,QAAQ,IACK,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,EAAsC;IAC7D,OAAO,EAAE;QACP,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CACvC,iCAAgB,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAA1C,GAAG,CAA2C,CAC1D,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CAAC,OAA2C;IAChE,OAAO,OAAO;QACZ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC5C,iCAAgB,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAA3C,GAAG,CAA4C,CAC3D,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ContentPageMeta } from '../../model/ContentPageDef';
|
|
2
|
-
import { VNode as _VNode } from '../../model/VNode';
|
|
3
|
-
export interface ContentPageHeadProps {
|
|
4
|
-
HeadComponent: <Props, Context, VNode = _VNode>(props: Props, context?: Context) => VNode;
|
|
5
|
-
data: ContentPageMeta;
|
|
6
|
-
}
|
|
7
|
-
export declare const ContentPageHead: import("@redneckz/uni-jsx").UNIComponent<ContentPageHeadProps, any, any>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
export const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
4
|
-
const { title, main, og, twitter, jsonLd } = data;
|
|
5
|
-
const { description, keywords, canonical, robots } = main || {};
|
|
6
|
-
return (_jsxs(HeadComponent, { children: [_jsx("title", { children: title }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description ? _jsx("meta", { name: "description", content: description }) : null, keywords ? _jsx("meta", { name: "keywords", content: keywords.join(',') }) : null, robots ? _jsx("meta", { name: "robots", content: robots.join(',') }) : null, renderOpenGraph(og), renderTwitter(twitter), canonical ? _jsx("link", { rel: "canonical", href: canonical }) : null, jsonLd ? _jsx("script", { type: "application/ld+json", children: jsonLd }) : null, children] }));
|
|
7
|
-
});
|
|
8
|
-
function renderOpenGraph(og) {
|
|
9
|
-
return og
|
|
10
|
-
? Object.entries(og).map(([key, value]) => (_jsx("meta", { property: `og:${key}`, content: value }, key)))
|
|
11
|
-
: null;
|
|
12
|
-
}
|
|
13
|
-
function renderTwitter(twitter) {
|
|
14
|
-
return twitter
|
|
15
|
-
? Object.entries(twitter).map(([key, value]) => (_jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
16
|
-
: null;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ContentPageHead.js.map
|