@redneckz/wildless-cms-uni-blocks 0.2.57 → 0.2.60
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/dist/BaseTile.d.ts +4 -3
- package/dist/BaseTile.js +24 -11
- package/dist/BaseTile.js.map +1 -1
- package/dist/Blocks.d.ts +3 -1
- package/dist/Blocks.js +2 -0
- package/dist/Blocks.js.map +1 -1
- package/dist/Icons/AppleIcon.d.ts +1 -0
- package/dist/Icons/AppleIcon.js +6 -0
- package/dist/Icons/AppleIcon.js.map +1 -0
- package/dist/Icons/PlayMarket.d.ts +1 -0
- package/dist/Icons/PlayMarket.js +6 -0
- package/dist/Icons/PlayMarket.js.map +1 -0
- package/dist/Icons/index.d.ts +2 -0
- package/dist/Icons/index.js +5 -1
- package/dist/Icons/index.js.map +1 -1
- package/dist/MobileAppTile.d.ts +2 -1
- package/dist/MobileAppTile.js +2 -2
- package/dist/MobileAppTile.js.map +1 -1
- package/dist/ProductBlock.js +1 -1
- package/dist/ProductBlock.js.map +1 -1
- package/dist/ProductBlockInner.js +1 -1
- package/dist/ProductBlockInner.js.map +1 -1
- package/dist/ProductGallery.js +1 -1
- package/dist/ProductGallery.js.map +1 -1
- package/dist/ProductTile.js +3 -3
- package/dist/ProductTile.js.map +1 -1
- package/dist/PromoTile.d.ts +8 -0
- package/dist/PromoTile.js +18 -0
- package/dist/PromoTile.js.map +1 -0
- package/dist/Tile.js +14 -1
- package/dist/Tile.js.map +1 -1
- package/dist/api/DaDataAPI.js +2 -2
- package/dist/api/DaDataAPI.js.map +1 -1
- package/dist/content-page-repository/ContentPageRepository.js +1 -1
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/content-page-repository/index.d.ts +0 -1
- package/dist/content-page-repository/index.js +1 -3
- package/dist/content-page-repository/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/{content-page-repository/toMobilePage.d.ts → toMobilePage.d.ts} +1 -1
- package/dist/{content-page-repository/toMobilePage.js → toMobilePage.js} +0 -0
- package/dist/toMobilePage.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/ui-kit/Button.d.ts +1 -3
- package/dist/ui-kit/Button.js +3 -3
- package/dist/ui-kit/Button.js.map +1 -1
- package/dist/ui-kit/IconButton.d.ts +6 -0
- package/dist/ui-kit/IconButton.js +11 -0
- package/dist/ui-kit/IconButton.js.map +1 -0
- package/dist/utils/getColSpan.d.ts +1 -0
- package/dist/utils/getColSpan.js +9 -0
- package/dist/utils/getColSpan.js.map +1 -0
- package/dist/utils/getGeolocation.d.ts +1 -0
- package/dist/utils/getGeolocation.js +5 -0
- package/dist/utils/getGeolocation.js.map +1 -0
- package/lib/BaseTile.d.ts +4 -3
- package/lib/BaseTile.js +24 -11
- package/lib/BaseTile.js.map +1 -1
- package/lib/Blocks.d.ts +3 -1
- package/lib/Blocks.js +2 -0
- package/lib/Blocks.js.map +1 -1
- package/lib/Icons/AppleIcon.d.ts +1 -0
- package/lib/Icons/AppleIcon.js +3 -0
- package/lib/Icons/AppleIcon.js.map +1 -0
- package/lib/Icons/PlayMarket.d.ts +1 -0
- package/lib/Icons/PlayMarket.js +3 -0
- package/lib/Icons/PlayMarket.js.map +1 -0
- package/lib/Icons/index.d.ts +2 -0
- package/lib/Icons/index.js +2 -0
- package/lib/Icons/index.js.map +1 -1
- package/lib/MobileAppTile.d.ts +2 -1
- package/lib/MobileAppTile.js +2 -2
- package/lib/MobileAppTile.js.map +1 -1
- package/lib/ProductBlock.js +1 -1
- package/lib/ProductBlock.js.map +1 -1
- package/lib/ProductBlockInner.js +1 -1
- package/lib/ProductBlockInner.js.map +1 -1
- package/lib/ProductGallery.js +1 -1
- package/lib/ProductGallery.js.map +1 -1
- package/lib/ProductTile.js +3 -3
- package/lib/ProductTile.js.map +1 -1
- package/lib/PromoTile.d.ts +8 -0
- package/lib/PromoTile.js +16 -0
- package/lib/PromoTile.js.map +1 -0
- package/lib/Tile.js +14 -1
- package/lib/Tile.js.map +1 -1
- package/lib/api/DaDataAPI.js +2 -2
- package/lib/api/DaDataAPI.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/content-page-repository/ContentPageRepository.js +1 -1
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/content-page-repository/index.d.ts +0 -1
- package/lib/content-page-repository/index.js +0 -1
- package/lib/content-page-repository/index.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/{content-page-repository/toMobilePage.d.ts → toMobilePage.d.ts} +1 -1
- package/lib/{content-page-repository/toMobilePage.js → toMobilePage.js} +0 -0
- package/lib/toMobilePage.js.map +1 -0
- package/lib/types.d.ts +2 -0
- package/lib/ui-kit/Button.d.ts +1 -3
- package/lib/ui-kit/Button.js +3 -3
- package/lib/ui-kit/Button.js.map +1 -1
- package/lib/ui-kit/IconButton.d.ts +6 -0
- package/lib/ui-kit/IconButton.js +9 -0
- package/lib/ui-kit/IconButton.js.map +1 -0
- package/lib/utils/getColSpan.d.ts +1 -0
- package/lib/utils/getColSpan.js +6 -0
- package/lib/utils/getColSpan.js.map +1 -0
- package/lib/utils/getGeolocation.d.ts +1 -0
- package/lib/utils/getGeolocation.js +2 -0
- package/lib/utils/getGeolocation.js.map +1 -0
- package/package.json +1 -1
- package/src/BaseTile.tsx +34 -18
- package/src/Blocks.ts +3 -0
- package/src/ContentPage.fixture.tsx +1 -1
- package/src/ContentPage.page.json +35 -22
- package/src/Icons/AppleIcon.tsx +15 -0
- package/src/Icons/PlayMarket.tsx +8 -0
- package/src/Icons/index.ts +2 -0
- package/src/MobileAppTile.tsx +4 -3
- package/src/ProductBlock.tsx +3 -1
- package/src/ProductBlockInner.tsx +3 -3
- package/src/ProductGallery.tsx +7 -3
- package/src/ProductTile.tsx +3 -3
- package/src/PromoTile.tsx +47 -0
- package/src/Tile.tsx +18 -1
- package/src/api/DaDataAPI.ts +2 -2
- package/src/content-page-repository/ContentPageRepository.ts +1 -1
- package/src/content-page-repository/index.ts +0 -1
- package/src/index.ts +4 -1
- package/src/{content-page-repository/toMobilePage.ts → toMobilePage.ts} +1 -1
- package/src/types.ts +2 -0
- package/src/ui-kit/Button.fixture.tsx +22 -0
- package/src/ui-kit/Button.tsx +12 -5
- package/src/ui-kit/IconButton.tsx +27 -0
- package/src/utils/getColSpan.ts +5 -0
- package/src/utils/{getCurrentPosition.ts → getGeolocation.ts} +1 -1
- package/dist/content-page-repository/toMobilePage.js.map +0 -1
- package/dist/utils/getCurrentPosition.d.ts +0 -1
- package/dist/utils/getCurrentPosition.js +0 -5
- package/dist/utils/getCurrentPosition.js.map +0 -1
- package/lib/content-page-repository/toMobilePage.js.map +0 -1
- package/lib/utils/getCurrentPosition.d.ts +0 -1
- package/lib/utils/getCurrentPosition.js +0 -2
- package/lib/utils/getCurrentPosition.js.map +0 -1
package/src/api/DaDataAPI.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getGeolocation } from '../utils/getGeolocation';
|
|
2
2
|
|
|
3
3
|
import type { DaDataResult } from '../types';
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ export function DaDataAPI(baseURL = '') {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
try {
|
|
12
|
-
const coords = await
|
|
12
|
+
const coords = await getGeolocation();
|
|
13
13
|
const response = await fetch(`${baseURL}/geolocate`, {
|
|
14
14
|
method: 'POST',
|
|
15
15
|
mode: 'cors',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
import util from 'util';
|
|
3
|
+
import { toMobilePage } from '../toMobilePage';
|
|
3
4
|
import type { ContentPageDef } from '../types';
|
|
4
|
-
import { toMobilePage } from './toMobilePage';
|
|
5
5
|
import type { TransformationOptions } from './TransformationOptions';
|
|
6
6
|
import { transformContentPage } from './transformContentPage';
|
|
7
7
|
|
package/src/index.ts
CHANGED
|
@@ -16,13 +16,16 @@ export type {
|
|
|
16
16
|
export type {
|
|
17
17
|
ContentPageContext,
|
|
18
18
|
Router,
|
|
19
|
+
AsyncDataHook,
|
|
20
|
+
GeolocationHook,
|
|
19
21
|
LikeService,
|
|
20
|
-
Search,
|
|
21
22
|
HandlerDecorator,
|
|
23
|
+
Search,
|
|
22
24
|
} from './ContentPageContext';
|
|
23
25
|
|
|
24
26
|
export { ContentPageHead } from './ContentPageHead';
|
|
25
27
|
export { ContentPage } from './ContentPage';
|
|
28
|
+
export { toMobilePage } from './toMobilePage';
|
|
26
29
|
|
|
27
30
|
export { Blocks } from './Blocks';
|
|
28
31
|
export type { BlockContent } from './Blocks';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BlockDef, ContentPageDef } from '
|
|
1
|
+
import type { BlockDef, ContentPageDef } from './types';
|
|
2
2
|
|
|
3
3
|
export function toMobilePage(contentPage: ContentPageDef): ContentPageDef {
|
|
4
4
|
const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
package/src/types.ts
CHANGED
|
@@ -15,6 +15,8 @@ import type { ContentPageContext } from './ContentPageContext';
|
|
|
15
15
|
export type ColorPalette = 'pc' | 'bc' | 'eo';
|
|
16
16
|
|
|
17
17
|
export type BlockVersion = 'primary' | 'secondary';
|
|
18
|
+
export type ButtonVersion = 'primary' | 'secondary';
|
|
19
|
+
export type TitleSize = 'S' | 'M' | 'L' | 'XL';
|
|
18
20
|
|
|
19
21
|
export interface BlockDef {
|
|
20
22
|
type: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '../setup-fixture';
|
|
2
2
|
|
|
3
3
|
import { Button } from './Button';
|
|
4
|
+
import { IconButton } from './IconButton';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
all: (
|
|
@@ -60,6 +61,27 @@ export default {
|
|
|
60
61
|
/>
|
|
61
62
|
</div>
|
|
62
63
|
</div>
|
|
64
|
+
<div>
|
|
65
|
+
<p>With Icon</p>
|
|
66
|
+
<div className="flex gap-6" data-theme="pc">
|
|
67
|
+
<IconButton
|
|
68
|
+
href="https://www.rshb.ru/"
|
|
69
|
+
target="_blank"
|
|
70
|
+
aboveText="Доступно в"
|
|
71
|
+
text="Google Play"
|
|
72
|
+
version="secondary"
|
|
73
|
+
icon="PlayMarket"
|
|
74
|
+
/>
|
|
75
|
+
<IconButton
|
|
76
|
+
href="https://www.rshb.ru/"
|
|
77
|
+
target="_blank"
|
|
78
|
+
aboveText="Загрузите в"
|
|
79
|
+
text="App Store"
|
|
80
|
+
version="secondary"
|
|
81
|
+
icon="AppleIcon"
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
63
85
|
</div>
|
|
64
86
|
),
|
|
65
87
|
'primary (Private clients)': (
|
package/src/ui-kit/Button.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { LinkContent } from '../types';
|
|
2
|
+
import type { ButtonVersion, LinkContent } from '../types';
|
|
3
3
|
|
|
4
|
-
type ButtonVersion = 'primary' | 'secondary';
|
|
5
4
|
export interface ButtonProps extends LinkContent {
|
|
6
5
|
className?: string;
|
|
7
6
|
onClick?: (ev: MouseEvent) => any;
|
|
@@ -21,7 +20,7 @@ const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
|
|
|
21
20
|
secondary: 'bg-secondary-light text-secondary-text',
|
|
22
21
|
};
|
|
23
22
|
|
|
24
|
-
const styleButton = 'inline-block rounded-md px-
|
|
23
|
+
const styleButton = 'inline-block rounded-md px-8 py-2 text-center font-sans';
|
|
25
24
|
|
|
26
25
|
export const Button = JSX<ButtonProps>(
|
|
27
26
|
({
|
|
@@ -46,7 +45,11 @@ export const Button = JSX<ButtonProps>(
|
|
|
46
45
|
className || ''
|
|
47
46
|
}`}
|
|
48
47
|
>
|
|
49
|
-
|
|
48
|
+
{children ? (
|
|
49
|
+
<div>{children}</div>
|
|
50
|
+
) : (
|
|
51
|
+
<div className="text-sm font-medium py-1.5">{text}</div>
|
|
52
|
+
)}
|
|
50
53
|
</div>
|
|
51
54
|
);
|
|
52
55
|
}
|
|
@@ -59,7 +62,11 @@ export const Button = JSX<ButtonProps>(
|
|
|
59
62
|
onClick={onClick}
|
|
60
63
|
aria-label={ariaLabel}
|
|
61
64
|
>
|
|
62
|
-
|
|
65
|
+
{children ? (
|
|
66
|
+
<div>{children}</div>
|
|
67
|
+
) : (
|
|
68
|
+
<div className="text-sm font-medium py-1.5">{text}</div>
|
|
69
|
+
)}
|
|
63
70
|
</a>
|
|
64
71
|
);
|
|
65
72
|
},
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { AppleIcon, PlayMarket } from '../Icons/index';
|
|
3
|
+
import type { ButtonProps } from './Button';
|
|
4
|
+
import { Button } from './Button';
|
|
5
|
+
|
|
6
|
+
const ICONS = { AppleIcon, PlayMarket };
|
|
7
|
+
|
|
8
|
+
export interface IconButtonProps extends ButtonProps {
|
|
9
|
+
icon?: string;
|
|
10
|
+
aboveText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const IconButton = JSX<IconButtonProps>((props) => {
|
|
14
|
+
return (
|
|
15
|
+
<Button {...props}>
|
|
16
|
+
{props.icon ? (
|
|
17
|
+
<div className="flex items-center">
|
|
18
|
+
<div className="mr-2">{ICONS[props.icon as keyof typeof ICONS]?.()}</div>
|
|
19
|
+
<div>
|
|
20
|
+
<div className="text-xxs text-left">{props.aboveText}</div>
|
|
21
|
+
<div className="text-sm font-medium text-left">{props.text}</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
) : null}
|
|
25
|
+
</Button>
|
|
26
|
+
);
|
|
27
|
+
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toMobilePage.js","sourceRoot":"","sources":["../../src/content-page-repository/toMobilePage.ts"],"names":[],"mappings":";;AAEA,SAAgB,YAAY,CAAC,WAA2B;IACtD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9F,OAAO;QACL,GAAG,WAAW;QACd,MAAM;KACP,CAAC;AACJ,CAAC;AAND,oCAMC;AAED,SAAS,aAAa,CAAC,KAAe;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,MAAM,EAAE;QACV,OAAO;YACL,GAAG,KAAK;YACR,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;SACzD,CAAC;KACH;SAAM;QACL,OAAO,KAAK,CAAC;KACd;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getCurrentPosition: () => Promise<GeolocationCoordinates>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.getCurrentPosition = void 0;
|
|
3
|
-
const getCurrentPosition = async () => new Promise((resolve) => navigator.geolocation.getCurrentPosition(({ coords }) => resolve(coords)));
|
|
4
|
-
exports.getCurrentPosition = getCurrentPosition;
|
|
5
|
-
//# sourceMappingURL=getCurrentPosition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCurrentPosition.js","sourceRoot":"","sources":["../../src/utils/getCurrentPosition.ts"],"names":[],"mappings":";;AAAO,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE,CAC3C,IAAI,OAAO,CAAyB,CAAC,OAAO,EAAE,EAAE,CAC9C,SAAS,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAC1E,CAAC;AAHS,QAAA,kBAAkB,sBAG3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toMobilePage.js","sourceRoot":"","sources":["../../src/content-page-repository/toMobilePage.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,WAA2B;IACtD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9F,OAAO;QACL,GAAG,WAAW;QACd,MAAM;KACP,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAe;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,MAAM,EAAE;QACV,OAAO;YACL,GAAG,KAAK;YACR,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;SACzD,CAAC;KACH;SAAM;QACL,OAAO,KAAK,CAAC;KACd;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getCurrentPosition: () => Promise<GeolocationCoordinates>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCurrentPosition.js","sourceRoot":"","sources":["../../src/utils/getCurrentPosition.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE,CAC3C,IAAI,OAAO,CAAyB,CAAC,OAAO,EAAE,EAAE,CAC9C,SAAS,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAC1E,CAAC"}
|