@gravity-ui/page-constructor 8.14.1 → 8.15.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 (40) hide show
  1. package/build/cjs/blocks/Footer/components/CopyrightFloor/CopyrightFloor.js +6 -6
  2. package/build/cjs/blocks/Footer/components/CopyrightFloor/CopyrightFloor.js.map +1 -1
  3. package/build/cjs/components/ReactPlayer/ReactPlayer.css +0 -50
  4. package/build/cjs/components/ReactPlayer/ReactPlayer.js +4 -16
  5. package/build/cjs/components/ReactPlayer/ReactPlayer.js.map +1 -1
  6. package/build/cjs/components/VideoBlock/VideoBlock.css +0 -30
  7. package/build/cjs/components/VideoBlock/VideoBlock.d.ts +2 -1
  8. package/build/cjs/components/VideoBlock/VideoBlock.js +18 -2
  9. package/build/cjs/components/VideoBlock/VideoBlock.js.map +1 -1
  10. package/build/cjs/components/VideoButton/VideoButton.css +64 -0
  11. package/build/cjs/components/VideoButton/VideoButton.d.ts +9 -0
  12. package/build/cjs/components/VideoButton/VideoButton.js +50 -0
  13. package/build/cjs/components/VideoButton/VideoButton.js.map +1 -0
  14. package/build/cjs/context/projectSettingsContext/ProjectSettingsContext.d.ts +7 -0
  15. package/build/cjs/context/projectSettingsContext/ProjectSettingsContext.js.map +1 -1
  16. package/build/cjs/models/constructor-items/common.d.ts +8 -1
  17. package/build/cjs/models/constructor-items/common.js +1 -0
  18. package/build/cjs/models/constructor-items/common.js.map +1 -1
  19. package/build/esm/blocks/Footer/components/CopyrightFloor/CopyrightFloor.js +6 -6
  20. package/build/esm/blocks/Footer/components/CopyrightFloor/CopyrightFloor.js.map +1 -1
  21. package/build/esm/components/ReactPlayer/ReactPlayer.css +0 -50
  22. package/build/esm/components/ReactPlayer/ReactPlayer.js +4 -16
  23. package/build/esm/components/ReactPlayer/ReactPlayer.js.map +1 -1
  24. package/build/esm/components/VideoBlock/VideoBlock.css +0 -30
  25. package/build/esm/components/VideoBlock/VideoBlock.d.ts +2 -1
  26. package/build/esm/components/VideoBlock/VideoBlock.js +19 -3
  27. package/build/esm/components/VideoBlock/VideoBlock.js.map +1 -1
  28. package/build/esm/components/VideoButton/VideoButton.css +64 -0
  29. package/build/esm/components/VideoButton/VideoButton.d.ts +10 -0
  30. package/build/esm/components/VideoButton/VideoButton.js +48 -0
  31. package/build/esm/components/VideoButton/VideoButton.js.map +1 -0
  32. package/build/esm/context/projectSettingsContext/ProjectSettingsContext.d.ts +7 -0
  33. package/build/esm/context/projectSettingsContext/ProjectSettingsContext.js.map +1 -1
  34. package/build/esm/models/constructor-items/common.d.ts +8 -1
  35. package/build/esm/models/constructor-items/common.js +1 -0
  36. package/build/esm/models/constructor-items/common.js.map +1 -1
  37. package/package.json +1 -1
  38. package/server/models/constructor-items/common.d.ts +8 -1
  39. package/server/models/constructor-items/common.js +1 -0
  40. package/widget/index.js +1 -1
