@gravity-ui/page-constructor 6.9.1 → 6.10.0
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/CardLayout/schema.d.ts +76 -0
- package/build/cjs/blocks/ContentLayout/schema.d.ts +76 -0
- package/build/cjs/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/cjs/components/BackgroundImage/BackgroundImage.js.map +1 -1
- package/build/cjs/components/Image/Image.d.ts +4 -2
- package/build/cjs/components/Image/Image.js +22 -8
- package/build/cjs/components/Image/Image.js.map +1 -1
- package/build/cjs/components/Image/schema.d.ts +95 -0
- package/build/cjs/components/Image/schema.js +15 -0
- package/build/cjs/components/Image/schema.js.map +1 -1
- package/build/cjs/models/constructor-items/common.d.ts +13 -6
- package/build/cjs/models/constructor-items/common.js +8 -1
- package/build/cjs/models/constructor-items/common.js.map +1 -1
- package/build/cjs/schema/constants.d.ts +19 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +19 -0
- package/build/esm/blocks/CardLayout/schema.d.ts +76 -0
- package/build/esm/blocks/ContentLayout/schema.d.ts +76 -0
- package/build/esm/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/esm/components/BackgroundImage/BackgroundImage.js.map +1 -1
- package/build/esm/components/Image/Image.d.ts +4 -2
- package/build/esm/components/Image/Image.js +21 -8
- package/build/esm/components/Image/Image.js.map +1 -1
- package/build/esm/components/Image/schema.d.ts +95 -0
- package/build/esm/components/Image/schema.js +15 -0
- package/build/esm/components/Image/schema.js.map +1 -1
- package/build/esm/models/constructor-items/common.d.ts +13 -6
- package/build/esm/models/constructor-items/common.js +7 -0
- package/build/esm/models/constructor-items/common.js.map +1 -1
- package/build/esm/schema/constants.d.ts +19 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +19 -0
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/common.d.ts +13 -6
- package/server/models/constructor-items/common.js +8 -1
- package/widget/index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"../../../../src","sources":["models/constructor-items/common.ts"],"names":[],"mappings":";;;AAOA,QAAQ;AACR,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACjB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,+CAA2B,CAAA;IAC3B,yCAAqB,CAAA;AACzB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;AACf,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACjB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,iCAAa,CAAA;IACb,iCAAa,CAAA;AACjB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,yDAAmC,CAAA;IACnC,oEAA8C,CAAA;AAClD,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACvC,gDAAa,CAAA;IACb,kDAAe,CAAA;IACf,oDAAiB,CAAA;AACrB,CAAC,EAJW,+BAA+B,+CAA/B,+BAA+B,QAI1C;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;AACrB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,6CAAmB,CAAA;IACnB,2CAAiB,CAAA;AACrB,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,gCAAmB,CAAA;IACnB,6CAAgC,CAAA;AACpC,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB","sourcesContent":["import * as React from 'react';\n\nimport {ButtonView, ButtonProps as UikitButtonProps} from '@gravity-ui/uikit';\n\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase, AnalyticsEventsProp, ClassNameProps, QAProps} from '../common';\n\n// enums\nexport enum AuthorType {\n Column = 'column',\n Line = 'line',\n}\n\nexport enum PriceDetailsType {\n MARKED_LIST = 'marked-list',\n SETTINGS = 'settings',\n}\n\nexport enum PriceLabelColor {\n BLUE = 'blue',\n GREEN = 'green',\n YELLOW = 'yellow',\n PURPLE = 'purple',\n RED = 'red',\n}\n\nexport enum PlayButtonType {\n Default = 'default',\n Text = 'text',\n}\n\nexport enum PlayButtonThemes {\n Blue = 'blue',\n Grey = 'grey',\n}\n\nexport enum CustomControlsType {\n WithMuteButton = 'with-mute-button',\n WithPlayPauseButton = 'with-play-pause-button',\n}\n\nexport enum CustomControlsButtonPositioning {\n Left = 'left',\n Right = 'right',\n Center = 'center',\n}\n\nexport enum MediaVideoType {\n Default = 'default',\n Player = 'player',\n}\n\nexport enum MediaVideoControlsType {\n Default = 'default',\n Custom = 'custom',\n}\n\nexport enum QuoteType {\n Chevron = 'chevron', // « »\n EnglishDouble = 'english-double', // “ ”\n}\n\n// types\nexport type TextTheme = 'light' | 'dark';\nexport type TextSize = 'xs' | 's' | 'sm' | 'm' | 'l';\nexport type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';\nexport type HeaderWidth = 's' | 'm' | 'l';\nexport type HeaderImageSize = 's' | 'm';\nexport type HeaderOffset = 'default' | 'large';\nexport type Justify = 'start' | 'center' | 'end';\nexport type ColumnsCount = 1 | 2 | 3 | 4;\nexport type LegendTableMarkerType = 'disk' | 'tick';\nexport type LinkTheme = 'file-link' | 'normal' | 'back' | 'underline';\nexport type MediaDirection = 'media-content' | 'content-media';\nexport type PriceDescriptionColor = 'cornflower' | 'black';\nexport type ContentSize = 's' | 'm' | 'l';\nexport type ContentTextSize = 's' | 'm' | 'l';\nexport type ContentTheme = 'default' | 'dark' | 'light';\nexport type FileLinkType = 'vertical' | 'horizontal';\nexport type ImageCardMargins = 's' | 'm';\nexport type LayoutItemContentMargin = 'm' | 'l';\n\n// modifiers\nexport interface Themable {\n theme?: TextTheme;\n}\n\nexport interface Justifyable {\n justify?: Justify;\n}\n\nexport interface Stylable {\n className?: string;\n}\n\nexport interface Animatable {\n animated?: boolean;\n}\n\nexport interface Tabbable {\n tabIndex?: number;\n}\n\nexport interface Roleable {\n role?: React.AriaRole;\n}\n\nexport interface AriaProps {\n ariaProps?: React.AriaAttributes;\n}\n\n//common props\nexport interface Background {\n image?: string;\n color?: string;\n}\n\nexport interface AnchorProps {\n text: string;\n url: string;\n}\n\n/**\n * @deprecated Component VideoBlock will be deleted, which uses this logic\n */\ninterface LoopProps {\n start: number;\n end?: number;\n}\n\n// images\n\nexport interface ImageInfoProps\n extends Pick<\n React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>,\n 'aria-describedby' | 'loading'\n > {\n alt?: string;\n fetchPriority?: 'high' | 'low' | 'auto';\n disableCompress?: boolean;\n}\n\nexport interface ImageObjectProps extends ImageInfoProps {\n src: string;\n}\n\nexport interface ImageDeviceProps extends ImageInfoProps {\n desktop: string;\n mobile: string;\n tablet?: string;\n}\n\nexport type ImageProps = string | ImageObjectProps | ImageDeviceProps;\nexport type ThemedImage = ThemeSupporting<ImageProps>;\n\nexport interface BackgroundImageProps\n extends React.HTMLProps<HTMLDivElement>,\n Partial<ImageDeviceProps>,\n Partial<ImageObjectProps>,\n QAProps {\n style?: React.CSSProperties;\n imageClassName?: string;\n hide?: boolean;\n}\n\n//components props\nexport interface MediaVideoProps extends AnalyticsEventsBase {\n src: string[];\n type?: MediaVideoType;\n loop?: LoopProps | boolean;\n muted?: boolean;\n autoplay?: boolean;\n elapsedTime?: number;\n playButton?: PlayButtonProps;\n controls?: MediaVideoControlsType;\n customControlsOptions?: CustomControlsOptions;\n ariaLabel?: string;\n contain?: boolean;\n}\n\n// links\nexport interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {\n url: string;\n urlTitle?: string;\n text?: string;\n textSize?: TextSize;\n theme?: LinkTheme;\n colorTheme?: TextTheme;\n arrow?: boolean;\n target?: string;\n extraProps?: React.HTMLProps<HTMLAnchorElement>;\n}\n\nexport interface FileLinkProps extends ClassNameProps, Tabbable {\n href: string;\n text: React.ReactNode;\n type?: FileLinkType;\n textSize?: TextSize;\n theme?: ContentTheme;\n urlTitle?: string;\n onClick?: () => void;\n extraProps?: React.HTMLProps<HTMLAnchorElement>;\n}\n\n// buttons\nexport type ButtonTheme =\n | ButtonView\n | 'github'\n | 'app-store'\n | 'google-play'\n | 'scale'\n | 'monochrome';\n\nexport interface ButtonProps\n extends AnalyticsEventsBase,\n Pick<UikitButtonProps, 'size' | 'width' | 'extraProps'> {\n text: string;\n url: string;\n urlTitle?: string;\n primary?: boolean;\n theme?: ButtonTheme;\n img?: ButtonImageProps | string;\n target?: string;\n}\n\nexport type ButtonImagePosition = 'left' | 'right';\n\nexport interface ButtonImageProps {\n url: string;\n position?: ButtonImagePosition;\n alt?: string;\n}\n\nexport interface CustomControlsOptions {\n type?: CustomControlsType;\n muteButtonShown?: boolean;\n positioning?: CustomControlsButtonPositioning;\n}\n\nexport interface PlayButtonProps extends ClassNameProps {\n type?: PlayButtonType;\n theme?: PlayButtonThemes;\n text?: string;\n}\n\nexport type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;\n\nexport interface MediaComponentVideoProps extends AnalyticsEventsBase {\n video: MediaVideoProps;\n height?: number;\n ratio?: number | 'auto';\n previewImg?: string;\n}\n\nexport interface MediaComponentVideoIframeProps {\n videoIframe: string;\n}\n\nexport interface MediaComponentYoutubeProps {\n youtube: string;\n previewImg?: string;\n fullscreen?: boolean;\n}\n\nexport interface MediaComponentImageProps {\n image: ImageProps | ImageProps[] | ImageDeviceProps;\n video?: MediaVideoProps;\n parallax?: boolean;\n height?: number;\n disableImageSliderForArrayInput?: boolean;\n}\n\nexport interface MediaComponentDataLensProps {\n dataLens: DataLensProps;\n}\n\nexport interface MediaComponentIframeProps {\n iframe: IframeProps;\n margins?: boolean;\n}\n\nexport interface MediaProps\n extends Animatable,\n Partial<MediaComponentDataLensProps>,\n Partial<MediaComponentYoutubeProps>,\n Partial<MediaComponentVideoIframeProps>,\n Partial<MediaComponentImageProps>,\n Partial<MediaComponentIframeProps>,\n Partial<MediaComponentVideoProps> {\n color?: string;\n videoMicrodata?: {\n name?: string;\n description?: string;\n duration?: string;\n uploadDate?: string;\n contentUrl?: string;\n thumbnailUrl?: string;\n };\n}\n\nexport interface BackgroundMediaProps extends MediaProps, Animatable, QAProps {\n fullWidthMedia?: boolean;\n className?: string;\n mediaClassName?: string;\n}\n\nexport type Coordinate = number[];\n\nexport interface MapBaseProps {\n zoom?: number;\n className?: string;\n}\n\nexport interface GMapProps extends MapBaseProps {\n address: string;\n}\n\nexport interface YMapProps extends MapBaseProps {\n markers: YMapMarker[];\n id: string;\n}\n\nexport interface YMapMarker {\n address?: string;\n coordinate?: Coordinate;\n label?: YMapMarkerLabel;\n}\n\nexport interface YMapMarkerLabel {\n iconCaption?: string;\n iconContent?: string;\n iconColor?: string;\n preset?: string;\n}\n\nexport type MapProps = GMapProps | YMapProps;\n\nexport type ThemedMediaProps = ThemeSupporting<MediaProps>;\n\nexport interface DataLensObjectProps {\n id: string;\n theme: 'dark' | 'light';\n}\n\nexport interface IframeProps {\n src: string;\n width?: number;\n height?: number;\n title?: string;\n name?: string;\n}\n\nexport type DataLensProps = string | DataLensObjectProps;\n\nexport interface AuthorItem {\n firstName: string;\n secondName: string;\n description?: string;\n avatar?: ThemeSupporting<ImageProps> | JSX.Element;\n}\n\nexport interface HeaderBreadCrumbsProps extends ClassNameProps {\n items: {\n url: string;\n text: React.ReactNode;\n }[];\n theme?: TextTheme;\n analyticsEvents?: AnalyticsEventsProp;\n}\n\nexport interface TitleItemProps extends Justifyable, TitleItemBaseProps {\n navTitle?: string;\n anchor?: string;\n}\n\nexport interface TitleItemBaseProps {\n text: string;\n textSize?: TextSize;\n url?: string;\n urlTitle?: string;\n custom?: string | React.ReactNode;\n onClick?: () => void;\n}\n\nexport type MediaView = 'fit' | 'full';\n\n// card\nexport type MediaBorder = 'shadow' | 'line' | 'none';\nexport type CardBorder = MediaBorder;\nexport type ControlPosition = 'content' | 'footer';\n\nexport interface CardBaseProps {\n border?: CardBorder;\n}\n\nexport type CardLayoutProps = {\n controlPosition?: ControlPosition;\n};\n\n//price\nexport interface PriceDescriptionProps {\n title: string;\n detailedTitle?: string;\n description: string;\n label?: {\n color: PriceLabelColor;\n text?: string;\n size?: TextSize;\n };\n}\n\nexport interface PriceDetailsSettingsProps {\n title: string;\n description: string;\n}\n\nexport interface PriceDetailsListProps {\n text: string;\n}\n\nexport interface PriceDetailsProps {\n items?: PriceDetailsSettingsProps[] | PriceDetailsListProps[];\n}\n\nexport interface PriceItemProps\n extends PriceDetailsProps,\n PriceDescriptionProps,\n AnalyticsEventsBase {}\n\nexport interface PriceFoldableDetailsProps {\n title: string;\n size?: TextSize;\n titleColor?: PriceDescriptionColor;\n}\n\n/** @deprecated */\nexport interface PriceDetailedProps extends CardBaseProps {\n items: PriceItemProps[];\n description?: {\n titleSize?: TextSize;\n descriptionSize?: TextSize;\n titleColor?: PriceDescriptionColor;\n };\n details?: {\n titleSize?: TextSize;\n descriptionSize?: TextSize;\n };\n priceType?: PriceDetailsType;\n numberGroupItems?: 3 | 4 | 5;\n isCombined?: boolean;\n useMixedView?: boolean;\n foldable?: PriceFoldableDetailsProps;\n labelsDefaultText?: Record<PriceLabelColor, string>;\n}\n\nexport interface AuthorProps extends QAProps {\n author: AuthorItem;\n className?: string;\n authorContainerClassName?: string;\n type?: AuthorType;\n theme?: ContentTheme;\n}\n\nexport interface TitleProps {\n title?: TitleItemProps | string;\n subtitle?: string;\n}\n\nexport interface YandexFormProps extends AnalyticsEventsBase {\n id: number | string;\n containerId?: string;\n theme?: string;\n className?: string;\n headerHeight?: number;\n customFormOrigin?: string;\n customFormSection?: string;\n params?: {[key: string]: string};\n\n onSubmit?: () => void;\n onLoad?: () => void;\n}\n\nexport interface WithBorder {\n border?: MediaBorder;\n /**\n * @deprecated use custom class for media-component\n */\n disableShadow?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"../../../../src","sources":["models/constructor-items/common.ts"],"names":[],"mappings":";;;AAOA,QAAQ;AACR,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACjB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,+CAA2B,CAAA;IAC3B,yCAAqB,CAAA;AACzB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;AACf,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACjB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,iCAAa,CAAA;IACb,iCAAa,CAAA;AACjB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,yDAAmC,CAAA;IACnC,oEAA8C,CAAA;AAClD,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACvC,gDAAa,CAAA;IACb,kDAAe,CAAA;IACf,oDAAiB,CAAA;AACrB,CAAC,EAJW,+BAA+B,+CAA/B,+BAA+B,QAI1C;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;AACrB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,6CAAmB,CAAA;IACnB,2CAAiB,CAAA;AACrB,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,gCAAmB,CAAA;IACnB,6CAAgC,CAAA;AACpC,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAsED,SAAS;AAET,IAAY,MAIX;AAJD,WAAY,MAAM;IACd,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;AACrB,CAAC,EAJW,MAAM,sBAAN,MAAM,QAIjB","sourcesContent":["import * as React from 'react';\n\nimport {ButtonView, ButtonProps as UikitButtonProps} from '@gravity-ui/uikit';\n\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase, AnalyticsEventsProp, ClassNameProps, QAProps} from '../common';\n\n// enums\nexport enum AuthorType {\n Column = 'column',\n Line = 'line',\n}\n\nexport enum PriceDetailsType {\n MARKED_LIST = 'marked-list',\n SETTINGS = 'settings',\n}\n\nexport enum PriceLabelColor {\n BLUE = 'blue',\n GREEN = 'green',\n YELLOW = 'yellow',\n PURPLE = 'purple',\n RED = 'red',\n}\n\nexport enum PlayButtonType {\n Default = 'default',\n Text = 'text',\n}\n\nexport enum PlayButtonThemes {\n Blue = 'blue',\n Grey = 'grey',\n}\n\nexport enum CustomControlsType {\n WithMuteButton = 'with-mute-button',\n WithPlayPauseButton = 'with-play-pause-button',\n}\n\nexport enum CustomControlsButtonPositioning {\n Left = 'left',\n Right = 'right',\n Center = 'center',\n}\n\nexport enum MediaVideoType {\n Default = 'default',\n Player = 'player',\n}\n\nexport enum MediaVideoControlsType {\n Default = 'default',\n Custom = 'custom',\n}\n\nexport enum QuoteType {\n Chevron = 'chevron', // « »\n EnglishDouble = 'english-double', // “ ”\n}\n\n// types\nexport type TextTheme = 'light' | 'dark';\nexport type TextSize = 'xs' | 's' | 'sm' | 'm' | 'l';\nexport type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';\nexport type HeaderWidth = 's' | 'm' | 'l';\nexport type HeaderImageSize = 's' | 'm';\nexport type HeaderOffset = 'default' | 'large';\nexport type Justify = 'start' | 'center' | 'end';\nexport type ColumnsCount = 1 | 2 | 3 | 4;\nexport type LegendTableMarkerType = 'disk' | 'tick';\nexport type LinkTheme = 'file-link' | 'normal' | 'back' | 'underline';\nexport type MediaDirection = 'media-content' | 'content-media';\nexport type PriceDescriptionColor = 'cornflower' | 'black';\nexport type ContentSize = 's' | 'm' | 'l';\nexport type ContentTextSize = 's' | 'm' | 'l';\nexport type ContentTheme = 'default' | 'dark' | 'light';\nexport type FileLinkType = 'vertical' | 'horizontal';\nexport type ImageCardMargins = 's' | 'm';\nexport type LayoutItemContentMargin = 'm' | 'l';\n\n// modifiers\nexport interface Themable {\n theme?: TextTheme;\n}\n\nexport interface Justifyable {\n justify?: Justify;\n}\n\nexport interface Stylable {\n className?: string;\n}\n\nexport interface Animatable {\n animated?: boolean;\n}\n\nexport interface Tabbable {\n tabIndex?: number;\n}\n\nexport interface Roleable {\n role?: React.AriaRole;\n}\n\nexport interface AriaProps {\n ariaProps?: React.AriaAttributes;\n}\n\n//common props\nexport interface Background {\n image?: string;\n color?: string;\n}\n\nexport interface AnchorProps {\n text: string;\n url: string;\n}\n\n/**\n * @deprecated Component VideoBlock will be deleted, which uses this logic\n */\ninterface LoopProps {\n start: number;\n end?: number;\n}\n\n// images\n\nexport enum Device {\n Desktop = 'desktop',\n Mobile = 'mobile',\n Tablet = 'tablet',\n}\n\nexport interface ImageInfoProps\n extends Pick<\n React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>,\n 'aria-describedby' | 'loading'\n >,\n ImageDevicesVisibleProps {\n alt?: string;\n fetchPriority?: 'high' | 'low' | 'auto';\n disableCompress?: boolean;\n}\n\nexport interface ImageObjectProps extends ImageInfoProps {\n src: string;\n}\n\nexport interface ImageDeviceProps extends ImageInfoProps {\n [Device.Desktop]: string;\n [Device.Mobile]: string;\n [Device.Tablet]?: string;\n}\n\nexport interface ImageDevicesVisibleProps {\n hide?: boolean | Partial<Record<Device, boolean>>;\n}\n\nexport type ImageProps = string | ImageObjectProps | ImageDeviceProps;\nexport type ThemedImage = ThemeSupporting<ImageProps>;\n\nexport interface BackgroundImageProps\n extends React.HTMLProps<HTMLDivElement>,\n Partial<ImageDeviceProps>,\n Partial<ImageObjectProps>,\n QAProps,\n ImageDevicesVisibleProps {\n style?: React.CSSProperties;\n imageClassName?: string;\n}\n\n//components props\nexport interface MediaVideoProps extends AnalyticsEventsBase {\n src: string[];\n type?: MediaVideoType;\n loop?: LoopProps | boolean;\n muted?: boolean;\n autoplay?: boolean;\n elapsedTime?: number;\n playButton?: PlayButtonProps;\n controls?: MediaVideoControlsType;\n customControlsOptions?: CustomControlsOptions;\n ariaLabel?: string;\n contain?: boolean;\n}\n\n// links\nexport interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {\n url: string;\n urlTitle?: string;\n text?: string;\n textSize?: TextSize;\n theme?: LinkTheme;\n colorTheme?: TextTheme;\n arrow?: boolean;\n target?: string;\n extraProps?: React.HTMLProps<HTMLAnchorElement>;\n}\n\nexport interface FileLinkProps extends ClassNameProps, Tabbable {\n href: string;\n text: React.ReactNode;\n type?: FileLinkType;\n textSize?: TextSize;\n theme?: ContentTheme;\n urlTitle?: string;\n onClick?: () => void;\n extraProps?: React.HTMLProps<HTMLAnchorElement>;\n}\n\n// buttons\nexport type ButtonTheme =\n | ButtonView\n | 'github'\n | 'app-store'\n | 'google-play'\n | 'scale'\n | 'monochrome';\n\nexport interface ButtonProps\n extends AnalyticsEventsBase,\n Pick<UikitButtonProps, 'size' | 'width' | 'extraProps'> {\n text: string;\n url: string;\n urlTitle?: string;\n primary?: boolean;\n theme?: ButtonTheme;\n img?: ButtonImageProps | string;\n target?: string;\n}\n\nexport type ButtonImagePosition = 'left' | 'right';\n\nexport interface ButtonImageProps {\n url: string;\n position?: ButtonImagePosition;\n alt?: string;\n}\n\nexport interface CustomControlsOptions {\n type?: CustomControlsType;\n muteButtonShown?: boolean;\n positioning?: CustomControlsButtonPositioning;\n}\n\nexport interface PlayButtonProps extends ClassNameProps {\n type?: PlayButtonType;\n theme?: PlayButtonThemes;\n text?: string;\n}\n\nexport type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;\n\nexport interface MediaComponentVideoProps extends AnalyticsEventsBase {\n video: MediaVideoProps;\n height?: number;\n ratio?: number | 'auto';\n previewImg?: string;\n}\n\nexport interface MediaComponentVideoIframeProps {\n videoIframe: string;\n}\n\nexport interface MediaComponentYoutubeProps {\n youtube: string;\n previewImg?: string;\n fullscreen?: boolean;\n}\n\nexport interface MediaComponentImageProps {\n image: ImageProps | ImageProps[] | ImageDeviceProps;\n video?: MediaVideoProps;\n parallax?: boolean;\n height?: number;\n disableImageSliderForArrayInput?: boolean;\n}\n\nexport interface MediaComponentDataLensProps {\n dataLens: DataLensProps;\n}\n\nexport interface MediaComponentIframeProps {\n iframe: IframeProps;\n margins?: boolean;\n}\n\nexport interface MediaProps\n extends Animatable,\n Partial<MediaComponentDataLensProps>,\n Partial<MediaComponentYoutubeProps>,\n Partial<MediaComponentVideoIframeProps>,\n Partial<MediaComponentImageProps>,\n Partial<MediaComponentIframeProps>,\n Partial<MediaComponentVideoProps> {\n color?: string;\n videoMicrodata?: {\n name?: string;\n description?: string;\n duration?: string;\n uploadDate?: string;\n contentUrl?: string;\n thumbnailUrl?: string;\n };\n}\n\nexport interface BackgroundMediaProps extends MediaProps, Animatable, QAProps {\n fullWidthMedia?: boolean;\n className?: string;\n mediaClassName?: string;\n}\n\nexport type Coordinate = number[];\n\nexport interface MapBaseProps {\n zoom?: number;\n className?: string;\n}\n\nexport interface GMapProps extends MapBaseProps {\n address: string;\n}\n\nexport interface YMapProps extends MapBaseProps {\n markers: YMapMarker[];\n id: string;\n}\n\nexport interface YMapMarker {\n address?: string;\n coordinate?: Coordinate;\n label?: YMapMarkerLabel;\n}\n\nexport interface YMapMarkerLabel {\n iconCaption?: string;\n iconContent?: string;\n iconColor?: string;\n preset?: string;\n}\n\nexport type MapProps = GMapProps | YMapProps;\n\nexport type ThemedMediaProps = ThemeSupporting<MediaProps>;\n\nexport interface DataLensObjectProps {\n id: string;\n theme: 'dark' | 'light';\n}\n\nexport interface IframeProps {\n src: string;\n width?: number;\n height?: number;\n title?: string;\n name?: string;\n}\n\nexport type DataLensProps = string | DataLensObjectProps;\n\nexport interface AuthorItem {\n firstName: string;\n secondName: string;\n description?: string;\n avatar?: ThemeSupporting<ImageProps> | JSX.Element;\n}\n\nexport interface HeaderBreadCrumbsProps extends ClassNameProps {\n items: {\n url: string;\n text: React.ReactNode;\n }[];\n theme?: TextTheme;\n analyticsEvents?: AnalyticsEventsProp;\n}\n\nexport interface TitleItemProps extends Justifyable, TitleItemBaseProps {\n navTitle?: string;\n anchor?: string;\n}\n\nexport interface TitleItemBaseProps {\n text: string;\n textSize?: TextSize;\n url?: string;\n urlTitle?: string;\n custom?: string | React.ReactNode;\n onClick?: () => void;\n}\n\nexport type MediaView = 'fit' | 'full';\n\n// card\nexport type MediaBorder = 'shadow' | 'line' | 'none';\nexport type CardBorder = MediaBorder;\nexport type ControlPosition = 'content' | 'footer';\n\nexport interface CardBaseProps {\n border?: CardBorder;\n}\n\nexport type CardLayoutProps = {\n controlPosition?: ControlPosition;\n};\n\n//price\nexport interface PriceDescriptionProps {\n title: string;\n detailedTitle?: string;\n description: string;\n label?: {\n color: PriceLabelColor;\n text?: string;\n size?: TextSize;\n };\n}\n\nexport interface PriceDetailsSettingsProps {\n title: string;\n description: string;\n}\n\nexport interface PriceDetailsListProps {\n text: string;\n}\n\nexport interface PriceDetailsProps {\n items?: PriceDetailsSettingsProps[] | PriceDetailsListProps[];\n}\n\nexport interface PriceItemProps\n extends PriceDetailsProps,\n PriceDescriptionProps,\n AnalyticsEventsBase {}\n\nexport interface PriceFoldableDetailsProps {\n title: string;\n size?: TextSize;\n titleColor?: PriceDescriptionColor;\n}\n\n/** @deprecated */\nexport interface PriceDetailedProps extends CardBaseProps {\n items: PriceItemProps[];\n description?: {\n titleSize?: TextSize;\n descriptionSize?: TextSize;\n titleColor?: PriceDescriptionColor;\n };\n details?: {\n titleSize?: TextSize;\n descriptionSize?: TextSize;\n };\n priceType?: PriceDetailsType;\n numberGroupItems?: 3 | 4 | 5;\n isCombined?: boolean;\n useMixedView?: boolean;\n foldable?: PriceFoldableDetailsProps;\n labelsDefaultText?: Record<PriceLabelColor, string>;\n}\n\nexport interface AuthorProps extends QAProps {\n author: AuthorItem;\n className?: string;\n authorContainerClassName?: string;\n type?: AuthorType;\n theme?: ContentTheme;\n}\n\nexport interface TitleProps {\n title?: TitleItemProps | string;\n subtitle?: string;\n}\n\nexport interface YandexFormProps extends AnalyticsEventsBase {\n id: number | string;\n containerId?: string;\n theme?: string;\n className?: string;\n headerHeight?: number;\n customFormOrigin?: string;\n customFormSection?: string;\n params?: {[key: string]: string};\n\n onSubmit?: () => void;\n onLoad?: () => void;\n}\n\nexport interface WithBorder {\n border?: MediaBorder;\n /**\n * @deprecated use custom class for media-component\n */\n disableShadow?: boolean;\n}\n"]}
|
|
@@ -804,6 +804,25 @@ export declare const cardSchemas: {
|
|
|
804
804
|
type: string;
|
|
805
805
|
enum: string[];
|
|
806
806
|
};
|
|
807
|
+
hide: {
|
|
808
|
+
oneOf: ({
|
|
809
|
+
type: string;
|
|
810
|
+
properties?: undefined;
|
|
811
|
+
} | {
|
|
812
|
+
type: string;
|
|
813
|
+
properties: {
|
|
814
|
+
mobile: {
|
|
815
|
+
type: string;
|
|
816
|
+
};
|
|
817
|
+
tablet: {
|
|
818
|
+
type: string;
|
|
819
|
+
};
|
|
820
|
+
desktop: {
|
|
821
|
+
type: string;
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
})[];
|
|
825
|
+
};
|
|
807
826
|
};
|
|
808
827
|
} & {
|
|
809
828
|
optionName: string;
|
|
@@ -53,6 +53,25 @@ export declare const BackgroundCard: {
|
|
|
53
53
|
type: string;
|
|
54
54
|
enum: string[];
|
|
55
55
|
};
|
|
56
|
+
hide: {
|
|
57
|
+
oneOf: ({
|
|
58
|
+
type: string;
|
|
59
|
+
properties?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
type: string;
|
|
62
|
+
properties: {
|
|
63
|
+
mobile: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
tablet: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
desktop: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
})[];
|
|
74
|
+
};
|
|
56
75
|
};
|
|
57
76
|
} & {
|
|
58
77
|
optionName: string;
|
|
@@ -52,6 +52,25 @@ export declare const CardLayoutProps: {
|
|
|
52
52
|
type: string;
|
|
53
53
|
enum: string[];
|
|
54
54
|
};
|
|
55
|
+
hide: {
|
|
56
|
+
oneOf: ({
|
|
57
|
+
type: string;
|
|
58
|
+
properties?: undefined;
|
|
59
|
+
} | {
|
|
60
|
+
type: string;
|
|
61
|
+
properties: {
|
|
62
|
+
mobile: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
tablet: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
desktop: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
})[];
|
|
73
|
+
};
|
|
55
74
|
};
|
|
56
75
|
optionName: string;
|
|
57
76
|
type: string;
|
|
@@ -89,6 +108,25 @@ export declare const CardLayoutProps: {
|
|
|
89
108
|
type: string;
|
|
90
109
|
enum: string[];
|
|
91
110
|
};
|
|
111
|
+
hide: {
|
|
112
|
+
oneOf: ({
|
|
113
|
+
type: string;
|
|
114
|
+
properties?: undefined;
|
|
115
|
+
} | {
|
|
116
|
+
type: string;
|
|
117
|
+
properties: {
|
|
118
|
+
mobile: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
tablet: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
desktop: {
|
|
125
|
+
type: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
})[];
|
|
129
|
+
};
|
|
92
130
|
};
|
|
93
131
|
optionName: string;
|
|
94
132
|
type: string;
|
|
@@ -240,6 +278,25 @@ export declare const CardLayoutBlock: {
|
|
|
240
278
|
type: string;
|
|
241
279
|
enum: string[];
|
|
242
280
|
};
|
|
281
|
+
hide: {
|
|
282
|
+
oneOf: ({
|
|
283
|
+
type: string;
|
|
284
|
+
properties?: undefined;
|
|
285
|
+
} | {
|
|
286
|
+
type: string;
|
|
287
|
+
properties: {
|
|
288
|
+
mobile: {
|
|
289
|
+
type: string;
|
|
290
|
+
};
|
|
291
|
+
tablet: {
|
|
292
|
+
type: string;
|
|
293
|
+
};
|
|
294
|
+
desktop: {
|
|
295
|
+
type: string;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
})[];
|
|
299
|
+
};
|
|
243
300
|
};
|
|
244
301
|
optionName: string;
|
|
245
302
|
type: string;
|
|
@@ -277,6 +334,25 @@ export declare const CardLayoutBlock: {
|
|
|
277
334
|
type: string;
|
|
278
335
|
enum: string[];
|
|
279
336
|
};
|
|
337
|
+
hide: {
|
|
338
|
+
oneOf: ({
|
|
339
|
+
type: string;
|
|
340
|
+
properties?: undefined;
|
|
341
|
+
} | {
|
|
342
|
+
type: string;
|
|
343
|
+
properties: {
|
|
344
|
+
mobile: {
|
|
345
|
+
type: string;
|
|
346
|
+
};
|
|
347
|
+
tablet: {
|
|
348
|
+
type: string;
|
|
349
|
+
};
|
|
350
|
+
desktop: {
|
|
351
|
+
type: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
})[];
|
|
355
|
+
};
|
|
280
356
|
};
|
|
281
357
|
optionName: string;
|
|
282
358
|
type: string;
|
|
@@ -50,6 +50,25 @@ export declare const ContentLayoutBlock: {
|
|
|
50
50
|
type: string;
|
|
51
51
|
enum: string[];
|
|
52
52
|
};
|
|
53
|
+
hide: {
|
|
54
|
+
oneOf: ({
|
|
55
|
+
type: string;
|
|
56
|
+
properties?: undefined;
|
|
57
|
+
} | {
|
|
58
|
+
type: string;
|
|
59
|
+
properties: {
|
|
60
|
+
mobile: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
tablet: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
desktop: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
})[];
|
|
71
|
+
};
|
|
53
72
|
};
|
|
54
73
|
} | {
|
|
55
74
|
optionName: string;
|
|
@@ -84,6 +103,25 @@ export declare const ContentLayoutBlock: {
|
|
|
84
103
|
type: string;
|
|
85
104
|
enum: string[];
|
|
86
105
|
};
|
|
106
|
+
hide: {
|
|
107
|
+
oneOf: ({
|
|
108
|
+
type: string;
|
|
109
|
+
properties?: undefined;
|
|
110
|
+
} | {
|
|
111
|
+
type: string;
|
|
112
|
+
properties: {
|
|
113
|
+
mobile: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
tablet: {
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
desktop: {
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
})[];
|
|
124
|
+
};
|
|
87
125
|
};
|
|
88
126
|
})[];
|
|
89
127
|
};
|
|
@@ -256,6 +294,25 @@ export declare const ContentLayoutBlock: {
|
|
|
256
294
|
type: string;
|
|
257
295
|
enum: string[];
|
|
258
296
|
};
|
|
297
|
+
hide: {
|
|
298
|
+
oneOf: ({
|
|
299
|
+
type: string;
|
|
300
|
+
properties?: undefined;
|
|
301
|
+
} | {
|
|
302
|
+
type: string;
|
|
303
|
+
properties: {
|
|
304
|
+
mobile: {
|
|
305
|
+
type: string;
|
|
306
|
+
};
|
|
307
|
+
tablet: {
|
|
308
|
+
type: string;
|
|
309
|
+
};
|
|
310
|
+
desktop: {
|
|
311
|
+
type: string;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
})[];
|
|
315
|
+
};
|
|
259
316
|
};
|
|
260
317
|
} | {
|
|
261
318
|
optionName: string;
|
|
@@ -290,6 +347,25 @@ export declare const ContentLayoutBlock: {
|
|
|
290
347
|
type: string;
|
|
291
348
|
enum: string[];
|
|
292
349
|
};
|
|
350
|
+
hide: {
|
|
351
|
+
oneOf: ({
|
|
352
|
+
type: string;
|
|
353
|
+
properties?: undefined;
|
|
354
|
+
} | {
|
|
355
|
+
type: string;
|
|
356
|
+
properties: {
|
|
357
|
+
mobile: {
|
|
358
|
+
type: string;
|
|
359
|
+
};
|
|
360
|
+
tablet: {
|
|
361
|
+
type: string;
|
|
362
|
+
};
|
|
363
|
+
desktop: {
|
|
364
|
+
type: string;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
})[];
|
|
368
|
+
};
|
|
293
369
|
};
|
|
294
370
|
})[];
|
|
295
371
|
};
|
|
@@ -5,9 +5,9 @@ import './BackgroundImage.css';
|
|
|
5
5
|
export const qaIdByDefault = 'background-image';
|
|
6
6
|
const b = block('storage-background-image');
|
|
7
7
|
const BackgroundImage = (props) => {
|
|
8
|
-
const { children, src, desktop, className, imageClassName, style,
|
|
8
|
+
const { children, src, desktop, className, imageClassName, style, qa } = props;
|
|
9
9
|
const qaAttributes = getQaAttrubutes(qa || qaIdByDefault);
|
|
10
|
-
return (_jsxs("div", { className: b(null, className), style: style, "data-qa": qa || qaIdByDefault, children: [(src || desktop) &&
|
|
10
|
+
return (_jsxs("div", { className: b(null, className), style: style, "data-qa": qa || qaIdByDefault, children: [(src || desktop) && (_jsx(Image, { ...props, className: b('img', imageClassName), qa: qaAttributes.image })), children && _jsx("div", { className: b('container'), children: children })] }));
|
|
11
11
|
};
|
|
12
12
|
export default BackgroundImage;
|
|
13
13
|
//# sourceMappingURL=BackgroundImage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundImage.js","sourceRoot":"../../../../src","sources":["components/BackgroundImage/BackgroundImage.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,6BAAoB;AACnD,OAAO,KAAK,0BAAuB;AAEnC,OAAO,uBAAuB,CAAC;AAE/B,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEhD,MAAM,CAAC,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAE5C,MAAM,eAAe,GAAG,CAAC,KAAoD,EAAE,EAAE;IAC7E,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BackgroundImage.js","sourceRoot":"../../../../src","sources":["components/BackgroundImage/BackgroundImage.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,6BAAoB;AACnD,OAAO,KAAK,0BAAuB;AAEnC,OAAO,uBAAuB,CAAC;AAE/B,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEhD,MAAM,CAAC,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAE5C,MAAM,eAAe,GAAG,CAAC,KAAoD,EAAE,EAAE;IAC7E,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,EAAC,GAAG,KAAK,CAAC;IAC7E,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,IAAI,aAAa,CAAC,CAAC;IAE1D,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,aAAW,EAAE,IAAI,aAAa,aACzE,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CACjB,KAAC,KAAK,OAAK,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,KAAK,GAAI,CACpF,EACA,QAAQ,IAAI,cAAK,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,YAAG,QAAQ,GAAO,IAC3D,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BackgroundImageProps} from '../../models';\nimport {block, getQaAttrubutes} from '../../utils';\nimport Image from '../Image/Image';\n\nimport './BackgroundImage.scss';\n\nexport const qaIdByDefault = 'background-image';\n\nconst b = block('storage-background-image');\n\nconst BackgroundImage = (props: React.PropsWithChildren<BackgroundImageProps>) => {\n const {children, src, desktop, className, imageClassName, style, qa} = props;\n const qaAttributes = getQaAttrubutes(qa || qaIdByDefault);\n\n return (\n <div className={b(null, className)} style={style} data-qa={qa || qaIdByDefault}>\n {(src || desktop) && (\n <Image {...props} className={b('img', imageClassName)} qa={qaAttributes.image} />\n )}\n {children && <div className={b('container')}>{children}</div>}\n </div>\n );\n};\n\nexport default BackgroundImage;\n"]}
|
|
@@ -10,7 +10,9 @@ export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDevi
|
|
|
10
10
|
export interface DeviceSpecificFragmentProps extends QAProps {
|
|
11
11
|
disableWebp: boolean;
|
|
12
12
|
src: string;
|
|
13
|
-
|
|
13
|
+
maxBreakpoint?: number;
|
|
14
|
+
minBreakpoint?: number;
|
|
14
15
|
}
|
|
15
|
-
declare const
|
|
16
|
+
export declare const EMPTY_IMG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjwvc3ZnPg==";
|
|
17
|
+
declare const Image: (props: ImageProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export default Image;
|
|
@@ -2,27 +2,40 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { BREAKPOINTS } from "../../constants.js";
|
|
4
4
|
import { ProjectSettingsContext } from "../../context/projectSettingsContext/index.js";
|
|
5
|
+
import { Device } from "../../models/index.js";
|
|
5
6
|
import { getQaAttrubutes } from "../../utils/index.js";
|
|
6
7
|
import { isCompressible } from "../../utils/imageCompress.js";
|
|
7
8
|
import ImageBase from "../ImageBase/ImageBase.js";
|
|
8
9
|
const checkWebP = (src) => {
|
|
9
10
|
return src.endsWith('.webp') ? src : src + '.webp';
|
|
10
11
|
};
|
|
11
|
-
const
|
|
12
|
+
export const EMPTY_IMG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjwvc3ZnPg==';
|
|
13
|
+
const DeviceSpecificFragment = ({ disableWebp, src, maxBreakpoint, minBreakpoint, qa, }) => {
|
|
14
|
+
const media = [];
|
|
15
|
+
if (maxBreakpoint) {
|
|
16
|
+
media.push(`(max-width: ${maxBreakpoint}px)`);
|
|
17
|
+
}
|
|
18
|
+
if (minBreakpoint) {
|
|
19
|
+
media.push(`(min-width: ${minBreakpoint}px)`);
|
|
20
|
+
}
|
|
21
|
+
const mediaString = media.join(' and ');
|
|
22
|
+
return (_jsxs(React.Fragment, { children: [!disableWebp && (_jsx("source", { srcSet: checkWebP(src), type: "image/webp", media: mediaString, "data-qa": `${qa}-compressed` })), _jsx("source", { srcSet: src, media: mediaString, "data-qa": qa })] }));
|
|
23
|
+
};
|
|
12
24
|
const Image = (props) => {
|
|
13
25
|
const projectSettings = React.useContext(ProjectSettingsContext);
|
|
14
|
-
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, onLoad, containerClassName, qa, fetchPriority, loading, } = props;
|
|
26
|
+
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, onLoad, containerClassName, qa, fetchPriority, loading, hide, } = props;
|
|
15
27
|
const [imgLoadingError, setImgLoadingError] = React.useState(false);
|
|
16
28
|
const src = imageSrc || desktop;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const qaAttributes = getQaAttrubutes(qa, 'mobile-webp-source', 'mobile-source', 'tablet-webp-source', 'tablet-source', 'desktop-source-compressed');
|
|
21
|
-
const disableWebp =
|
|
29
|
+
const hideDevices = typeof hide === 'boolean' || !hide
|
|
30
|
+
? Object.values(Device).reduce((acc, device) => ({ ...acc, [device]: Boolean(hide) }), {})
|
|
31
|
+
: hide;
|
|
32
|
+
const qaAttributes = getQaAttrubutes(qa, 'mobile-webp-source', 'mobile-source', 'tablet-webp-source', 'tablet-source', 'desktop-source', 'desktop-source-compressed');
|
|
33
|
+
const disableWebp = !src ||
|
|
34
|
+
projectSettings.disableCompress ||
|
|
22
35
|
disableCompress ||
|
|
23
36
|
!isCompressible(src) ||
|
|
24
37
|
imgLoadingError;
|
|
25
|
-
return (_jsxs("picture", { className: containerClassName, "data-qa": qa, children: [mobile && (_jsx(DeviceSpecificFragment, { src: mobile, disableWebp: disableWebp,
|
|
38
|
+
return (_jsxs("picture", { className: containerClassName, "data-qa": qa, children: [(mobile || hideDevices.mobile) && (_jsx(DeviceSpecificFragment, { src: mobile || EMPTY_IMG, disableWebp: disableWebp || Boolean(hideDevices.mobile), maxBreakpoint: BREAKPOINTS.sm, qa: qaAttributes.mobileSource })), (tablet || hideDevices.tablet) && (_jsx(DeviceSpecificFragment, { src: tablet || EMPTY_IMG, disableWebp: disableWebp || Boolean(hideDevices.tablet), maxBreakpoint: BREAKPOINTS.md, minBreakpoint: BREAKPOINTS.sm, qa: qaAttributes.tabletSource })), hideDevices.desktop && (_jsx(DeviceSpecificFragment, { src: EMPTY_IMG, disableWebp: true, minBreakpoint: BREAKPOINTS.md, qa: qaAttributes.desktopSource })), src && !disableWebp && (_jsx("source", { srcSet: checkWebP(src), type: "image/webp", "data-qa": qaAttributes.desktopSourceCompressed })), _jsx(ImageBase, { className: className, alt: alt, src: src, style: style, fetchPriority: fetchPriority, loading: loading, onClick: onClick, onError: () => setImgLoadingError(true), onLoad: onLoad })] }));
|
|
26
39
|
};
|
|
27
40
|
export default Image;
|
|
28
41
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sourceRoot":"../../../../src","sources":["components/Image/Image.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,sBAAsB,EAAC,sDAA6C;
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"../../../../src","sources":["components/Image/Image.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,sBAAsB,EAAC,sDAA6C;AAC5E,OAAO,EAAC,MAAM,EAA8C,8BAAqB;AACjF,OAAO,EAAC,eAAe,EAAC,6BAAoB;AAC5C,OAAO,EAAC,cAAc,EAAC,qCAAkC;AACzD,OAAO,SAAS,kCAA+B;AAiB/C,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE;IAC9B,OAAO,GAAG,CAAC,QAAQ,CAAC,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AAa,EAAE,WAAW,CAAC,EAAE,EAC7B,EAAE,EAAE,YAAY,CAAC,YAAY,GAC/B,CACL,EACA,WAAW,CAAC,OAAO,IAAI,CACpB,KAAC,sBAAsB,IACnB,GAAG,EAAE,SAAS,EACd,WAAW,QACX,aAAa,EAAE,WAAW,CAAC,EAAE,EAC7B,EAAE,EAAE,YAAY,CAAC,aAAa,GAChC,CACL,EACA,GAAG,IAAI,CAAC,WAAW,IAAI,CACpB,iBACI,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,IAAI,EAAC,YAAY,aACR,YAAY,CAAC,uBAAuB,GAC/C,CACL,EACD,KAAC,SAAS,IACN,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,EACvC,MAAM,EAAE,MAAM,GAChB,IACI,CACb,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BREAKPOINTS} from '../../constants';\nimport {ProjectSettingsContext} from '../../context/projectSettingsContext';\nimport {Device, ImageDeviceProps, ImageObjectProps, QAProps} from '../../models';\nimport {getQaAttrubutes} from '../../utils';\nimport {isCompressible} from '../../utils/imageCompress';\nimport ImageBase from '../ImageBase/ImageBase';\n\nexport interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDeviceProps>, QAProps {\n style?: React.CSSProperties;\n className?: string;\n onClick?: React.MouseEventHandler;\n onLoad?: React.ReactEventHandler<HTMLDivElement>;\n containerClassName?: string;\n}\n\nexport interface DeviceSpecificFragmentProps extends QAProps {\n disableWebp: boolean;\n src: string;\n maxBreakpoint?: number;\n minBreakpoint?: number;\n}\n\nconst checkWebP = (src: string) => {\n return src.endsWith('.webp') ? src : src + '.webp';\n};\n\nexport const EMPTY_IMG =\n 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjwvc3ZnPg==';\n\nconst DeviceSpecificFragment = ({\n disableWebp,\n src,\n maxBreakpoint,\n minBreakpoint,\n qa,\n}: DeviceSpecificFragmentProps) => {\n const media: string[] = [];\n\n if (maxBreakpoint) {\n media.push(`(max-width: ${maxBreakpoint}px)`);\n }\n\n if (minBreakpoint) {\n media.push(`(min-width: ${minBreakpoint}px)`);\n }\n\n const mediaString = media.join(' and ');\n\n return (\n <React.Fragment>\n {!disableWebp && (\n <source\n srcSet={checkWebP(src)}\n type=\"image/webp\"\n media={mediaString}\n data-qa={`${qa}-compressed`}\n />\n )}\n <source srcSet={src} media={mediaString} data-qa={qa} />\n </React.Fragment>\n );\n};\n\nconst Image = (props: ImageProps) => {\n const projectSettings = React.useContext(ProjectSettingsContext);\n const {\n src: imageSrc,\n alt,\n disableCompress,\n tablet,\n desktop,\n mobile,\n style,\n className,\n onClick,\n onLoad,\n containerClassName,\n qa,\n fetchPriority,\n loading,\n hide,\n } = props;\n const [imgLoadingError, setImgLoadingError] = React.useState(false);\n\n const src = imageSrc || desktop;\n\n const hideDevices =\n typeof hide === 'boolean' || !hide\n ? Object.values(Device).reduce(\n (acc, device) => ({...acc, [device]: Boolean(hide)}),\n {} as Record<Device, boolean>,\n )\n : hide;\n\n const qaAttributes = getQaAttrubutes(\n qa,\n 'mobile-webp-source',\n 'mobile-source',\n 'tablet-webp-source',\n 'tablet-source',\n 'desktop-source',\n 'desktop-source-compressed',\n );\n\n const disableWebp =\n !src ||\n projectSettings.disableCompress ||\n disableCompress ||\n !isCompressible(src) ||\n imgLoadingError;\n\n return (\n <picture className={containerClassName} data-qa={qa}>\n {(mobile || hideDevices.mobile) && (\n <DeviceSpecificFragment\n src={mobile || EMPTY_IMG}\n disableWebp={disableWebp || Boolean(hideDevices.mobile)}\n maxBreakpoint={BREAKPOINTS.sm}\n qa={qaAttributes.mobileSource}\n />\n )}\n {(tablet || hideDevices.tablet) && (\n <DeviceSpecificFragment\n src={tablet || EMPTY_IMG}\n disableWebp={disableWebp || Boolean(hideDevices.tablet)}\n maxBreakpoint={BREAKPOINTS.md}\n minBreakpoint={BREAKPOINTS.sm}\n qa={qaAttributes.tabletSource}\n />\n )}\n {hideDevices.desktop && (\n <DeviceSpecificFragment\n src={EMPTY_IMG}\n disableWebp\n minBreakpoint={BREAKPOINTS.md}\n qa={qaAttributes.desktopSource}\n />\n )}\n {src && !disableWebp && (\n <source\n srcSet={checkWebP(src)}\n type=\"image/webp\"\n data-qa={qaAttributes.desktopSourceCompressed}\n />\n )}\n <ImageBase\n className={className}\n alt={alt}\n src={src}\n style={style}\n fetchPriority={fetchPriority}\n loading={loading}\n onClick={onClick}\n onError={() => setImgLoadingError(true)}\n onLoad={onLoad}\n />\n </picture>\n );\n};\n\nexport default Image;\n"]}
|
|
@@ -31,6 +31,25 @@ export declare const ImageDeviceProps: {
|
|
|
31
31
|
type: string;
|
|
32
32
|
enum: string[];
|
|
33
33
|
};
|
|
34
|
+
hide: {
|
|
35
|
+
oneOf: ({
|
|
36
|
+
type: string;
|
|
37
|
+
properties?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
type: string;
|
|
40
|
+
properties: {
|
|
41
|
+
mobile: {
|
|
42
|
+
type: string;
|
|
43
|
+
};
|
|
44
|
+
tablet: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
desktop: {
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
})[];
|
|
52
|
+
};
|
|
34
53
|
};
|
|
35
54
|
};
|
|
36
55
|
export declare const ImageBaseObjectProps: {
|
|
@@ -75,6 +94,25 @@ export declare const ImageBaseObjectProps: {
|
|
|
75
94
|
type: string;
|
|
76
95
|
enum: string[];
|
|
77
96
|
};
|
|
97
|
+
hide: {
|
|
98
|
+
oneOf: ({
|
|
99
|
+
type: string;
|
|
100
|
+
properties?: undefined;
|
|
101
|
+
} | {
|
|
102
|
+
type: string;
|
|
103
|
+
properties: {
|
|
104
|
+
mobile: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
tablet: {
|
|
108
|
+
type: string;
|
|
109
|
+
};
|
|
110
|
+
desktop: {
|
|
111
|
+
type: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
})[];
|
|
115
|
+
};
|
|
78
116
|
};
|
|
79
117
|
};
|
|
80
118
|
export declare const ImageObjectProps: {
|
|
@@ -120,6 +158,25 @@ export declare const ImageObjectProps: {
|
|
|
120
158
|
type: string;
|
|
121
159
|
enum: string[];
|
|
122
160
|
};
|
|
161
|
+
hide: {
|
|
162
|
+
oneOf: ({
|
|
163
|
+
type: string;
|
|
164
|
+
properties?: undefined;
|
|
165
|
+
} | {
|
|
166
|
+
type: string;
|
|
167
|
+
properties: {
|
|
168
|
+
mobile: {
|
|
169
|
+
type: string;
|
|
170
|
+
};
|
|
171
|
+
tablet: {
|
|
172
|
+
type: string;
|
|
173
|
+
};
|
|
174
|
+
desktop: {
|
|
175
|
+
type: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
})[];
|
|
179
|
+
};
|
|
123
180
|
};
|
|
124
181
|
};
|
|
125
182
|
export declare const ImageProps: {
|
|
@@ -193,6 +250,25 @@ export declare const BackgroundImageProps: {
|
|
|
193
250
|
type: string;
|
|
194
251
|
enum: string[];
|
|
195
252
|
};
|
|
253
|
+
hide: {
|
|
254
|
+
oneOf: ({
|
|
255
|
+
type: string;
|
|
256
|
+
properties?: undefined;
|
|
257
|
+
} | {
|
|
258
|
+
type: string;
|
|
259
|
+
properties: {
|
|
260
|
+
mobile: {
|
|
261
|
+
type: string;
|
|
262
|
+
};
|
|
263
|
+
tablet: {
|
|
264
|
+
type: string;
|
|
265
|
+
};
|
|
266
|
+
desktop: {
|
|
267
|
+
type: string;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
})[];
|
|
271
|
+
};
|
|
196
272
|
};
|
|
197
273
|
} | {
|
|
198
274
|
optionName: string;
|
|
@@ -227,6 +303,25 @@ export declare const BackgroundImageProps: {
|
|
|
227
303
|
type: string;
|
|
228
304
|
enum: string[];
|
|
229
305
|
};
|
|
306
|
+
hide: {
|
|
307
|
+
oneOf: ({
|
|
308
|
+
type: string;
|
|
309
|
+
properties?: undefined;
|
|
310
|
+
} | {
|
|
311
|
+
type: string;
|
|
312
|
+
properties: {
|
|
313
|
+
mobile: {
|
|
314
|
+
type: string;
|
|
315
|
+
};
|
|
316
|
+
tablet: {
|
|
317
|
+
type: string;
|
|
318
|
+
};
|
|
319
|
+
desktop: {
|
|
320
|
+
type: string;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
})[];
|
|
324
|
+
};
|
|
230
325
|
};
|
|
231
326
|
})[];
|
|
232
327
|
};
|
|
@@ -16,6 +16,21 @@ const ImageBase = {
|
|
|
16
16
|
type: 'string',
|
|
17
17
|
enum: ['high', 'low', 'auto'],
|
|
18
18
|
},
|
|
19
|
+
hide: {
|
|
20
|
+
oneOf: [
|
|
21
|
+
{
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
mobile: { type: 'boolean' },
|
|
28
|
+
tablet: { type: 'boolean' },
|
|
29
|
+
desktop: { type: 'boolean' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
19
34
|
};
|
|
20
35
|
const StyleBase = {
|
|
21
36
|
type: 'object',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["components/Image/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,yCAAsC;AAE3D,MAAM,CAAC,MAAM,eAAe,GACxB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IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACR,GAAG,SAAS;QACZ,GAAG,EAAE;YACD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,eAAe;SAC3B;QACD,KAAK,EAAE,SAAS;KACnB;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,GAAG,oBAAoB;IACvB,QAAQ,EAAE,CAAC,KAAK,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,KAAK,EAAE;QACH;YACI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,eAAe;YACxB,UAAU,EAAE,KAAK;SACpB;QACD,YAAY,CAAC;YACT,GAAG,gBAAgB;YACnB,UAAU,EAAE,SAAS;SACxB,CAAC;QACF,YAAY,CAAC;YACT,GAAG,gBAAgB;YACnB,UAAU,EAAE,gBAAgB;SAC/B,CAAC;QACF;YACI,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,YAAY,CAAC;gBAChB,GAAG,gBAAgB;aACtB,CAAC;YACF,UAAU,EAAE,cAAc;SAC7B;QACD;YACI,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,YAAY,CAAC;gBAChB,GAAG,gBAAgB;aACtB,CAAC;YACF,UAAU,EAAE,qBAAqB;SACpC;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,KAAK,EAAE;QACH;YACI,GAAG,oBAAoB;YACvB,UAAU,EAAE,SAAS;SACxB;QACD;YACI,GAAG,gBAAgB;YACnB,UAAU,EAAE,gBAAgB;SAC/B;KACJ;CACJ,CAAC","sourcesContent":["import {filteredItem} from '../../schema/validators/utils';\n\nexport const imageUrlPattern =\n '^((http[s]?|ftp):\\\\/)?\\\\/?([^:\\\\/\\\\s]+)((\\\\/\\\\w+)*\\\\/)([\\\\w\\\\-\\\\.]+[^#?\\\\s]+)(.*)?(#[\\\\w\\\\-]+)?$';\n\nconst ImageBase = {\n alt: {\n type: 'string',\n contentType: 'text',\n },\n disableCompress: {\n type: 'boolean',\n },\n loading: {\n type: 'string',\n enum: ['eager', 'lazy'],\n },\n fetchPriority: {\n type: 'string',\n enum: ['high', 'low', 'auto'],\n },\n};\n\nconst StyleBase = {\n type: 'object',\n additionalProperties: false,\n required: [],\n properties: {\n backgroundColor: {type: 'string'},\n height: {type: ['string', 'number']},\n width: {type: ['string', 'number']},\n color: {type: 'string'},\n },\n};\n\nexport const ImageDeviceProps = {\n type: 'object',\n additionalProperties: false,\n required: ['desktop', 'mobile'],\n properties: {\n ...ImageBase,\n desktop: {type: 'string', pattern: imageUrlPattern},\n tablet: {\n type: 'string',\n pattern: imageUrlPattern,\n },\n mobile: {\n type: 'string',\n pattern: imageUrlPattern,\n },\n },\n};\n\nexport const ImageBaseObjectProps = {\n type: 'object',\n additionalProperties: false,\n properties: {\n ...ImageBase,\n src: {\n type: 'string',\n pattern: imageUrlPattern,\n },\n style: StyleBase,\n },\n};\n\nexport const ImageObjectProps = {\n ...ImageBaseObjectProps,\n required: ['src'],\n};\n\nexport const ImageProps = {\n oneOf: [\n {\n type: 'string',\n pattern: imageUrlPattern,\n optionName: 'url',\n },\n filteredItem({\n ...ImageObjectProps,\n optionName: 'options',\n }),\n filteredItem({\n ...ImageDeviceProps,\n optionName: 'device options',\n }),\n {\n type: 'array',\n items: filteredItem({\n ...ImageObjectProps,\n }),\n optionName: 'options list',\n },\n {\n type: 'array',\n items: filteredItem({\n ...ImageDeviceProps,\n }),\n optionName: 'device options list',\n },\n ],\n};\n\nexport const BackgroundImageProps = {\n anyOf: [\n {\n ...ImageBaseObjectProps,\n optionName: 'options',\n },\n {\n ...ImageDeviceProps,\n optionName: 'device options',\n },\n ],\n};\n"]}
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["components/Image/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,yCAAsC;AAE3D,MAAM,CAAC,MAAM,eAAe,GACxB,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YACI,GAAG,gBAAgB;YACnB,UAAU,EAAE,gBAAgB;SAC/B;KACJ;CACJ,CAAC","sourcesContent":["import {filteredItem} from '../../schema/validators/utils';\n\nexport const imageUrlPattern =\n '^((http[s]?|ftp):\\\\/)?\\\\/?([^:\\\\/\\\\s]+)((\\\\/\\\\w+)*\\\\/)([\\\\w\\\\-\\\\.]+[^#?\\\\s]+)(.*)?(#[\\\\w\\\\-]+)?$';\n\nconst ImageBase = {\n alt: {\n type: 'string',\n contentType: 'text',\n },\n disableCompress: {\n type: 'boolean',\n },\n loading: {\n type: 'string',\n enum: ['eager', 'lazy'],\n },\n fetchPriority: {\n type: 'string',\n enum: ['high', 'low', 'auto'],\n },\n hide: {\n oneOf: [\n {\n type: 'boolean',\n },\n {\n type: 'object',\n properties: {\n mobile: {type: 'boolean'},\n tablet: {type: 'boolean'},\n desktop: {type: 'boolean'},\n },\n },\n ],\n },\n};\n\nconst StyleBase = {\n type: 'object',\n additionalProperties: false,\n required: [],\n properties: {\n backgroundColor: {type: 'string'},\n height: {type: ['string', 'number']},\n width: {type: ['string', 'number']},\n color: {type: 'string'},\n },\n};\n\nexport const ImageDeviceProps = {\n type: 'object',\n additionalProperties: false,\n required: ['desktop', 'mobile'],\n properties: {\n ...ImageBase,\n desktop: {type: 'string', pattern: imageUrlPattern},\n tablet: {\n type: 'string',\n pattern: imageUrlPattern,\n },\n mobile: {\n type: 'string',\n pattern: imageUrlPattern,\n },\n },\n};\n\nexport const ImageBaseObjectProps = {\n type: 'object',\n additionalProperties: false,\n properties: {\n ...ImageBase,\n src: {\n type: 'string',\n pattern: imageUrlPattern,\n },\n style: StyleBase,\n },\n};\n\nexport const ImageObjectProps = {\n ...ImageBaseObjectProps,\n required: ['src'],\n};\n\nexport const ImageProps = {\n oneOf: [\n {\n type: 'string',\n pattern: imageUrlPattern,\n optionName: 'url',\n },\n filteredItem({\n ...ImageObjectProps,\n optionName: 'options',\n }),\n filteredItem({\n ...ImageDeviceProps,\n optionName: 'device options',\n }),\n {\n type: 'array',\n items: filteredItem({\n ...ImageObjectProps,\n }),\n optionName: 'options list',\n },\n {\n type: 'array',\n items: filteredItem({\n ...ImageDeviceProps,\n }),\n optionName: 'device options list',\n },\n ],\n};\n\nexport const BackgroundImageProps = {\n anyOf: [\n {\n ...ImageBaseObjectProps,\n optionName: 'options',\n },\n {\n ...ImageDeviceProps,\n optionName: 'device options',\n },\n ],\n};\n"]}
|