@gravity-ui/page-constructor 6.2.1 → 6.3.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.
Files changed (50) hide show
  1. package/build/cjs/blocks/Tabs/TabContent/TabContent.css +77 -0
  2. package/build/cjs/blocks/Tabs/TabContent/TabContent.d.ts +12 -0
  3. package/build/cjs/blocks/Tabs/TabContent/TabContent.js +70 -0
  4. package/build/cjs/blocks/Tabs/TabContent/TabContent.js.map +1 -0
  5. package/build/cjs/blocks/Tabs/Tabs.css +0 -72
  6. package/build/cjs/blocks/Tabs/Tabs.js +13 -57
  7. package/build/cjs/blocks/Tabs/Tabs.js.map +1 -1
  8. package/build/cjs/components/Button/Button.d.ts +1 -0
  9. package/build/cjs/components/Button/Button.js.map +1 -1
  10. package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +2 -0
  11. package/build/cjs/components/ButtonTabs/ButtonTabs.js +3 -2
  12. package/build/cjs/components/ButtonTabs/ButtonTabs.js.map +1 -1
  13. package/build/cjs/components/VideoBlock/VideoBlock.js +1 -1
  14. package/build/cjs/components/VideoBlock/VideoBlock.js.map +1 -1
  15. package/build/cjs/context/projectSettingsContext/ProjectSettingsContext.d.ts +1 -0
  16. package/build/cjs/context/projectSettingsContext/ProjectSettingsContext.js.map +1 -1
  17. package/build/cjs/grid/Col/Col.d.ts +3 -2
  18. package/build/cjs/grid/Col/Col.js +2 -2
  19. package/build/cjs/grid/Col/Col.js.map +1 -1
  20. package/build/cjs/grid/Row/Row.d.ts +4 -3
  21. package/build/cjs/grid/Row/Row.js +2 -2
  22. package/build/cjs/grid/Row/Row.js.map +1 -1
  23. package/build/cjs/models/constructor-items/common.d.ts +3 -0
  24. package/build/cjs/models/constructor-items/common.js.map +1 -1
  25. package/build/esm/blocks/Tabs/TabContent/TabContent.css +77 -0
  26. package/build/esm/blocks/Tabs/TabContent/TabContent.d.ts +13 -0
  27. package/build/esm/blocks/Tabs/TabContent/TabContent.js +66 -0
  28. package/build/esm/blocks/Tabs/TabContent/TabContent.js.map +1 -0
  29. package/build/esm/blocks/Tabs/Tabs.css +0 -72
  30. package/build/esm/blocks/Tabs/Tabs.js +13 -57
  31. package/build/esm/blocks/Tabs/Tabs.js.map +1 -1
  32. package/build/esm/components/Button/Button.d.ts +1 -0
  33. package/build/esm/components/Button/Button.js.map +1 -1
  34. package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +2 -0
  35. package/build/esm/components/ButtonTabs/ButtonTabs.js +3 -2
  36. package/build/esm/components/ButtonTabs/ButtonTabs.js.map +1 -1
  37. package/build/esm/components/VideoBlock/VideoBlock.js +1 -1
  38. package/build/esm/components/VideoBlock/VideoBlock.js.map +1 -1
  39. package/build/esm/context/projectSettingsContext/ProjectSettingsContext.d.ts +1 -0
  40. package/build/esm/context/projectSettingsContext/ProjectSettingsContext.js.map +1 -1
  41. package/build/esm/grid/Col/Col.d.ts +3 -2
  42. package/build/esm/grid/Col/Col.js +2 -2
  43. package/build/esm/grid/Col/Col.js.map +1 -1
  44. package/build/esm/grid/Row/Row.d.ts +4 -3
  45. package/build/esm/grid/Row/Row.js +2 -2
  46. package/build/esm/grid/Row/Row.js.map +1 -1
  47. package/build/esm/models/constructor-items/common.d.ts +3 -0
  48. package/build/esm/models/constructor-items/common.js.map +1 -1
  49. package/package.json +1 -1
  50. package/server/models/constructor-items/common.d.ts +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonTabs.js","sourceRoot":"../../../../src","sources":["components/ButtonTabs/ButtonTabs.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,EAAC,MAAM,EAAC,oBAAiB;AAEhC,OAAO,kBAAkB,CAAC;AAE1B,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAmB/B,MAAM,UAAU,GAA8B,CAAC,EAC3C,SAAS,EACT,KAAK,E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QAProps} from '../../models';\nimport {block} from '../../utils';\nimport {Button} from '../index';\n\nimport './ButtonTabs.scss';\n\nconst b = block('button-tabs');\n\nexport interface ButtonTabsItemProps\n extends Omit<ButtonProps, 'url' | 'primary' | 'target' | 'text'> {\n id: string | null;\n title: string;\n}\n\nexport interface ButtonTabsProps extends QAProps {\n className?: string;\n items: ButtonTabsItemProps[];\n activeTab?: string | null;\n onSelectTab?: (\n tabId: string | null,\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>,\n ) => void;\n tabSize?: ButtonSize;\n}\n\nconst ButtonTabs: React.FC<ButtonTabsProps> = ({\n className,\n items,\n activeTab,\n onSelectTab,\n tabSize = 'l',\n qa,\n}) => {\n const activeTabId: string | null = React.useMemo(() => {\n if (activeTab) {\n return activeTab;\n }\n\n return items[0].id;\n }, [activeTab, items]);\n\n const handleClick = React.useCallback(\n (tabId: string | null) => (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n if (onSelectTab) {\n onSelectTab(tabId, e);\n }\n },\n [onSelectTab],\n );\n\n return (\n <div className={b(null, className)} role=\"tablist\" data-qa={qa}>\n {items.map(({id, title}) => {\n const isActive = id === activeTabId;\n\n return (\n <Button\n text={title}\n className={b('item', {active: isActive})}\n key={title}\n size={tabSize}\n onClick={handleClick(id)}\n extraProps={{\n role: 'tab',\n 'aria-selected': isActive,\n }}\n />\n );\n })}\n </div>\n );\n};\n\nexport default ButtonTabs;\n"]}
