From 5b0c26d47e321f519f74952c0eed58d5a963a4e8 Mon Sep 17 00:00:00 2001 From: Juli Ovechkina Date: Thu, 23 Nov 2023 23:12:17 +0000 Subject: [PATCH] feat: add iframe to media (#698) --- .storybook/stories/documentation/Types.mdx | 25 +++++++--- README.md | 2 +- .../Media/__stories__/Media.stories.tsx | 50 ++++++++++++++++++- src/blocks/Media/__stories__/data.json | 42 ++++++++++++++++ src/components/Media/Iframe/Iframe.scss | 25 ++++++++++ src/components/Media/Iframe/Iframe.tsx | 32 ++++++++++++ src/components/Media/Iframe/i18n/en.json | 3 ++ src/components/Media/Iframe/i18n/index.ts | 8 +++ src/components/Media/Iframe/i18n/ru.json | 3 ++ src/components/Media/Media.tsx | 9 ++++ .../Media/__stories__/Media.stories.tsx | 11 ++++ src/components/Media/__stories__/data.json | 8 +++ src/models/constructor-items/common.ts | 14 ++++++ src/schema/validators/common.ts | 24 +++++++++ 14 files changed, 247 insertions(+), 9 deletions(-) create mode 100644 src/components/Media/Iframe/Iframe.scss create mode 100644 src/components/Media/Iframe/Iframe.tsx create mode 100644 src/components/Media/Iframe/i18n/en.json create mode 100644 src/components/Media/Iframe/i18n/index.ts create mode 100644 src/components/Media/Iframe/i18n/ru.json diff --git a/.storybook/stories/documentation/Types.mdx b/.storybook/stories/documentation/Types.mdx index c1fc58f9a..103bf93ba 100644 --- a/.storybook/stories/documentation/Types.mdx +++ b/.storybook/stories/documentation/Types.mdx @@ -52,13 +52,6 @@ import { Meta } from '@storybook/blocks'; --- -# `DataLens` — DataLens chart - -- `id: string` — Chart ID -- `theme: dark | light` — Chart theme - ---- - # `Media` — Image/video/DataLens/Youtube - `color?: string` — Background color @@ -70,6 +63,24 @@ import { Meta } from '@storybook/blocks'; - `previewImg?: string` - `dataLens?: string |` [DataLens](#DataLens) - `fullscreen?: boolean` — Enabling full-screen mode for image or video. Default true - for multiple images, false - for single image, video. It doesn't work with dataLens and youtube +- `iframe?: [Iframe](#Iframe)` + + +--- + +# `DataLens` — DataLens chart + +- `id: string` — Chart ID +- `theme: dark | light` — Chart theme + +--- + +# `Iframe` + +- `src: string` — Iframe link +- `name?: string` — Iframe name + +You can add all attributes which `