@gravity-ui/page-constructor 7.4.0 → 7.5.1-alpha.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/ContentLayout/ContentLayout.js +4 -2
- package/build/cjs/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/cjs/blocks/Header/Header.d.ts +5 -1
- package/build/cjs/blocks/Header/Header.js +9 -16
- package/build/cjs/blocks/Header/Header.js.map +1 -1
- package/build/cjs/components/IconWrapper/IconWrapper.css +13 -1
- package/build/cjs/components/IconWrapper/IconWrapper.js +2 -2
- package/build/cjs/components/IconWrapper/IconWrapper.js.map +1 -1
- package/build/cjs/containers/PageConstructor/Provider.js +2 -0
- package/build/cjs/containers/PageConstructor/Provider.js.map +1 -1
- package/build/cjs/context/windowWidthContext/BreakpointContext.d.ts +4 -0
- package/build/cjs/context/windowWidthContext/BreakpointContext.js +33 -0
- package/build/cjs/context/windowWidthContext/BreakpointContext.js.map +1 -0
- package/build/cjs/context/windowWidthContext/index.d.ts +1 -0
- package/build/cjs/context/windowWidthContext/index.js +5 -0
- package/build/cjs/context/windowWidthContext/index.js.map +1 -0
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +3 -2
- package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -2
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js.map +1 -1
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +2 -2
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js.map +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -2
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js.map +1 -1
- package/build/esm/blocks/ContentLayout/ContentLayout.js +4 -2
- package/build/esm/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/esm/blocks/Header/Header.d.ts +5 -1
- package/build/esm/blocks/Header/Header.js +9 -16
- package/build/esm/blocks/Header/Header.js.map +1 -1
- package/build/esm/components/IconWrapper/IconWrapper.css +13 -1
- package/build/esm/components/IconWrapper/IconWrapper.js +2 -2
- package/build/esm/components/IconWrapper/IconWrapper.js.map +1 -1
- package/build/esm/containers/PageConstructor/Provider.js +2 -0
- package/build/esm/containers/PageConstructor/Provider.js.map +1 -1
- package/build/esm/context/windowWidthContext/BreakpointContext.d.ts +4 -0
- package/build/esm/context/windowWidthContext/BreakpointContext.js +27 -0
- package/build/esm/context/windowWidthContext/BreakpointContext.js.map +1 -0
- package/build/esm/context/windowWidthContext/index.d.ts +1 -0
- package/build/esm/context/windowWidthContext/index.js +2 -0
- package/build/esm/context/windowWidthContext/index.js.map +1 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +3 -2
- package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -2
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js.map +1 -1
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +2 -2
- package/build/esm/sub-blocks/BasicCard/BasicCard.js.map +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +2 -2
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js.map +1 -1
- package/package.json +1 -1
- package/server/models/constructor-items/sub-blocks.d.ts +3 -2
- package/widget/index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutItem.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/LayoutItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAC,kCAAyB;AAC/E,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAC,KAAK,EAAE,cA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AAW,IAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,YAC3E,KAAC,OAAO,OAAK,YAAY,EAAE,OAAO,EAAE,OAAO,GAAI,GACrC,GACZ,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {FullscreenMedia, IconWrapper, Media, MetaInfo} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {ContentBlockProps, LayoutItemProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\nimport Content from '../Content/Content';\n\nimport {getLayoutItemLinks, hasFullscreen, showFullscreenIcon} from './utils';\n\nimport './LayoutItem.scss';\n\nconst b = block('layout-item');\n\nconst LayoutItem = ({\n content: {links, ...content},\n contentMargin = 'm',\n metaInfo,\n media,\n border,\n fullscreen,\n icon,\n className,\n analyticsEvents,\n controlPosition = 'content',\n}: LayoutItemProps) => {\n const normalizedLinks = React.useMemo(() => getLayoutItemLinks(links), [links]);\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n const contentProps: ContentBlockProps = {\n controlPosition: areControlsInFooter ? 'bottom' : 'default',\n ...content,\n links: normalizedLinks,\n size: content.size || 's',\n colSizes: {all: 12, md: 12},\n };\n const titleId = useUniqId();\n const renderMedia = () => {\n if (!media) {\n return null;\n }\n const themedMedia = getThemedValue(media, theme);\n const {title} = content;\n const mediaWithMicrodata = mergeVideoMicrodata(themedMedia, {\n name: typeof title === 'string' ? title : title?.text,\n description: content.text,\n });\n\n return fullscreen && hasFullscreen(themedMedia) ? (\n <FullscreenMedia showFullscreenIcon={showFullscreenIcon(themedMedia)}>\n {({\n className: mediaClassName,\n fullscreen: _fullscreen,\n ...fullscreenMediaProps\n } = {}) => (\n <Media\n {...mediaWithMicrodata}\n {...fullscreenMediaProps}\n className={b('media', {border}, mediaClassName)}\n analyticsEvents={analyticsEvents}\n />\n )}\n </FullscreenMedia>\n ) : (\n <Media\n {...themedMedia}\n className={b('media', {border})}\n analyticsEvents={analyticsEvents}\n />\n );\n };\n return (\n <div className={b(null, className)}>\n {renderMedia()}\n {metaInfo && <MetaInfo items={metaInfo} className={b('meta-info')} />}\n <div className={b('content', {'no-media': !media, margin: contentMargin})}>\n <IconWrapper icon={themedIcon} className={b('wrapper')} size={contentProps.size}>\n <Content {...contentProps} titleId={titleId} />\n </IconWrapper>\n </div>\n </div>\n );\n};\n\nexport default LayoutItem;\n"]}
|
package/package.json
CHANGED
|
@@ -35,6 +35,7 @@ export interface PositionedIcon {
|
|
|
35
35
|
}
|
|
36
36
|
export interface IconWrapperProps {
|
|
37
37
|
icon?: PositionedIcon;
|
|
38
|
+
size?: 's' | 'm' | 'l';
|
|
38
39
|
}
|
|
39
40
|
export declare enum ImageCardDirection {
|
|
40
41
|
Direct = "direct",
|
|
@@ -104,7 +105,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
|
|
|
104
105
|
paddingBottom?: 's' | 'm' | 'l' | 'xl';
|
|
105
106
|
backgroundColor?: string;
|
|
106
107
|
}
|
|
107
|
-
export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | '
|
|
108
|
+
export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {
|
|
108
109
|
url: string;
|
|
109
110
|
urlTitle?: string;
|
|
110
111
|
icon?: ThemeSupporting<ImageProps>;
|
|
@@ -136,7 +137,7 @@ export interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, '
|
|
|
136
137
|
list?: string[];
|
|
137
138
|
}
|
|
138
139
|
export interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {
|
|
139
|
-
content: Omit<ContentBlockProps, 'colSizes' | 'centered'
|
|
140
|
+
content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;
|
|
140
141
|
contentMargin?: LayoutItemContentMargin;
|
|
141
142
|
media?: ThemeSupporting<MediaProps>;
|
|
142
143
|
metaInfo?: string[];
|
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))}}]);";
|