1
+ {"version":3,"file":"ButtonTabs.js","sourceRoot":"../../../../src","sources":["components/ButtonTabs/ButtonTabs.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,EAAC,MAAM,EAAC,oBAAiB;AAEhC,OAAO,kBAAkB,CAAC;AAE1B,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAqB/B,MAAM,UAAU,GAA8B,CAAC,EA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ARI,KAAK,CASZ,CACL,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {ButtonProps, QAProps} from '../../models';\nimport {block} from '../../utils';\nimport {Button} from '../index';\n\nimport './ButtonTabs.scss';\n\nconst b = block('button-tabs');\n\nexport interface ButtonTabsItemProps\n extends Omit<ButtonProps, 'url' | 'primary' | 'target' | 'text'> {\n id: string | null;\n title: string;\n}\n\nexport interface ButtonTabsProps extends QAProps {\n className?: string;\n items: ButtonTabsItemProps[];\n activeTab?: string | null;\n onSelectTab?: (\n tabId: string | null,\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>,\n ) => void;\n tabSize?: ButtonSize;\n getTabElementId?: (tabId: string) => string;\n getTabContentElementId?: (tabId: string) => string;\n}\n\nconst ButtonTabs: React.FC<ButtonTabsProps> = ({\n className,\n items,\n activeTab,\n onSelectTab,\n tabSize = 'l',\n qa,\n getTabElementId,\n getTabContentElementId,\n}) => {\n const activeTabId: string | null = React.useMemo(() => {\n if (activeTab) {\n return activeTab;\n }\n\n return items[0].id;\n }, [activeTab, items]);\n\n const handleClick = React.useCallback(\n (tabId: string | null) => (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n if (onSelectTab) {\n onSelectTab(tabId, e);\n }\n },\n [onSelectTab],\n );\n\n return (\n <div className={b(null, className)} role=\"tablist\" data-qa={qa}>\n {items.map(({id, title}) => {\n const isActive = id === activeTabId;\n\n return (\n <Button\n text={title}\n className={b('item', {active: isActive})}\n key={title}\n size={tabSize}\n onClick={handleClick(id)}\n id={getTabElementId?.(id ?? '')}\n extraProps={{\n role: 'tab',\n 'aria-selected': isActive,\n 'aria-controls': getTabContentElementId?.(id ?? ''),\n }}\n />\n );\n })}\n </div>\n );\n};\n\nexport default ButtonTabs;\n"]}
@@ -86,7 +86,7 @@ const VideoBlock = (props) => {
86
86
  };