@@ -22,34 +22,4 @@ unpredictable css rules order in build */
22
22
  .pc-VideoBlock__image-wrapper {
23
23
  height: 100%;
24
24
  width: 100%;
25
- }
26
- .pc-VideoBlock__button {
27
- display: inline-block;
28
- margin: 0;
29
- padding: 0;
30
- font: inherit;
31
- border: none;
32
- outline: none;
33
- color: inherit;
34
- background: none;
35
- cursor: pointer;
36
- display: flex;
37
- justify-content: center;
38
- align-items: center;
39
- position: absolute;
40
- width: 64px;
41
- height: 64px;
42
- color: var(--g-color-base-background);
43
- background-color: var(--g-color-base-brand);
44
- border-radius: 50%;
45
- }
46
- .pc-VideoBlock__button:focus {
47
- outline: 2px solid var(--g-color-line-focus);
48
- outline-offset: 0;
49
- }
50
- .pc-VideoBlock__button:focus:not(:focus-visible) {
51
- outline: 0;
52
- }
53
- .pc-VideoBlock__icon {
54
- margin-left: 1px;
55
25
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { AnalyticsEventsBase } from "../../models/common.js";
3
+ import { VideoButtonProps } from "../VideoButton/VideoButton.js";
3
4
  import './VideoBlock.css';
4
5
  export declare const AUTOPLAY_ATTRIBUTES: {
5
6
  autoplay: number;
@@ -14,7 +15,7 @@ export interface VideoBlockProps extends AnalyticsEventsBase {
14
15
  attributes?: Record<string, string>;
15
16
  className?: string;
16
17
  previewImg?: string;
17
- playButton?: React.ReactNode;
18
+ playButton?: React.ReactNode | VideoButtonProps;
18
19
  playButtonId?: string;
19
20
  height?: number;
20
21
  fullscreen?: boolean;
@@ -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 { PlayFill } from '@gravity-ui/icons';
4
- import { Icon, useActionHandlers, useUniqId } from '@gravity-ui/uikit';
3
+ import { useActionHandlers, useUniqId } from '@gravity-ui/uikit';
5
4
  import debounce from "lodash/debounce.js";
6
5
  import { v4 as uuidv4 } from 'uuid';
7
6
  import { useAnalytics } from "../../hooks/useAnalytics.js";
8
7
  import { DefaultEventNames } from "../../models/common.js";
9
8
  import { block, getPageSearchParams } from "../../utils/index.js";
10
9
  import Image from "../Image/Image.js";
10
+ import VideoButton from "../VideoButton/VideoButton.js";
11
11
  import { i18n } from "./i18n/index.js";
12
12
  import './VideoBlock.css';
13
13
  const RECORD_URL = 'https://www.youtube.com/embed/';
@@ -40,6 +40,18 @@ function getYoutubeVideoSrc(stream, record) {
40
40
  export function getHeight(width) {
41
41
  return (width / 16) * 9;
42
42
  }
43
+ const isReactNode = (value) => {
44
+ if (value === null || typeof value === 'boolean')
45
+ return true;
46
+ if (typeof value === 'string' || typeof value === 'number')
47
+ return true;
48
+ if (React.isValidElement(value))
49
+ return true;
50
+ if (Array.isArray(value)) {
51
+ return value.every(isReactNode);
52
+ }
53
+ return false;
54
+ };
43
55
  const VideoBlock = (props) => {
44
56
  const { stream, record, videoIframe, attributes, className, id, previewImg, playButton, playButtonId, height, fullscreen, analyticsEvents, autoplay, onImageLoad, } = props;
45
57
  const handleAnalytics = useAnalytics(DefaultEventNames.VideoPreview);
@@ -91,10 +103,14 @@ const VideoBlock = (props) => {
91
103
  React.useEffect(() => {
92
104
  setHidePreview(false);
93
105
  }, [src]);
106
+ const buttonProps = React.useMemo(() => isReactNode(playButton)
107
+ ? { customButton: playButton }
108
+ : playButton, [playButton]);
109
+ const buttonLabelId = buttonProps?.customButton ? playButtonId : buttonProps?.id || buttonId;
94
110
  if (!src) {
95
111
  return null;
96
112
  }
97
- return (_jsxs("div", { className: b(null, className), style: { height: currentHeight }, ref: ref, children: [iframeContent, previewImg && !hidePreview && !fullscreen && (_jsxs("div", { className: b('preview'), onClick: onPreviewClick, onKeyDown: onPreviewKeyDown, role: "button", tabIndex: 0, "aria-labelledby": playButton ? playButtonId : buttonId, children: [_jsx(Image, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper'), onLoad: onImageLoad }), playButton || (_jsx("button", { title: "Play", id: buttonId, className: b('button'), children: _jsx(Icon, { className: b('icon'), data: PlayFill, size: 24 }) }))] }))] }));
113
+ return (_jsxs("div", { className: b(null, className), style: { height: currentHeight }, ref: ref, children: [iframeContent, previewImg && !hidePreview && !fullscreen && (_jsxs("div", { className: b('preview'), onClick: onPreviewClick, onKeyDown: onPreviewKeyDown, role: "button", tabIndex: 0, "aria-labelledby": buttonLabelId, children: [_jsx(Image, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper'), onLoad: onImageLoad }), _jsx(VideoButton, { id: buttonId, ...buttonProps })] }))] }));
98
114
  };
99
115
  export default VideoBlock;
100
116
  //# sourceMappingURL=VideoBlock.js.map
@@ -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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c,EACvB,SAAS,EAAE,gBAAgB,EAC3B,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,qBACM,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,aAErD,KAAC,KAAK,IACF,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EACrB,kBAAkB,EAAE,CAAC,CAAC,eAAe,CAAC,EACtC,MAAM,EAAE,WAAW,GACrB,EACD,UAAU,IAAI,CACX,iBAAQ,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 {\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"]}
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,iBAAiB,EAAE,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC/D,O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,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {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';\nimport VideoButton, {VideoButtonProps} from '../VideoButton/VideoButton';\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\nconst isReactNode = (value: React.ReactNode | VideoButtonProps) => {\n if (value === null || typeof value === 'boolean') return true;\n\n if (typeof value === 'string' || typeof value === 'number') return true;\n\n if (React.isValidElement(value)) return true;\n\n if (Array.isArray(value)) {\n return value.every(isReactNode);\n }\n\n return false;\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 | VideoButtonProps;\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 {\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 const buttonProps = React.useMemo(\n () =>\n isReactNode(playButton)\n ? {customButton: playButton as React.ReactNode}\n : (playButton as VideoButtonProps | undefined),\n [playButton],\n );\n const buttonLabelId = buttonProps?.customButton ? playButtonId : buttonProps?.id || buttonId;\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={buttonLabelId}\n >\n <Image\n src={previewImg}\n className={b('image')}\n containerClassName={b('image-wrapper')}\n onLoad={onImageLoad}\n />\n <VideoButton id={buttonId} {...buttonProps} />\n </div>\n )}\n </div>\n );\n};\n\nexport default VideoBlock;\n"]}
@@ -0,0 +1,64 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ .pc-video-button {
4
+ display: inline-block;
5
+ margin: 0;
6
+ padding: 0;
7
+ font: inherit;
8
+ border: none;
9
+ outline: none;
10
+ color: inherit;
11
+ background: none;
12
+ cursor: pointer;
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ position: absolute;
17
+ width: 64px;
18
+ height: 64px;
19
+ border-radius: 50%;
20
+ transition: color 0.4s, background-color 0.4s;
21
+ }
22
+ .pc-video-button:focus {
23
+ outline: 2px solid var(--g-color-line-focus);
24
+ outline-offset: 0;
25
+ }
26
+ .pc-video-button:focus:not(:focus-visible) {
27
+ outline: 0;
28
+ }
29
+ .pc-video-button_theme_blue {
30
+ color: var(--g-color-base-background);
31
+ background-color: var(--g-color-base-brand);
32
+ }
33
+ .pc-video-button_theme_blue:hover {
34
+ background-color: var(--g-color-base-brand-hover);
35
+ }
36
+ .pc-video-button_theme_grey {
37
+ color: var(--pc-text-header-color);
38
+ background-color: #eff2f8;
39
+ }
40
+ .pc-video-button_theme_custom {
41
+ color: var(--pc-video-button-triangle-color);
42
+ background-color: var(--pc-video-button-circle-color);
43
+ }
44
+ .pc-video-button_theme_custom:hover {
45
+ color: var(--pc-video-button-triangle-hover-color, var(--pc-video-button-triangle-color));
46
+ background-color: var(--pc-video-button-circle-hover-color, var(--pc-video-button-circle-color));
47
+ }
48
+ .pc-video-button_text {
49
+ padding: 16px 32px;
50
+ font-weight: 400;
51
+ font-size: 24px;
52
+ line-height: 32px;
53
+ width: auto;
54
+ height: auto;
55
+ }
56
+ .pc-video-button__icon {
57
+ margin-left: 1px;
58
+ }
59
+ @media only screen and (max-width: 577px) {
60
+ .pc-video-button_text {
61
+ font-size: 20px;
62
+ line-height: 24px;
63
+ }
64
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { PlayButtonProps } from "../../models/index.js";
3
+ import './VideoButton.css';
4
+ export interface VideoButtonProps extends PlayButtonProps {
5
+ customButton?: React.ReactNode;
6
+ ref?: React.LegacyRef<HTMLButtonElement>;
7
+ id?: string;
8
+ }
9
+ declare const VideoButton: ({ customButton, text, type, theme: initialTheme, className, ref, id, }: VideoButtonProps) => string | number | true | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element;
10
+ export default VideoButton;
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { PlayFill } from '@gravity-ui/icons';
4
+ import { Icon } from '@gravity-ui/uikit';
5
+ import { ProjectSettingsContext } from "../../context/projectSettingsContext/index.js";
6
+ import { useTheme } from "../../context/theme/index.js";
7
+ import { PlayButtonThemes, PlayButtonType } from "../../models/index.js";
8
+ import { block, getThemedValue } from "../../utils/index.js";
9
+ import { i18n } from "../ReactPlayer/i18n/index.js";
10
+ import './VideoButton.css';
11
+ const b = block('video-button');
12
+ const VideoButton = ({ customButton, text, type, theme: initialTheme, className, ref, id, }) => {
13
+ const { defaultVideoButtonSettings } = React.useContext(ProjectSettingsContext);
14
+ const currentTheme = useTheme();
15
+ const playButtonContent = React.useMemo(() => {
16
+ switch (type) {
17
+ case PlayButtonType.Text:
18
+ return text;
19
+ case PlayButtonType.Default:
20
+ default:
21
+ return _jsx(Icon, { className: b('icon'), data: PlayFill, size: 24 });
22
+ }
23
+ }, [text, type]);
24
+ const theme = initialTheme || defaultVideoButtonSettings?.theme || PlayButtonThemes.Blue;
25
+ const style = React.useMemo(() => {
26
+ if (theme !== PlayButtonThemes.Custom) {
27
+ return undefined;
28
+ }
29
+ const themedColors = defaultVideoButtonSettings?.colors
30
+ ? getThemedValue(defaultVideoButtonSettings.colors, currentTheme)
31
+ : undefined;
32
+ const resolveColor = (colorName) => {
33
+ return themedColors?.[colorName];
34
+ };
35
+ return {
36
+ '--pc-video-button-circle-color': resolveColor('circleColor'),
37
+ '--pc-video-button-circle-hover-color': resolveColor('circleHoverColor'),
38
+ '--pc-video-button-triangle-color': resolveColor('triangleColor'),
39
+ '--pc-video-button-triangle-hover-color': resolveColor('triangleHoverColor'),
40
+ };
41
+ }, [currentTheme, defaultVideoButtonSettings?.colors, theme]);
42
+ if (customButton) {
43
+ return customButton;
44
+ }
45
+ return (_jsx("button", { className: b({ theme, text: Boolean(text) }, className), "aria-label": i18n('play'), ref: ref, id: id, style: style, children: playButtonContent }));
46
+ };
47
+ export default VideoButton;
48
+ //# sourceMappingURL=VideoButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VideoButton.js","sourceRoot":"../../../../src","sources":["components/VideoButton/VideoButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,IAAI,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QACrB,CAAC;QAED,MAAM,YAAY,GAAG,0BAA0B,EAAE,MAAM;YACnD,CAAC,CAAC,cAAc,CAAC,0BAA0B,CAAC,MAAM,EAAE,YAAY,CAAC;YACjE,CAAC,CAAC,SAAS,CAAC;QAEhB,MAAM,YAAY,GAAG,CAAC,SAAiC,EAAE,EAAE;YACvD,OAAO,YAAY,EAAE,CAAC,SAAS,CAAC,CAAC;QACrC,CAAC,CAAC;QAEF,OAAO;YACH,gCAAgC,EAAE,YAAY,CAAC,aAAa,CAAC;YAC7D,sCAAsC,EAAE,YAAY,CAAC,kBAAkB,CAAC;YACxE,kCAAkC,EAAE,YAAY,CAAC,eAAe,CAAC;YACjE,wCAAwC,EAAE,YAAY,CAAC,oBAAoB,CAAC;SACxD,CAAC;IAC7B,CAAC,EAAE,CAAC,YAAY,EAAE,0BAA0B,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAE9D,IAAI,YAAY,EAAE,CAAC;QACf,OAAO,YAAY,CAAC;IACxB,CAAC;IAED,OAAO,CACH,iBACI,SAAS,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAC,EAAE,SAAS,CAAC,gBACzC,IAAI,CAAC,MAAM,CAAC,EACxB,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,YAEX,iBAAiB,GACb,CACZ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {PlayFill} from '@gravity-ui/icons';\nimport {Icon} from '@gravity-ui/uikit';\n\nimport {ProjectSettingsContext} from '../../context/projectSettingsContext';\nimport {useTheme} from '../../context/theme';\nimport {PlayButtonColors, PlayButtonProps, PlayButtonThemes, PlayButtonType} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {i18n} from '../ReactPlayer/i18n';\n\nimport './VideoButton.scss';\n\nexport interface VideoButtonProps extends PlayButtonProps {\n customButton?: React.ReactNode;\n ref?: React.LegacyRef<HTMLButtonElement>;\n id?: string;\n}\n\nconst b = block('video-button');\n\nconst VideoButton = ({\n customButton,\n text,\n type,\n theme: initialTheme,\n className,\n ref,\n id,\n}: VideoButtonProps) => {\n const {defaultVideoButtonSettings} = React.useContext(ProjectSettingsContext);\n const currentTheme = useTheme();\n\n const playButtonContent = React.useMemo(() => {\n switch (type) {\n case PlayButtonType.Text:\n return text;\n case PlayButtonType.Default:\n default:\n return <Icon className={b('icon')} data={PlayFill} size={24} />;\n }\n }, [text, type]);\n\n const theme = initialTheme || defaultVideoButtonSettings?.theme || PlayButtonThemes.Blue;\n\n const style = React.useMemo(() => {\n if (theme !== PlayButtonThemes.Custom) {\n return undefined;\n }\n\n const themedColors = defaultVideoButtonSettings?.colors\n ? getThemedValue(defaultVideoButtonSettings.colors, currentTheme)\n : undefined;\n\n const resolveColor = (colorName: keyof PlayButtonColors) => {\n return themedColors?.[colorName];\n };\n\n return {\n '--pc-video-button-circle-color': resolveColor('circleColor'),\n '--pc-video-button-circle-hover-color': resolveColor('circleHoverColor'),\n '--pc-video-button-triangle-color': resolveColor('triangleColor'),\n '--pc-video-button-triangle-hover-color': resolveColor('triangleHoverColor'),\n } as React.CSSProperties;\n }, [currentTheme, defaultVideoButtonSettings?.colors, theme]);\n\n if (customButton) {\n return customButton;\n }\n\n return (\n <button\n className={b({theme, text: Boolean(text)}, className)}\n aria-label={i18n('play')}\n ref={ref}\n id={id}\n style={style}\n >\n {playButtonContent}\n </button>\n );\n};\n\nexport default VideoButton;\n"]}
@@ -1,8 +1,15 @@
1
1
  import * as React from 'react';
2
+ import { PlayButtonColors, PlayButtonProps } from "../../models/index.js";
3
+ import { ThemeSupporting } from "../../utils/index.js";
4
+ type DefaultVideoButtonSettings = Pick<PlayButtonProps, 'theme'> & {
5
+ colors?: ThemeSupporting<PlayButtonColors>;
6
+ };
2
7
  export interface ProjectSettingsContextProps {
3
8
  disableCompress?: boolean;
4
9
  isAnimationEnabled?: boolean;
5
10
  renderInvisibleBlocks?: boolean;
6
11
  defaultYandexFormTheme?: string;
12
+ defaultVideoButtonSettings?: DefaultVideoButtonSettings;
7
13
  }
8
14
  export declare const ProjectSettingsContext: React.Context<ProjectSettingsContextProps>;
15
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectSettingsContext.js","sourceRoot":"../../../../src","sources":["context/projectSettingsContext/ProjectSettingsContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/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 defaultYandexFormTheme?: string;\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;AAiB/B,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAA8B,EAAE,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {PlayButtonColors, PlayButtonProps} from '../../models';\nimport {ThemeSupporting} from '../../utils';\n\ntype DefaultVideoButtonSettings = Pick<PlayButtonProps, 'theme'> & {\n colors?: ThemeSupporting<PlayButtonColors>;\n};\n\nexport interface ProjectSettingsContextProps {\n disableCompress?: boolean;\n isAnimationEnabled?: boolean;\n renderInvisibleBlocks?: boolean;\n defaultYandexFormTheme?: string;\n defaultVideoButtonSettings?: DefaultVideoButtonSettings;\n}\n\nexport const ProjectSettingsContext = React.createContext<ProjectSettingsContextProps>({});\n"]}
@@ -24,7 +24,8 @@ export declare enum PlayButtonType {
24
24
  }
25
25
  export declare enum PlayButtonThemes {
26
26
  Blue = "blue",
27
- Grey = "grey"
27
+ Grey = "grey",
28
+ Custom = "custom"
28
29
  }
29
30
  export declare enum CustomControlsType {
30
31
  WithMuteButton = "with-mute-button",
@@ -195,6 +196,12 @@ export interface CustomControlsOptions {
195
196
  muteButtonShown?: boolean;
196
197
  positioning?: CustomControlsButtonPositioning;
197
198
  }
199
+ export interface PlayButtonColors {
200
+ circleColor?: string;
201
+ circleHoverColor?: string;
202
+ triangleColor?: string;
203
+ triangleHoverColor?: string;
204
+ }
198
205
  export interface PlayButtonProps extends ClassNameProps {
199
206
  type?: PlayButtonType;
200
207
  theme?: PlayButtonThemes;
@@ -26,6 +26,7 @@ export var PlayButtonThemes;
26
26
  (function (PlayButtonThemes) {
27
27
  PlayButtonThemes["Blue"] = "blue";
28
28
  PlayButtonThemes["Grey"] = "grey";
29
+ PlayButtonThemes["Custom"] = "custom";
29
30
  })(PlayButtonThemes || (PlayButtonThemes = {}));
30
31
  export var CustomControlsType;
31
32
  (function (CustomControlsType) {
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"../../../../src","sources":["models/constructor-items/common.ts"],"names":[],"mappings":"AAQA,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;AAuED,SAAS;AAET,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IACd,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;AACrB,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB","sourcesContent":["import * as React from 'react';\n\nimport * as icons from '@gravity-ui/icons';\nimport {ButtonView, IconData, 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' | 'xl';\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';\nexport type GravityIconProps = string | {name: keyof typeof icons; color: 'brand' | 'text-color'};\n\n// modifiers\nexport interface Themable {\n theme?: TextTheme;\n}\n\nexport interface Justifyable {\n justify?: Justify;\n}\n\nexport interface Stylable {\n className?: string;\n}\n\nexport interface Animatable {\n animated?: boolean;\n}\n\nexport interface Tabbable {\n tabIndex?: number;\n}\n\nexport interface Roleable {\n role?: React.AriaRole;\n}\n\nexport interface AriaProps {\n ariaProps?: React.AriaAttributes;\n}\n\n//common props\nexport interface Background {\n image?: string;\n color?: string;\n}\n\nexport interface AnchorProps {\n text: string;\n url: string;\n}\n\n/**\n * @deprecated Component VideoBlock will be deleted, which uses this logic\n */\ninterface LoopProps {\n start: number;\n end?: number;\n}\n\n// images\n\nexport enum Device {\n Desktop = 'desktop',\n Mobile = 'mobile',\n Tablet = 'tablet',\n}\n\nexport interface ImageInfoProps\n extends Pick<\n React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>,\n 'aria-describedby' | 'loading'\n >,\n ImageDevicesVisibleProps {\n alt?: string;\n fetchPriority?: 'high' | 'low' | 'auto';\n disableCompress?: boolean;\n}\n\nexport interface ImageObjectProps extends ImageInfoProps {\n src: string;\n}\n\nexport interface ImageDeviceProps extends ImageInfoProps {\n [Device.Desktop]: string;\n [Device.Mobile]: string;\n [Device.Tablet]?: string;\n}\n\nexport interface ImageDevicesVisibleProps {\n hide?: boolean | Partial<Record<Device, boolean>>;\n}\n\nexport type ImageProps = string | ImageObjectProps | ImageDeviceProps;\nexport type ThemedImage = ThemeSupporting<ImageProps>;\n\nexport interface BackgroundImageProps\n extends React.HTMLProps<HTMLDivElement>,\n Partial<ImageDeviceProps>,\n Partial<ImageObjectProps>,\n QAProps,\n ImageDevicesVisibleProps {\n style?: React.CSSProperties;\n imageClassName?: string;\n}\n\n//components props\nexport interface MediaVideoProps extends AnalyticsEventsBase {\n src: string[];\n type?: MediaVideoType;\n loop?: LoopProps | boolean;\n muted?: boolean;\n autoplay?: boolean;\n elapsedTime?: number;\n playButton?: PlayButtonProps;\n controls?: MediaVideoControlsType;\n customControlsOptions?: CustomControlsOptions;\n ariaLabel?: string;\n contain?: boolean;\n onVideoEnd?: () => void;\n ref?: React.Ref<HTMLVideoElement | null>;\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 extends AnalyticsEventsBase {\n text: string;\n url: string;\n urlTitle?: string;\n primary?: boolean;\n theme?: ButtonTheme;\n img?: ButtonImageProps | string;\n target?: string;\n size?: UikitButtonProps['size'];\n width?: UikitButtonProps['width'];\n extraProps?: UikitButtonProps['extraProps'];\n}\n\nexport type ButtonImagePosition = 'left' | 'right';\n\nexport interface ButtonImageProps {\n url?: string;\n position?: ButtonImagePosition;\n alt?: string;\n iconData?: IconData;\n iconSize?: number;\n className?: 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, number];\n\nexport interface MapBaseProps {\n zoom?: number;\n className?: string;\n forceAspectRatio?: boolean;\n}\n\nexport interface GMapProps extends MapBaseProps {\n address: string;\n}\n\nexport type YMapMargin =\n | number\n | [vertical: number, horizontal: number]\n | [top: number, right: number, bottom: number, left: number];\n\nexport interface YMapCopyrightPosition {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n}\n\nexport interface YMapProps extends MapBaseProps {\n markers: YMapMarker[];\n disableControls?: boolean;\n disableBalloons?: boolean;\n areaMargin?: YMapMargin;\n copyrightPosition?: YMapCopyrightPosition;\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 iconImageHref?: string;\n iconImageSize?: [number, number];\n iconImageOffset?: [number, number];\n iconImageClipRect?: [[number, number], [number, number]];\n iconLayout?: 'default#image';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n iconShape?: Record<string, any>;\n preset?: string;\n}\n\nexport interface YMapMarkerPrivate extends YMapMarker {\n label?: YMapMarkerLabelPrivate;\n}\n\nexport interface YMapMarkerLabelPrivate extends YMapMarkerLabel {\n cursor?: string;\n interactivityModel?: 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, QAProps {\n items: {\n url: string;\n text: React.ReactNode;\n }[];\n theme?: TextTheme;\n analyticsEvents?: AnalyticsEventsProp;\n}\n\nexport interface TitleItemProps extends Justifyable, TitleItemBaseProps, AnalyticsEventsBase {\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":"AAQA,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;AAH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AAA;AACpC,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAuED,SAAS;AAET,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IACd,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;AACrB,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB","sourcesContent":["import * as React from 'react';\n\nimport * as icons from '@gravity-ui/icons';\nimport {ButtonView, IconData, 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 Custom = 'custom',\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' | 'xl';\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';\nexport type GravityIconProps = string | {name: keyof typeof icons; color: 'brand' | 'text-color'};\n\n// modifiers\nexport interface Themable {\n theme?: TextTheme;\n}\n\nexport interface Justifyable {\n justify?: Justify;\n}\n\nexport interface Stylable {\n className?: string;\n}\n\nexport interface Animatable {\n animated?: boolean;\n}\n\nexport interface Tabbable {\n tabIndex?: number;\n}\n\nexport interface Roleable {\n role?: React.AriaRole;\n}\n\nexport interface AriaProps {\n ariaProps?: React.AriaAttributes;\n}\n\n//common props\nexport interface Background {\n image?: string;\n color?: string;\n}\n\nexport interface AnchorProps {\n text: string;\n url: string;\n}\n\n/**\n * @deprecated Component VideoBlock will be deleted, which uses this logic\n */\ninterface LoopProps {\n start: number;\n end?: number;\n}\n\n// images\n\nexport enum Device {\n Desktop = 'desktop',\n Mobile = 'mobile',\n Tablet = 'tablet',\n}\n\nexport interface ImageInfoProps\n extends Pick<\n React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>,\n 'aria-describedby' | 'loading'\n >,\n ImageDevicesVisibleProps {\n alt?: string;\n fetchPriority?: 'high' | 'low' | 'auto';\n disableCompress?: boolean;\n}\n\nexport interface ImageObjectProps extends ImageInfoProps {\n src: string;\n}\n\nexport interface ImageDeviceProps extends ImageInfoProps {\n [Device.Desktop]: string;\n [Device.Mobile]: string;\n [Device.Tablet]?: string;\n}\n\nexport interface ImageDevicesVisibleProps {\n hide?: boolean | Partial<Record<Device, boolean>>;\n}\n\nexport type ImageProps = string | ImageObjectProps | ImageDeviceProps;\nexport type ThemedImage = ThemeSupporting<ImageProps>;\n\nexport interface BackgroundImageProps\n extends React.HTMLProps<HTMLDivElement>,\n Partial<ImageDeviceProps>,\n Partial<ImageObjectProps>,\n QAProps,\n ImageDevicesVisibleProps {\n style?: React.CSSProperties;\n imageClassName?: string;\n}\n\n//components props\nexport interface MediaVideoProps extends AnalyticsEventsBase {\n src: string[];\n type?: MediaVideoType;\n loop?: LoopProps | boolean;\n muted?: boolean;\n autoplay?: boolean;\n elapsedTime?: number;\n playButton?: PlayButtonProps;\n controls?: MediaVideoControlsType;\n customControlsOptions?: CustomControlsOptions;\n ariaLabel?: string;\n contain?: boolean;\n onVideoEnd?: () => void;\n ref?: React.Ref<HTMLVideoElement | null>;\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 extends AnalyticsEventsBase {\n text: string;\n url: string;\n urlTitle?: string;\n primary?: boolean;\n theme?: ButtonTheme;\n img?: ButtonImageProps | string;\n target?: string;\n size?: UikitButtonProps['size'];\n width?: UikitButtonProps['width'];\n extraProps?: UikitButtonProps['extraProps'];\n}\n\nexport type ButtonImagePosition = 'left' | 'right';\n\nexport interface ButtonImageProps {\n url?: string;\n position?: ButtonImagePosition;\n alt?: string;\n iconData?: IconData;\n iconSize?: number;\n className?: string;\n}\n\nexport interface CustomControlsOptions {\n type?: CustomControlsType;\n muteButtonShown?: boolean;\n positioning?: CustomControlsButtonPositioning;\n}\n\nexport interface PlayButtonColors {\n circleColor?: string;\n circleHoverColor?: string;\n triangleColor?: string;\n triangleHoverColor?: string;\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, number];\n\nexport interface MapBaseProps {\n zoom?: number;\n className?: string;\n forceAspectRatio?: boolean;\n}\n\nexport interface GMapProps extends MapBaseProps {\n address: string;\n}\n\nexport type YMapMargin =\n | number\n | [vertical: number, horizontal: number]\n | [top: number, right: number, bottom: number, left: number];\n\nexport interface YMapCopyrightPosition {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n}\n\nexport interface YMapProps extends MapBaseProps {\n markers: YMapMarker[];\n disableControls?: boolean;\n disableBalloons?: boolean;\n areaMargin?: YMapMargin;\n copyrightPosition?: YMapCopyrightPosition;\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 iconImageHref?: string;\n iconImageSize?: [number, number];\n iconImageOffset?: [number, number];\n iconImageClipRect?: [[number, number], [number, number]];\n iconLayout?: 'default#image';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n iconShape?: Record<string, any>;\n preset?: string;\n}\n\nexport interface YMapMarkerPrivate extends YMapMarker {\n label?: YMapMarkerLabelPrivate;\n}\n\nexport interface YMapMarkerLabelPrivate extends YMapMarkerLabel {\n cursor?: string;\n interactivityModel?: 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, QAProps {\n items: {\n url: string;\n text: React.ReactNode;\n }[];\n theme?: TextTheme;\n analyticsEvents?: AnalyticsEventsProp;\n}\n\nexport interface TitleItemProps extends Justifyable, TitleItemBaseProps, AnalyticsEventsBase {\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": "8.14.1",
3
+ "version": "8.15.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -24,7 +24,8 @@ export declare enum PlayButtonType {
24
24
  }
25
25
  export declare enum PlayButtonThemes {
26
26
  Blue = "blue",
27
- Grey = "grey"
27
+ Grey = "grey",
28
+ Custom = "custom"
28
29
  }
29
30
  export declare enum CustomControlsType {
30
31
  WithMuteButton = "with-mute-button",
@@ -195,6 +196,12 @@ export interface CustomControlsOptions {
195
196
  muteButtonShown?: boolean;
196
197
  positioning?: CustomControlsButtonPositioning;
197
198
  }
199
+ export interface PlayButtonColors {
200
+ circleColor?: string;
201
+ circleHoverColor?: string;
202
+ triangleColor?: string;
203
+ triangleHoverColor?: string;
204
+ }
198
205
  export interface PlayButtonProps extends ClassNameProps {
199
206
  type?: PlayButtonType;
200
207
  theme?: PlayButtonThemes;
@@ -29,6 +29,7 @@ var PlayButtonThemes;
29
29
  (function (PlayButtonThemes) {
30
30
  PlayButtonThemes["Blue"] = "blue";
31
31
  PlayButtonThemes["Grey"] = "grey";
32
+ PlayButtonThemes["Custom"] = "custom";
32
33
  })(PlayButtonThemes || (exports.PlayButtonThemes = PlayButtonThemes = {}));
33
34
  var CustomControlsType;
34
35
  (function (CustomControlsType) {
package/widget/index.js CHANGED
@@ -1 +1 @@
1
- export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[1349],{31349:function(_,t,Y){_.exports=function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var Y=t(_),e={name:\"zh-tw\",weekdays:\"星期日_星期一_星期二_星期三_星期四_星期五_星期六\".split(\"_\"),weekdaysShort:\"週日_週一_週二_週三_週四_週五_週六\".split(\"_\"),weekdaysMin:\"日_一_二_三_四_五_六\".split(\"_\"),months:\"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),ordinal:function(_,t){return\"W\"===t?_+\"週\":_+\"日\"},formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日 HH:mm\",LLLL:\"YYYY年M月D日dddd HH:mm\",l:\"YYYY/M/D\",ll:\"YYYY年M月D日\",lll:\"YYYY年M月D日 HH:mm\",llll:\"YYYY年M月D日dddd HH:mm\"},relativeTime:{future:\"%s內\",past:\"%s前\",s:\"幾秒\",m:\"1 分鐘\",mm:\"%d 分鐘\",h:\"1 小時\",hh:\"%d 小時\",d:\"1 天\",dd:\"%d 天\",M:\"1 個月\",MM:\"%d 個月\",y:\"1 年\",yy:\"%d 年\"},meridiem:function(_,t){var Y=100*_+t;return Y<600?\"凌晨\":Y<900?\"早上\":Y<1100?\"上午\":Y<1300?\"中午\":Y<1800?\"下午\":\"晚上\"}};return Y.default.locale(e,null,!0),e}(Y(74353))}}]);";
1
+ export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[122],{87741:function(_,t,e){_.exports=function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var e=t(_),s={name:\"zh-hk\",months:\"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),weekdays:\"星期日_星期一_星期二_星期三_星期四_星期五_星期六\".split(\"_\"),weekdaysShort:\"週日_週一_週二_週三_週四_週五_週六\".split(\"_\"),weekdaysMin:\"日_一_二_三_四_五_六\".split(\"_\"),ordinal:function(_,t){return\"W\"===t?_+\"週\":_+\"日\"},formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日 HH:mm\",LLLL:\"YYYY年M月D日dddd HH:mm\"},relativeTime:{future:\"%s內\",past:\"%s前\",s:\"幾秒\",m:\"一分鐘\",mm:\"%d 分鐘\",h:\"一小時\",hh:\"%d 小時\",d:\"一天\",dd:\"%d 天\",M:\"一個月\",MM:\"%d 個月\",y:\"一年\",yy:\"%d 年\"}};return e.default.locale(s,null,!0),s}(e(74353))}}]);";