@gravity-ui/page-constructor 7.23.0 → 8.0.0-alpha.1
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/_vendor/swiper-modules.js +1309 -0
- package/build/cjs/_vendor/swiper-modules.js.map +7 -0
- package/build/cjs/_vendor/swiper-react.js +4651 -0
- package/build/cjs/_vendor/swiper-react.js.map +7 -0
- package/build/cjs/_vendor/swiper.js +3822 -0
- package/build/cjs/_vendor/swiper.js.map +7 -0
- package/build/cjs/blocks/Slider/Slider.d.ts +6 -4
- package/build/cjs/blocks/Slider/Slider.js +7 -7
- package/build/cjs/blocks/Slider/Slider.js.map +1 -1
- package/build/cjs/blocks/Slider/useSlider.d.ts +1 -2
- package/build/cjs/blocks/Slider/useSlider.js +3 -7
- package/build/cjs/blocks/Slider/useSlider.js.map +1 -1
- package/build/cjs/blocks/Slider/useSliderPagination.d.ts +1 -1
- package/build/cjs/blocks/Slider/useSliderPagination.js.map +1 -1
- package/build/cjs/blocks/Slider/utils.d.ts +1 -1
- package/build/cjs/blocks/Slider/utils.js.map +1 -1
- package/build/cjs/node_modules/swiper/modules/a11y.css +9 -0
- package/build/cjs/node_modules/swiper/modules/autoplay.css +0 -0
- package/build/cjs/node_modules/swiper/modules/index.js +1309 -0
- package/build/cjs/node_modules/swiper/modules/pagination.css +181 -0
- package/build/cjs/node_modules/swiper/package.json +14 -0
- package/build/cjs/node_modules/swiper/swiper-react.d.ts +497 -0
- package/build/cjs/node_modules/swiper/swiper-react.js +4651 -0
- package/build/cjs/node_modules/swiper/swiper.css +229 -0
- package/build/cjs/node_modules/swiper/swiper.d.ts +5 -0
- package/build/cjs/node_modules/swiper/swiper.js +3822 -0
- package/build/cjs/node_modules/swiper/types/index.d.ts +6 -0
- package/build/cjs/node_modules/swiper/types/modules/index.d.ts +53 -0
- package/build/esm/blocks/Slider/Slider.d.ts +6 -4
- package/build/esm/blocks/Slider/Slider.js +7 -7
- package/build/esm/blocks/Slider/Slider.js.map +1 -1
- package/build/esm/blocks/Slider/useSlider.d.ts +2 -3
- package/build/esm/blocks/Slider/useSlider.js +3 -7
- package/build/esm/blocks/Slider/useSlider.js.map +1 -1
- package/build/esm/blocks/Slider/useSliderPagination.d.ts +1 -1
- package/build/esm/blocks/Slider/useSliderPagination.js.map +1 -1
- package/build/esm/blocks/Slider/utils.d.ts +1 -1
- package/build/esm/blocks/Slider/utils.js.map +1 -1
- package/package.json +4 -2
- package/widget/index.js +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { SwiperModule } from '../shared.d.ts';
|
|
2
|
+
|
|
3
|
+
declare const A11y: SwiperModule;
|
|
4
|
+
declare const Autoplay: SwiperModule;
|
|
5
|
+
declare const Controller: SwiperModule;
|
|
6
|
+
declare const EffectCoverflow: SwiperModule;
|
|
7
|
+
declare const EffectCube: SwiperModule;
|
|
8
|
+
declare const EffectFade: SwiperModule;
|
|
9
|
+
declare const EffectFlip: SwiperModule;
|
|
10
|
+
declare const EffectCreative: SwiperModule;
|
|
11
|
+
declare const EffectCards: SwiperModule;
|
|
12
|
+
declare const HashNavigation: SwiperModule;
|
|
13
|
+
declare const History: SwiperModule;
|
|
14
|
+
declare const Keyboard: SwiperModule;
|
|
15
|
+
declare const Lazy: SwiperModule;
|
|
16
|
+
declare const Mousewheel: SwiperModule;
|
|
17
|
+
declare const Navigation: SwiperModule;
|
|
18
|
+
declare const Pagination: SwiperModule;
|
|
19
|
+
declare const Parallax: SwiperModule;
|
|
20
|
+
declare const Scrollbar: SwiperModule;
|
|
21
|
+
declare const Thumbs: SwiperModule;
|
|
22
|
+
declare const Virtual: SwiperModule;
|
|
23
|
+
declare const Zoom: SwiperModule;
|
|
24
|
+
declare const FreeMode: SwiperModule;
|
|
25
|
+
declare const Grid: SwiperModule;
|
|
26
|
+
declare const Manipulation: SwiperModule;
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
A11y,
|
|
30
|
+
Autoplay,
|
|
31
|
+
Controller,
|
|
32
|
+
EffectCoverflow,
|
|
33
|
+
EffectCube,
|
|
34
|
+
EffectFade,
|
|
35
|
+
EffectFlip,
|
|
36
|
+
EffectCreative,
|
|
37
|
+
EffectCards,
|
|
38
|
+
HashNavigation,
|
|
39
|
+
History,
|
|
40
|
+
Keyboard,
|
|
41
|
+
Lazy,
|
|
42
|
+
Mousewheel,
|
|
43
|
+
Navigation,
|
|
44
|
+
Pagination,
|
|
45
|
+
Parallax,
|
|
46
|
+
Scrollbar,
|
|
47
|
+
Thumbs,
|
|
48
|
+
Virtual,
|
|
49
|
+
Zoom,
|
|
50
|
+
FreeMode,
|
|
51
|
+
Grid,
|
|
52
|
+
Manipulation,
|
|
53
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import 'swiper/css';
|
|
3
|
+
import 'swiper/css/a11y';
|
|
4
|
+
import 'swiper/css/pagination';
|
|
5
|
+
import { Swiper as SwiperReact } from 'swiper/react';
|
|
3
6
|
import { ClassNameProps, Refable, SliderProps as SliderParams } from "../../models/index.js";
|
|
4
7
|
import './Slider.css';
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export interface SliderProps extends Omit<SliderParams, 'children'>, Partial<Pick<SwiperReact, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
|
|
8
|
+
export type { Swiper, SwiperOptions } from 'swiper/types';
|
|
9
|
+
export interface SliderProps extends Omit<SliderParams, 'children'>, Partial<Pick<React.ComponentProps<typeof SwiperReact>, 'onSlideChange' | 'onSlideChangeTransitionStart' | 'onSlideChangeTransitionEnd' | 'onActiveIndexChange' | 'onBreakpoint'>>, Refable<HTMLDivElement>, ClassNameProps {
|
|
8
10
|
type?: string;
|
|
9
11
|
anchorId?: string;
|
|
10
12
|
dotsClassName?: string;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import 'swiper/css';
|
|
4
|
+
import 'swiper/css/a11y';
|
|
5
|
+
import 'swiper/css/pagination';
|
|
6
|
+
import { A11y, Autoplay, Pagination } from 'swiper/modules';
|
|
7
|
+
import { Swiper as SwiperReact, SwiperSlide } from 'swiper/react';
|
|
5
8
|
import Anchor from "../../components/Anchor/Anchor.js";
|
|
6
9
|
import AnimateBlock from "../../components/AnimateBlock/AnimateBlock.js";
|
|
7
10
|
import Title from "../../components/Title/Title.js";
|
|
@@ -12,12 +15,9 @@ import { i18n } from "./i18n/index.js";
|
|
|
12
15
|
import { useSlider } from "./useSlider.js";
|
|
13
16
|
import { useSliderPagination } from "./useSliderPagination.js";
|
|
14
17
|
import './Slider.css';
|
|
15
|
-
import 'swiper/swiper-bundle.css';
|
|
16
18
|
const b = block('SliderBlock');
|
|
17
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
18
|
-
Swiper.use([Autoplay, A11y, Pagination]);
|
|
19
19
|
export const SliderBlock = ({ animated, title, description, type, anchorId, arrows = true, adaptive, autoplay: autoplayMs, dots = true, initialSlide = 0, className, dotsClassName, disclaimer, children, blockClassName, arrowSize, slidesToShow, onSlideChange, onSlideChangeTransitionStart, onSlideChangeTransitionEnd, onActiveIndexChange, onBreakpoint, }) => {
|
|
20
|
-
const { autoplay, isLocked, childrenCount, breakpoints, onSwiper,
|
|
20
|
+
const { autoplay, isLocked, childrenCount, breakpoints, onSwiper, onPrev, onNext, setIsLocked } = useSlider({
|
|
21
21
|
slidesToShow,
|
|
22
22
|
children,
|
|
23
23
|
type,
|
|
@@ -40,7 +40,7 @@ export const SliderBlock = ({ animated, title, description, type, anchorId, arro
|
|
|
40
40
|
arrows,
|
|
41
41
|
'without-dots': !dots || isLocked,
|
|
42
42
|
type,
|
|
43
|
-
}, blockClassName), children: [anchorId && _jsx(Anchor, { id: anchorId }), _jsx(Title, { title: title, subtitle: description, className: b('header', { 'no-description': !description }) }), _jsxs(AnimateBlock, { className: b('animate-slides'), animate: animated, children: [_jsx(SwiperReact, { className: b('slider', className), onSwiper: onSwiper, speed: 1000, autoplay: autoplay, autoHeight: adaptive, initialSlide: initialSlide, noSwiping: false, breakpoints: breakpoints, onSlideChange: onSlideChange, onSlideChangeTransitionStart: onSlideChangeTransitionStart, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onActiveIndexChange: onActiveIndexChange, onBreakpoint: onBreakpoint, onLock: () => setIsLocked(true), onUnlock: () => setIsLocked(false),
|
|
43
|
+
}, blockClassName), children: [anchorId && _jsx(Anchor, { id: anchorId }), _jsx(Title, { title: title, subtitle: description, className: b('header', { 'no-description': !description }) }), _jsxs(AnimateBlock, { className: b('animate-slides'), animate: animated, children: [_jsx(SwiperReact, { modules: [Autoplay, A11y, Pagination], className: b('slider', className), onSwiper: onSwiper, speed: 1000, autoplay: autoplay, autoHeight: adaptive, initialSlide: initialSlide, noSwiping: false, breakpoints: breakpoints, onSlideChange: onSlideChange, onSlideChangeTransitionStart: onSlideChangeTransitionStart, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onActiveIndexChange: onActiveIndexChange, onBreakpoint: onBreakpoint, onLock: () => setIsLocked(true), onUnlock: () => setIsLocked(false), watchOverflow: true, watchSlidesProgress: true, a11y: {
|
|
44
44
|
slideLabelMessage: '',
|
|
45
45
|
paginationBulletMessage: i18n('dot-label', { index: '{{index}}' }),
|
|
46
46
|
}, ...paginationProps, children: React.Children.map(children, (elem, index) => (_jsx(SwiperSlide, { className: b('slide'), children: ({ isVisible }) => (_jsx("div", { className: b('slide-item'), "aria-hidden": !isA11yControlHidden && !isVisible, children: elem })) }, index))) }), arrows && !isLocked && (_jsx(React.Fragment, { children: _jsxs("div", { "aria-hidden": isA11yControlHidden, children: [_jsx(Arrow, { className: b('arrow', { prev: true }), type: "left", transparent: type === SliderType.HeaderCard, onClick: onPrev, size: arrowSize, extraProps: { tabIndex: controlTabIndex } }), _jsx(Arrow, { className: b('arrow', { next: true }), type: "right", transparent: type === SliderType.HeaderCard, onClick: onNext, size: arrowSize, extraProps: { tabIndex: controlTabIndex } })] }) })), _jsx("div", { className: b('footer'), children: disclaimer ? (_jsx("div", { className: b('disclaimer', { size: disclaimer?.size || 'm' }), children: disclaimer?.text })) : null })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","sourceRoot":"../../../../src","sources":["blocks/Slider/Slider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAC,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAC,MAAM,IAAI,WAAW,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAEhE,OAAO,MAAM,0CAAuC;AACpD,OAAO,YAAY,sDAAmD;AACtE,OAAO,KAAK,wCAAqC;AACjD,OAAO,EAAuD,UAAU,EAAC,8BAAqB;AAC9F,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,KAAK,yBAAsB;AAClC,OAAO,EAAC,IAAI,EAAC,wBAAe;AAC5B,OAAO,EAAC,SAAS,EAAC,uBAAoB;AACtC,OAAO,EAAC,mBAAmB,EAAC,iCAA8B;AAE1D,OAAO,cAAc,CAAC;AACtB,OAAO,0BAA0B,CAAC;AAIlC,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAwB/B,sDAAsD;AACtD,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EACxB,QAAQ,EACR,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,MAAM,GAAG,IAAI,E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IAAI,GACH,CACT,IARoC,KAAK,CAShC,CACjB,CAAC,GACQ,EACb,MAAM,IAAI,CAAC,QAAQ,IAAI,CACpB,KAAC,KAAK,CAAC,QAAQ,cACX,8BAAkB,mBAAmB,aACjC,KAAC,KAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,EACnC,IAAI,EAAC,MAAM,EACX,WAAW,EAAE,IAAI,KAAK,UAAU,CAAC,UAAU,EAC3C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,EAAC,QAAQ,EAAE,eAAe,EAAC,GACzC,EACF,KAAC,KAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,EACnC,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE,IAAI,KAAK,UAAU,CAAC,UAAU,EAC3C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,EAAC,QAAQ,EAAE,eAAe,EAAC,GACzC,IACA,GACO,CACpB,EACD,cAAK,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,YACtB,UAAU,CAAC,CAAC,CAAC,CACV,cAAK,SAAS,EAAE,CAAC,CAAC,YAAY,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,IAAI,GAAG,EAAC,CAAC,YAC3D,UAAU,EAAE,IAAI,GACf,CACT,CAAC,CAAC,CAAC,IAAI,GACN,IACK,IACb,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport Swiper, {A11y, Autoplay, Pagination} from 'swiper';\nimport {Swiper as SwiperReact, SwiperSlide} from 'swiper/react';\n\nimport Anchor from '../../components/Anchor/Anchor';\nimport AnimateBlock from '../../components/AnimateBlock/AnimateBlock';\nimport Title from '../../components/Title/Title';\nimport {ClassNameProps, Refable, SliderProps as SliderParams, SliderType} from '../../models';\nimport {block} from '../../utils';\n\nimport Arrow from './Arrow/Arrow';\nimport {i18n} from './i18n';\nimport {useSlider} from './useSlider';\nimport {useSliderPagination} from './useSliderPagination';\n\nimport './Slider.scss';\nimport 'swiper/swiper-bundle.css';\n\nexport type {Swiper, SwiperOptions} from 'swiper';\n\nconst b = block('SliderBlock');\n\nexport interface SliderProps\n extends Omit<SliderParams, 'children'>,\n Partial<\n Pick<\n SwiperReact,\n | 'onSlideChange'\n | 'onSlideChangeTransitionStart'\n | 'onSlideChangeTransitionEnd'\n | 'onActiveIndexChange'\n | 'onBreakpoint'\n >\n >,\n Refable<HTMLDivElement>,\n ClassNameProps {\n type?: string;\n anchorId?: string;\n dotsClassName?: string;\n blockClassName?: string;\n arrowSize?: number;\n initialSlide?: number;\n}\n\n// eslint-disable-next-line react-hooks/rules-of-hooks\nSwiper.use([Autoplay, A11y, Pagination]);\n\nexport const SliderBlock = ({\n animated,\n title,\n description,\n type,\n anchorId,\n arrows = true,\n adaptive,\n autoplay: autoplayMs,\n dots = true,\n initialSlide = 0,\n className,\n dotsClassName,\n disclaimer,\n children,\n blockClassName,\n arrowSize,\n slidesToShow,\n onSlideChange,\n onSlideChangeTransitionStart,\n onSlideChangeTransitionEnd,\n onActiveIndexChange,\n onBreakpoint,\n}: React.PropsWithChildren<SliderProps>) => {\n const {\n autoplay,\n isLocked,\n childrenCount,\n breakpoints,\n onSwiper,\n onImagesReady,\n onPrev,\n onNext,\n setIsLocked,\n } = useSlider({\n slidesToShow,\n children,\n type,\n autoplayMs,\n });\n\n const isA11yControlHidden = Boolean(autoplay);\n const controlTabIndex = isA11yControlHidden ? -1 : 0;\n\n const paginationProps = useSliderPagination({\n enabled: dots,\n isA11yControlHidden,\n controlTabIndex,\n bulletClass: b('dot', dotsClassName),\n bulletActiveClass: b('dot_active'),\n paginationLabel: i18n('pagination-label'),\n });\n\n return (\n <div\n className={b(\n {\n 'one-slide': childrenCount === 1,\n 'only-arrows':\n (!title || (typeof title !== 'string' && !title?.text)) &&\n !description &&\n arrows,\n 'without-dots': !dots || isLocked,\n type,\n },\n blockClassName,\n )}\n >\n {anchorId && <Anchor id={anchorId} />}\n <Title\n title={title}\n subtitle={description}\n className={b('header', {'no-description': !description})}\n />\n <AnimateBlock className={b('animate-slides')} animate={animated}>\n <SwiperReact\n className={b('slider', className)}\n onSwiper={onSwiper}\n speed={1000}\n autoplay={autoplay}\n autoHeight={adaptive}\n initialSlide={initialSlide}\n noSwiping={false}\n breakpoints={breakpoints}\n onSlideChange={onSlideChange}\n onSlideChangeTransitionStart={onSlideChangeTransitionStart}\n onSlideChangeTransitionEnd={onSlideChangeTransitionEnd}\n onActiveIndexChange={onActiveIndexChange}\n onBreakpoint={onBreakpoint}\n onLock={() => setIsLocked(true)}\n onUnlock={() => setIsLocked(false)}\n onImagesReady={onImagesReady}\n watchSlidesVisibility\n watchOverflow\n a11y={{\n slideLabelMessage: '',\n paginationBulletMessage: i18n('dot-label', {index: '{{index}}'}),\n }}\n {...paginationProps}\n >\n {React.Children.map(children, (elem, index) => (\n <SwiperSlide className={b('slide')} key={index}>\n {({isVisible}) => (\n <div\n className={b('slide-item')}\n aria-hidden={!isA11yControlHidden && !isVisible}\n >\n {elem}\n </div>\n )}\n </SwiperSlide>\n ))}\n </SwiperReact>\n {arrows && !isLocked && (\n <React.Fragment>\n <div aria-hidden={isA11yControlHidden}>\n <Arrow\n className={b('arrow', {prev: true})}\n type=\"left\"\n transparent={type === SliderType.HeaderCard}\n onClick={onPrev}\n size={arrowSize}\n extraProps={{tabIndex: controlTabIndex}}\n />\n <Arrow\n className={b('arrow', {next: true})}\n type=\"right\"\n transparent={type === SliderType.HeaderCard}\n onClick={onNext}\n size={arrowSize}\n extraProps={{tabIndex: controlTabIndex}}\n />\n </div>\n </React.Fragment>\n )}\n <div className={b('footer')}>\n {disclaimer ? (\n <div className={b('disclaimer', {size: disclaimer?.size || 'm'})}>\n {disclaimer?.text}\n </div>\n ) : null}\n </div>\n </AnimateBlock>\n </div>\n );\n};\n\nexport default SliderBlock;\n"]}
|
|
1
|
+
{"version":3,"file":"Slider.js","sourceRoot":"../../../../src","sources":["blocks/Slider/Slider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,YAAY,CAAC;AACpB,OAAO,iBAAiB,CAAC;AACzB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAC,MAAM,IAAI,WAAW,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAEhE,OAAO,MAAM,0CAAuC;AACpD,OAAO,YAAY,sDAAmD;AACtE,OAAO,KAAK,wCAAqC;AACjD,OAAO,EAAuD,UAAU,EAAC,8BAAqB;AAC9F,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,KAAK,yBAAsB;AAClC,OAAO,EAAC,IAAI,EAAC,wBAAe;AAC5B,OAAO,EAAC,SAAS,EAAC,uBAAoB;AACtC,OAAO,EAAC,mBAAmB,EAAC,iCAA8B;AAE1D,OAAO,cAAc,CAAC;AAItB,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAwB/B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EACxB,QAAQ,EACR,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,MAAM,GAAG,IAAI,EACb,QAAQ,EACR,QAAQ,EAAE,UAAU,EACpB,IAAI,GAAG,IAAI,EACX,YAAY,GAAG,CAAC,EAChB,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,EACR,cAAc,EACd,SAAS,EACT,YAAY,EACZ,aAAa,EACb,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,YAAY,GACuB,EAAE,EAAE;IACvC,MAAM,EAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,QA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,KAAK,UAAU,CAAC,UAAU,EAC3C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,EAAC,QAAQ,EAAE,eAAe,EAAC,GACzC,EACF,KAAC,KAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,EACnC,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE,IAAI,KAAK,UAAU,CAAC,UAAU,EAC3C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,EAAC,QAAQ,EAAE,eAAe,EAAC,GACzC,IACA,GACO,CACpB,EACD,cAAK,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,YACtB,UAAU,CAAC,CAAC,CAAC,CACV,cAAK,SAAS,EAAE,CAAC,CAAC,YAAY,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,IAAI,GAAG,EAAC,CAAC,YAC3D,UAAU,EAAE,IAAI,GACf,CACT,CAAC,CAAC,CAAC,IAAI,GACN,IACK,IACb,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport 'swiper/css';\nimport 'swiper/css/a11y';\nimport 'swiper/css/pagination';\nimport {A11y, Autoplay, Pagination} from 'swiper/modules';\nimport {Swiper as SwiperReact, SwiperSlide} from 'swiper/react';\n\nimport Anchor from '../../components/Anchor/Anchor';\nimport AnimateBlock from '../../components/AnimateBlock/AnimateBlock';\nimport Title from '../../components/Title/Title';\nimport {ClassNameProps, Refable, SliderProps as SliderParams, SliderType} from '../../models';\nimport {block} from '../../utils';\n\nimport Arrow from './Arrow/Arrow';\nimport {i18n} from './i18n';\nimport {useSlider} from './useSlider';\nimport {useSliderPagination} from './useSliderPagination';\n\nimport './Slider.scss';\n\nexport type {Swiper, SwiperOptions} from 'swiper/types';\n\nconst b = block('SliderBlock');\n\nexport interface SliderProps\n extends Omit<SliderParams, 'children'>,\n Partial<\n Pick<\n React.ComponentProps<typeof SwiperReact>,\n | 'onSlideChange'\n | 'onSlideChangeTransitionStart'\n | 'onSlideChangeTransitionEnd'\n | 'onActiveIndexChange'\n | 'onBreakpoint'\n >\n >,\n Refable<HTMLDivElement>,\n ClassNameProps {\n type?: string;\n anchorId?: string;\n dotsClassName?: string;\n blockClassName?: string;\n arrowSize?: number;\n initialSlide?: number;\n}\n\nexport const SliderBlock = ({\n animated,\n title,\n description,\n type,\n anchorId,\n arrows = true,\n adaptive,\n autoplay: autoplayMs,\n dots = true,\n initialSlide = 0,\n className,\n dotsClassName,\n disclaimer,\n children,\n blockClassName,\n arrowSize,\n slidesToShow,\n onSlideChange,\n onSlideChangeTransitionStart,\n onSlideChangeTransitionEnd,\n onActiveIndexChange,\n onBreakpoint,\n}: React.PropsWithChildren<SliderProps>) => {\n const {autoplay, isLocked, childrenCount, breakpoints, onSwiper, onPrev, onNext, setIsLocked} =\n useSlider({\n slidesToShow,\n children,\n type,\n autoplayMs,\n });\n\n const isA11yControlHidden = Boolean(autoplay);\n const controlTabIndex = isA11yControlHidden ? -1 : 0;\n\n const paginationProps = useSliderPagination({\n enabled: dots,\n isA11yControlHidden,\n controlTabIndex,\n bulletClass: b('dot', dotsClassName),\n bulletActiveClass: b('dot_active'),\n paginationLabel: i18n('pagination-label'),\n });\n\n return (\n <div\n className={b(\n {\n 'one-slide': childrenCount === 1,\n 'only-arrows':\n (!title || (typeof title !== 'string' && !title?.text)) &&\n !description &&\n arrows,\n 'without-dots': !dots || isLocked,\n type,\n },\n blockClassName,\n )}\n >\n {anchorId && <Anchor id={anchorId} />}\n <Title\n title={title}\n subtitle={description}\n className={b('header', {'no-description': !description})}\n />\n <AnimateBlock className={b('animate-slides')} animate={animated}>\n <SwiperReact\n modules={[Autoplay, A11y, Pagination]}\n className={b('slider', className)}\n onSwiper={onSwiper}\n speed={1000}\n autoplay={autoplay}\n autoHeight={adaptive}\n initialSlide={initialSlide}\n noSwiping={false}\n breakpoints={breakpoints}\n onSlideChange={onSlideChange}\n onSlideChangeTransitionStart={onSlideChangeTransitionStart}\n onSlideChangeTransitionEnd={onSlideChangeTransitionEnd}\n onActiveIndexChange={onActiveIndexChange}\n onBreakpoint={onBreakpoint}\n onLock={() => setIsLocked(true)}\n onUnlock={() => setIsLocked(false)}\n watchOverflow\n watchSlidesProgress\n a11y={{\n slideLabelMessage: '',\n paginationBulletMessage: i18n('dot-label', {index: '{{index}}'}),\n }}\n {...paginationProps}\n >\n {React.Children.map(children, (elem, index) => (\n <SwiperSlide className={b('slide')} key={index}>\n {({isVisible}) => (\n <div\n className={b('slide-item')}\n aria-hidden={!isA11yControlHidden && !isVisible}\n >\n {elem}\n </div>\n )}\n </SwiperSlide>\n ))}\n </SwiperReact>\n {arrows && !isLocked && (\n <React.Fragment>\n <div aria-hidden={isA11yControlHidden}>\n <Arrow\n className={b('arrow', {prev: true})}\n type=\"left\"\n transparent={type === SliderType.HeaderCard}\n onClick={onPrev}\n size={arrowSize}\n extraProps={{tabIndex: controlTabIndex}}\n />\n <Arrow\n className={b('arrow', {next: true})}\n type=\"right\"\n transparent={type === SliderType.HeaderCard}\n onClick={onNext}\n size={arrowSize}\n extraProps={{tabIndex: controlTabIndex}}\n />\n </div>\n </React.Fragment>\n )}\n <div className={b('footer')}>\n {disclaimer ? (\n <div className={b('disclaimer', {size: disclaimer?.size || 'm'})}>\n {disclaimer?.text}\n </div>\n ) : null}\n </div>\n </AnimateBlock>\n </div>\n );\n};\n\nexport default SliderBlock;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Swiper } from 'swiper
|
|
2
|
+
import type { Swiper } from 'swiper';
|
|
3
3
|
import { SlidesToShow } from "../../models/index.js";
|
|
4
4
|
type UseSliderProps = React.PropsWithChildren<{
|
|
5
5
|
autoplayMs?: number;
|
|
@@ -11,8 +11,7 @@ export declare const useSlider: ({ children, autoplayMs, type, ...props }: UseSl
|
|
|
11
11
|
onSwiper: React.Dispatch<React.SetStateAction<Swiper | undefined>>;
|
|
12
12
|
onNext: () => void;
|
|
13
13
|
onPrev: () => void;
|
|
14
|
-
|
|
15
|
-
breakpoints: Record<number, import("swiper").SwiperOptions>;
|
|
14
|
+
breakpoints: Record<number, import("swiper/types").SwiperOptions>;
|
|
16
15
|
childrenCount: number;
|
|
17
16
|
isLocked: boolean;
|
|
18
17
|
setIsLocked: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -34,18 +34,15 @@ export const useSlider = ({ children, autoplayMs, type, ...props }) => {
|
|
|
34
34
|
}
|
|
35
35
|
slider.slidePrev();
|
|
36
36
|
};
|
|
37
|
-
const handleImagesReady = React.useCallback((localSlider) => {
|
|
38
|
-
setTimeout(() => localSlider.update(), 100);
|
|
39
|
-
}, []);
|
|
40
37
|
React.useEffect(() => {
|
|
41
|
-
if (!slider) {
|
|
38
|
+
if (!slider || !slider.autoplay) {
|
|
42
39
|
return;
|
|
43
40
|
}
|
|
44
41
|
if (autoplayEnabled) {
|
|
45
|
-
slider
|
|
42
|
+
slider?.autoplay?.start();
|
|
46
43
|
}
|
|
47
44
|
else {
|
|
48
|
-
slider
|
|
45
|
+
slider?.autoplay?.stop();
|
|
49
46
|
}
|
|
50
47
|
}, [slider, autoplayEnabled]);
|
|
51
48
|
return {
|
|
@@ -53,7 +50,6 @@ export const useSlider = ({ children, autoplayMs, type, ...props }) => {
|
|
|
53
50
|
onSwiper: setSlider,
|
|
54
51
|
onNext: handleNext,
|
|
55
52
|
onPrev: handlePrev,
|
|
56
|
-
onImagesReady: handleImagesReady,
|
|
57
53
|
breakpoints,
|
|
58
54
|
childrenCount,
|
|
59
55
|
isLocked,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSlider.js","sourceRoot":"../../../../src","sources":["blocks/Slider/useSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAC,UAAU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swiper} from 'swiper';\n\nimport {SliderType, SlidesToShow} from '../../models';\n\nimport {getSliderResponsiveParams, useMemoized} from './utils';\n\ntype UseSliderProps = React.PropsWithChildren<{\n autoplayMs?: number;\n type?: string;\n slidesToShow?: SlidesToShow;\n}>;\n\nexport const useSlider = ({children, autoplayMs, type, ...props}: UseSliderProps) => {\n const [slider, setSlider] = React.useState<Swiper>();\n const [isLocked, setIsLocked] = React.useState(false);\n const slidesToShow = useMemoized(props.slidesToShow);\n\n const childrenCount = React.Children.count(children);\n\n const autoplayEnabled = autoplayMs !== undefined && autoplayMs > 0;\n\n const breakpoints = React.useMemo(() => {\n return getSliderResponsiveParams({\n contentLength: childrenCount,\n slidesToShow,\n mobileFullscreen: Boolean(\n type && Object.values(SliderType).includes(type as SliderType),\n ),\n });\n }, [slidesToShow, type, childrenCount]);\n\n const handleNext = () => {\n if (!slider) {\n return;\n }\n\n if (slider.isEnd) {\n slider.slideTo(0);\n return;\n }\n\n slider.slideNext();\n };\n\n const handlePrev = () => {\n if (!slider) {\n return;\n }\n\n if (slider.isBeginning) {\n slider.slideTo(childrenCount - 1);\n return;\n }\n\n slider.slidePrev();\n };\n\n React.useEffect(() => {\n if (!slider || !slider.autoplay) {\n return;\n }\n\n if (autoplayEnabled) {\n slider?.autoplay?.start();\n } else {\n slider?.autoplay?.stop();\n }\n }, [slider, autoplayEnabled]);\n\n return {\n slider,\n onSwiper: setSlider,\n onNext: handleNext,\n onPrev: handlePrev,\n breakpoints,\n childrenCount,\n isLocked,\n setIsLocked,\n autoplay: autoplayEnabled && {\n delay: autoplayMs,\n disableOnInteraction: false,\n },\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSliderPagination.js","sourceRoot":"../../../../src","sources":["blocks/Slider/useSliderPagination.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,oBAAoB,EAAC,mBAAgB;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAOnC,EAAsE,EAAE;IACrE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,EAAC,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAAC,GACzF,KAAK,CAAC;IAEV,OAAO;QACH,UAAU,EAAE;YACR,SAAS,EAAE,IAAI;YACf,WAAW;YACX,iBAAiB;SACpB;QACD,kBAAkB,EAAE,CAAC,MAAM,EAAE,EAAE;YAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAExC,oBAAoB,CAAC,UAAU,EAAE;gBAC7B,IAAI,EAAE,MAAM;gBACZ,aAAa,EAAE,mBAAmB;gBAClC,YAAY,EAAE,eAAe;aAChC,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;YAE/D,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACvB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;gBAE9D,oBAAoB,CAAC,MAAM,EAAE;oBACzB,IAAI,EAAE,eAAe;oBACrB,aAAa,EAAE,mBAAmB;oBAClC,cAAc,EAAE,QAAQ;oBACxB,QAAQ,EAAE,eAAe;iBAC5B,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useSliderPagination.js","sourceRoot":"../../../../src","sources":["blocks/Slider/useSliderPagination.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,oBAAoB,EAAC,mBAAgB;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAOnC,EAAsE,EAAE;IACrE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,EAAC,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAAC,GACzF,KAAK,CAAC;IAEV,OAAO;QACH,UAAU,EAAE;YACR,SAAS,EAAE,IAAI;YACf,WAAW;YACX,iBAAiB;SACpB;QACD,kBAAkB,EAAE,CAAC,MAAM,EAAE,EAAE;YAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAExC,oBAAoB,CAAC,UAAU,EAAE;gBAC7B,IAAI,EAAE,MAAM;gBACZ,aAAa,EAAE,mBAAmB;gBAClC,YAAY,EAAE,eAAe;aAChC,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;YAE/D,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACvB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;gBAE9D,oBAAoB,CAAC,MAAM,EAAE;oBACzB,IAAI,EAAE,eAAe;oBACrB,aAAa,EAAE,mBAAmB;oBAClC,cAAc,EAAE,QAAQ;oBACxB,QAAQ,EAAE,eAAe;iBAC5B,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type {SwiperProps} from 'swiper/react';\n\nimport {setElementAtrributes} from './utils';\n\nexport const useSliderPagination = (props: {\n enabled: boolean;\n isA11yControlHidden: boolean;\n controlTabIndex: number;\n bulletClass: string;\n bulletActiveClass: string;\n paginationLabel: string;\n}): Pick<SwiperProps, 'pagination' | 'onPaginationUpdate'> | undefined => {\n if (!props.enabled) {\n return undefined;\n }\n\n const {isA11yControlHidden, controlTabIndex, bulletClass, bulletActiveClass, paginationLabel} =\n props;\n\n return {\n pagination: {\n clickable: true,\n bulletClass,\n bulletActiveClass,\n },\n onPaginationUpdate: (slider) => {\n const pagination = slider.pagination.el;\n\n setElementAtrributes(pagination, {\n role: 'menu',\n 'aria-hidden': isA11yControlHidden,\n 'aria-label': paginationLabel,\n });\n\n const bullets = pagination.querySelectorAll(`.${bulletClass}`);\n\n bullets.forEach((bullet) => {\n const isActive = bullet.classList.contains(bulletActiveClass);\n\n setElementAtrributes(bullet, {\n role: 'menuitemradio',\n 'aria-hidden': isA11yControlHidden,\n 'aria-checked': isActive,\n tabindex: controlTabIndex,\n });\n });\n },\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"../../../../src","sources":["blocks/Slider/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,OAAO,0BAAuB;AACrC,OAAO,MAAM,yBAAsB;AAGnC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,OAAO,EAAC,qBAAqB,EAAuC,oBAAiB;AAErF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7B,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7B,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7B,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,IAAI;CACnC,CAAC;AAQF,MAAM,UAAU,yBAAyB,CAAC,EACtC,aAAa,EACb,YAAY,EACZ,gBAAgB,GACI;IACpB,IAAI,MAAM,CAAC;IAEX,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,MAAM,CAClD,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,YAAY,EAAC,CAAC,EACnE,EAA4B,CAC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EAAE,EAAE,CAC1F,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,CACtD,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CACjD,CAAC","sourcesContent":["import * as React from 'react';\n\nimport isEqual from 'lodash/isEqual';\nimport pickBy from 'lodash/pickBy';\nimport type {SwiperOptions} from 'swiper/types
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"../../../../src","sources":["blocks/Slider/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,OAAO,0BAAuB;AACrC,OAAO,MAAM,yBAAsB;AAGnC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,OAAO,EAAC,qBAAqB,EAAuC,oBAAiB;AAErF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7B,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7B,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7B,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,IAAI;CACnC,CAAC;AAQF,MAAM,UAAU,yBAAyB,CAAC,EACtC,aAAa,EACb,YAAY,EACZ,gBAAgB,GACI;IACpB,IAAI,MAAM,CAAC;IAEX,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,MAAM,CAClD,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,YAAY,EAAC,CAAC,EACnE,EAA4B,CAC/B,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,MAAM,GAAG,YAAY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CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,CACtD,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CACjD,CAAC","sourcesContent":["import * as React from 'react';\n\nimport isEqual from 'lodash/isEqual';\nimport pickBy from 'lodash/pickBy';\nimport type {SwiperOptions} from 'swiper/types';\n\nimport {BREAKPOINTS} from '../../constants';\n\nimport {SliderBreakpointNames, SliderBreakpointParams, SlidesToShow} from './models';\n\nexport const DEFAULT_SLIDE_BREAKPOINTS = {\n [SliderBreakpointNames.Lg]: 3,\n [SliderBreakpointNames.Md]: 2,\n [SliderBreakpointNames.Sm]: 2,\n [SliderBreakpointNames.Xs]: 1.15,\n};\n\nexport interface GetSlidesToShowParams {\n contentLength: number;\n slidesToShow?: SlidesToShow;\n mobileFullscreen?: boolean;\n}\n\nexport function getSliderResponsiveParams({\n contentLength,\n slidesToShow,\n mobileFullscreen,\n}: GetSlidesToShowParams) {\n let result;\n\n if (typeof slidesToShow === 'number') {\n result = Object.keys(DEFAULT_SLIDE_BREAKPOINTS).reduce(\n (acc, breakpointName) => ({...acc, [breakpointName]: slidesToShow}),\n {} as SliderBreakpointParams,\n );\n } else {\n result = slidesToShow || DEFAULT_SLIDE_BREAKPOINTS;\n }\n\n const showCount = {\n ...DEFAULT_SLIDE_BREAKPOINTS,\n ...pickBy(result, (value) => !isNaN(value)),\n xs: !mobileFullscreen && contentLength > 1 ? DEFAULT_SLIDE_BREAKPOINTS.xs : 1,\n };\n\n return Object.entries(showCount).reduce(\n (res, [breakpointName, value]) => {\n // eslint-disable-next-line no-param-reassign\n res[BREAKPOINTS[breakpointName as SliderBreakpointNames] + 1] = {\n slidesPerView: value,\n };\n return res;\n },\n {} as Record<number, SwiperOptions>,\n );\n}\n\nexport const useMemoized = <T>(value: T): T => {\n const [memoizedValue, setMemoizedValue] = React.useState(value);\n\n React.useEffect(() => {\n setMemoizedValue((memoized) =>\n value && typeof value === 'object' && isEqual(memoized, value) ? memoized : value,\n );\n }, [value]);\n\n return memoizedValue;\n};\n\nexport const setElementAtrributes = (element: Element, attributes: Record<string, unknown>) =>\n Object.entries(attributes).forEach(([attribute, value]) =>\n element.setAttribute(attribute, String(value)),\n );\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.1",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"react-waypoint": "^10.1.0",
|
|
117
117
|
"sanitize-html": "2.12.1",
|
|
118
118
|
"snakecase-keys": "^5.1.0",
|
|
119
|
-
"swiper": "^
|
|
119
|
+
"swiper": "^10.2.0",
|
|
120
120
|
"typograf": "^7.4.1",
|
|
121
121
|
"utility-types": "^3.10.0",
|
|
122
122
|
"uuid": "^9.0.0"
|
|
@@ -170,9 +170,11 @@
|
|
|
170
170
|
"@types/webpack-env": "^1.18.1",
|
|
171
171
|
"@types/youtube-player": "^5.5.11",
|
|
172
172
|
"autoprefixer": "^10.4.14",
|
|
173
|
+
"babel-jest": "^30.2.0",
|
|
173
174
|
"babel-loader": "^8.3.0",
|
|
174
175
|
"css-loader": "^5.2.7",
|
|
175
176
|
"es5-ext": "0.10.53",
|
|
177
|
+
"esbuild": "^0.25.11",
|
|
176
178
|
"eslint": "^8.57.1",
|
|
177
179
|
"eslint-plugin-no-not-accumulator-reassign": "^0.1.0",
|
|
178
180
|
"eslint-plugin-react": "^7.37.4",
|
package/widget/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[
|
|
1
|
+
export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[6007],{56007:function(_,t,e){_.exports=function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var e=t(_),Y={name:\"zh\",weekdays:\"星期日_星期一_星期二_星期三_星期四_星期五_星期六\".split(\"_\"),weekdaysShort:\"周日_周一_周二_周三_周四_周五_周六\".split(\"_\"),weekdaysMin:\"日_一_二_三_四_五_六\".split(\"_\"),months:\"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),ordinal:function(_,t){return\"W\"===t?_+\"周\":_+\"日\"},weekStart:1,yearStart:4,formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日Ah点mm分\",LLLL:\"YYYY年M月D日ddddAh点mm分\",l:\"YYYY/M/D\",ll:\"YYYY年M月D日\",lll:\"YYYY年M月D日 HH:mm\",llll:\"YYYY年M月D日dddd HH:mm\"},relativeTime:{future:\"%s后\",past:\"%s前\",s:\"几秒\",m:\"1 分钟\",mm:\"%d 分钟\",h:\"1 小时\",hh:\"%d 小时\",d:\"1 天\",dd:\"%d 天\",M:\"1 个月\",MM:\"%d 个月\",y:\"1 年\",yy:\"%d 年\"},meridiem:function(_,t){var e=100*_+t;return e<600?\"凌晨\":e<900?\"早上\":e<1100?\"上午\":e<1300?\"中午\":e<1800?\"下午\":\"晚上\"}};return e.default.locale(Y,null,!0),Y}(e(74353))}}]);";
|