87
87
  }, [height]);
88
88
  const iframeContent = React.useMemo(() => {
89
- return (_jsx("iframe", { id: fullId, src: iframeSrc, width: "100%", height: "100%", title: i18n('iframe-title'), frameBorder: "0", allowFullScreen: true, allow: "autoplay; fullscreen; encrypted-media; accelerometer; gyroscope; picture-in-picture; clipboard-write; web-share; screen-wake-lock", loading: "lazy" }));
89
+ return (_jsx("iframe", { id: fullId, src: iframeSrc, width: "100%", height: "100%", title: i18n('iframe-title'), frameBorder: "0", allowFullScreen: true, scrolling: "no", allow: "autoplay; fullscreen; encrypted-media; accelerometer; gyroscope; picture-in-picture; clipboard-write; web-share; screen-wake-lock", loading: "lazy" }));
90
90
  }, [fullId, iframeSrc]);
91
91
  React.useEffect(() => {
92
92
  setHidePreview(false);
@@ -1 +1 @@
1
- {"version":3,"file":"VideoBlock.js","sourceRoot":"../../../../src","sources":["components/VideoBlock/VideoBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,QAAQ,2BAAwB;AACvC,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,YAAY,EAAC,oCAAiC;AACtD,OAAO,EAAsB,iBAAiB,EAAC,+BAA4B;AAC3E,OAAO,EAAC,KAAK,EAAE,mBAAmB,EAAC,6BAAoB;AACvD,OAAO,KAAK,0BAAuB;AAEnC,OAAO,EAAC,IAAI,EAAC,wBAAe;AAE5B,OAAO,kBAAkB,CAAC;AAE1B,MAAM,UAAU,GAAG,gCAAgC,CAAC;AACpD,MAAM,UAAU,GAAG,oDAAoD,CAAC;AACxE,MAAM,SAAS,GAAG,mBAAmB,CAAC;AACtC,MAAM,SAAS,GAAG,sBAAsB,CAAC;A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IAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAI,GACnD,CACZ,IACC,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {PlayFill} from '@gravity-ui/icons';\nimport {Icon, useActionHandlers, useUniqId} from '@gravity-ui/uikit';\nimport debounce from 'lodash/debounce';\nimport {v4 as uuidv4} from 'uuid';\n\nimport {useAnalytics} from '../../hooks/useAnalytics';\nimport {AnalyticsEventsBase, DefaultEventNames} from '../../models/common';\nimport {block, getPageSearchParams} from '../../utils';\nimport Image from '../Image/Image';\n\nimport {i18n} from './i18n';\n\nimport './VideoBlock.scss';\n\nconst RECORD_URL = 'https://www.youtube.com/embed/';\nconst STREAM_URL = 'https://www.youtube.com/embed/live_stream?channel=';\nconst RECORD_RE = /[0-9A-Za-z_-]{11}/;\nconst STREAM_RE = /[0-9A-Za-z_-]{23,25}/;\nconst AUTOPLAY_DELAY = 300;\n\nexport const AUTOPLAY_ATTRIBUTES = {\n autoplay: 1,\n mute: 1,\n};\nconst NO_AUTOPLAY_ATTRIBUTES = {\n autoplay: 0,\n};\n\nconst b = block('VideoBlock');\n\nfunction getYoutubeVideoSrc(stream?: string, record?: string) {\n if (!stream && !record) {\n return null;\n }\n\n const [videoLink, url, re] = stream\n ? [stream, STREAM_URL, STREAM_RE]\n : [record, RECORD_URL, RECORD_RE];\n const match = videoLink?.match(re);\n let src;\n\n if (match && match.length) {\n src = url + match[0];\n }\n\n return src;\n}\n\nexport function getHeight(width: number): number {\n return (width / 16) * 9;\n}\n\nexport interface VideoBlockProps extends AnalyticsEventsBase {\n id?: string;\n stream?: string;\n record?: string;\n videoIframe?: string;\n attributes?: Record<string, string>;\n className?: string;\n previewImg?: string;\n playButton?: React.ReactNode;\n playButtonId?: string;\n height?: number;\n fullscreen?: boolean;\n autoplay?: boolean;\n onImageLoad?: () => void;\n}\n\nconst VideoBlock = (props: VideoBlockProps) => {\n const {\n stream,\n record,\n videoIframe,\n attributes,\n className,\n id,\n previewImg,\n playButton,\n playButtonId,\n height,\n fullscreen,\n analyticsEvents,\n autoplay,\n onImageLoad,\n } = props;\n const handleAnalytics = useAnalytics(DefaultEventNames.VideoPreview);\n\n const src = videoIframe ? videoIframe : getYoutubeVideoSrc(stream, record);\n const ref = React.useRef<HTMLDivElement>(null);\n const [hidePreview, setHidePreview] = React.useState(false);\n const [currentHeight, setCurrentHeight] = React.useState(height || undefined);\n const fullId = React.useMemo(() => id || uuidv4(), [id]);\n const buttonId = useUniqId();\n\n const [isPlaying, setIsPlaying] = React.useState(!previewImg);\n\n const iframeSrc = React.useMemo(() => {\n if (src && isPlaying) {\n try {\n const url = new URL(src);\n const searchParams = getPageSearchParams({\n ...(attributes || {}),\n ...(previewImg || autoplay ? AUTOPLAY_ATTRIBUTES : NO_AUTOPLAY_ATTRIBUTES),\n });\n\n searchParams.forEach((value, key) => {\n url.searchParams.set(key, value);\n });\n\n return url.href;\n } catch (e) {\n return src;\n }\n }\n\n return undefined;\n }, [attributes, autoplay, isPlaying, previewImg, src]);\n\n const onPreviewClick = React.useCallback(() => {\n handleAnalytics(analyticsEvents);\n\n setIsPlaying(true);\n\n setTimeout(() => setHidePreview(true), AUTOPLAY_DELAY);\n }, [handleAnalytics, analyticsEvents]);\n\n const {onKeyDown: onPreviewKeyDown} = useActionHandlers(onPreviewClick);\n\n React.useEffect(() => {\n const updateSize = debounce(() => {\n setCurrentHeight(\n ref.current ? Math.round(getHeight(ref.current.offsetWidth)) : undefined,\n );\n }, 100);\n\n updateSize();\n window.addEventListener('resize', updateSize, {passive: true});\n return () => {\n window.removeEventListener('resize', updateSize);\n };\n }, [height]);\n\n const iframeContent = React.useMemo(() => {\n return (\n <iframe\n id={fullId}\n src={iframeSrc}\n width=\"100%\"\n height=\"100%\"\n title={i18n('iframe-title')}\n frameBorder=\"0\"\n allowFullScreen={true}\n allow=\"autoplay; fullscreen; encrypted-media; accelerometer; gyroscope; picture-in-picture; clipboard-write; web-share; screen-wake-lock\"\n loading=\"lazy\"\n />\n );\n }, [fullId, iframeSrc]);\n\n React.useEffect(() => {\n setHidePreview(false);\n }, [src]);\n\n if (!src) {\n return null;\n }\n\n return (\n <div className={b(null, className)} style={{height: currentHeight}} ref={ref}>\n {iframeContent}\n {previewImg && !hidePreview && !fullscreen && (\n <div\n className={b('preview')}\n onClick={onPreviewClick}\n onKeyDown={onPreviewKeyDown}\n role=\"button\"\n tabIndex={0}\n aria-labelledby={playButton ? playButtonId : buttonId}\n >\n <Image\n src={previewImg}\n className={b('image')}\n containerClassName={b('image-wrapper')}\n onLoad={onImageLoad}\n />\n {playButton || (\n <button title=\"Play\" id={buttonId} className={b('button')}>\n <Icon className={b('icon')} data={PlayFill} size={24} />\n </button>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default VideoBlock;\n"]}
1
+ {"version":3,"file":"VideoBlock.js","sourceRoot":"../../../../src","sources":["components/VideoBlock/VideoBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,QAAQ,2BAAwB;AACvC,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,YAAY,EAAC,oCAAiC;AACtD,OAAO,EAAsB,iBAAiB,EAAC,+BAA4B;AAC3E,OAAO,EAAC,KAAK,EAAE,mBAAmB,EAAC,6BAAoB;AACvD,OAAO,KAAK,0BAAuB;AAEnC,OAAO,EAAC,IAAI,EAAC,wBAAe;AAE5B,OAAO,kBAAkB,CAAC;AAE1B,MAAM,UAAU,GAAG,gCAAgC,CAAC;AACpD,MAAM,UAAU,GAAG,oDAAoD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Q,KAAK,EAAC,MAAM,EAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,YACrD,KAAC,IAAI,IAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAI,GACnD,CACZ,IACC,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {PlayFill} from '@gravity-ui/icons';\nimport {Icon, useActionHandlers, useUniqId} from '@gravity-ui/uikit';\nimport debounce from 'lodash/debounce';\nimport {v4 as uuidv4} from 'uuid';\n\nimport {useAnalytics} from '../../hooks/useAnalytics';\nimport {AnalyticsEventsBase, DefaultEventNames} from '../../models/common';\nimport {block, getPageSearchParams} from '../../utils';\nimport Image from '../Image/Image';\n\nimport {i18n} from './i18n';\n\nimport './VideoBlock.scss';\n\nconst RECORD_URL = 'https://www.youtube.com/embed/';\nconst STREAM_URL = 'https://www.youtube.com/embed/live_stream?channel=';\nconst RECORD_RE = /[0-9A-Za-z_-]{11}/;\nconst STREAM_RE = /[0-9A-Za-z_-]{23,25}/;\nconst AUTOPLAY_DELAY = 300;\n\nexport const AUTOPLAY_ATTRIBUTES = {\n autoplay: 1,\n mute: 1,\n};\nconst NO_AUTOPLAY_ATTRIBUTES = {\n autoplay: 0,\n};\n\nconst b = block('VideoBlock');\n\nfunction getYoutubeVideoSrc(stream?: string, record?: string) {\n if (!stream && !record) {\n return null;\n }\n\n const [videoLink, url, re] = stream\n ? [stream, STREAM_URL, STREAM_RE]\n : [record, RECORD_URL, RECORD_RE];\n const match = videoLink?.match(re);\n let src;\n\n if (match && match.length) {\n src = url + match[0];\n }\n\n return src;\n}\n\nexport function getHeight(width: number): number {\n return (width / 16) * 9;\n}\n\nexport interface VideoBlockProps extends AnalyticsEventsBase {\n id?: string;\n stream?: string;\n record?: string;\n videoIframe?: string;\n attributes?: Record<string, string>;\n className?: string;\n previewImg?: string;\n playButton?: React.ReactNode;\n playButtonId?: string;\n height?: number;\n fullscreen?: boolean;\n autoplay?: boolean;\n onImageLoad?: () => void;\n}\n\nconst VideoBlock = (props: VideoBlockProps) => {\n const {\n stream,\n record,\n videoIframe,\n attributes,\n className,\n id,\n previewImg,\n playButton,\n playButtonId,\n height,\n fullscreen,\n analyticsEvents,\n autoplay,\n onImageLoad,\n } = props;\n const handleAnalytics = useAnalytics(DefaultEventNames.VideoPreview);\n\n const src = videoIframe ? videoIframe : getYoutubeVideoSrc(stream, record);\n const ref = React.useRef<HTMLDivElement>(null);\n const [hidePreview, setHidePreview] = React.useState(false);\n const [currentHeight, setCurrentHeight] = React.useState(height || undefined);\n const fullId = React.useMemo(() => id || uuidv4(), [id]);\n const buttonId = useUniqId();\n\n const [isPlaying, setIsPlaying] = React.useState(!previewImg);\n\n const iframeSrc = React.useMemo(() => {\n if (src && isPlaying) {\n try {\n const url = new URL(src);\n const searchParams = getPageSearchParams({\n ...(attributes || {}),\n ...(previewImg || autoplay ? AUTOPLAY_ATTRIBUTES : NO_AUTOPLAY_ATTRIBUTES),\n });\n\n searchParams.forEach((value, key) => {\n url.searchParams.set(key, value);\n });\n\n return url.href;\n } catch (e) {\n return src;\n }\n }\n\n return undefined;\n }, [attributes, autoplay, isPlaying, previewImg, src]);\n\n const onPreviewClick = React.useCallback(() => {\n handleAnalytics(analyticsEvents);\n\n setIsPlaying(true);\n\n setTimeout(() => setHidePreview(true), AUTOPLAY_DELAY);\n }, [handleAnalytics, analyticsEvents]);\n\n const {onKeyDown: onPreviewKeyDown} = useActionHandlers(onPreviewClick);\n\n React.useEffect(() => {\n const updateSize = debounce(() => {\n setCurrentHeight(\n ref.current ? Math.round(getHeight(ref.current.offsetWidth)) : undefined,\n );\n }, 100);\n\n updateSize();\n window.addEventListener('resize', updateSize, {passive: true});\n return () => {\n window.removeEventListener('resize', updateSize);\n };\n }, [height]);\n\n const iframeContent = React.useMemo(() => {\n return (\n <iframe\n id={fullId}\n src={iframeSrc}\n width=\"100%\"\n height=\"100%\"\n title={i18n('iframe-title')}\n frameBorder=\"0\"\n allowFullScreen={true}\n scrolling=\"no\"\n allow=\"autoplay; fullscreen; encrypted-media; accelerometer; gyroscope; picture-in-picture; clipboard-write; web-share; screen-wake-lock\"\n loading=\"lazy\"\n />\n );\n }, [fullId, iframeSrc]);\n\n React.useEffect(() => {\n setHidePreview(false);\n }, [src]);\n\n if (!src) {\n return null;\n }\n\n return (\n <div className={b(null, className)} style={{height: currentHeight}} ref={ref}>\n {iframeContent}\n {previewImg && !hidePreview && !fullscreen && (\n <div\n className={b('preview')}\n onClick={onPreviewClick}\n onKeyDown={onPreviewKeyDown}\n role=\"button\"\n tabIndex={0}\n aria-labelledby={playButton ? playButtonId : buttonId}\n >\n <Image\n src={previewImg}\n className={b('image')}\n containerClassName={b('image-wrapper')}\n onLoad={onImageLoad}\n />\n {playButton || (\n <button title=\"Play\" id={buttonId} className={b('button')}>\n <Icon className={b('icon')} data={PlayFill} size={24} />\n </button>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default VideoBlock;\n"]}
@@ -2,5 +2,6 @@ import * as React from 'react';
2
2
  export interface ProjectSettingsContextProps {
3
3
  disableCompress?: boolean;
4
4
  isAnimationEnabled?: boolean;
5
+ renderInvisibleBlocks?: boolean;
5
6
  }
6
7
  export declare const ProjectSettingsContext: React.Context<ProjectSettingsContextProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectSettingsContext.js","sourceRoot":"../../../../src","sources":["context/projectSettingsContext/ProjectSettingsContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAA8B,EAAE,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nexport interface ProjectSettingsContextProps {\n disableCompress?: boolean;\n isAnimationEnabled?: boolean;\n}\n\nexport const ProjectSettingsContext = React.createContext<ProjectSettingsContextProps>({});\n"]}
1
+ {"version":3,"file":"ProjectSettingsContext.js","sourceRoot":"../../../../src","sources":["context/projectSettingsContext/ProjectSettingsContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAA8B,EAAE,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nexport interface ProjectSettingsContextProps {\n disableCompress?: boolean;\n isAnimationEnabled?: boolean;\n renderInvisibleBlocks?: boolean;\n}\n\nexport const ProjectSettingsContext = React.createContext<ProjectSettingsContextProps>({});\n"]}
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
- import { QAProps, Refable, Roleable } from "../../models/index.js";
2
+ import { AriaProps, QAProps, Refable, Roleable } from "../../models/index.js";
3
3
  import { GridColumnClassParams } from "../types.js";
4
- export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivElement>, QAProps, Roleable {
4
+ export interface GridColumnProps extends GridColumnClassParams, Refable<HTMLDivElement>, QAProps, Roleable, AriaProps {
5
+ id?: string;
5
6
  style?: React.CSSProperties;
6
7
  children?: React.ReactNode;
7
8
  }
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { getColClass } from "../utils.js";
4
4
  export const Col = React.forwardRef((props, ref) => {
5
- const { children, style, qa, role, ...rest } = props;
6
- return (_jsx("div", { ref: ref, className: getColClass(rest), style: style, "data-qa": qa, role: role, children: children }));
5
+ const { id, children, style, qa, role, ariaProps, ...rest } = props;
6
+ return (_jsx("div", { ref: ref, id: id, className: getColClass(rest), style: style, "data-qa": qa, role: role, ...ariaProps, children: children }));
7
7
  });
8
8
  Col.displayName = 'Col';
9
9
  //# sourceMappingURL=Col.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Col.js","sourceRoot":"../../../../src","sources":["grid/Col/Col.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAC,WAAW,EAAC,oBAAiB;AAWrC,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAC/B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACX,MAAM,EAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAC,GAAG,KAAK,CAAC;IAEnD,OAAO,CACH,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,aAAW,EAAE,EAAE,IAAI,EAAE,IAAI,YAC7E,QAAQ,GACP,CACT,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {QAProps, Refable, Roleable} from '../../models';\nimport {GridColumnClassParams} from '../types';\nimport {getColClass} from '../utils';\n\nexport interface GridColumnProps\n extends GridColumnClassParams,\n Refable<HTMLDivElement>,\n QAProps,\n Roleable {\n style?: React.CSSProperties;\n children?: React.ReactNode;\n}\n\nexport const Col = React.forwardRef<HTMLDivElement, React.PropsWithChildren<GridColumnProps>>(\n (props, ref) => {\n const {children, style, qa, role, ...rest} = props;\n\n return (\n <div ref={ref} className={getColClass(rest)} style={style} data-qa={qa} role={role}>\n {children}\n </div>\n );\n },\n);\n\nCol.displayName = 'Col';\n"]}
1
+ {"version":3,"file":"Col.js","sourceRoot":"../../../../src","sources":["grid/Col/Col.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAC,WAAW,EAAC,oBAAiB;AAarC,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAC/B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACX,MAAM,EAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,EAAC,GAAG,KAAK,CAAC;IAElE,OAAO,CACH,cACI,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,EAC5B,KAAK,EAAE,KAAK,aACH,EAAE,EACX,IAAI,EAAE,IAAI,KACN,SAAS,YAEZ,QAAQ,GACP,CACT,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {AriaProps, QAProps, Refable, Roleable} from '../../models';\nimport {GridColumnClassParams} from '../types';\nimport {getColClass} from '../utils';\n\nexport interface GridColumnProps\n extends GridColumnClassParams,\n Refable<HTMLDivElement>,\n QAProps,\n Roleable,\n AriaProps {\n id?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n}\n\nexport const Col = React.forwardRef<HTMLDivElement, React.PropsWithChildren<GridColumnProps>>(\n (props, ref) => {\n const {id, children, style, qa, role, ariaProps, ...rest} = props;\n\n return (\n <div\n ref={ref}\n id={id}\n className={getColClass(rest)}\n style={style}\n data-qa={qa}\n role={role}\n {...ariaProps}\n >\n {children}\n </div>\n );\n },\n);\n\nCol.displayName = 'Col';\n"]}
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
- import { Refable } from "../../models/common.js";
2
+ import { ClassNameProps, Refable } from "../../models/common.js";
3
3
  import { GridAlignItems, GridJustifyContent } from "../types.js";
4
- export interface RowProps extends Refable<HTMLDivElement> {
5
- className?: string;
4
+ import { AriaProps, Roleable } from "../../models/index.js";
5
+ export interface RowProps extends ClassNameProps, Refable<HTMLDivElement>, Roleable, AriaProps {
6
+ id?: string;
6
7
  justifyContent?: GridJustifyContent;
7
8
  alignItems?: GridAlignItems;
8
9
  noGutter?: boolean;
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  export const Row = React.forwardRef((props, ref) => {
4
- const { className, justifyContent, alignItems, noGutter, style, children } = props;
4
+ const { id, className, justifyContent, alignItems, noGutter, style, role, ariaProps, children } = props;
5
5
  const getClassName = React.useCallback(() => {
6
6
  return ['row', className, justifyContent, alignItems, noGutter && 'no-gutter']
7
7
  .filter(Boolean)
8
8
  .join(' ');
9
9
  }, [className, justifyContent, alignItems, noGutter]);
10
- return (_jsx("div", { ref: ref, className: getClassName(), style: style, children: children }));
10
+ return (_jsx("div", { ref: ref, id: id, className: getClassName(), style: style, role: role, ...ariaProps, children: children }));
11
11
  });
12
12
  Row.displayName = 'Row';
13
13
  //# sourceMappingURL=Row.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Row.js","sourceRoot":"../../../../src","sources":["grid/Row/Row.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAA2B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACzE,MAAM,EAAC,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAC,GAAG,KAAK,CAAC;IAEjF,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,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,YACjD,QAAQ,GACP,CACT,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Refable} from '../../models/common';\nimport {GridAlignItems, GridJustifyContent} from '../types';\n\nexport interface RowProps extends Refable<HTMLDivElement> {\n className?: 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 {className, justifyContent, alignItems, noGutter, style, children} = 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} className={getClassName()} style={style}>\n {children}\n </div>\n );\n});\n\nRow.displayName = 'Row';\n"]}
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 {ClassNameProps, Refable} from '../../models/common';\nimport {GridAlignItems, GridJustifyContent} from '../types';\nimport {AriaProps, Roleable} from '../../models';\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"]}
@@ -82,6 +82,9 @@ export interface Tabbable {
82
82
  export interface Roleable {
83
83
  role?: React.AriaRole;
84
84
  }
85
+ export interface AriaProps {
86
+ ariaProps?: React.AriaAttributes;
87
+ }
85
88
  export interface Background {
86
89
  image?: string;
87
90
  color?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"../../../../src","sources":["models/constructor-items/common.ts"],"names":[],"mappings":"AAOA,QAAQ;AACR,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,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AGpB","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\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,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,+CAA2B,CAAA;IAC3B,yCAAqB,CAAA;AACzB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;AACf,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACjB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,iCAAa,CAAA;IACb,iCAAa,CAAA;AACjB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,yDAAmC,CAAA;IACnC,oEAA8C,CAAA;AAClD,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACvC,gDAAa,CAAA;IACb,kDAAe,CAAA;IACf,oDAAiB,CAAA;AACrB,CAAC,EAJW,+BAA+B,KAA/B,+BAA+B,QAI1C;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;AACrB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,6CAAmB,CAAA;IACnB,2CAAiB,CAAA;AACrB,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAED,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,gCAAmB,CAAA;IACnB,6CAAgC,CAAA;AACpC,CAAC,EAHW,SAAS,KAAT,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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "6.2.1",
3
+ "version": "6.3.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -82,6 +82,9 @@ export interface Tabbable {
82
82
  export interface Roleable {
83
83
  role?: React.AriaRole;
84
84
  }
85
+ export interface AriaProps {
86
+ ariaProps?: React.AriaAttributes;
87
+ }
85
88
  export interface Background {
86
89
  image?: string;
87
90
  color?: string;