@redneckz/wildless-cms-uni-blocks 0.8.6 → 0.8.8
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +11 -8
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/bundle/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/bundle/model/DefaultListItemType.d.ts +4 -0
- package/bundle/model/RichTextItem.d.ts +8 -0
- package/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/dist/components/ProductTile/ProductTile.js +1 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/dist/components/TextBlock/TextBlock.js +3 -2
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/dist/hooks/useLink.js +7 -3
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/model/DefaultListItemType.d.ts +4 -0
- package/dist/model/DefaultListItemType.js +2 -0
- package/dist/model/DefaultListItemType.js.map +1 -0
- package/dist/model/RichTextItem.d.ts +8 -0
- package/dist/model/RichTextItem.js +2 -0
- package/dist/model/RichTextItem.js.map +1 -0
- package/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/lib/components/ProductTile/ProductTile.js +1 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/lib/components/TextBlock/TextBlock.js +3 -2
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/lib/hooks/useLink.js +8 -4
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/model/DefaultListItemType.d.ts +4 -0
- package/lib/model/DefaultListItemType.js +2 -0
- package/lib/model/DefaultListItemType.js.map +1 -0
- package/lib/model/RichTextItem.d.ts +8 -0
- package/lib/model/RichTextItem.js +2 -0
- package/lib/model/RichTextItem.js.map +1 -0
- package/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/mobile/bundle/bundle.umd.js +8 -4
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/mobile/bundle/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/mobile/bundle/model/DefaultListItemType.d.ts +4 -0
- package/mobile/bundle/model/RichTextItem.d.ts +8 -0
- package/mobile/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/mobile/dist/components/ProductTile/ProductTile.js +1 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/mobile/dist/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/mobile/dist/hooks/useLink.js +7 -3
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/model/DefaultListItemType.d.ts +4 -0
- package/mobile/dist/model/DefaultListItemType.js +2 -0
- package/mobile/dist/model/DefaultListItemType.js.map +1 -0
- package/mobile/dist/model/RichTextItem.d.ts +8 -0
- package/mobile/dist/model/RichTextItem.js +2 -0
- package/mobile/dist/model/RichTextItem.js.map +1 -0
- package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/mobile/lib/components/ProductTile/ProductTile.js +1 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/mobile/lib/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/mobile/lib/hooks/useLink.js +8 -4
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/model/DefaultListItemType.d.ts +4 -0
- package/mobile/lib/model/DefaultListItemType.js +2 -0
- package/mobile/lib/model/DefaultListItemType.js.map +1 -0
- package/mobile/lib/model/RichTextItem.d.ts +8 -0
- package/mobile/lib/model/RichTextItem.js +2 -0
- package/mobile/lib/model/RichTextItem.js.map +1 -0
- package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/mobile/src/components/ProductTile/ProductTile.tsx +1 -2
- package/mobile/src/components/ProductTile/ProductTileContent.ts +4 -15
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -13
- package/mobile/src/components/TextBlock/TextBlock.ui.json +7 -1
- package/mobile/src/components/TextBlock/TextBlockContent.ts +12 -10
- package/mobile/src/hooks/useLink.ts +10 -5
- package/mobile/src/model/DefaultListItemType.ts +4 -0
- package/mobile/src/model/RichTextItem.ts +9 -0
- package/mobile/src/ui-kit/BenefitItem/BenefitItemProps.ts +4 -14
- package/package.json +1 -1
- package/src/components/ProductTile/ProductTile.tsx +1 -2
- package/src/components/ProductTile/ProductTileContent.ts +4 -15
- package/src/components/StepsBlock/StepsBlockContent.ts +13 -13
- package/src/components/TextBlock/TextBlock.tsx +3 -0
- package/src/components/TextBlock/TextBlock.ui.json +7 -1
- package/src/components/TextBlock/TextBlockContent.ts +12 -10
- package/src/hooks/useLink.ts +10 -5
- package/src/model/DefaultListItemType.ts +4 -0
- package/src/model/RichTextItem.ts +9 -0
- package/src/ui-kit/BenefitItem/BenefitItemProps.ts +4 -14
- package/dist/model/BlurVersion.d.ts +0 -0
- package/dist/model/BlurVersion.js +0 -1
- package/dist/model/BlurVersion.js.map +0 -1
- package/lib/model/BlurVersion.d.ts +0 -0
- package/lib/model/BlurVersion.js +0 -1
- package/lib/model/BlurVersion.js.map +0 -1
- package/mobile/dist/model/BlurVersion.d.ts +0 -0
- package/mobile/dist/model/BlurVersion.js +0 -1
- package/mobile/dist/model/BlurVersion.js.map +0 -1
- package/mobile/lib/model/BlurVersion.d.ts +0 -0
- package/mobile/lib/model/BlurVersion.js +0 -1
- package/mobile/lib/model/BlurVersion.js.map +0 -1
- package/mobile/src/model/BlurVersion.ts +0 -0
- package/src/model/BlurVersion.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextItem.js","sourceRoot":"","sources":["../../src/model/RichTextItem.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { IconVersion } from '../../model/IconVersion';
|
|
4
5
|
import type { IconProps } from '../../model/Picture';
|
|
5
|
-
import {
|
|
6
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
6
7
|
export interface BenefitItemCommonProps {
|
|
7
8
|
/** @hidden */
|
|
8
9
|
benefitsVersion?: IconVersion;
|
|
@@ -15,24 +16,14 @@ export declare type BenefitItemProps = DescriptionProps & LabelProps & IconProps
|
|
|
15
16
|
/**
|
|
16
17
|
* @title Стандартный бенефит
|
|
17
18
|
*/
|
|
18
|
-
declare type DefaultBenefit = BenefitItemProps &
|
|
19
|
-
/** @default default */
|
|
20
|
-
type: 'default';
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* @title Форматированный текст
|
|
24
|
-
*/
|
|
25
|
-
declare type RichText = RichTextProps & {
|
|
26
|
-
/** @default rte */
|
|
27
|
-
type: 'rte';
|
|
28
|
-
};
|
|
19
|
+
declare type DefaultBenefit = BenefitItemProps & DefaultListItemType;
|
|
29
20
|
/**
|
|
30
21
|
* @title Преимущество
|
|
31
22
|
* @default{
|
|
32
23
|
* "type": "default"
|
|
33
24
|
* }
|
|
34
25
|
*/
|
|
35
|
-
export declare type ComplexBenefitProps = DefaultBenefit |
|
|
26
|
+
export declare type ComplexBenefitProps = DefaultBenefit | RichTextItem;
|
|
36
27
|
/**
|
|
37
28
|
* @title Преимущество
|
|
38
29
|
*/
|
|
@@ -15,7 +15,6 @@ function renderBenefits(benefits, image) {
|
|
|
15
15
|
}
|
|
16
16
|
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
17
17
|
const benefitsWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
18
|
-
return (_jsx("div", { className: `z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
19
|
-
${benefitsWidth}`, children: benefits.length ? benefits.map(renderBenefit) : null }));
|
|
18
|
+
return (_jsx("div", { className: `z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline ${benefitsWidth}`, children: benefits.length ? benefits.map(renderBenefit) : null }));
|
|
20
19
|
}
|
|
21
20
|
//# sourceMappingURL=ProductTile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../../../src/components/ProductTile/ProductTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAA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Q,CAAC,CAAC,CAAC,EAAE,CAAC,EACnF,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,EAAE,EAAC,IAAI,EACP,KAAK,EAAC,WAAW,GACjB,EACD,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,EAC/B,2BAA2B,CAAC,qBAAqB,EAAE,KAAK,CAAC,EACzD,oBAAoB,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,IAC7D,EACL,WAAW,CAAC,KAAK,EAAE,kBAAkB,CAAC,IAC1B,CAChB,CACF,CAAC;AAEF,SAAS,cAAc,CAAC,QAAmB,EAAE,KAAe;IAC1D,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;QACpB,OAAO,IAAI,CAAC;KACb;IAED,wGAAwG;IACxG,MAAM,aAAa,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,MAAM,CAAC;IAEvE,OAAO,CACL,cACE,SAAS,EAAE,yFAAyF,aAAa,EAAE,YAElH,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,GACjD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, HeadlineProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { Picture } from '../../model/Picture';
|
|
5
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
4
6
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
|
-
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
6
7
|
/**
|
|
7
8
|
* @title Стандартный
|
|
8
9
|
*/
|
|
9
|
-
declare type TextBenefit = DescriptionProps & LabelProps &
|
|
10
|
-
/** @default default */
|
|
11
|
-
type: 'default';
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* @title Форматированный текст
|
|
15
|
-
*/
|
|
16
|
-
declare type RichText = RichTextProps & {
|
|
17
|
-
/** @default rte */
|
|
18
|
-
type: 'rte';
|
|
19
|
-
};
|
|
10
|
+
declare type TextBenefit = DescriptionProps & LabelProps & DefaultListItemType;
|
|
20
11
|
/**
|
|
21
12
|
* @title Преимущество
|
|
22
13
|
* @default{
|
|
23
14
|
* "type": "default"
|
|
24
15
|
* }
|
|
25
16
|
*/
|
|
26
|
-
export declare type Benefit = TextBenefit |
|
|
17
|
+
export declare type Benefit = TextBenefit | RichTextItem;
|
|
27
18
|
/**
|
|
28
19
|
* @title Продуктовая плитка
|
|
29
20
|
*/
|
|
@@ -3,10 +3,7 @@ import type { DescriptionProps, HeadlineCommonProps, LabelProps } from '../../mo
|
|
|
3
3
|
import type { IconProps } from '../../model/Picture';
|
|
4
4
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
5
5
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
|
-
|
|
7
|
-
* @title Шаг
|
|
8
|
-
*/
|
|
9
|
-
export declare type Step = DescriptionProps & LabelProps & IconProps & {
|
|
6
|
+
declare type StepCommonProps = IconProps & {
|
|
10
7
|
/** @title Кнопка */
|
|
11
8
|
button?: ButtonWithIconProps;
|
|
12
9
|
/**
|
|
@@ -17,6 +14,10 @@ export declare type Step = DescriptionProps & LabelProps & IconProps & {
|
|
|
17
14
|
/** @title Список */
|
|
18
15
|
items?: string[];
|
|
19
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* @title Шаг
|
|
19
|
+
*/
|
|
20
|
+
export declare type Step = DescriptionProps & LabelProps & StepCommonProps;
|
|
20
21
|
/**
|
|
21
22
|
* @title Блок шаги
|
|
22
23
|
*/
|
|
@@ -41,3 +42,4 @@ export declare type StepsBlockContent = HeadlineCommonProps & {
|
|
|
41
42
|
size?: SizeVersion;
|
|
42
43
|
version?: BlockVersion;
|
|
43
44
|
};
|
|
45
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Picture } from '../../model/Picture';
|
|
2
1
|
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
3
|
+
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
3
4
|
/**
|
|
4
5
|
* @title Цвет блока
|
|
5
6
|
* @enumNames ["Основная", "Второстепенная", "Второстепенная прозрачная"]
|
|
@@ -13,7 +14,7 @@ export declare type TextBlockIconVersion = 'none' | 'small' | 'big';
|
|
|
13
14
|
/**
|
|
14
15
|
* @title Текстовый блок
|
|
15
16
|
*/
|
|
16
|
-
export declare type TextBlockContent = HeadlineCommonProps & {
|
|
17
|
+
export declare type TextBlockContent = HeadlineCommonProps & RichTextProps & {
|
|
17
18
|
iconVersion?: TextBlockIconVersion;
|
|
18
19
|
image?: Picture;
|
|
19
20
|
blockVersion?: TextBlockVersion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { projectSettings } from '../ProjectSettings.js';
|
|
2
2
|
import { useBlockRouter } from '../services/BlockRouter/useBlockRouter.js';
|
|
3
|
-
import { isHash, isLocalURL,
|
|
3
|
+
import { isHash, isLocalURL, joinPath } from '../utils/url.js';
|
|
4
4
|
import { handlerDecorator } from './handlerDecorator.js';
|
|
5
5
|
import { useRouter } from './useRouter.js';
|
|
6
6
|
export function useLink(isRemote) {
|
|
@@ -8,12 +8,16 @@ export function useLink(isRemote) {
|
|
|
8
8
|
const blockRouter = useBlockRouter();
|
|
9
9
|
return (props) => ({
|
|
10
10
|
...props,
|
|
11
|
-
href:
|
|
12
|
-
? joinPath(projectSettings.BASE_PATH, props.href)
|
|
13
|
-
: props.href,
|
|
11
|
+
href: adjustHref(props.href),
|
|
14
12
|
'aria-label': props.text,
|
|
15
13
|
onClick: handlerDecorator(handleHref(props), props),
|
|
16
14
|
});
|
|
15
|
+
function adjustHref(href) {
|
|
16
|
+
const isRelativeToBase = !isRemote && href?.startsWith('/');
|
|
17
|
+
return projectSettings.BASE_PATH && href && isRelativeToBase
|
|
18
|
+
? joinPath(projectSettings.BASE_PATH, href)
|
|
19
|
+
: href;
|
|
20
|
+
}
|
|
17
21
|
function handleHref({ href, target, onClick }) {
|
|
18
22
|
return (ev) => {
|
|
19
23
|
onClick && onClick(ev);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,MAAM,UAAU,OAAO,CAAC,QAAkB;IACxC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,OAAO,CAA2C,KAAQ,EAAiB,EAAE,CAAC,CAAC;QAC7E,GAAG,KAAK;QACR,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5B,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;KACpD,CAAC,CAAC;IAEH,SAAS,UAAU,CAAC,IAAwB;QAC1C,MAAM,gBAAgB,GAAG,CAAC,QAAQ,IAAI,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;QAE5D,OAAO,eAAe,CAAC,SAAS,IAAI,IAAI,IAAI,gBAAgB;YAC1D,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC;YAC3C,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAED,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAkC;QAC3E,OAAO,CAAC,EAAqB,EAAE,EAAE;YAC/B,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;YAEvB,IAAI,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBACzC,kBAAkB;gBAClB,OAAO;aACR;YAED,iBAAiB;YACjB,EAAE,EAAE,cAAc,EAAE,CAAC;YACrB,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE;gBAChB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACxB;iBAAM,IAAI,IAAI,EAAE;gBACf,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACnB;QACH,CAAC,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultListItemType.js","sourceRoot":"","sources":["../../src/model/DefaultListItemType.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextItem.js","sourceRoot":"","sources":["../../src/model/RichTextItem.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { IconVersion } from '../../model/IconVersion';
|
|
4
5
|
import type { IconProps } from '../../model/Picture';
|
|
5
|
-
import {
|
|
6
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
6
7
|
export interface BenefitItemCommonProps {
|
|
7
8
|
/** @hidden */
|
|
8
9
|
benefitsVersion?: IconVersion;
|
|
@@ -15,24 +16,14 @@ export declare type BenefitItemProps = DescriptionProps & LabelProps & IconProps
|
|
|
15
16
|
/**
|
|
16
17
|
* @title Стандартный бенефит
|
|
17
18
|
*/
|
|
18
|
-
declare type DefaultBenefit = BenefitItemProps &
|
|
19
|
-
/** @default default */
|
|
20
|
-
type: 'default';
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* @title Форматированный текст
|
|
24
|
-
*/
|
|
25
|
-
declare type RichText = RichTextProps & {
|
|
26
|
-
/** @default rte */
|
|
27
|
-
type: 'rte';
|
|
28
|
-
};
|
|
19
|
+
declare type DefaultBenefit = BenefitItemProps & DefaultListItemType;
|
|
29
20
|
/**
|
|
30
21
|
* @title Преимущество
|
|
31
22
|
* @default{
|
|
32
23
|
* "type": "default"
|
|
33
24
|
* }
|
|
34
25
|
*/
|
|
35
|
-
export declare type ComplexBenefitProps = DefaultBenefit |
|
|
26
|
+
export declare type ComplexBenefitProps = DefaultBenefit | RichTextItem;
|
|
36
27
|
/**
|
|
37
28
|
* @title Преимущество
|
|
38
29
|
*/
|
|
@@ -62,8 +62,7 @@ function renderBenefits(benefits: Benefit[], image?: Picture) {
|
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
64
|
<div
|
|
65
|
-
className={`z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
66
|
-
${benefitsWidth}`}
|
|
65
|
+
className={`z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline ${benefitsWidth}`}
|
|
67
66
|
>
|
|
68
67
|
{benefits.length ? benefits.map(renderBenefit) : null}
|
|
69
68
|
</div>
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, HeadlineProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { Picture } from '../../model/Picture';
|
|
5
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
4
6
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
|
-
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @title Стандартный
|
|
9
10
|
*/
|
|
10
|
-
type TextBenefit = DescriptionProps &
|
|
11
|
-
LabelProps & {
|
|
12
|
-
/** @default default */
|
|
13
|
-
type: 'default';
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @title Форматированный текст
|
|
18
|
-
*/
|
|
19
|
-
type RichText = RichTextProps & {
|
|
20
|
-
/** @default rte */
|
|
21
|
-
type: 'rte';
|
|
22
|
-
};
|
|
11
|
+
type TextBenefit = DescriptionProps & LabelProps & DefaultListItemType;
|
|
23
12
|
|
|
24
13
|
/**
|
|
25
14
|
* @title Преимущество
|
|
@@ -27,7 +16,7 @@ type RichText = RichTextProps & {
|
|
|
27
16
|
* "type": "default"
|
|
28
17
|
* }
|
|
29
18
|
*/
|
|
30
|
-
export type Benefit = TextBenefit |
|
|
19
|
+
export type Benefit = TextBenefit | RichTextItem;
|
|
31
20
|
|
|
32
21
|
/**
|
|
33
22
|
* @title Продуктовая плитка
|
|
@@ -4,22 +4,22 @@ import type { IconProps } from '../../model/Picture';
|
|
|
4
4
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
5
5
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
6
|
|
|
7
|
+
type StepCommonProps = IconProps & {
|
|
8
|
+
/** @title Кнопка */
|
|
9
|
+
button?: ButtonWithIconProps;
|
|
10
|
+
/**
|
|
11
|
+
* @title Буллиты
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
isDotted?: boolean;
|
|
15
|
+
/** @title Список */
|
|
16
|
+
items?: string[];
|
|
17
|
+
};
|
|
18
|
+
|
|
7
19
|
/**
|
|
8
20
|
* @title Шаг
|
|
9
21
|
*/
|
|
10
|
-
export type Step = DescriptionProps &
|
|
11
|
-
LabelProps &
|
|
12
|
-
IconProps & {
|
|
13
|
-
/** @title Кнопка */
|
|
14
|
-
button?: ButtonWithIconProps;
|
|
15
|
-
/**
|
|
16
|
-
* @title Буллиты
|
|
17
|
-
* @default true
|
|
18
|
-
*/
|
|
19
|
-
isDotted?: boolean;
|
|
20
|
-
/** @title Список */
|
|
21
|
-
items?: string[];
|
|
22
|
-
};
|
|
22
|
+
export type Step = DescriptionProps & LabelProps & StepCommonProps;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @title Блок шаги
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Picture } from '../../model/Picture';
|
|
2
1
|
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
3
|
+
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @title Цвет блока
|
|
@@ -16,12 +17,13 @@ export type TextBlockIconVersion = 'none' | 'small' | 'big';
|
|
|
16
17
|
/**
|
|
17
18
|
* @title Текстовый блок
|
|
18
19
|
*/
|
|
19
|
-
export type TextBlockContent = HeadlineCommonProps &
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
export type TextBlockContent = HeadlineCommonProps &
|
|
21
|
+
RichTextProps & {
|
|
22
|
+
iconVersion?: TextBlockIconVersion;
|
|
23
|
+
image?: Picture;
|
|
24
|
+
blockVersion?: TextBlockVersion;
|
|
25
|
+
/** @title Буллиты */ // TODO: mobile prop
|
|
26
|
+
isDotted?: boolean;
|
|
27
|
+
/** @title Список (моб.) */ // TODO: mobile prop
|
|
28
|
+
items?: string[];
|
|
29
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LinkProps } from '../model/LinkProps';
|
|
2
2
|
import { projectSettings } from '../ProjectSettings';
|
|
3
3
|
import { useBlockRouter } from '../services/BlockRouter/useBlockRouter';
|
|
4
|
-
import { isHash, isLocalURL,
|
|
4
|
+
import { isHash, isLocalURL, joinPath } from '../utils/url';
|
|
5
5
|
import { handlerDecorator } from './handlerDecorator';
|
|
6
6
|
import { useRouter } from './useRouter';
|
|
7
7
|
|
|
@@ -19,14 +19,19 @@ export function useLink(isRemote?: boolean) {
|
|
|
19
19
|
|
|
20
20
|
return <L extends Partial<LinkProps & Clickable>>(props: L): L & Clickable => ({
|
|
21
21
|
...props,
|
|
22
|
-
href:
|
|
23
|
-
projectSettings.BASE_PATH && props.href && !(isRemote || isURL(props.href))
|
|
24
|
-
? joinPath(projectSettings.BASE_PATH, props.href)
|
|
25
|
-
: props.href,
|
|
22
|
+
href: adjustHref(props.href),
|
|
26
23
|
'aria-label': props.text,
|
|
27
24
|
onClick: handlerDecorator(handleHref(props), props),
|
|
28
25
|
});
|
|
29
26
|
|
|
27
|
+
function adjustHref(href: string | undefined) {
|
|
28
|
+
const isRelativeToBase = !isRemote && href?.startsWith('/');
|
|
29
|
+
|
|
30
|
+
return projectSettings.BASE_PATH && href && isRelativeToBase
|
|
31
|
+
? joinPath(projectSettings.BASE_PATH, href)
|
|
32
|
+
: href;
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
function handleHref({ href, target, onClick }: Partial<LinkProps & Clickable>) {
|
|
31
36
|
return (ev?: PreventableEvent) => {
|
|
32
37
|
onClick && onClick(ev);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { IconVersion } from '../../model/IconVersion';
|
|
4
5
|
import type { IconProps } from '../../model/Picture';
|
|
5
|
-
import {
|
|
6
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
6
7
|
|
|
7
8
|
export interface BenefitItemCommonProps {
|
|
8
9
|
/** @hidden */
|
|
@@ -18,18 +19,7 @@ export type BenefitItemProps = DescriptionProps & LabelProps & IconProps;
|
|
|
18
19
|
/**
|
|
19
20
|
* @title Стандартный бенефит
|
|
20
21
|
*/
|
|
21
|
-
type DefaultBenefit = BenefitItemProps &
|
|
22
|
-
/** @default default */
|
|
23
|
-
type: 'default';
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @title Форматированный текст
|
|
28
|
-
*/
|
|
29
|
-
type RichText = RichTextProps & {
|
|
30
|
-
/** @default rte */
|
|
31
|
-
type: 'rte';
|
|
32
|
-
};
|
|
22
|
+
type DefaultBenefit = BenefitItemProps & DefaultListItemType;
|
|
33
23
|
|
|
34
24
|
/**
|
|
35
25
|
* @title Преимущество
|
|
@@ -37,7 +27,7 @@ type RichText = RichTextProps & {
|
|
|
37
27
|
* "type": "default"
|
|
38
28
|
* }
|
|
39
29
|
*/
|
|
40
|
-
export type ComplexBenefitProps = DefaultBenefit |
|
|
30
|
+
export type ComplexBenefitProps = DefaultBenefit | RichTextItem;
|
|
41
31
|
|
|
42
32
|
/**
|
|
43
33
|
* @title Преимущество
|
package/package.json
CHANGED
|
@@ -62,8 +62,7 @@ function renderBenefits(benefits: Benefit[], image?: Picture) {
|
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
64
|
<div
|
|
65
|
-
className={`z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
66
|
-
${benefitsWidth}`}
|
|
65
|
+
className={`z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline ${benefitsWidth}`}
|
|
67
66
|
>
|
|
68
67
|
{benefits.length ? benefits.map(renderBenefit) : null}
|
|
69
68
|
</div>
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, HeadlineProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { Picture } from '../../model/Picture';
|
|
5
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
4
6
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
|
-
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @title Стандартный
|
|
9
10
|
*/
|
|
10
|
-
type TextBenefit = DescriptionProps &
|
|
11
|
-
LabelProps & {
|
|
12
|
-
/** @default default */
|
|
13
|
-
type: 'default';
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @title Форматированный текст
|
|
18
|
-
*/
|
|
19
|
-
type RichText = RichTextProps & {
|
|
20
|
-
/** @default rte */
|
|
21
|
-
type: 'rte';
|
|
22
|
-
};
|
|
11
|
+
type TextBenefit = DescriptionProps & LabelProps & DefaultListItemType;
|
|
23
12
|
|
|
24
13
|
/**
|
|
25
14
|
* @title Преимущество
|
|
@@ -27,7 +16,7 @@ type RichText = RichTextProps & {
|
|
|
27
16
|
* "type": "default"
|
|
28
17
|
* }
|
|
29
18
|
*/
|
|
30
|
-
export type Benefit = TextBenefit |
|
|
19
|
+
export type Benefit = TextBenefit | RichTextItem;
|
|
31
20
|
|
|
32
21
|
/**
|
|
33
22
|
* @title Продуктовая плитка
|
|
@@ -4,22 +4,22 @@ import type { IconProps } from '../../model/Picture';
|
|
|
4
4
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
5
5
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
6
|
|
|
7
|
+
type StepCommonProps = IconProps & {
|
|
8
|
+
/** @title Кнопка */
|
|
9
|
+
button?: ButtonWithIconProps;
|
|
10
|
+
/**
|
|
11
|
+
* @title Буллиты
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
isDotted?: boolean;
|
|
15
|
+
/** @title Список */
|
|
16
|
+
items?: string[];
|
|
17
|
+
};
|
|
18
|
+
|
|
7
19
|
/**
|
|
8
20
|
* @title Шаг
|
|
9
21
|
*/
|
|
10
|
-
export type Step = DescriptionProps &
|
|
11
|
-
LabelProps &
|
|
12
|
-
IconProps & {
|
|
13
|
-
/** @title Кнопка */
|
|
14
|
-
button?: ButtonWithIconProps;
|
|
15
|
-
/**
|
|
16
|
-
* @title Буллиты
|
|
17
|
-
* @default true
|
|
18
|
-
*/
|
|
19
|
-
isDotted?: boolean;
|
|
20
|
-
/** @title Список */
|
|
21
|
-
items?: string[];
|
|
22
|
-
};
|
|
22
|
+
export type Step = DescriptionProps & LabelProps & StepCommonProps;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @title Блок шаги
|
|
@@ -4,6 +4,7 @@ import type { Picture } from '../../model/Picture';
|
|
|
4
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
6
|
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
7
|
+
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
7
8
|
import { Text } from '../../ui-kit/Text/Text';
|
|
8
9
|
import type { TextBlockContent, TextBlockVersion } from './TextBlockContent';
|
|
9
10
|
|
|
@@ -23,6 +24,7 @@ export const TextBlock = JSX<TextBlockProps>(
|
|
|
23
24
|
blockVersion = 'primary',
|
|
24
25
|
iconVersion,
|
|
25
26
|
image,
|
|
27
|
+
__html,
|
|
26
28
|
...rest
|
|
27
29
|
}) => {
|
|
28
30
|
const isSecondaryBlock = blockVersion === 'secondary';
|
|
@@ -41,6 +43,7 @@ export const TextBlock = JSX<TextBlockProps>(
|
|
|
41
43
|
{description ? (
|
|
42
44
|
<div className="mt-1">{renderDescription(description, isSecondaryBlock)}</div>
|
|
43
45
|
) : null}
|
|
46
|
+
{__html ? <RichText __html={__html} /> : null}
|
|
44
47
|
</div>
|
|
45
48
|
</BlockWrapper>
|
|
46
49
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Picture } from '../../model/Picture';
|
|
2
1
|
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
3
|
+
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @title Цвет блока
|
|
@@ -16,12 +17,13 @@ export type TextBlockIconVersion = 'none' | 'small' | 'big';
|
|
|
16
17
|
/**
|
|
17
18
|
* @title Текстовый блок
|
|
18
19
|
*/
|
|
19
|
-
export type TextBlockContent = HeadlineCommonProps &
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
export type TextBlockContent = HeadlineCommonProps &
|
|
21
|
+
RichTextProps & {
|
|
22
|
+
iconVersion?: TextBlockIconVersion;
|
|
23
|
+
image?: Picture;
|
|
24
|
+
blockVersion?: TextBlockVersion;
|
|
25
|
+
/** @title Буллиты */ // TODO: mobile prop
|
|
26
|
+
isDotted?: boolean;
|
|
27
|
+
/** @title Список (моб.) */ // TODO: mobile prop
|
|
28
|
+
items?: string[];
|
|
29
|
+
};
|