@gravity-ui/page-constructor 7.6.2 → 7.7.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/README.md +4 -0
- package/build/cjs/blocks/CardLayout/CardLayout.js.map +1 -1
- package/build/cjs/blocks/Companies/schema.d.ts +1 -0
- package/build/cjs/blocks/Companies/schema.js +2 -1
- package/build/cjs/blocks/Companies/schema.js.map +1 -1
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +2 -2
- package/build/cjs/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/cjs/blocks/FilterBlock/FilterBlock.js.map +1 -1
- package/build/cjs/blocks/Header/Header.d.ts +7 -1
- package/build/cjs/blocks/Header/Header.js +6 -7
- package/build/cjs/blocks/Header/Header.js.map +1 -1
- package/build/cjs/blocks/Tabs/TabContent/TabContent.js +12 -12
- package/build/cjs/blocks/Tabs/TabContent/TabContent.js.map +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js.map +1 -1
- package/build/cjs/components/UnpublishedLabel/UnpublishedLabel.js.map +1 -1
- package/build/cjs/components/YandexForm/YandexForm.js +1 -1
- package/build/cjs/components/YandexForm/YandexForm.js.map +1 -1
- package/build/cjs/containers/PageConstructor/Provider.js.map +1 -1
- package/build/cjs/context/windowWidthContext/BreakpointContext.js +1 -1
- package/build/cjs/context/windowWidthContext/BreakpointContext.js.map +1 -1
- package/build/cjs/grid/Grid/Grid.js.map +1 -1
- package/build/cjs/grid/Row/Row.d.ts +1 -1
- package/build/cjs/grid/Row/Row.js.map +1 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/cjs/models/navigation.d.ts +1 -1
- package/build/cjs/models/navigation.js.map +1 -1
- package/build/cjs/schema/constants.d.ts +5 -0
- 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/BackgroundCard/schema.d.ts +5 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +1 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/esm/blocks/CardLayout/CardLayout.js.map +1 -1
- package/build/esm/blocks/Companies/schema.d.ts +1 -0
- package/build/esm/blocks/Companies/schema.js +2 -1
- package/build/esm/blocks/Companies/schema.js.map +1 -1
- package/build/esm/blocks/ContentLayout/ContentLayout.js +2 -2
- package/build/esm/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/esm/blocks/FilterBlock/FilterBlock.js.map +1 -1
- package/build/esm/blocks/Header/Header.d.ts +7 -1
- package/build/esm/blocks/Header/Header.js +6 -7
- package/build/esm/blocks/Header/Header.js.map +1 -1
- package/build/esm/blocks/Tabs/TabContent/TabContent.js +7 -7
- package/build/esm/blocks/Tabs/TabContent/TabContent.js.map +1 -1
- package/build/esm/blocks/Tabs/Tabs.js +2 -2
- package/build/esm/blocks/Tabs/Tabs.js.map +1 -1
- package/build/esm/components/UnpublishedLabel/UnpublishedLabel.js.map +1 -1
- package/build/esm/components/YandexForm/YandexForm.js +1 -1
- package/build/esm/components/YandexForm/YandexForm.js.map +1 -1
- package/build/esm/containers/PageConstructor/Provider.js.map +1 -1
- package/build/esm/context/windowWidthContext/BreakpointContext.js +1 -1
- package/build/esm/context/windowWidthContext/BreakpointContext.js.map +1 -1
- package/build/esm/grid/Grid/Grid.d.ts +1 -1
- package/build/esm/grid/Grid/Grid.js +1 -1
- package/build/esm/grid/Grid/Grid.js.map +1 -1
- package/build/esm/grid/Row/Row.d.ts +1 -1
- package/build/esm/grid/Row/Row.js.map +1 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/esm/models/navigation.d.ts +1 -1
- package/build/esm/models/navigation.js.map +1 -1
- package/build/esm/schema/constants.d.ts +5 -0
- 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/BackgroundCard/schema.d.ts +5 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.js +2 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/sub-blocks.d.ts +1 -1
- package/server/models/navigation.d.ts +1 -1
- package/widget/index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabContent.js","sourceRoot":"../../../../../src","sources":["blocks/Tabs/TabContent/TabContent.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"TabContent.js","sourceRoot":"../../../../../src","sources":["blocks/Tabs/TabContent/TabContent.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,eAAe,EAAE,UAAU,EAAC,qCAA4B;AAChE,OAAO,EAAC,aAAa,EAAC,iDAA8C;AACpE,OAAO,KAAK,2CAAwC;AACpD,OAAO,EAAC,SAAS,EAAC,qDAAkD;AACpE,OAAO,EAAC,sBAAsB,EAAC,yDAAgD;AAC/E,OAAO,EAAC,QAAQ,EAAC,wCAA+B;AAChD,OAAO,EAAC,GAAG,EAAE,sBAAsB,EAAE,GAAG,EAAC,+BAAsB;AAE/D,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,gCAAuB;AACrD,OAAO,EAAC,mBAAmB,EAAC,oCAAiC;AAC7D,OAAO,eAAe,8CAA2C;AAEjE,OAAO,kBAAkB,CAAC;AAE1B,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;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K,EAAE,EAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAC,CAAC,EAC5D,EAAE,EAAE,sBAAsB,EAAE,CAAC,OAAO,CAAC,EACrC,IAAI,EAAC,UAAU,EACf,SAAS,EAAE;YACP,iBAAiB,EAAE,eAAe,EAAE,CAAC,OAAO,CAAC;SAChD,aAEA,YAAY,EACZ,WAAW,KATP,OAAO,CAUV,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {FullscreenImage, YFMWrapper} from '../../../components';\nimport {getMediaImage} from '../../../components/Media/Image/utils';\nimport Media from '../../../components/Media/Media';\nimport {getHeight} from '../../../components/VideoBlock/VideoBlock';\nimport {ProjectSettingsContext} from '../../../context/projectSettingsContext';\nimport {useTheme} from '../../../context/theme';\nimport {Col, GridColumnOrderClasses, Row} from '../../../grid';\nimport {ContentSize, TabsBlockItem} from '../../../models';\nimport {block, getThemedValue} from '../../../utils';\nimport {mergeVideoMicrodata} from '../../../utils/microdata';\nimport TabsTextContent from '../TabsTextContent/TabsTextContent';\n\nimport './TabContent.scss';\n\nconst b = block('tab-content');\n\nexport interface TabContentProps {\n tabData: TabsBlockItem;\n isActive: boolean;\n isReverse: boolean;\n contentSize: ContentSize;\n centered?: boolean;\n play: boolean;\n getTabElementId?: (tabId: string) => string;\n getTabContentElementId?: (tabId: string) => string;\n}\n\nexport const TabContent = ({\n tabData,\n isActive,\n isReverse,\n contentSize,\n centered,\n play,\n getTabElementId,\n getTabContentElementId,\n}: TabContentProps) => {\n const {tabName} = tabData;\n\n const mediaContainerRef = React.useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const {renderInvisibleBlocks} = React.useContext(ProjectSettingsContext);\n\n const captionId = useUniqId();\n\n const mediaWidth = mediaContainerRef?.current?.offsetWidth;\n const [minImageHeight, setMinImageHeight] = React.useState(\n mediaContainerRef?.current?.offsetHeight,\n );\n\n const shouldRender = renderInvisibleBlocks || isActive;\n\n const themedImage = getThemedValue(tabData.image, theme);\n const themedMedia = getThemedValue(tabData.media, theme);\n\n const hasNoImage = !themedMedia?.image && !tabData.image;\n const mediaVideoHeight = hasNoImage && mediaWidth && getHeight(mediaWidth);\n\n // TODO remove property support activeTabData?.image. Use only activeTabData?.media?.image\n const imageProps = React.useMemo(() => {\n const imagePropsResult = themedImage && getMediaImage(themedImage);\n\n if (tabData.caption && imagePropsResult) {\n Object.assign(imagePropsResult, {\n 'aria-describedby': captionId,\n });\n }\n\n return imagePropsResult;\n }, [captionId, tabData.caption, themedImage]);\n\n const handleImageHeight = React.useCallback(() => {\n if (minImageHeight !== mediaContainerRef?.current?.offsetHeight) {\n setMinImageHeight(mediaContainerRef?.current?.offsetHeight);\n }\n }, [minImageHeight]);\n\n React.useEffect(() => {\n handleImageHeight();\n }, [isActive, handleImageHeight]);\n\n if (!shouldRender) {\n return null;\n }\n\n const showMedia = isActive && Boolean(tabData.media || imageProps);\n const showText = Boolean(tabData.text);\n const border = tabData.border || 'shadow';\n\n const textContent = showText && (\n <TabsTextContent\n showMedia={showMedia}\n data={tabData}\n imageProps={imageProps || undefined}\n isReverse={isReverse}\n contentSize={contentSize}\n centered={centered}\n />\n );\n\n const mediaContent = showMedia && (\n <Col\n sizes={{all: 12, md: 8}}\n orders={{\n all: GridColumnOrderClasses.Last,\n md: GridColumnOrderClasses.First,\n }}\n className={b('col', {centered: centered})}\n >\n {tabData.media && (\n <div style={{minHeight: mediaVideoHeight || minImageHeight}}>\n <div ref={mediaContainerRef}>\n <Media\n {...mergeVideoMicrodata(getThemedValue(tabData.media, theme), {\n name: tabData.tabName,\n description: tabData.caption ? tabData.caption : undefined,\n })}\n key={tabName}\n className={b('media', {border})}\n playVideo={play}\n height={mediaVideoHeight || undefined}\n onImageLoad={handleImageHeight}\n />\n </div>\n </div>\n )}\n {imageProps && (\n <React.Fragment>\n <FullscreenImage {...imageProps} imageClassName={b('image', {border})} />\n </React.Fragment>\n )}\n {tabData.caption && (\n <div className={b('caption')} id={captionId}>\n <YFMWrapper\n content={tabData.caption}\n modifiers={{constructor: true}}\n id={captionId}\n />\n </div>\n )}\n </Col>\n );\n\n return (\n <Row\n key={tabName}\n className={b('row', {reverse: isReverse, hidden: !isActive})}\n id={getTabContentElementId?.(tabName)}\n role=\"tabpanel\"\n ariaProps={{\n 'aria-labelledby': getTabElementId?.(tabName),\n }}\n >\n {mediaContent}\n {textContent}\n </Row>\n );\n};\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { getUniqId } from '@gravity-ui/uikit';
|
|
3
4
|
import AnimateBlock from "../../components/AnimateBlock/AnimateBlock.js";
|
|
4
5
|
import ButtonTabs from "../../components/ButtonTabs/ButtonTabs.js";
|
|
5
6
|
import Title from "../../components/Title/Title.js";
|
|
6
7
|
import { Col, GridJustifyContent, Row } from "../../grid/index.js";
|
|
7
8
|
import { block } from "../../utils/index.js";
|
|
8
|
-
import './Tabs.css';
|
|
9
9
|
import { TabContent } from "./TabContent/TabContent.js";
|
|
10
|
-
import
|
|
10
|
+
import './Tabs.css';
|
|
11
11
|
const b = block('tabs-block');
|
|
12
12
|
export const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', contentSize = 's', }) => {
|
|
13
13
|
const [activeTab, setActiveTab] = React.useState(items[0].tabName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"../../../../src","sources":["blocks/Tabs/Tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,YAAY,sDAAmD;AACtE,OAAO,UAAiC,kDAA+C;AACvF,OAAO,KAAK,wCAAqC;AACjD,OAAO,EAAC,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAC,4BAAmB;AAExD,OAAO,EAA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AAC,MAAM,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAC,CAAC,EAC1C,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAE,sBAAsB,GAChD,GACA,GACJ,EACL,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;gBACnB,MAAM,EAAC,OAAO,EAAC,GAAG,OAAO,CAAC;gBAE1B,OAAO,CACH,KAAC,UAAU,IAEP,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,KAAK,SAAS,EAC/B,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAE,sBAAsB,IARzC,OAAO,CASd,CACL,CAAC;YACN,CAAC,CAAC,IACS,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {getUniqId} from '@gravity-ui/uikit';\n\nimport AnimateBlock from '../../components/AnimateBlock/AnimateBlock';\nimport ButtonTabs, {ButtonTabsItemProps} from '../../components/ButtonTabs/ButtonTabs';\nimport Title from '../../components/Title/Title';\nimport {Col, GridJustifyContent, Row} from '../../grid';\nimport {TabsBlockProps} from '../../models';\nimport {block} from '../../utils';\n\nimport {TabContent} from './TabContent/TabContent';\n\nimport './Tabs.scss';\n\nconst b = block('tabs-block');\n\nexport const TabsBlock = ({\n items,\n title,\n description,\n animated,\n tabsColSizes,\n centered,\n direction = 'media-content',\n contentSize = 's',\n}: TabsBlockProps) => {\n const [activeTab, setActiveTab] = React.useState<string | null>(items[0].tabName);\n const [play, setPlay] = React.useState<boolean>(false);\n\n const tabs: ButtonTabsItemProps[] = items.map(({tabName}) => ({title: tabName, id: tabName}));\n const isReverse = direction === 'content-media';\n\n const tabIds = React.useMemo(\n () =>\n items.reduce(\n (acc, {tabName}) => Object.assign(acc, {[tabName]: getUniqId()}),\n {} as Record<string, string>,\n ),\n [items],\n );\n\n const getTabElementId = (tabId: string) => `${tabIds[tabId]}`;\n const getTabContentElementId = (tabId: string) => `${tabIds[tabId]}-content`;\n\n const onSelectTab = React.useCallback(\n (tabId: string | null, e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n setActiveTab(tabId);\n e.currentTarget.scrollIntoView({\n inline: 'center',\n behavior: 'smooth',\n block: 'nearest',\n });\n },\n [],\n );\n\n return (\n <AnimateBlock className={b()} onScroll={() => setPlay(true)} animate={animated}>\n <Title\n title={title}\n subtitle={description}\n className={b('title', {centered: centered})}\n />\n <Row justifyContent={centered ? GridJustifyContent.Center : undefined}>\n <Col sizes={tabsColSizes}>\n <ButtonTabs\n items={tabs}\n onSelectTab={onSelectTab}\n activeTab={activeTab}\n className={b('tabs', {centered: centered})}\n getTabElementId={getTabElementId}\n getTabContentElementId={getTabContentElementId}\n />\n </Col>\n </Row>\n {items.map((tabData) => {\n const {tabName} = tabData;\n\n return (\n <TabContent\n key={tabName}\n tabData={tabData}\n isActive={tabName === activeTab}\n isReverse={isReverse}\n contentSize={contentSize}\n centered={centered}\n play={play}\n getTabElementId={getTabElementId}\n getTabContentElementId={getTabContentElementId}\n />\n );\n })}\n </AnimateBlock>\n );\n};\n\nexport default TabsBlock;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnpublishedLabel.js","sourceRoot":"../../../../src","sources":["components/UnpublishedLabel/UnpublishedLabel.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,EAAC,IAAI,EAAC,wBAAe;
|
|
1
|
+
{"version":3,"file":"UnpublishedLabel.js","sourceRoot":"../../../../src","sources":["components/UnpublishedLabel/UnpublishedLabel.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,EAAC,IAAI,EAAC,wBAAe;AAE5B,OAAO,wBAAwB,CAAC;AAEhC,MAAM,CAAC,GAAG,KAAK,CAAC,mBAAmB,CAAC,CAAC;AASrC,MAAM,gBAAgB,GAAG,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,IAAI,GAAG,MAAM,GACgC,EAAE,EAAE,CAAC,CAClD,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,SAAS,CAAC,YAAG,QAAQ,IAAI,IAAI,CAAC,qBAAqB,CAAC,GAAO,CACxF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {block} from '../../utils';\n\nimport {i18n} from './i18n';\n\nimport './UnpublishedLabel.scss';\n\nconst b = block('unpublished-label');\n\nexport type LabeLType = 'label' | 'line';\n\nexport interface UnpublishedLabelProps {\n type?: LabeLType;\n className?: string;\n}\n\nconst UnpublishedLabel = ({\n className,\n children,\n type = 'line',\n}: React.PropsWithChildren<UnpublishedLabelProps>) => (\n <div className={b({type}, className)}>{children || i18n('label_non_published')}</div>\n);\n\nexport default UnpublishedLabel;\n"]}
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { LocaleContext } from "../../context/localeContext/index.js";
|
|
4
4
|
import { MobileContext } from "../../context/mobileContext/index.js";
|
|
5
|
+
import { ProjectSettingsContext } from "../../context/projectSettingsContext/index.js";
|
|
5
6
|
import { useAnalytics } from "../../hooks/index.js";
|
|
6
7
|
import { DefaultEventNames } from "../../models/common.js";
|
|
7
8
|
import { block } from "../../utils/index.js";
|
|
8
9
|
import { HEADER_HEIGHT } from "../constants.js";
|
|
9
|
-
import { ProjectSettingsContext } from "../../context/projectSettingsContext/index.js";
|
|
10
10
|
export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
|
|
11
11
|
export const YANDEX_FORM_SECTION = 'surveys';
|
|
12
12
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Yand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,EAAE,aAAa,CAAC,CAAC,CAAC;IAEtC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,SAAS,EAAE,CAAC;QACZ,wCAAwC;QACxC,qFAAqF;QACrF,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAEnC,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IAE3C,OAAO,cAAK,GAAG,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,GAAI,CAAC;AACzE,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {LocaleContext} from '../../context/localeContext';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useAnalytics} from '../../hooks';\nimport {YandexFormProps} from '../../models';\nimport {DefaultEventNames} from '../../models/common';\nimport {block} from '../../utils';\nimport {HEADER_HEIGHT} from '../constants';\nimport {ProjectSettingsContext} from '../../context/projectSettingsContext';\n\nexport const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';\nexport const YANDEX_FORM_SECTION = 'surveys';\nconst CONTAINER_ID = 'pc-yandex-form-container';\n\nconst b = block('yandex-form');\n\nconst YandexForm = (props: YandexFormProps) => {\n const {\n onLoad,\n id,\n params,\n className,\n theme,\n containerId = CONTAINER_ID,\n headerHeight = HEADER_HEIGHT,\n onSubmit,\n analyticsEvents,\n customFormOrigin,\n customFormSection,\n } = props;\n const formContainerRef = React.useRef<HTMLDivElement>(null);\n const iframeRef = React.useRef<HTMLIFrameElement>();\n const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;\n const yaFormSection = customFormSection || YANDEX_FORM_SECTION;\n\n const handleAnalytics = useAnalytics(DefaultEventNames.YandexFormSubmit);\n const isMobile = React.useContext(MobileContext);\n const locale = React.useContext(LocaleContext);\n const {defaultYandexFormTheme} = React.useContext(ProjectSettingsContext);\n\n const updateFormIframe = React.useCallback(\n (container: HTMLDivElement) => {\n const queryParams = new URLSearchParams(location.search);\n const url = location.origin + location.pathname;\n const formTheme = theme || defaultYandexFormTheme;\n\n queryParams.set('url', url);\n queryParams.set('iframe', '1');\n\n if (locale?.lang) {\n queryParams.set('lang', locale.lang);\n }\n\n if (formTheme) {\n queryParams.set('theme', formTheme);\n }\n\n if (isMobile) {\n queryParams.set('media-type', 'mobile');\n }\n\n if (params) {\n Object.keys(params).forEach((param) => {\n queryParams.set(param, params[param]);\n });\n }\n\n const src = `${yaFormOrigin}/${yaFormSection}/${id}/?${queryParams}`;\n\n if (iframeRef.current) {\n iframeRef.current.src = src;\n } else {\n iframeRef.current = document.createElement('iframe');\n iframeRef.current.src = src;\n iframeRef.current.id = containerId;\n iframeRef.current.name = `form${id}`;\n iframeRef.current.setAttribute('loading', 'lazy');\n iframeRef.current.frameBorder = '0';\n iframeRef.current.scrolling = 'no';\n iframeRef.current.width = '100%';\n container.appendChild(iframeRef.current);\n }\n },\n [\n theme,\n defaultYandexFormTheme,\n locale.lang,\n isMobile,\n params,\n yaFormOrigin,\n yaFormSection,\n id,\n containerId,\n ],\n );\n\n const handleSubmit = React.useCallback(() => {\n if (formContainerRef && formContainerRef.current) {\n const {top} = formContainerRef.current.getBoundingClientRect();\n window.scrollBy(0, top - headerHeight);\n }\n\n handleAnalytics(analyticsEvents);\n\n if (onSubmit) {\n onSubmit();\n }\n }, [handleAnalytics, analyticsEvents, onSubmit, headerHeight]);\n\n const handleMessage = React.useCallback(\n ({origin, data}: MessageEvent) => {\n if (origin !== yaFormOrigin) {\n return;\n }\n\n try {\n const parsed = JSON.parse(data);\n const height = parsed['iframe-height'];\n const {message, name, redirectUrl} = parsed;\n if (name !== `form${id}`) {\n return;\n }\n\n if (iframeRef.current && height && !message) {\n iframeRef.current.height = `${height}px`;\n onLoad?.();\n }\n\n if (message === 'sent' || redirectUrl) {\n // event with redirectUrl is comming when form with redirect is used\n // otherwise, message: 'sent' is not comming on such sort of forms\n // to catch this event and handle analytics redirectUrl is added to condition\n handleSubmit();\n }\n } catch {\n return;\n }\n },\n [yaFormOrigin, id, onLoad, handleSubmit],\n );\n\n const addIframe = React.useCallback(() => {\n const container = formContainerRef.current;\n\n if (container) {\n updateFormIframe(container);\n window.addEventListener('message', handleMessage, {passive: true});\n }\n }, [updateFormIframe, handleMessage]);\n\n React.useEffect(() => {\n addIframe();\n // Crunch for mobile chrome in lite mode\n // https://support.google.com/chrome/answer/2392284?co=GENIE.Platform%3DAndroid&oco=1\n setTimeout(() => onLoad?.(), 1000);\n\n return () => window.removeEventListener('message', handleMessage);\n }, [id, addIframe, handleMessage, onLoad]);\n\n return <div ref={formContainerRef} className={b(null, className)} />;\n};\n\nexport default YandexForm;\n"]}
|
|
1
|
+
{"version":3,"file":"YandexForm.js","sourceRoot":"../../../../src","sources":["components/YandexForm/YandexForm.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,aAAa,EAAC,6CAAoC;AAC1D,OAAO,EAAC,aAAa,EAAC,6CAAoC;AAC1D,OAAO,EAAC,sBAAsB,EAAC,sDAA6C;AAC5E,OAAO,EAAC,YAAY,EAAC,6BAAoB;AAEzC,OAAO,EAAC,iBAAiB,EAAC,+BAA4B;AACtD,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,EAAC,aAAa,EAAC,wBAAqB;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAC7C,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAEhD,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAE/B,MAAM,UAAU,GAAG,CAAC,KAAsB,EAA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,CAAC;YAED,IAAI,OAAO,KAAK,MAAM,IAAI,WAAW,EAAE,CAAC;gBACpC,oEAAoE;gBACpE,kEAAkE;gBAClE,6EAA6E;gBAC7E,YAAY,EAAE,CAAC;YACnB,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACL,OAAO;QACX,CAAC;IACL,CAAC,EACD,CAAC,YAAY,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,CAC3C,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACrC,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAO,CAAC;QAE3C,IAAI,SAAS,EAAE,CAAC;YACZ,gBAAgB,CAAC,SAAS,CAAC,CAAC;YAC5B,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QACvE,CAAC;IACL,CAAC,EAAE,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC;IAEtC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,SAAS,EAAE,CAAC;QACZ,wCAAwC;QACxC,qFAAqF;QACrF,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAEnC,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IAE3C,OAAO,cAAK,GAAG,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,GAAI,CAAC;AACzE,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {LocaleContext} from '../../context/localeContext';\nimport {MobileContext} from '../../context/mobileContext';\nimport {ProjectSettingsContext} from '../../context/projectSettingsContext';\nimport {useAnalytics} from '../../hooks';\nimport {YandexFormProps} from '../../models';\nimport {DefaultEventNames} from '../../models/common';\nimport {block} from '../../utils';\nimport {HEADER_HEIGHT} from '../constants';\n\nexport const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';\nexport const YANDEX_FORM_SECTION = 'surveys';\nconst CONTAINER_ID = 'pc-yandex-form-container';\n\nconst b = block('yandex-form');\n\nconst YandexForm = (props: YandexFormProps) => {\n const {\n onLoad,\n id,\n params,\n className,\n theme,\n containerId = CONTAINER_ID,\n headerHeight = HEADER_HEIGHT,\n onSubmit,\n analyticsEvents,\n customFormOrigin,\n customFormSection,\n } = props;\n const formContainerRef = React.useRef<HTMLDivElement>(null);\n const iframeRef = React.useRef<HTMLIFrameElement>();\n const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;\n const yaFormSection = customFormSection || YANDEX_FORM_SECTION;\n\n const handleAnalytics = useAnalytics(DefaultEventNames.YandexFormSubmit);\n const isMobile = React.useContext(MobileContext);\n const locale = React.useContext(LocaleContext);\n const {defaultYandexFormTheme} = React.useContext(ProjectSettingsContext);\n\n const updateFormIframe = React.useCallback(\n (container: HTMLDivElement) => {\n const queryParams = new URLSearchParams(location.search);\n const url = location.origin + location.pathname;\n const formTheme = theme || defaultYandexFormTheme;\n\n queryParams.set('url', url);\n queryParams.set('iframe', '1');\n\n if (locale?.lang) {\n queryParams.set('lang', locale.lang);\n }\n\n if (formTheme) {\n queryParams.set('theme', formTheme);\n }\n\n if (isMobile) {\n queryParams.set('media-type', 'mobile');\n }\n\n if (params) {\n Object.keys(params).forEach((param) => {\n queryParams.set(param, params[param]);\n });\n }\n\n const src = `${yaFormOrigin}/${yaFormSection}/${id}/?${queryParams}`;\n\n if (iframeRef.current) {\n iframeRef.current.src = src;\n } else {\n iframeRef.current = document.createElement('iframe');\n iframeRef.current.src = src;\n iframeRef.current.id = containerId;\n iframeRef.current.name = `form${id}`;\n iframeRef.current.setAttribute('loading', 'lazy');\n iframeRef.current.frameBorder = '0';\n iframeRef.current.scrolling = 'no';\n iframeRef.current.width = '100%';\n container.appendChild(iframeRef.current);\n }\n },\n [\n theme,\n defaultYandexFormTheme,\n locale.lang,\n isMobile,\n params,\n yaFormOrigin,\n yaFormSection,\n id,\n containerId,\n ],\n );\n\n const handleSubmit = React.useCallback(() => {\n if (formContainerRef && formContainerRef.current) {\n const {top} = formContainerRef.current.getBoundingClientRect();\n window.scrollBy(0, top - headerHeight);\n }\n\n handleAnalytics(analyticsEvents);\n\n if (onSubmit) {\n onSubmit();\n }\n }, [handleAnalytics, analyticsEvents, onSubmit, headerHeight]);\n\n const handleMessage = React.useCallback(\n ({origin, data}: MessageEvent) => {\n if (origin !== yaFormOrigin) {\n return;\n }\n\n try {\n const parsed = JSON.parse(data);\n const height = parsed['iframe-height'];\n const {message, name, redirectUrl} = parsed;\n if (name !== `form${id}`) {\n return;\n }\n\n if (iframeRef.current && height && !message) {\n iframeRef.current.height = `${height}px`;\n onLoad?.();\n }\n\n if (message === 'sent' || redirectUrl) {\n // event with redirectUrl is comming when form with redirect is used\n // otherwise, message: 'sent' is not comming on such sort of forms\n // to catch this event and handle analytics redirectUrl is added to condition\n handleSubmit();\n }\n } catch {\n return;\n }\n },\n [yaFormOrigin, id, onLoad, handleSubmit],\n );\n\n const addIframe = React.useCallback(() => {\n const container = formContainerRef.current;\n\n if (container) {\n updateFormIframe(container);\n window.addEventListener('message', handleMessage, {passive: true});\n }\n }, [updateFormIframe, handleMessage]);\n\n React.useEffect(() => {\n addIframe();\n // Crunch for mobile chrome in lite mode\n // https://support.google.com/chrome/answer/2392284?co=GENIE.Platform%3DAndroid&oco=1\n setTimeout(() => onLoad?.(), 1000);\n\n return () => window.removeEventListener('message', handleMessage);\n }, [id, addIframe, handleMessage, onLoad]);\n\n return <div ref={formContainerRef} className={b(null, className)} />;\n};\n\nexport default YandexForm;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"../../../../src","sources":["containers/PageConstructor/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,aAAa,EAAC,sCAAmC;AACzD,OAAO,EAAC,gBAAgB,EAAwB,gDAAuC;AACvF,OAAO,EACH,2BAA2B,EAC3B,YAAY,GAEf,mDAAgD;AACjD,OAAO,EAAC,YAAY,EAAoB,4CAAmC;AAC3E,OAAO,EAAC,aAAa,EAAqB,6CAAoC;AAC9E,OAAO,EAAC,eAAe,EAAuB,+CAAsC;AACpF,OAAO,EAAC,WAAW,EAAmB,eAAe,EAAC,iDAA8C;AACpG,OAAO,EAAC,aAAa,EAAC,6CAAoC;AAC1D,OAAO,EACH,sBAAsB,GAEzB,sDAA6C;AAC9C,OAAO,EAAC,UAAU,EAAkB,0CAAiC;AACrE,OAAO,EAAC,YAAY,EAAC,qCAA4B;
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"../../../../src","sources":["containers/PageConstructor/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,aAAa,EAAC,sCAAmC;AACzD,OAAO,EAAC,gBAAgB,EAAwB,gDAAuC;AACvF,OAAO,EACH,2BAA2B,EAC3B,YAAY,GAEf,mDAAgD;AACjD,OAAO,EAAC,YAAY,EAAoB,4CAAmC;AAC3E,OAAO,EAAC,aAAa,EAAqB,6CAAoC;AAC9E,OAAO,EAAC,eAAe,EAAuB,+CAAsC;AACpF,OAAO,EAAC,WAAW,EAAmB,eAAe,EAAC,iDAA8C;AACpG,OAAO,EAAC,aAAa,EAAC,6CAAoC;AAC1D,OAAO,EACH,sBAAsB,GAEzB,sDAA6C;AAC9C,OAAO,EAAC,UAAU,EAAkB,0CAAiC;AACrE,OAAO,EAAC,YAAY,EAAC,qCAA4B;AACjD,OAAO,EAAC,mBAAmB,EAAC,kDAAyC;AAgBrE,MAAM,CAAC,MAAM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ACpF,iCAAiC;IAEjC,OAAO,KAAC,KAAK,CAAC,QAAQ,cAAE,OAAO,GAAkB,CAAC;AACtD,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {DEFAULT_THEME} from '../../components/constants';\nimport {AnalyticsContext, AnalyticsContextProps} from '../../context/analyticsContext';\nimport {\n DEFAULT_FORMS_CONTEXT_VALUE,\n FormsContext,\n FormsContextProps,\n} from '../../context/formsContext/FormsContext';\nimport {ImageContext, ImageContextProps} from '../../context/imageContext';\nimport {LocaleContext, LocaleContextProps} from '../../context/localeContext';\nimport {LocationContext, LocationContextProps} from '../../context/locationContext';\nimport {MapsContext, MapsContextType, initialMapValue} from '../../context/mapsContext/mapsContext';\nimport {MobileContext} from '../../context/mobileContext';\nimport {\n ProjectSettingsContext,\n ProjectSettingsContextProps,\n} from '../../context/projectSettingsContext';\nimport {SSRContext, SSRContextProps} from '../../context/ssrContext';\nimport {ThemeContext} from '../../context/theme';\nimport {WindowWidthProvider} from '../../context/windowWidthContext';\nimport {Theme} from '../../models';\n\nexport interface PageConstructorProviderProps {\n isMobile?: boolean;\n locale?: LocaleContextProps;\n location?: LocationContextProps;\n ssrConfig?: SSRContextProps;\n theme?: Theme;\n mapsContext?: MapsContextType;\n projectSettings?: ProjectSettingsContextProps;\n analytics?: AnalyticsContextProps;\n forms?: FormsContextProps;\n image?: ImageContextProps;\n}\n\nexport const PageConstructorProvider = (\n props: React.PropsWithChildren<PageConstructorProviderProps>,\n) => {\n const {\n isMobile,\n mapsContext = initialMapValue,\n locale = {},\n location = {},\n analytics = {},\n ssrConfig = {},\n projectSettings = {},\n theme = DEFAULT_THEME,\n children,\n image = {},\n forms = DEFAULT_FORMS_CONTEXT_VALUE,\n } = props;\n\n /* eslint-disable react/jsx-key */\n const context = [\n <ThemeContext.Provider value={{theme}} />,\n <ProjectSettingsContext.Provider value={projectSettings} />,\n <LocaleContext.Provider value={locale} />,\n <ImageContext.Provider value={image} />,\n <LocationContext.Provider value={location} />,\n <MobileContext.Provider value={Boolean(isMobile)} />,\n <MapsContext.Provider value={mapsContext} />,\n <AnalyticsContext.Provider value={analytics} />,\n <FormsContext.Provider value={forms} />,\n <SSRContext.Provider value={{isServer: ssrConfig?.isServer}} />,\n <WindowWidthProvider />,\n ].reduceRight((prev, provider) => React.cloneElement(provider, {}, prev), children);\n /* eslint-enable react/jsx-key */\n\n return <React.Fragment>{context}</React.Fragment>;\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import throttle from "lodash/throttle.js";
|
|
4
|
-
import { SSRContext } from "../ssrContext/index.js";
|
|
5
4
|
import { BREAKPOINTS } from "../../constants.js";
|
|
5
|
+
import { SSRContext } from "../ssrContext/index.js";
|
|
6
6
|
const DEFAULT_WIDTH = BREAKPOINTS.xl;
|
|
7
7
|
const UPDATE_FREQUENCY_MS = 100;
|
|
8
8
|
export const WindowWidthContext = React.createContext(DEFAULT_WIDTH);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreakpointContext.js","sourceRoot":"../../../../src","sources":["context/windowWidthContext/BreakpointContext.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BreakpointContext.js","sourceRoot":"../../../../src","sources":["context/windowWidthContext/BreakpointContext.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,QAAQ,2BAAwB;AAEvC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,UAAU,EAAC,+BAAsB;AAEzC,MAAM,aAAa,GAAG,WAAW,CAAC,EAAE,CAAC;AACrC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAS,aAAa,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAC,QAAQ,EAA0B,EAAE,EAAE;IACvE,MAAM,EAAC,QAAQ,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAEhD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEpE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,QAAQ,EAAE,CAAC;YACX,OAAO;QACX,CAAC;QAED,MAAM,YAAY,GAAG,QAAQ,CACzB,GAAG,EAAE;YACD,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACtC,CAAC,EACD,mBAAmB,EACnB,EAAC,OAAO,EAAE,IAAI,EAAC,CAClB,CAAC;QAEF,YAAY,EAAE,CAAC;QAEf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QAEjE,6CAA6C;QAC7C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACH,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,WAAW,YAAG,QAAQ,GAA+B,CAC5F,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport throttle from 'lodash/throttle';\n\nimport {BREAKPOINTS} from '../../constants';\nimport {SSRContext} from '../ssrContext';\n\nconst DEFAULT_WIDTH = BREAKPOINTS.xl;\nconst UPDATE_FREQUENCY_MS = 100;\n\nexport const WindowWidthContext = React.createContext<number>(DEFAULT_WIDTH);\n\nexport const WindowWidthProvider = ({children}: React.PropsWithChildren) => {\n const {isServer} = React.useContext(SSRContext);\n\n const [windowWidth, setWindowWidth] = React.useState(DEFAULT_WIDTH);\n\n React.useEffect(() => {\n if (isServer) {\n return;\n }\n\n const handleResize = throttle(\n () => {\n setWindowWidth(window.innerWidth);\n },\n UPDATE_FREQUENCY_MS,\n {leading: true},\n );\n\n handleResize();\n\n window.addEventListener('resize', handleResize, {passive: true});\n\n // eslint-disable-next-line consistent-return\n return () => window.removeEventListener('resize', handleResize);\n }, [isServer]);\n\n return (\n <WindowWidthContext.Provider value={windowWidth}>{children}</WindowWidthContext.Provider>\n );\n};\n\nexport const useWindowWidth = () => React.useContext(WindowWidthContext);\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { block } from "../../utils/index.js";
|
|
3
|
-
import '../styles/bootstrap.css';
|
|
4
3
|
import './Grid.css';
|
|
4
|
+
import '../styles/bootstrap.css';
|
|
5
5
|
const b = block('Grid');
|
|
6
6
|
export const Grid = ({ debug, children, className, style, containerClass = '', }) => (_jsx("div", { style: style, className: b({ debug }, className), children: _jsx("div", { className: `container-fluid ${containerClass}`, children: children }) }));
|
|
7
7
|
//# sourceMappingURL=Grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.js","sourceRoot":"../../../../src","sources":["grid/Grid/Grid.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"Grid.js","sourceRoot":"../../../../src","sources":["grid/Grid/Grid.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,YAAY,CAAC;AACpB,OAAO,yBAAyB,CAAC;AAEjC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AASxB,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACjB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,KAAK,EACL,cAAc,GAAG,EAAE,GACc,EAAE,EAAE,CAAC,CACtC,cAAK,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,SAAS,CAAC,YAC/C,cAAK,SAAS,EAAE,mBAAmB,cAAc,EAAE,YAAG,QAAQ,GAAO,GACnE,CACT,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {block} from '../../utils';\n\nimport './Grid.scss';\nimport '../styles/bootstrap.scss';\n\nconst b = block('Grid');\n\nexport interface GridProps {\n debug?: boolean;\n className?: string;\n containerClass?: string;\n style?: React.CSSProperties;\n}\n\nexport const Grid = ({\n debug,\n children,\n className,\n style,\n containerClass = '',\n}: React.PropsWithChildren<GridProps>) => (\n <div style={style} className={b({debug}, className)}>\n <div className={`container-fluid ${containerClass}`}>{children}</div>\n </div>\n);\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { AriaProps, Roleable } from "../../models/index.js";
|
|
2
3
|
import { ClassNameProps, Refable } from "../../models/common.js";
|
|
3
4
|
import { GridAlignItems, GridJustifyContent } from "../types.js";
|
|
4
|
-
import { AriaProps, Roleable } from "../../models/index.js";
|
|
5
5
|
export interface RowProps extends ClassNameProps, Refable<HTMLDivElement>, Roleable, AriaProps {
|
|
6
6
|
id?: string;
|
|
7
7
|
justifyContent?: GridJustifyContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.js","sourceRoot":"../../../../src","sources":["grid/Row/Row.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAA2B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACzE,MAAM,EAAC,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAC,GACzF,KAAK,CAAC;IAEV,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,IAAI,WAAW,CAAC;aACzE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtD,OAAO,CACH,cAAK,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,KAAM,SAAS,YACpF,QAAQ,GACP,CACT,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Row.js","sourceRoot":"../../../../src","sources":["grid/Row/Row.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAA2B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACzE,MAAM,EAAC,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAC,GACzF,KAAK,CAAC;IAEV,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,IAAI,WAAW,CAAC;aACzE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtD,OAAO,CACH,cAAK,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,KAAM,SAAS,YACpF,QAAQ,GACP,CACT,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {AriaProps, Roleable} from '../../models';\nimport {ClassNameProps, Refable} from '../../models/common';\nimport {GridAlignItems, GridJustifyContent} from '../types';\n\nexport interface RowProps extends ClassNameProps, Refable<HTMLDivElement>, Roleable, AriaProps {\n id?: string;\n justifyContent?: GridJustifyContent;\n alignItems?: GridAlignItems;\n noGutter?: boolean;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n}\n\nexport const Row = React.forwardRef<HTMLDivElement, RowProps>((props, ref) => {\n const {id, className, justifyContent, alignItems, noGutter, style, role, ariaProps, children} =\n props;\n\n const getClassName = React.useCallback(() => {\n return ['row', className, justifyContent, alignItems, noGutter && 'no-gutter']\n .filter(Boolean)\n .join(' ');\n }, [className, justifyContent, alignItems, noGutter]);\n\n return (\n <div ref={ref} id={id} className={getClassName()} style={style} role={role} {...ariaProps}>\n {children}\n </div>\n );\n});\n\nRow.displayName = 'Row';\n"]}
|
|
@@ -98,7 +98,7 @@ export interface QuoteProps extends Themable, CardBaseProps {
|
|
|
98
98
|
quoteType?: QuoteType;
|
|
99
99
|
button?: ButtonProps;
|
|
100
100
|
}
|
|
101
|
-
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, '
|
|
101
|
+
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'centered' | 'controlPosition'> {
|
|
102
102
|
url?: string;
|
|
103
103
|
urlTitle?: string;
|
|
104
104
|
background?: ThemeSupporting<ImageObjectProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAYD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n size?: 's' | 'm' | 'l';\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, '
|
|
1
|
+
{"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAYD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n size?: 's' | 'm' | 'l';\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'centered' | 'controlPosition'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n target?: string;\n iconPosition?: IconPosition;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ThemeSupporting } from "../utils/index.js";
|
|
2
|
-
import { ButtonProps, ImageProps } from "./constructor-items/index.js";
|
|
3
2
|
import { AnalyticsEventsBase } from "./common.js";
|
|
3
|
+
import { ButtonProps, ImageProps } from "./constructor-items/index.js";
|
|
4
4
|
export declare enum NavigationItemType {
|
|
5
5
|
Link = "link",
|
|
6
6
|
Dropdown = "dropdown",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"../../../src","sources":["models/navigation.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC1B,mCAAa,CAAA;IACb,2CAAqB,CAAA;IACrB,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,oDAA8B,CAAA;AAClC,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AASrE,MAAM,CAAN,IAAY,0BAWX;AAXD,WAAY,0BAA0B;IAClC,qDAAuB,CAAA;IACvB,iDAAmB,CAAA;IACnB,mDAAqB,CAAA;IACrB,0DAA4B,CAAA;IAC5B,4DAA8B,CAAA;IAC9B,oEAAsC,CAAA;IACtC,2DAA6B,CAAA;IAC7B,yDAA2B,CAAA;IAC3B,gEAAkC,CAAA;IAClC,mDAAqB,CAAA;AACzB,CAAC,EAXW,0BAA0B,KAA1B,0BAA0B,QAWrC","sourcesContent":["import {ThemeSupporting} from '../utils';\n\nimport {
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"../../../src","sources":["models/navigation.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC1B,mCAAa,CAAA;IACb,2CAAqB,CAAA;IACrB,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,oDAA8B,CAAA;AAClC,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AASrE,MAAM,CAAN,IAAY,0BAWX;AAXD,WAAY,0BAA0B;IAClC,qDAAuB,CAAA;IACvB,iDAAmB,CAAA;IACnB,mDAAqB,CAAA;IACrB,0DAA4B,CAAA;IAC5B,4DAA8B,CAAA;IAC9B,oEAAsC,CAAA;IACtC,2DAA6B,CAAA;IAC7B,yDAA2B,CAAA;IAC3B,gEAAkC,CAAA;IAClC,mDAAqB,CAAA;AACzB,CAAC,EAXW,0BAA0B,KAA1B,0BAA0B,QAWrC","sourcesContent":["import {ThemeSupporting} from '../utils';\n\nimport {AnalyticsEventsBase} from './common';\nimport {ButtonProps, ImageProps} from './constructor-items';\n\nexport enum NavigationItemType {\n Link = 'link',\n Dropdown = 'dropdown',\n Button = 'button',\n Social = 'social',\n GithubButton = 'github-button',\n}\n\nexport const NavigationItemTypes = Object.values(NavigationItemType);\n\nexport interface NavigationItemBase {\n text: string;\n icon?: ImageProps;\n url?: string;\n iconSize?: number;\n}\n\nexport enum NavigationGithubButtonIcon {\n heart = 'octicon-heart',\n eye = 'octicon-eye',\n star = 'octicon-star',\n fork = 'octicon-repo-forked',\n issue = 'octicon-issue-opened',\n comment = 'octicon-comment-discussion',\n download = 'octicon-download',\n package = 'octicon-package',\n template = 'octicon-repo-template',\n play = 'octicon-play',\n}\n\nexport interface NavigationGithubButton extends Omit<NavigationItemBase, 'icon'> {\n type: NavigationItemType.GithubButton;\n url: string;\n urlTitle?: string;\n label?: string;\n icon?: keyof typeof NavigationGithubButtonIcon;\n size?: string;\n}\n\nexport interface NavigationLinkItem extends Omit<NavigationItemBase, 'url'>, AnalyticsEventsBase {\n type: NavigationItemType.Link;\n url: string;\n urlTitle?: string;\n arrow?: boolean;\n target?: string;\n}\n\nexport interface NavigationButtonItem extends ButtonProps {\n type: NavigationItemType.Button;\n}\n\nexport interface NavigationDropdownItem extends NavigationItemBase {\n type: NavigationItemType.Dropdown;\n items: NavigationLinkItem[];\n hidePopup: () => void;\n isActive: boolean;\n}\n\nexport interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {\n type: NavigationItemType.Social;\n icon: ImageProps;\n url: string;\n urlTitle?: string;\n}\n\nexport type NavigationItemModel =\n | NavigationLinkItem\n | NavigationButtonItem\n | NavigationDropdownItem;\n\nexport type NavigationItemData =\n | NavigationLinkItem\n | NavigationButtonItem\n | NavigationSocialItem\n | NavigationDropdownItem;\n\nexport interface NavigationLogoData {\n icon: ImageProps;\n text?: string;\n url?: string;\n urlTitle?: string;\n alt?: string;\n}\n\nexport type ThemedNavigationLogoData = NavigationLogoData & ThemeSupporting<NavigationLogoData>;\n\nexport interface HeaderData {\n leftItems: NavigationItemModel[];\n rightItems?: NavigationItemModel[];\n\n /**\n * Items for the navigation header on mobile devices.\n * They are located to the right of the Logo and to the left of the MobileMenuButton.\n * @type {NavigationItemModel[]}\n */\n customMobileHeaderItems?: NavigationItemModel[];\n iconSize?: number;\n withBorder?: boolean;\n withBorderOnScroll?: boolean;\n}\n\nexport interface FooterColumn {\n title: string;\n links: NavigationItemModel[];\n}\n\nexport interface FooterUnderline {\n links?: NavigationItemModel[];\n copyright?: string;\n}\n\nexport interface FooterData {\n columns: FooterColumn[];\n social?: NavigationSocialItem[];\n underline?: FooterUnderline;\n}\n\nexport interface NavigationData {\n logo: ThemedNavigationLogoData;\n header: HeaderData;\n footer?: FooterData;\n renderNavigation?: () => React.ReactNode;\n}\n"]}
|
|
@@ -7,13 +7,13 @@ import Content from "../Content/Content.js";
|
|
|
7
7
|
import './BackgroundCard.css';
|
|
8
8
|
const b = block('background-card');
|
|
9
9
|
const BackgroundCard = (props) => {
|
|
10
|
-
const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', list, size = 's', } = props;
|
|
10
|
+
const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, colSizes = { all: 12, md: 12 }, controlPosition = 'content', list, size = 's', } = props;
|
|
11
11
|
const titleId = useUniqId();
|
|
12
12
|
const theme = useTheme();
|
|
13
13
|
const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
|
|
14
14
|
const borderType = hasBackgroundColor ? 'none' : border;
|
|
15
15
|
const areControlsInFooter = !paddingBottom && controlPosition === 'footer';
|
|
16
|
-
return (_jsx(CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), contentClassName: b('content'), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle, children: _jsxs(CardBase.Content, { children: [_jsx(BackgroundImage, { className: b('image'), ...getThemedValue(background, theme), style: { backgroundColor } }), _jsx(Content, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: size, theme: cardTheme, links: links, buttons: buttons, list: list, colSizes:
|
|
16
|
+
return (_jsx(CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), contentClassName: b('content'), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle, children: _jsxs(CardBase.Content, { children: [_jsx(BackgroundImage, { className: b('image'), ...getThemedValue(background, theme), style: { backgroundColor } }), _jsx(Content, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: size, theme: cardTheme, links: links, buttons: buttons, list: list, colSizes: colSizes, controlPosition: areControlsInFooter ? 'bottom' : 'default' })] }) }));
|
|
17
17
|
};
|
|
18
18
|
export default BackgroundCard;
|
|
19
19
|
//# sourceMappingURL=BackgroundCard.js.map
|
|
@@ -1 +1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niqId} from '@gravity-ui/uikit';\n\nimport {BackgroundImage, CardBase} from '../../components/';\nimport {useTheme} from '../../context/theme';\nimport {BackgroundCardProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BackgroundCard.scss';\n\nconst b = block('background-card');\n\nconst BackgroundCard = (props: BackgroundCardProps) => {\n const {\n url,\n title,\n text,\n border,\n background,\n paddingBottom,\n backgroundColor,\n additionalInfo,\n theme: cardTheme = 'default',\n links,\n buttons,\n analyticsEvents,\n urlTitle,\n colSizes = {all: 12, md: 12},\n controlPosition = 'content',\n list,\n size = 's',\n } = props;\n\n const titleId = useUniqId();\n\n const theme = useTheme();\n const hasBackgroundColor = backgroundColor || cardTheme !== 'default';\n const borderType = hasBackgroundColor ? 'none' : border;\n const areControlsInFooter = !paddingBottom && controlPosition === 'footer';\n\n return (\n <CardBase\n className={b({padding: paddingBottom, theme: cardTheme})}\n contentClassName={b('content')}\n url={url}\n border={borderType}\n analyticsEvents={analyticsEvents}\n urlTitle={urlTitle}\n >\n <CardBase.Content>\n <BackgroundImage\n className={b('image')}\n {...getThemedValue(background, theme)}\n style={{backgroundColor}}\n />\n <Content\n titleId={titleId}\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n size={size}\n theme={cardTheme}\n links={links}\n buttons={buttons}\n list={list}\n colSizes={colSizes}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BackgroundCard;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import omit from "lodash/omit.js";
|
|
2
2
|
import { ImageObjectProps } from "../../components/Image/schema.js";
|
|
3
|
-
import { BaseProps, CardBase, CardLayoutProps, withTheme } from "../../schema/validators/common.js";
|
|
3
|
+
import { BaseProps, CardBase, CardLayoutProps, containerSizesObject, withTheme, } from "../../schema/validators/common.js";
|
|
4
4
|
import { AnalyticsEventSchema } from "../../schema/validators/event.js";
|
|
5
5
|
import { ContentBase } from "../Content/schema.js";
|
|
6
6
|
const BackgroundCardContentProps = omit(ContentBase, ['size', 'controlPosition']);
|
|
@@ -44,6 +44,7 @@ export const BackgroundCard = {
|
|
|
44
44
|
type: 'string',
|
|
45
45
|
enum: ['content', 'footer'],
|
|
46
46
|
},
|
|
47
|
+
colSizes: containerSizesObject,
|
|
47
48
|
},
|
|
48
49
|
},
|
|
49
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/BackgroundCard/schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,uBAAoB;AAE/B,OAAO,EAAC,gBAAgB,EAAC,yCAAsC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/BackgroundCard/schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,uBAAoB;AAE/B,OAAO,EAAC,gBAAgB,EAAC,yCAAsC;AAC/D,OAAO,EACH,SAAS,EACT,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,SAAS,GACZ,0CAAuC;AACxC,OAAO,EAAC,oBAAoB,EAAC,yCAAsC;AACnE,OAAO,EAAC,WAAW,EAAC,6BAA0B;AAE9C,MAAM,0BAA0B,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAElF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,iBAAiB,EAAE;QACf,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;QAC3B,UAAU,EAAE;YACR,GAAG,SAAS;YACZ,GAAG,QAAQ;YACX,GAAG,eAAe;YAClB,GAAG,0BAA0B;YAC7B,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB;YACD,UAAU,EAAE,SAAS,CAAC,gBAAgB,CAAC;YACvC,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;aACjB;YACD,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC;aAC9B;YACD,eAAe,EAAE;gBACb,KAAK,EAAE;oBACH;wBACI,GAAG,oBAAoB;wBACvB,UAAU,EAAE,QAAQ;qBACvB;oBACD;wBACI,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,oBAAoB;wBAC3B,UAAU,EAAE,MAAM;qBACrB;iBACJ;aACJ;YACD,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;aAC9B;YACD,QAAQ,EAAE,oBAAoB;SACjC;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {ImageObjectProps} from '../../components/Image/schema';\nimport {\n BaseProps,\n CardBase,\n CardLayoutProps,\n containerSizesObject,\n withTheme,\n} from '../../schema/validators/common';\nimport {AnalyticsEventSchema} from '../../schema/validators/event';\nimport {ContentBase} from '../Content/schema';\n\nconst BackgroundCardContentProps = omit(ContentBase, ['size', 'controlPosition']);\n\nexport const BackgroundCard = {\n 'background-card': {\n additionalProperties: false,\n required: ['title', 'text'],\n properties: {\n ...BaseProps,\n ...CardBase,\n ...CardLayoutProps,\n ...BackgroundCardContentProps,\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n background: withTheme(ImageObjectProps),\n backgroundColor: {\n type: 'string',\n },\n paddingBottom: {\n type: 'string',\n enum: ['s', 'm', 'l', 'xl'],\n },\n analyticsEvents: {\n oneOf: [\n {\n ...AnalyticsEventSchema,\n optionName: 'single',\n },\n {\n type: 'array',\n items: AnalyticsEventSchema,\n optionName: 'list',\n },\n ],\n },\n controlPosition: {\n type: 'string',\n enum: ['content', 'footer'],\n },\n colSizes: containerSizesObject,\n },\n },\n};\n"]}
|