@doyourjob/gravity-ui-page-constructor 5.31.103 → 5.31.105
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/build/cjs/blocks/Quotes/QuotesItem/QuotesItem.css +18 -6
- package/build/cjs/blocks/SliderNew/Slider.d.ts +3 -14
- package/build/cjs/blocks/SliderNew/Slider.js +13 -53
- package/build/cjs/blocks/SliderNew/SliderClient.d.ts +14 -0
- package/build/cjs/blocks/SliderNew/SliderClient.js +57 -0
- package/build/cjs/blocks/SliderNew/useSlider.d.ts +4 -5
- package/build/cjs/blocks/SliderNew/useSlider.js +6 -5
- package/build/cjs/blocks/SliderNew/useSliderPagination.d.ts +1 -1
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/context/ssrContext/SSRContext.d.ts +9 -0
- package/build/esm/blocks/Quotes/QuotesItem/QuotesItem.css +18 -6
- package/build/esm/blocks/SliderNew/Slider.d.ts +3 -15
- package/build/esm/blocks/SliderNew/Slider.js +13 -54
- package/build/esm/blocks/SliderNew/SliderClient.d.ts +15 -0
- package/build/esm/blocks/SliderNew/SliderClient.js +53 -0
- package/build/esm/blocks/SliderNew/useSlider.d.ts +4 -5
- package/build/esm/blocks/SliderNew/useSlider.js +6 -5
- package/build/esm/blocks/SliderNew/useSliderPagination.d.ts +1 -1
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/context/ssrContext/SSRContext.d.ts +9 -0
- package/package.json +3 -2
- package/widget/index.js +1 -1
|
@@ -22,6 +22,11 @@ unpredictable css rules order in build */
|
|
|
22
22
|
display: flex;
|
|
23
23
|
gap: 16px;
|
|
24
24
|
}
|
|
25
|
+
@media (max-width: 769px) {
|
|
26
|
+
.pc-quotes-item__header {
|
|
27
|
+
padding-top: 20px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
25
30
|
.pc-quotes-item__author {
|
|
26
31
|
display: flex;
|
|
27
32
|
flex: 1;
|
|
@@ -79,7 +84,14 @@ unpredictable css rules order in build */
|
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
.pc-quotes-item__logo {
|
|
87
|
+
display: block;
|
|
82
88
|
max-width: 100%;
|
|
89
|
+
max-height: 80px;
|
|
90
|
+
}
|
|
91
|
+
@media (max-width: 769px) {
|
|
92
|
+
.pc-quotes-item__logo {
|
|
93
|
+
max-height: 40px;
|
|
94
|
+
}
|
|
83
95
|
}
|
|
84
96
|
.pc-quotes-item__body {
|
|
85
97
|
max-width: 960px;
|
|
@@ -92,8 +104,8 @@ unpredictable css rules order in build */
|
|
|
92
104
|
}
|
|
93
105
|
@media (max-width: 769px) {
|
|
94
106
|
.pc-quotes-item__body_style_normal {
|
|
95
|
-
font-size:
|
|
96
|
-
line-height:
|
|
107
|
+
font-size: 20px;
|
|
108
|
+
line-height: 24px;
|
|
97
109
|
}
|
|
98
110
|
}
|
|
99
111
|
.pc-quotes-item__body_style_short {
|
|
@@ -102,8 +114,8 @@ unpredictable css rules order in build */
|
|
|
102
114
|
}
|
|
103
115
|
@media (max-width: 769px) {
|
|
104
116
|
.pc-quotes-item__body_style_short {
|
|
105
|
-
font-size:
|
|
106
|
-
line-height:
|
|
117
|
+
font-size: 24px;
|
|
118
|
+
line-height: 28px;
|
|
107
119
|
}
|
|
108
120
|
}
|
|
109
121
|
.pc-quotes-item__body_style_long {
|
|
@@ -112,8 +124,8 @@ unpredictable css rules order in build */
|
|
|
112
124
|
}
|
|
113
125
|
@media (max-width: 769px) {
|
|
114
126
|
.pc-quotes-item__body_style_long {
|
|
115
|
-
font-size:
|
|
116
|
-
line-height:
|
|
127
|
+
font-size: 17px;
|
|
128
|
+
line-height: 22px;
|
|
117
129
|
}
|
|
118
130
|
}
|
|
119
131
|
@media (max-width: 769px) {
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import 'swiper/swiper-bundle.css';
|
|
5
|
-
export type { Swiper, SwiperOptions } from 'swiper';
|
|
6
|
-
export interface SliderNewProps extends Omit<SliderParams, 'children'>, Partial<Pick<SwiperReact, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
|
|
7
|
-
type?: string;
|
|
8
|
-
anchorId?: string;
|
|
9
|
-
dotsClassName?: string;
|
|
10
|
-
blockClassName?: string;
|
|
11
|
-
arrowSize?: number;
|
|
12
|
-
initialSlide?: number;
|
|
13
|
-
}
|
|
14
|
-
export declare const SliderNewBlock: ({ animated, title, description, type, anchorId, arrows, adaptive, autoplay: autoplayMs, infinite, dots, initialSlide, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }: React.PropsWithChildren<SliderNewProps>) => JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SliderNewProps } from './SliderClient';
|
|
3
|
+
export declare const SliderNewBlock: (props: React.PropsWithChildren<SliderNewProps>) => JSX.Element;
|
|
15
4
|
export default SliderNewBlock;
|
|
@@ -2,59 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SliderNewBlock = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const b = (0, utils_1.block)('slider-new-block');
|
|
19
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
20
|
-
swiper_1.default.use([swiper_1.Autoplay, swiper_1.A11y, swiper_1.Pagination]);
|
|
21
|
-
const SliderNewBlock = ({ animated, title, description, type, anchorId, arrows = true, adaptive, autoplay: autoplayMs, infinite = false, dots = true, initialSlide = 0, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }) => {
|
|
22
|
-
const { autoplay, isLocked, childrenCount, breakpoints, onSwiper, onImagesReady, onPrev, onNext, setIsLocked, } = (0, useSlider_1.useSlider)({
|
|
23
|
-
slidesToShow,
|
|
24
|
-
children,
|
|
25
|
-
type,
|
|
26
|
-
autoplayMs,
|
|
27
|
-
});
|
|
28
|
-
const isA11yControlHidden = Boolean(autoplay);
|
|
29
|
-
const controlTabIndex = isA11yControlHidden ? -1 : 0;
|
|
30
|
-
const paginationProps = (0, useSliderPagination_1.useSliderPagination)({
|
|
31
|
-
enabled: dots,
|
|
32
|
-
isA11yControlHidden,
|
|
33
|
-
controlTabIndex,
|
|
34
|
-
bulletClass: b('dot', dotsClassName),
|
|
35
|
-
bulletActiveClass: b('dot_active'),
|
|
36
|
-
paginationLabel: (0, i18n_1.i18n)('pagination-label'),
|
|
37
|
-
});
|
|
38
|
-
return (React.createElement("div", { className: b({
|
|
39
|
-
'one-slide': childrenCount === 1,
|
|
40
|
-
'only-arrows': (!title || (typeof title !== 'string' && !(title === null || title === void 0 ? void 0 : title.text))) &&
|
|
41
|
-
!description &&
|
|
42
|
-
arrows,
|
|
43
|
-
'without-dots': !dots || isLocked,
|
|
44
|
-
type,
|
|
45
|
-
}, blockClassName) },
|
|
46
|
-
anchorId && React.createElement(Anchor_1.default, { id: anchorId }),
|
|
47
|
-
React.createElement(Title_1.default, { title: title, subtitle: description, className: b('header', { 'no-description': !description }) }),
|
|
48
|
-
React.createElement(AnimateBlock_1.default, { className: b('animate-slides'), animate: animated },
|
|
49
|
-
React.createElement(react_1.Swiper, Object.assign({ className: b('slider', className), onSwiper: onSwiper, speed: 700, autoplay: autoplay, loop: infinite, autoHeight: adaptive, initialSlide: initialSlide, noSwiping: false, slidesOffsetBefore: 24, slidesOffsetAfter: 24, breakpoints: breakpoints, onSlideChange: onSlideChange, onSlideChangeTransitionStart: onSlideChangeTransitionStart, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onActiveIndexChange: onActiveIndexChange, onBreakpoint: onBreakpoint, onLock: () => setIsLocked(true), onUnlock: () => setIsLocked(false), onImagesReady: onImagesReady, watchSlidesVisibility: true, watchOverflow: true, a11y: {
|
|
50
|
-
slideLabelMessage: '',
|
|
51
|
-
paginationBulletMessage: (0, i18n_1.i18n)('dot-label', { index: '{{index}}' }),
|
|
52
|
-
} }, paginationProps), React.Children.map(children, (elem, index) => (React.createElement(react_1.SwiperSlide, { className: b('slide'), key: index }, ({ isVisible }) => (React.createElement("div", { className: b('slide-item'), "aria-hidden": !isA11yControlHidden && !isVisible }, elem)))))),
|
|
53
|
-
arrows && !isLocked && (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement("div", { "aria-hidden": isA11yControlHidden },
|
|
55
|
-
React.createElement(Arrow_1.default, { className: b('arrow', { prev: true }), type: "left", transparent: type === models_1.SliderType.HeaderCard, onClick: onPrev, size: arrowSize, extraProps: { tabIndex: controlTabIndex } }),
|
|
56
|
-
React.createElement(Arrow_1.default, { className: b('arrow', { next: true }), type: "right", transparent: type === models_1.SliderType.HeaderCard, onClick: onNext, size: arrowSize, extraProps: { tabIndex: controlTabIndex } })))),
|
|
57
|
-
React.createElement("div", { className: b('footer') }, disclaimer ? (React.createElement("div", { className: b('disclaimer', { size: (disclaimer === null || disclaimer === void 0 ? void 0 : disclaimer.size) || 'm' }) }, disclaimer === null || disclaimer === void 0 ? void 0 : disclaimer.text)) : null))));
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const ssrContext_1 = require("../../context/ssrContext");
|
|
7
|
+
const SliderNewBlock = (props) => {
|
|
8
|
+
const { isServer, dynamic } = (0, react_1.useContext)(ssrContext_1.SSRContext);
|
|
9
|
+
const SliderClient = (0, react_1.useMemo)(() => {
|
|
10
|
+
if (dynamic && isServer) {
|
|
11
|
+
return dynamic(() => Promise.resolve().then(() => tslib_1.__importStar(require('./SliderClient'))).then((mod) => mod.SliderClient), {
|
|
12
|
+
ssr: false,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return require('./SliderClient').SliderClient;
|
|
16
|
+
}, [dynamic, isServer]);
|
|
17
|
+
return react_1.default.createElement(SliderClient, Object.assign({}, props));
|
|
58
18
|
};
|
|
59
19
|
exports.SliderNewBlock = SliderNewBlock;
|
|
60
20
|
exports.default = exports.SliderNewBlock;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SwiperProps } from 'swiper/react';
|
|
3
|
+
import { ClassNameProps, Refable, SliderProps as SliderParams } from '../../models';
|
|
4
|
+
import 'swiper/swiper-bundle.css';
|
|
5
|
+
export interface SliderNewProps extends Omit<SliderParams, 'children'>, Partial<Pick<SwiperProps, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
|
|
6
|
+
type?: string;
|
|
7
|
+
anchorId?: string;
|
|
8
|
+
dotsClassName?: string;
|
|
9
|
+
blockClassName?: string;
|
|
10
|
+
arrowSize?: number;
|
|
11
|
+
initialSlide?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const SliderClient: ({ animated, title, description, type, anchorId, arrows, adaptive, autoplay: autoplayMs, infinite, dots, initialSlide, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }: React.PropsWithChildren<SliderNewProps>) => JSX.Element;
|
|
14
|
+
export default SliderClient;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SliderClient = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const modules_1 = require("swiper/modules");
|
|
7
|
+
const react_1 = require("swiper/react");
|
|
8
|
+
const Anchor_1 = tslib_1.__importDefault(require("../../components/Anchor/Anchor"));
|
|
9
|
+
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
10
|
+
const Title_1 = tslib_1.__importDefault(require("../../components/Title/Title"));
|
|
11
|
+
const models_1 = require("../../models");
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
const Arrow_1 = tslib_1.__importDefault(require("./Arrow/Arrow"));
|
|
14
|
+
const i18n_1 = require("./i18n");
|
|
15
|
+
const useSlider_1 = require("./useSlider");
|
|
16
|
+
const useSliderPagination_1 = require("./useSliderPagination");
|
|
17
|
+
require("swiper/swiper-bundle.css");
|
|
18
|
+
const b = (0, utils_1.block)('slider-new-block');
|
|
19
|
+
const SliderClient = ({ animated, title, description, type, anchorId, arrows = true, adaptive, autoplay: autoplayMs, infinite = false, dots = true, initialSlide = 0, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }) => {
|
|
20
|
+
const { autoplay, isLocked, childrenCount, breakpoints, onSwiper, handleSwiperInit, onPrev, onNext, setIsLocked, } = (0, useSlider_1.useSlider)({
|
|
21
|
+
slidesToShow,
|
|
22
|
+
children,
|
|
23
|
+
type,
|
|
24
|
+
autoplayMs,
|
|
25
|
+
});
|
|
26
|
+
const isA11yControlHidden = Boolean(autoplay);
|
|
27
|
+
const controlTabIndex = isA11yControlHidden ? -1 : 0;
|
|
28
|
+
const paginationProps = (0, useSliderPagination_1.useSliderPagination)({
|
|
29
|
+
enabled: dots,
|
|
30
|
+
isA11yControlHidden,
|
|
31
|
+
controlTabIndex,
|
|
32
|
+
bulletClass: b('dot', dotsClassName),
|
|
33
|
+
bulletActiveClass: b('dot_active'),
|
|
34
|
+
paginationLabel: (0, i18n_1.i18n)('pagination-label'),
|
|
35
|
+
});
|
|
36
|
+
return (React.createElement("div", { className: b({
|
|
37
|
+
'one-slide': childrenCount === 1,
|
|
38
|
+
'only-arrows': (!title || (typeof title !== 'string' && !(title === null || title === void 0 ? void 0 : title.text))) &&
|
|
39
|
+
!description &&
|
|
40
|
+
arrows,
|
|
41
|
+
'without-dots': !dots || isLocked,
|
|
42
|
+
type,
|
|
43
|
+
}, blockClassName) },
|
|
44
|
+
anchorId && React.createElement(Anchor_1.default, { id: anchorId }),
|
|
45
|
+
React.createElement(Title_1.default, { title: title, subtitle: description, className: b('header', { 'no-description': !description }) }),
|
|
46
|
+
React.createElement(AnimateBlock_1.default, { className: b('animate-slides'), animate: animated },
|
|
47
|
+
React.createElement(react_1.Swiper, Object.assign({ modules: [modules_1.Autoplay, modules_1.A11y, modules_1.Pagination], className: b('slider', className), onSwiper: onSwiper, speed: 700, autoplay: autoplay, loop: infinite, autoHeight: adaptive, initialSlide: initialSlide, noSwiping: false, slidesOffsetBefore: 24, slidesOffsetAfter: 24, breakpoints: breakpoints, onSlideChange: onSlideChange, onSlideChangeTransitionStart: onSlideChangeTransitionStart, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onActiveIndexChange: onActiveIndexChange, onBreakpoint: onBreakpoint, onLock: () => setIsLocked(true), onUnlock: () => setIsLocked(false), onInit: handleSwiperInit, watchSlidesProgress: true, watchOverflow: true, a11y: {
|
|
48
|
+
slideLabelMessage: '',
|
|
49
|
+
paginationBulletMessage: (0, i18n_1.i18n)('dot-label', { index: '{{index}}' }),
|
|
50
|
+
} }, paginationProps), React.Children.map(children, (elem, index) => (React.createElement(react_1.SwiperSlide, { className: b('slide'), key: index }, ({ isVisible }) => (React.createElement("div", { className: b('slide-item'), "aria-hidden": !isA11yControlHidden && !isVisible }, elem)))))),
|
|
51
|
+
arrows && !isLocked && (React.createElement("div", { "aria-hidden": isA11yControlHidden },
|
|
52
|
+
React.createElement(Arrow_1.default, { className: b('arrow', { prev: true }), type: "left", transparent: type === models_1.SliderType.HeaderCard, onClick: onPrev, size: arrowSize, extraProps: { tabIndex: controlTabIndex } }),
|
|
53
|
+
React.createElement(Arrow_1.default, { className: b('arrow', { next: true }), type: "right", transparent: type === models_1.SliderType.HeaderCard, onClick: onNext, size: arrowSize, extraProps: { tabIndex: controlTabIndex } }))),
|
|
54
|
+
React.createElement("div", { className: b('footer') }, disclaimer ? (React.createElement("div", { className: b('disclaimer', { size: (disclaimer === null || disclaimer === void 0 ? void 0 : disclaimer.size) || 'm' }) }, disclaimer === null || disclaimer === void 0 ? void 0 : disclaimer.text)) : null))));
|
|
55
|
+
};
|
|
56
|
+
exports.SliderClient = SliderClient;
|
|
57
|
+
exports.default = exports.SliderClient;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Swiper } from 'swiper';
|
|
3
2
|
import { SlidesToShow } from '../../models';
|
|
4
3
|
type UseSliderProps = React.PropsWithChildren<{
|
|
5
4
|
autoplayMs?: number;
|
|
@@ -7,12 +6,12 @@ type UseSliderProps = React.PropsWithChildren<{
|
|
|
7
6
|
slidesToShow?: SlidesToShow;
|
|
8
7
|
}>;
|
|
9
8
|
export declare const useSlider: ({ children, autoplayMs, type, ...props }: UseSliderProps) => {
|
|
10
|
-
slider:
|
|
11
|
-
onSwiper: React.Dispatch<
|
|
9
|
+
slider: any;
|
|
10
|
+
onSwiper: React.Dispatch<any>;
|
|
12
11
|
onNext: () => void;
|
|
13
12
|
onPrev: () => void;
|
|
14
|
-
|
|
15
|
-
breakpoints: Record<number, import("swiper").SwiperOptions>;
|
|
13
|
+
handleSwiperInit: (swiper: Swiper) => void;
|
|
14
|
+
breakpoints: Record<number, import("swiper/types/swiper-options").SwiperOptions>;
|
|
16
15
|
childrenCount: number;
|
|
17
16
|
isLocked: boolean;
|
|
18
17
|
setIsLocked: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -39,11 +39,12 @@ const useSlider = (_a) => {
|
|
|
39
39
|
}
|
|
40
40
|
slider.slidePrev();
|
|
41
41
|
};
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const handleSwiperInit = (swiper) => {
|
|
43
|
+
setSlider(swiper);
|
|
44
|
+
setTimeout(() => swiper.update(), 100);
|
|
45
|
+
};
|
|
45
46
|
React.useEffect(() => {
|
|
46
|
-
if (!slider) {
|
|
47
|
+
if (!slider || !slider.autoplay) {
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
50
|
if (autoplayEnabled) {
|
|
@@ -58,7 +59,7 @@ const useSlider = (_a) => {
|
|
|
58
59
|
onSwiper: setSlider,
|
|
59
60
|
onNext: handleNext,
|
|
60
61
|
onPrev: handlePrev,
|
|
61
|
-
|
|
62
|
+
handleSwiperInit,
|
|
62
63
|
breakpoints,
|
|
63
64
|
childrenCount,
|
|
64
65
|
isLocked,
|
|
@@ -36,7 +36,7 @@ export declare const blockMap: {
|
|
|
36
36
|
"reports-cards-block": ({ title, typeKey, postscript, empty }: import("./models").ReportsCardsBlockProps) => JSX.Element;
|
|
37
37
|
"reports-sections-block": ({ title, typeKey, empty }: import("./models").ReportsSectionsBlockProps) => JSX.Element;
|
|
38
38
|
"form-wall-block": (props: import("./models").FormWallBlockProps) => JSX.Element;
|
|
39
|
-
"slider-new-block": (
|
|
39
|
+
"slider-new-block": (props: import("react").PropsWithChildren<import("./blocks/SliderNew/SliderClient").SliderNewProps>) => JSX.Element;
|
|
40
40
|
};
|
|
41
41
|
export declare const subBlockMap: {
|
|
42
42
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
type ComponentModule<P = {}> = {
|
|
3
|
+
default: React.ComponentType<P>;
|
|
4
|
+
};
|
|
5
|
+
export declare type LoaderComponent<P = {}> = Promise<React.ComponentType<P> | ComponentModule<P>>;
|
|
6
|
+
export declare type Loader<P = {}> = (() => LoaderComponent<P>) | LoaderComponent<P>;
|
|
2
7
|
export interface SSRContextProps {
|
|
3
8
|
isServer?: boolean;
|
|
9
|
+
dynamic?: <P = {}>(dynamicOptions: Loader<P>, options?: {
|
|
10
|
+
ssr?: boolean;
|
|
11
|
+
}) => React.ComponentType<P>;
|
|
4
12
|
}
|
|
5
13
|
export declare const SSRContext: React.Context<SSRContextProps>;
|
|
14
|
+
export {};
|
|
@@ -22,6 +22,11 @@ unpredictable css rules order in build */
|
|
|
22
22
|
display: flex;
|
|
23
23
|
gap: 16px;
|
|
24
24
|
}
|
|
25
|
+
@media (max-width: 769px) {
|
|
26
|
+
.pc-quotes-item__header {
|
|
27
|
+
padding-top: 20px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
25
30
|
.pc-quotes-item__author {
|
|
26
31
|
display: flex;
|
|
27
32
|
flex: 1;
|
|
@@ -79,7 +84,14 @@ unpredictable css rules order in build */
|
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
.pc-quotes-item__logo {
|
|
87
|
+
display: block;
|
|
82
88
|
max-width: 100%;
|
|
89
|
+
max-height: 80px;
|
|
90
|
+
}
|
|
91
|
+
@media (max-width: 769px) {
|
|
92
|
+
.pc-quotes-item__logo {
|
|
93
|
+
max-height: 40px;
|
|
94
|
+
}
|
|
83
95
|
}
|
|
84
96
|
.pc-quotes-item__body {
|
|
85
97
|
max-width: 960px;
|
|
@@ -92,8 +104,8 @@ unpredictable css rules order in build */
|
|
|
92
104
|
}
|
|
93
105
|
@media (max-width: 769px) {
|
|
94
106
|
.pc-quotes-item__body_style_normal {
|
|
95
|
-
font-size:
|
|
96
|
-
line-height:
|
|
107
|
+
font-size: 20px;
|
|
108
|
+
line-height: 24px;
|
|
97
109
|
}
|
|
98
110
|
}
|
|
99
111
|
.pc-quotes-item__body_style_short {
|
|
@@ -102,8 +114,8 @@ unpredictable css rules order in build */
|
|
|
102
114
|
}
|
|
103
115
|
@media (max-width: 769px) {
|
|
104
116
|
.pc-quotes-item__body_style_short {
|
|
105
|
-
font-size:
|
|
106
|
-
line-height:
|
|
117
|
+
font-size: 24px;
|
|
118
|
+
line-height: 28px;
|
|
107
119
|
}
|
|
108
120
|
}
|
|
109
121
|
.pc-quotes-item__body_style_long {
|
|
@@ -112,8 +124,8 @@ unpredictable css rules order in build */
|
|
|
112
124
|
}
|
|
113
125
|
@media (max-width: 769px) {
|
|
114
126
|
.pc-quotes-item__body_style_long {
|
|
115
|
-
font-size:
|
|
116
|
-
line-height:
|
|
127
|
+
font-size: 17px;
|
|
128
|
+
line-height: 22px;
|
|
117
129
|
}
|
|
118
130
|
}
|
|
119
131
|
@media (max-width: 769px) {
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import './Slider.css';
|
|
5
|
-
import 'swiper/swiper-bundle.css';
|
|
6
|
-
export type { Swiper, SwiperOptions } from 'swiper';
|
|
7
|
-
export interface SliderNewProps extends Omit<SliderParams, 'children'>, Partial<Pick<SwiperReact, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
|
|
8
|
-
type?: string;
|
|
9
|
-
anchorId?: string;
|
|
10
|
-
dotsClassName?: string;
|
|
11
|
-
blockClassName?: string;
|
|
12
|
-
arrowSize?: number;
|
|
13
|
-
initialSlide?: number;
|
|
14
|
-
}
|
|
15
|
-
export declare const SliderNewBlock: ({ animated, title, description, type, anchorId, arrows, adaptive, autoplay: autoplayMs, infinite, dots, initialSlide, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }: React.PropsWithChildren<SliderNewProps>) => JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SliderNewProps } from './SliderClient';
|
|
3
|
+
export declare const SliderNewBlock: (props: React.PropsWithChildren<SliderNewProps>) => JSX.Element;
|
|
16
4
|
export default SliderNewBlock;
|
|
@@ -1,56 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import 'swiper/swiper-bundle.css';
|
|
15
|
-
const b = block('slider-new-block');
|
|
16
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
17
|
-
Swiper.use([Autoplay, A11y, Pagination]);
|
|
18
|
-
export const SliderNewBlock = ({ animated, title, description, type, anchorId, arrows = true, adaptive, autoplay: autoplayMs, infinite = false, dots = true, initialSlide = 0, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }) => {
|
|
19
|
-
const { autoplay, isLocked, childrenCount, breakpoints, onSwiper, onImagesReady, onPrev, onNext, setIsLocked, } = useSlider({
|
|
20
|
-
slidesToShow,
|
|
21
|
-
children,
|
|
22
|
-
type,
|
|
23
|
-
autoplayMs,
|
|
24
|
-
});
|
|
25
|
-
const isA11yControlHidden = Boolean(autoplay);
|
|
26
|
-
const controlTabIndex = isA11yControlHidden ? -1 : 0;
|
|
27
|
-
const paginationProps = useSliderPagination({
|
|
28
|
-
enabled: dots,
|
|
29
|
-
isA11yControlHidden,
|
|
30
|
-
controlTabIndex,
|
|
31
|
-
bulletClass: b('dot', dotsClassName),
|
|
32
|
-
bulletActiveClass: b('dot_active'),
|
|
33
|
-
paginationLabel: i18n('pagination-label'),
|
|
34
|
-
});
|
|
35
|
-
return (React.createElement("div", { className: b({
|
|
36
|
-
'one-slide': childrenCount === 1,
|
|
37
|
-
'only-arrows': (!title || (typeof title !== 'string' && !(title === null || title === void 0 ? void 0 : title.text))) &&
|
|
38
|
-
!description &&
|
|
39
|
-
arrows,
|
|
40
|
-
'without-dots': !dots || isLocked,
|
|
41
|
-
type,
|
|
42
|
-
}, blockClassName) },
|
|
43
|
-
anchorId && React.createElement(Anchor, { id: anchorId }),
|
|
44
|
-
React.createElement(Title, { title: title, subtitle: description, className: b('header', { 'no-description': !description }) }),
|
|
45
|
-
React.createElement(AnimateBlock, { className: b('animate-slides'), animate: animated },
|
|
46
|
-
React.createElement(SwiperReact, Object.assign({ className: b('slider', className), onSwiper: onSwiper, speed: 700, autoplay: autoplay, loop: infinite, autoHeight: adaptive, initialSlide: initialSlide, noSwiping: false, slidesOffsetBefore: 24, slidesOffsetAfter: 24, breakpoints: breakpoints, onSlideChange: onSlideChange, onSlideChangeTransitionStart: onSlideChangeTransitionStart, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onActiveIndexChange: onActiveIndexChange, onBreakpoint: onBreakpoint, onLock: () => setIsLocked(true), onUnlock: () => setIsLocked(false), onImagesReady: onImagesReady, watchSlidesVisibility: true, watchOverflow: true, a11y: {
|
|
47
|
-
slideLabelMessage: '',
|
|
48
|
-
paginationBulletMessage: i18n('dot-label', { index: '{{index}}' }),
|
|
49
|
-
} }, paginationProps), React.Children.map(children, (elem, index) => (React.createElement(SwiperSlide, { className: b('slide'), key: index }, ({ isVisible }) => (React.createElement("div", { className: b('slide-item'), "aria-hidden": !isA11yControlHidden && !isVisible }, elem)))))),
|
|
50
|
-
arrows && !isLocked && (React.createElement(React.Fragment, null,
|
|
51
|
-
React.createElement("div", { "aria-hidden": isA11yControlHidden },
|
|
52
|
-
React.createElement(Arrow, { className: b('arrow', { prev: true }), type: "left", transparent: type === SliderType.HeaderCard, onClick: onPrev, size: arrowSize, extraProps: { tabIndex: controlTabIndex } }),
|
|
53
|
-
React.createElement(Arrow, { className: b('arrow', { next: true }), type: "right", transparent: type === SliderType.HeaderCard, onClick: onNext, size: arrowSize, extraProps: { tabIndex: controlTabIndex } })))),
|
|
54
|
-
React.createElement("div", { className: b('footer') }, disclaimer ? (React.createElement("div", { className: b('disclaimer', { size: (disclaimer === null || disclaimer === void 0 ? void 0 : disclaimer.size) || 'm' }) }, disclaimer === null || disclaimer === void 0 ? void 0 : disclaimer.text)) : null))));
|
|
1
|
+
import React, { useContext, useMemo } from 'react';
|
|
2
|
+
import { SSRContext } from '../../context/ssrContext';
|
|
3
|
+
export const SliderNewBlock = (props) => {
|
|
4
|
+
const { isServer, dynamic } = useContext(SSRContext);
|
|
5
|
+
const SliderClient = useMemo(() => {
|
|
6
|
+
if (dynamic && isServer) {
|
|
7
|
+
return dynamic(() => import('./SliderClient').then((mod) => mod.SliderClient), {
|
|
8
|
+
ssr: false,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return require('./SliderClient').SliderClient;
|
|
12
|
+
}, [dynamic, isServer]);
|
|
13
|
+
return React.createElement(SliderClient, Object.assign({}, props));
|
|
55
14
|
};
|
|
56
15
|
export default SliderNewBlock;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SwiperProps } from 'swiper/react';
|
|
3
|
+
import { ClassNameProps, Refable, SliderProps as SliderParams } from '../../models';
|
|
4
|
+
import './Slider.css';
|
|
5
|
+
import 'swiper/swiper-bundle.css';
|
|
6
|
+
export interface SliderNewProps extends Omit<SliderParams, 'children'>, Partial<Pick<SwiperProps, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
|
|
7
|
+
type?: string;
|
|
8
|
+
anchorId?: string;
|
|
9
|
+
dotsClassName?: string;
|
|
10
|
+
blockClassName?: string;
|
|
11
|
+
arrowSize?: number;
|
|
12
|
+
initialSlide?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const SliderClient: ({ animated, title, description, type, anchorId, arrows, adaptive, autoplay: autoplayMs, infinite, dots, initialSlide, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }: React.PropsWithChildren<SliderNewProps>) => JSX.Element;
|
|
15
|
+
export default SliderClient;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { A11y, Autoplay, Pagination } from 'swiper/modules';
|
|
3
|
+
import { Swiper as SwiperReact, SwiperSlide } from 'swiper/react';
|
|
4
|
+
import Anchor from '../../components/Anchor/Anchor';
|
|
5
|
+
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
6
|
+
import Title from '../../components/Title/Title';
|
|
7
|
+
import { SliderType } from '../../models';
|
|
8
|
+
import { block } from '../../utils';
|
|
9
|
+
import Arrow from './Arrow/Arrow';
|
|
10
|
+
import { i18n } from './i18n';
|
|
11
|
+
import { useSlider } from './useSlider';
|
|
12
|
+
import { useSliderPagination } from './useSliderPagination';
|
|
13
|
+
import './Slider.css';
|
|
14
|
+
import 'swiper/swiper-bundle.css';
|
|
15
|
+
const b = block('slider-new-block');
|
|
16
|
+
export const SliderClient = ({ animated, title, description, type, anchorId, arrows = true, adaptive, autoplay: autoplayMs, infinite = false, dots = true, initialSlide = 0, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }) => {
|
|
17
|
+
const { autoplay, isLocked, childrenCount, breakpoints, onSwiper, handleSwiperInit, onPrev, onNext, setIsLocked, } = useSlider({
|
|
18
|
+
slidesToShow,
|
|
19
|
+
children,
|
|
20
|
+
type,
|
|
21
|
+
autoplayMs,
|
|
22
|
+
});
|
|
23
|
+
const isA11yControlHidden = Boolean(autoplay);
|
|
24
|
+
const controlTabIndex = isA11yControlHidden ? -1 : 0;
|
|
25
|
+
const paginationProps = useSliderPagination({
|
|
26
|
+
enabled: dots,
|
|
27
|
+
isA11yControlHidden,
|
|
28
|
+
controlTabIndex,
|
|
29
|
+
bulletClass: b('dot', dotsClassName),
|
|
30
|
+
bulletActiveClass: b('dot_active'),
|
|
31
|
+
paginationLabel: i18n('pagination-label'),
|
|
32
|
+
});
|
|
33
|
+
return (React.createElement("div", { className: b({
|
|
34
|
+
'one-slide': childrenCount === 1,
|
|
35
|
+
'only-arrows': (!title || (typeof title !== 'string' && !(title === null || title === void 0 ? void 0 : title.text))) &&
|
|
36
|
+
!description &&
|
|
37
|
+
arrows,
|
|
38
|
+
'without-dots': !dots || isLocked,
|
|
39
|
+
type,
|
|
40
|
+
}, blockClassName) },
|
|
41
|
+
anchorId && React.createElement(Anchor, { id: anchorId }),
|
|
42
|
+
React.createElement(Title, { title: title, subtitle: description, className: b('header', { 'no-description': !description }) }),
|
|
43
|
+
React.createElement(AnimateBlock, { className: b('animate-slides'), animate: animated },
|
|
44
|
+
React.createElement(SwiperReact, Object.assign({ modules: [Autoplay, A11y, Pagination], className: b('slider', className), onSwiper: onSwiper, speed: 700, autoplay: autoplay, loop: infinite, autoHeight: adaptive, initialSlide: initialSlide, noSwiping: false, slidesOffsetBefore: 24, slidesOffsetAfter: 24, breakpoints: breakpoints, onSlideChange: onSlideChange, onSlideChangeTransitionStart: onSlideChangeTransitionStart, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onActiveIndexChange: onActiveIndexChange, onBreakpoint: onBreakpoint, onLock: () => setIsLocked(true), onUnlock: () => setIsLocked(false), onInit: handleSwiperInit, watchSlidesProgress: true, watchOverflow: true, a11y: {
|
|
45
|
+
slideLabelMessage: '',
|
|
46
|
+
paginationBulletMessage: i18n('dot-label', { index: '{{index}}' }),
|
|
47
|
+
} }, paginationProps), React.Children.map(children, (elem, index) => (React.createElement(SwiperSlide, { className: b('slide'), key: index }, ({ isVisible }) => (React.createElement("div", { className: b('slide-item'), "aria-hidden": !isA11yControlHidden && !isVisible }, elem)))))),
|
|
48
|
+
arrows && !isLocked && (React.createElement("div", { "aria-hidden": isA11yControlHidden },
|
|
49
|
+
React.createElement(Arrow, { className: b('arrow', { prev: true }), type: "left", transparent: type === SliderType.HeaderCard, onClick: onPrev, size: arrowSize, extraProps: { tabIndex: controlTabIndex } }),
|
|
50
|
+
React.createElement(Arrow, { className: b('arrow', { next: true }), type: "right", transparent: type === SliderType.HeaderCard, onClick: onNext, size: arrowSize, extraProps: { tabIndex: controlTabIndex } }))),
|
|
51
|
+
React.createElement("div", { className: b('footer') }, disclaimer ? (React.createElement("div", { className: b('disclaimer', { size: (disclaimer === null || disclaimer === void 0 ? void 0 : disclaimer.size) || 'm' }) }, disclaimer === null || disclaimer === void 0 ? void 0 : disclaimer.text)) : null))));
|
|
52
|
+
};
|
|
53
|
+
export default SliderClient;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Swiper } from 'swiper';
|
|
3
2
|
import { SlidesToShow } from '../../models';
|
|
4
3
|
type UseSliderProps = React.PropsWithChildren<{
|
|
5
4
|
autoplayMs?: number;
|
|
@@ -7,12 +6,12 @@ type UseSliderProps = React.PropsWithChildren<{
|
|
|
7
6
|
slidesToShow?: SlidesToShow;
|
|
8
7
|
}>;
|
|
9
8
|
export declare const useSlider: ({ children, autoplayMs, type, ...props }: UseSliderProps) => {
|
|
10
|
-
slider:
|
|
11
|
-
onSwiper: React.Dispatch<
|
|
9
|
+
slider: any;
|
|
10
|
+
onSwiper: React.Dispatch<any>;
|
|
12
11
|
onNext: () => void;
|
|
13
12
|
onPrev: () => void;
|
|
14
|
-
|
|
15
|
-
breakpoints: Record<number, import("swiper").SwiperOptions>;
|
|
13
|
+
handleSwiperInit: (swiper: Swiper) => void;
|
|
14
|
+
breakpoints: Record<number, import("swiper/types/swiper-options").SwiperOptions>;
|
|
16
15
|
childrenCount: number;
|
|
17
16
|
isLocked: boolean;
|
|
18
17
|
setIsLocked: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -36,11 +36,12 @@ export const useSlider = (_a) => {
|
|
|
36
36
|
}
|
|
37
37
|
slider.slidePrev();
|
|
38
38
|
};
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const handleSwiperInit = (swiper) => {
|
|
40
|
+
setSlider(swiper);
|
|
41
|
+
setTimeout(() => swiper.update(), 100);
|
|
42
|
+
};
|
|
42
43
|
React.useEffect(() => {
|
|
43
|
-
if (!slider) {
|
|
44
|
+
if (!slider || !slider.autoplay) {
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
if (autoplayEnabled) {
|
|
@@ -55,7 +56,7 @@ export const useSlider = (_a) => {
|
|
|
55
56
|
onSwiper: setSlider,
|
|
56
57
|
onNext: handleNext,
|
|
57
58
|
onPrev: handlePrev,
|
|
58
|
-
|
|
59
|
+
handleSwiperInit,
|
|
59
60
|
breakpoints,
|
|
60
61
|
childrenCount,
|
|
61
62
|
isLocked,
|
|
@@ -36,7 +36,7 @@ export declare const blockMap: {
|
|
|
36
36
|
"reports-cards-block": ({ title, typeKey, postscript, empty }: import("./models").ReportsCardsBlockProps) => JSX.Element;
|
|
37
37
|
"reports-sections-block": ({ title, typeKey, empty }: import("./models").ReportsSectionsBlockProps) => JSX.Element;
|
|
38
38
|
"form-wall-block": (props: import("./models").FormWallBlockProps) => JSX.Element;
|
|
39
|
-
"slider-new-block": (
|
|
39
|
+
"slider-new-block": (props: import("react").PropsWithChildren<import("./blocks/SliderNew/SliderClient").SliderNewProps>) => JSX.Element;
|
|
40
40
|
};
|
|
41
41
|
export declare const subBlockMap: {
|
|
42
42
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
type ComponentModule<P = {}> = {
|
|
3
|
+
default: React.ComponentType<P>;
|
|
4
|
+
};
|
|
5
|
+
export declare type LoaderComponent<P = {}> = Promise<React.ComponentType<P> | ComponentModule<P>>;
|
|
6
|
+
export declare type Loader<P = {}> = (() => LoaderComponent<P>) | LoaderComponent<P>;
|
|
2
7
|
export interface SSRContextProps {
|
|
3
8
|
isServer?: boolean;
|
|
9
|
+
dynamic?: <P = {}>(dynamicOptions: Loader<P>, options?: {
|
|
10
|
+
ssr?: boolean;
|
|
11
|
+
}) => React.ComponentType<P>;
|
|
4
12
|
}
|
|
5
13
|
export declare const SSRContext: React.Context<SSRContextProps>;
|
|
14
|
+
export {};
|