@meduza/ui-kit-2 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -179
- package/dist/BookmarkButton/BookmarkButton.stories.d.ts +10 -0
- package/dist/BookmarkButton/BookmarkButton.types.d.ts +6 -0
- package/dist/BookmarkButton/index.d.ts +3 -0
- package/dist/Button/Button.stories.d.ts +10 -0
- package/dist/Button/Button.types.d.ts +2 -2
- package/dist/CardTitle/CardTitle.stories.d.ts +10 -0
- package/dist/CardTitle/CardTitle.types.d.ts +8 -0
- package/dist/CardTitle/index.d.ts +3 -0
- package/dist/ChapterBlock/ChapterBlock.stories.d.ts +10 -0
- package/dist/ChapterBlock/ChapterBlock.types.d.ts +7 -0
- package/dist/ChapterBlock/index.d.ts +3 -0
- package/dist/Cover/Cover.stories.d.ts +10 -0
- package/dist/Cover/Cover.types.d.ts +4 -0
- package/dist/Cover/index.d.ts +3 -0
- package/dist/DocumentItemsCount/DocumentItemsCount.stories.d.ts +10 -0
- package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +7 -0
- package/dist/DocumentItemsCount/index.d.ts +3 -0
- package/dist/DotsOnImage/DotsOnImage.stories.d.ts +10 -0
- package/dist/DotsOnImage/DotsOnImage.types.d.ts +42 -0
- package/dist/DotsOnImage/index.d.ts +3 -0
- package/dist/Dropdown/Dropdown.stories.d.ts +10 -0
- package/dist/Dropdown/Dropdown.types.d.ts +6 -0
- package/dist/Dropdown/index.d.ts +4 -0
- package/dist/EmbedBlock/EmbedBlock.d.ts +3 -0
- package/dist/EmbedBlock/EmbedBlock.stories.d.ts +10 -0
- package/dist/EmbedBlock/EmbedBlock.types.d.ts +5 -0
- package/dist/EmbedBlock/IframeBlock.d.ts +3 -0
- package/dist/EmbedBlock/index.d.ts +3 -0
- package/dist/GroupedBlock/GroupedBlock.stories.d.ts +10 -0
- package/dist/GroupedBlock/GroupedBlock.types.d.ts +4 -0
- package/dist/GroupedBlock/index.d.ts +3 -0
- package/dist/HalfBlock/HalfBlock.stories.d.ts +10 -0
- package/dist/HalfBlock/HalfBlock.types.d.ts +4 -0
- package/dist/HalfBlock/index.d.ts +3 -0
- package/dist/Image/Image.stories.d.ts +10 -0
- package/dist/Image/Image.types.d.ts +38 -0
- package/dist/Image/RenderPicture.d.ts +4 -0
- package/dist/Image/index.d.ts +3 -0
- package/dist/ImportantLead/ImportantLead.stories.d.ts +10 -0
- package/dist/ImportantLead/ImportantLead.types.d.ts +4 -0
- package/dist/ImportantLead/index.d.ts +3 -0
- package/dist/Lazy/Lazy.stories.d.ts +10 -0
- package/dist/Lazy/Lazy.types.d.ts +5 -0
- package/dist/Lazy/index.d.ts +3 -0
- package/dist/ListBlock/ListBlock.stories.d.ts +10 -0
- package/dist/ListBlock/ListBlock.types.d.ts +4 -0
- package/dist/ListBlock/index.d.ts +3 -0
- package/dist/MaterialNote/MaterialNote.stories.d.ts +10 -0
- package/dist/MaterialNote/MaterialNote.types.d.ts +12 -0
- package/dist/MaterialNote/index.d.ts +3 -0
- package/dist/MaterialTitle/MaterialTitle.stories.d.ts +10 -0
- package/dist/MaterialTitle/MaterialTitle.types.d.ts +4 -0
- package/dist/MaterialTitle/index.d.ts +5 -0
- package/dist/MediaCaption/MediaCaption.stories.d.ts +10 -0
- package/dist/MediaCaption/MediaCaption.types.d.ts +5 -0
- package/dist/MediaCaption/index.d.ts +3 -0
- package/dist/Meta/Meta.stories.d.ts +10 -0
- package/dist/Meta/Meta.types.d.ts +18 -0
- package/dist/Meta/MetaContainer.d.ts +3 -0
- package/dist/Meta/index.d.ts +3 -0
- package/dist/MetaItem/MetaItem.stories.d.ts +10 -0
- package/dist/MetaItem/MetaItem.types.d.ts +7 -0
- package/dist/MetaItem/index.d.ts +3 -0
- package/dist/MetaItemLive/MetaItemLive.stories.d.ts +10 -0
- package/dist/MetaItemLive/MetaItemLive.types.d.ts +3 -0
- package/dist/MetaItemLive/index.d.ts +3 -0
- package/dist/Popover/Popover.stories.d.ts +10 -0
- package/dist/Popover/Popover.types.d.ts +5 -0
- package/dist/Popover/index.d.ts +3 -0
- package/dist/QuoteBlock/QuoteBlock.stories.d.ts +10 -0
- package/dist/QuoteBlock/QuoteBlock.types.d.ts +6 -0
- package/dist/QuoteBlock/index.d.ts +3 -0
- package/dist/RawHtmlBlock/RawHtmlBlock.stories.d.ts +10 -0
- package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +9 -0
- package/dist/RawHtmlBlock/index.d.ts +3 -0
- package/dist/RelatedBlock/RelatedBlock.stories.d.ts +10 -0
- package/dist/RelatedBlock/RelatedBlock.types.d.ts +4 -0
- package/dist/RelatedBlock/index.d.ts +3 -0
- package/dist/RenderBlocks/RenderBlocks.stories.d.ts +10 -0
- package/dist/RenderBlocks/RenderBlocks.types.d.ts +10 -0
- package/dist/RenderBlocks/index.d.ts +3 -0
- package/dist/RichTitle/RichTitle.stories.d.ts +10 -0
- package/dist/RichTitle/RichTitle.types.d.ts +4 -0
- package/dist/RichTitle/index.d.ts +3 -0
- package/dist/SimpleBlock/SimpleBlock.stories.d.ts +10 -0
- package/dist/SimpleBlock/SimpleBlock.types.d.ts +4 -0
- package/dist/SimpleBlock/index.d.ts +3 -0
- package/dist/SimpleTitle/SimpleTitle.stories.d.ts +10 -0
- package/dist/SimpleTitle/SimpleTitle.types.d.ts +4 -0
- package/dist/SimpleTitle/index.d.ts +3 -0
- package/dist/SourceBlock/SourceBlock.stories.d.ts +10 -0
- package/dist/SourceBlock/SourceBlock.types.d.ts +4 -0
- package/dist/SourceBlock/index.d.ts +3 -0
- package/dist/Spoiler/Spoiler.stories.d.ts +10 -0
- package/dist/Spoiler/Spoiler.types.d.ts +4 -0
- package/dist/Spoiler/index.d.ts +3 -0
- package/dist/SvgSymbol/SvgSymbol.stories.d.ts +10 -0
- package/dist/SvgSymbol/SvgSymbol.types.d.ts +8 -0
- package/dist/SvgSymbol/icons.d.ts +157 -0
- package/dist/SvgSymbol/index.d.ts +3 -0
- package/dist/Switcher/Switcher.stories.d.ts +10 -0
- package/dist/Switcher/Switcher.types.d.ts +12 -0
- package/dist/Switcher/index.d.ts +3 -0
- package/dist/Table/Table.stories.d.ts +10 -0
- package/dist/Table/Table.types.d.ts +25 -0
- package/dist/Table/index.d.ts +3 -0
- package/dist/Tag/Tag.stories.d.ts +10 -0
- package/dist/Tag/Tag.types.d.ts +12 -0
- package/dist/Tag/index.d.ts +3 -0
- package/dist/Timestamp/Timestamp.stories.d.ts +10 -0
- package/dist/Timestamp/Timestamp.types.d.ts +5 -0
- package/dist/Timestamp/index.d.ts +4 -0
- package/dist/Toolbar/Toolbar.stories.d.ts +10 -0
- package/dist/Toolbar/Toolbar.types.d.ts +5 -0
- package/dist/Toolbar/index.d.ts +3 -0
- package/dist/ToolbarButton/ToolbarButton.stories.d.ts +10 -0
- package/dist/ToolbarButton/ToolbarButton.types.d.ts +9 -0
- package/dist/ToolbarButton/index.d.ts +3 -0
- package/dist/_storybook/PreviewWrapper/index.d.ts +6 -0
- package/dist/constants.d.ts +22 -0
- package/dist/index.d.ts +37 -0
- package/dist/ui-kit-2.cjs.development.css +36 -0
- package/dist/ui-kit-2.cjs.development.js +2187 -39
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +2139 -32
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/utils/BlockContext.d.ts +8 -0
- package/dist/utils/DangerousHtml.d.ts +8 -0
- package/dist/utils/makeClassName.d.ts +1 -1
- package/dist/utils/makeStyleContext.d.ts +2 -0
- package/dist/utils/toCamel.d.ts +1 -0
- package/package.json +29 -13
- package/src/BookmarkButton/BookmarkButton.module.css +50 -0
- package/src/BookmarkButton/BookmarkButton.stories.module.css +5 -0
- package/src/BookmarkButton/BookmarkButton.stories.tsx +39 -0
- package/src/BookmarkButton/BookmarkButton.test.tsx +20 -0
- package/src/BookmarkButton/BookmarkButton.types.ts +6 -0
- package/src/BookmarkButton/index.tsx +37 -0
- package/src/Button/Button.stories.module.css +30 -0
- package/src/Button/Button.stories.tsx +87 -0
- package/src/Button/Button.test.tsx +42 -0
- package/src/Button/Button.types.ts +1 -3
- package/src/Button/index.tsx +2 -2
- package/src/CardTitle/CardTitle.module.css +52 -0
- package/src/CardTitle/CardTitle.stories.module.css +5 -0
- package/src/CardTitle/CardTitle.stories.tsx +36 -0
- package/src/CardTitle/CardTitle.test.tsx +20 -0
- package/src/CardTitle/CardTitle.types.ts +8 -0
- package/src/CardTitle/index.tsx +24 -0
- package/src/CardTitle/mock.json +8 -0
- package/src/ChapterBlock/ChapterBlock.module.css +70 -0
- package/src/ChapterBlock/ChapterBlock.stories.module.css +5 -0
- package/src/ChapterBlock/ChapterBlock.stories.tsx +36 -0
- package/src/ChapterBlock/ChapterBlock.test.tsx +20 -0
- package/src/ChapterBlock/ChapterBlock.types.ts +7 -0
- package/src/ChapterBlock/index.tsx +31 -0
- package/src/ChapterBlock/mock.json +5 -0
- package/src/Cover/Cover.module.css +5 -0
- package/src/Cover/Cover.stories.module.css +5 -0
- package/src/Cover/Cover.stories.tsx +34 -0
- package/src/Cover/Cover.test.tsx +20 -0
- package/src/Cover/Cover.types.ts +4 -0
- package/src/Cover/index.tsx +89 -0
- package/src/DocumentItemsCount/DocumentItemsCount.module.css +18 -0
- package/src/DocumentItemsCount/DocumentItemsCount.stories.module.css +5 -0
- package/src/DocumentItemsCount/DocumentItemsCount.stories.tsx +34 -0
- package/src/DocumentItemsCount/DocumentItemsCount.test.tsx +20 -0
- package/src/DocumentItemsCount/DocumentItemsCount.types.ts +6 -0
- package/src/DocumentItemsCount/index.tsx +54 -0
- package/src/DotsOnImage/DotsOnImage.module.css +56 -0
- package/src/DotsOnImage/DotsOnImage.stories.module.css +9 -0
- package/src/DotsOnImage/DotsOnImage.stories.tsx +37 -0
- package/src/DotsOnImage/DotsOnImage.test.tsx +19 -0
- package/src/DotsOnImage/DotsOnImage.types.ts +46 -0
- package/src/DotsOnImage/index.tsx +79 -0
- package/src/DotsOnImage/mock.json +75 -0
- package/src/Dropdown/Dropdown.module.css +82 -0
- package/src/Dropdown/Dropdown.stories.module.css +5 -0
- package/src/Dropdown/Dropdown.stories.tsx +55 -0
- package/src/Dropdown/Dropdown.test.tsx +20 -0
- package/src/Dropdown/Dropdown.types.ts +5 -0
- package/src/Dropdown/index.tsx +35 -0
- package/src/EmbedBlock/EmbedBlock.module.css +351 -0
- package/src/EmbedBlock/EmbedBlock.stories.module.css +5 -0
- package/src/EmbedBlock/EmbedBlock.stories.tsx +39 -0
- package/src/EmbedBlock/EmbedBlock.test.tsx +20 -0
- package/src/EmbedBlock/EmbedBlock.tsx +236 -0
- package/src/EmbedBlock/EmbedBlock.types.ts +5 -0
- package/src/EmbedBlock/IframeBlock.tsx +86 -0
- package/src/EmbedBlock/index.tsx +16 -0
- package/src/EmbedBlock/mock.json +89 -0
- package/src/GroupedBlock/GroupedBlock.module.css +94 -0
- package/src/GroupedBlock/GroupedBlock.stories.module.css +5 -0
- package/src/GroupedBlock/GroupedBlock.stories.tsx +34 -0
- package/src/GroupedBlock/GroupedBlock.test.tsx +20 -0
- package/src/GroupedBlock/GroupedBlock.types.ts +4 -0
- package/src/GroupedBlock/index.tsx +67 -0
- package/src/HalfBlock/HalfBlock.module.css +88 -0
- package/src/HalfBlock/HalfBlock.stories.module.css +5 -0
- package/src/HalfBlock/HalfBlock.stories.tsx +34 -0
- package/src/HalfBlock/HalfBlock.test.tsx +20 -0
- package/src/HalfBlock/HalfBlock.types.ts +4 -0
- package/src/HalfBlock/index.tsx +53 -0
- package/src/Image/Image.module.css +78 -0
- package/src/Image/Image.stories.module.css +5 -0
- package/src/Image/Image.stories.tsx +47 -0
- package/src/Image/Image.test.tsx +33 -0
- package/src/Image/Image.types.ts +40 -0
- package/src/Image/RenderPicture.tsx +70 -0
- package/src/Image/index.tsx +101 -0
- package/src/Image/mock.json +49 -0
- package/src/ImportantLead/ImportantLead.module.css +64 -0
- package/src/ImportantLead/ImportantLead.stories.module.css +5 -0
- package/src/ImportantLead/ImportantLead.stories.tsx +34 -0
- package/src/ImportantLead/ImportantLead.test.tsx +20 -0
- package/src/ImportantLead/ImportantLead.types.ts +4 -0
- package/src/ImportantLead/index.tsx +35 -0
- package/src/Lazy/Lazy.module.css +9 -0
- package/src/Lazy/Lazy.stories.module.css +5 -0
- package/src/Lazy/Lazy.stories.tsx +48 -0
- package/src/Lazy/Lazy.test.tsx +20 -0
- package/src/Lazy/Lazy.types.ts +4 -0
- package/src/Lazy/index.tsx +41 -0
- package/src/ListBlock/ListBlock.module.css +163 -0
- package/src/ListBlock/ListBlock.stories.module.css +5 -0
- package/src/ListBlock/ListBlock.stories.tsx +34 -0
- package/src/ListBlock/ListBlock.test.tsx +20 -0
- package/src/ListBlock/ListBlock.types.ts +4 -0
- package/src/ListBlock/index.tsx +33 -0
- package/src/MaterialNote/MaterialNote.module.css +139 -0
- package/src/MaterialNote/MaterialNote.stories.module.css +5 -0
- package/src/MaterialNote/MaterialNote.stories.tsx +36 -0
- package/src/MaterialNote/MaterialNote.test.tsx +20 -0
- package/src/MaterialNote/MaterialNote.types.ts +12 -0
- package/src/MaterialNote/index.tsx +30 -0
- package/src/MaterialNote/mock.json +18 -0
- package/src/MaterialTitle/MaterialTitle.module.css +33 -0
- package/src/MaterialTitle/MaterialTitle.stories.module.css +13 -0
- package/src/MaterialTitle/MaterialTitle.stories.tsx +52 -0
- package/src/MaterialTitle/MaterialTitle.test.tsx +20 -0
- package/src/MaterialTitle/MaterialTitle.types.ts +3 -0
- package/src/MaterialTitle/index.tsx +20 -0
- package/src/MediaCaption/MediaCaption.module.css +85 -0
- package/src/MediaCaption/MediaCaption.stories.module.css +5 -0
- package/src/MediaCaption/MediaCaption.stories.tsx +37 -0
- package/src/MediaCaption/MediaCaption.test.tsx +20 -0
- package/src/MediaCaption/MediaCaption.types.ts +5 -0
- package/src/MediaCaption/index.tsx +35 -0
- package/src/Meta/Meta.module.css +106 -0
- package/src/Meta/Meta.stories.module.css +7 -0
- package/src/Meta/Meta.stories.tsx +69 -0
- package/src/Meta/Meta.test.tsx +20 -0
- package/src/Meta/Meta.types.ts +19 -0
- package/src/Meta/MetaContainer.tsx +148 -0
- package/src/Meta/index.tsx +32 -0
- package/src/MetaItem/MetaItem.module.css +104 -0
- package/src/MetaItem/MetaItem.stories.module.css +5 -0
- package/src/MetaItem/MetaItem.stories.tsx +34 -0
- package/src/MetaItem/MetaItem.test.tsx +20 -0
- package/src/MetaItem/MetaItem.types.ts +6 -0
- package/src/MetaItem/index.tsx +26 -0
- package/src/MetaItemLive/MetaItemLive.module.css +124 -0
- package/src/MetaItemLive/MetaItemLive.stories.module.css +5 -0
- package/src/MetaItemLive/MetaItemLive.stories.tsx +34 -0
- package/src/MetaItemLive/MetaItemLive.test.tsx +20 -0
- package/src/MetaItemLive/MetaItemLive.types.ts +3 -0
- package/src/MetaItemLive/index.tsx +25 -0
- package/src/Popover/Popover.module.css +134 -0
- package/src/Popover/Popover.stories.module.css +5 -0
- package/src/Popover/Popover.stories.tsx +55 -0
- package/src/Popover/Popover.test.tsx +20 -0
- package/src/Popover/Popover.types.ts +4 -0
- package/src/Popover/index.tsx +78 -0
- package/src/QuoteBlock/QuoteBlock.module.css +79 -0
- package/src/QuoteBlock/QuoteBlock.stories.module.css +7 -0
- package/src/QuoteBlock/QuoteBlock.stories.tsx +36 -0
- package/src/QuoteBlock/QuoteBlock.test.tsx +20 -0
- package/src/QuoteBlock/QuoteBlock.types.ts +6 -0
- package/src/QuoteBlock/index.tsx +24 -0
- package/src/QuoteBlock/mock.json +6 -0
- package/src/RawHtmlBlock/RawHtmlBlock.stories.module.css +5 -0
- package/src/RawHtmlBlock/RawHtmlBlock.stories.tsx +34 -0
- package/src/RawHtmlBlock/RawHtmlBlock.test.tsx +20 -0
- package/src/RawHtmlBlock/RawHtmlBlock.types.ts +9 -0
- package/src/RawHtmlBlock/index.tsx +57 -0
- package/src/RelatedBlock/RelatedBlock.module.css +129 -0
- package/src/RelatedBlock/RelatedBlock.stories.module.css +5 -0
- package/src/RelatedBlock/RelatedBlock.stories.tsx +34 -0
- package/src/RelatedBlock/RelatedBlock.test.tsx +20 -0
- package/src/RelatedBlock/RelatedBlock.types.ts +4 -0
- package/src/RelatedBlock/index.tsx +45 -0
- package/src/RenderBlocks/RenderBlocks.stories.module.css +5 -0
- package/src/RenderBlocks/RenderBlocks.stories.tsx +34 -0
- package/src/RenderBlocks/RenderBlocks.test.tsx +20 -0
- package/src/RenderBlocks/RenderBlocks.types.ts +10 -0
- package/src/RenderBlocks/index.tsx +125 -0
- package/src/RichTitle/RichTitle.module.css +85 -0
- package/src/RichTitle/RichTitle.stories.module.css +5 -0
- package/src/RichTitle/RichTitle.stories.tsx +34 -0
- package/src/RichTitle/RichTitle.test.tsx +20 -0
- package/src/RichTitle/RichTitle.types.ts +4 -0
- package/src/RichTitle/index.tsx +32 -0
- package/src/SimpleBlock/FootnoteLink.css +34 -0
- package/src/SimpleBlock/SimpleBlock.module.css +393 -0
- package/src/SimpleBlock/SimpleBlock.stories.module.css +5 -0
- package/src/SimpleBlock/SimpleBlock.stories.tsx +34 -0
- package/src/SimpleBlock/SimpleBlock.test.tsx +20 -0
- package/src/SimpleBlock/SimpleBlock.types.ts +4 -0
- package/src/SimpleBlock/index.tsx +47 -0
- package/src/SimpleTitle/SimpleTitle.module.css +33 -0
- package/src/SimpleTitle/SimpleTitle.stories.module.css +5 -0
- package/src/SimpleTitle/SimpleTitle.stories.tsx +34 -0
- package/src/SimpleTitle/SimpleTitle.test.tsx +20 -0
- package/src/SimpleTitle/SimpleTitle.types.ts +4 -0
- package/src/SimpleTitle/index.tsx +29 -0
- package/src/SourceBlock/SourceBlock.module.css +110 -0
- package/src/SourceBlock/SourceBlock.stories.module.css +5 -0
- package/src/SourceBlock/SourceBlock.stories.tsx +34 -0
- package/src/SourceBlock/SourceBlock.test.tsx +20 -0
- package/src/SourceBlock/SourceBlock.types.ts +4 -0
- package/src/SourceBlock/index.tsx +44 -0
- package/src/Spoiler/Spoiler.module.css +177 -0
- package/src/Spoiler/Spoiler.stories.module.css +8 -0
- package/src/Spoiler/Spoiler.stories.tsx +36 -0
- package/src/Spoiler/Spoiler.test.tsx +20 -0
- package/src/Spoiler/Spoiler.types.ts +4 -0
- package/src/Spoiler/index.tsx +81 -0
- package/src/Spoiler/mock.json +49 -0
- package/src/SvgSymbol/SvgSymbol.module.css +240 -0
- package/src/SvgSymbol/SvgSymbol.stories.module.css +127 -0
- package/src/SvgSymbol/SvgSymbol.stories.tsx +95 -0
- package/src/SvgSymbol/SvgSymbol.test.tsx +21 -0
- package/src/SvgSymbol/SvgSymbol.types.ts +57 -0
- package/src/SvgSymbol/icons.ts +217 -0
- package/src/SvgSymbol/index.tsx +32 -0
- package/src/Switcher/Switcher.module.css +159 -0
- package/src/Switcher/Switcher.stories.module.css +28 -0
- package/src/Switcher/Switcher.stories.tsx +68 -0
- package/src/Switcher/Switcher.test.tsx +43 -0
- package/src/Switcher/Switcher.types.ts +16 -0
- package/src/Switcher/index.tsx +53 -0
- package/src/Table/Table.module.css +300 -0
- package/src/Table/Table.stories.module.css +5 -0
- package/src/Table/Table.stories.tsx +36 -0
- package/src/Table/Table.test.tsx +20 -0
- package/src/Table/Table.types.ts +26 -0
- package/src/Table/index.tsx +76 -0
- package/src/Table/mock.json +301 -0
- package/src/Tag/Tag.module.css +115 -0
- package/src/Tag/Tag.stories.module.css +5 -0
- package/src/Tag/Tag.stories.tsx +53 -0
- package/src/Tag/Tag.test.tsx +20 -0
- package/src/Tag/Tag.types.ts +14 -0
- package/src/Tag/index.tsx +33 -0
- package/src/Timestamp/Timestamp.module.css +6 -0
- package/src/Timestamp/Timestamp.stories.module.css +5 -0
- package/src/Timestamp/Timestamp.stories.tsx +34 -0
- package/src/Timestamp/Timestamp.test.tsx +20 -0
- package/src/Timestamp/Timestamp.types.ts +5 -0
- package/src/Timestamp/index.tsx +40 -0
- package/src/Toolbar/Toolbar.module.css +134 -0
- package/src/Toolbar/Toolbar.stories.module.css +5 -0
- package/src/Toolbar/Toolbar.stories.tsx +89 -0
- package/src/Toolbar/Toolbar.test.tsx +20 -0
- package/src/Toolbar/Toolbar.types.ts +4 -0
- package/src/Toolbar/index.tsx +28 -0
- package/src/ToolbarButton/ToolbarButton.module.css +97 -0
- package/src/ToolbarButton/ToolbarButton.stories.module.css +5 -0
- package/src/ToolbarButton/ToolbarButton.stories.tsx +36 -0
- package/src/ToolbarButton/ToolbarButton.test.tsx +20 -0
- package/src/ToolbarButton/ToolbarButton.types.ts +19 -0
- package/src/ToolbarButton/index.tsx +34 -0
- package/src/_storybook/PreviewWrapper/PreviewWrapper.module.css +117 -0
- package/src/_storybook/PreviewWrapper/index.tsx +23 -0
- package/src/constants.ts +24 -0
- package/src/index.tsx +38 -0
- package/src/utils/BlockContext.ts +7 -0
- package/src/utils/DangerousHtml.tsx +79 -0
- package/src/utils/makeClassName.ts +1 -1
- package/src/utils/makeStyleContext.ts +13 -0
- package/src/utils/toCamel.ts +2 -0
- package/LICENSE +0 -21
- package/src/global.d.ts +0 -4
package/dist/ui-kit-2.esm.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useEffect, useContext, Children, useRef, useCallback } from 'react';
|
|
2
|
+
import { useInView } from 'react-intersection-observer';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import 'dayjs/locale/ru';
|
|
5
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
6
|
+
import enableInlineVideo from 'iphone-inline-video';
|
|
2
7
|
|
|
3
8
|
var makeClassName = function makeClassName(list) {
|
|
4
9
|
return list.filter(function (_ref) {
|
|
@@ -33,36 +38,7 @@ var Loader = function Loader() {
|
|
|
33
38
|
})));
|
|
34
39
|
};
|
|
35
40
|
|
|
36
|
-
function styleInject(css, ref) {
|
|
37
|
-
if ( ref === void 0 ) ref = {};
|
|
38
|
-
var insertAt = ref.insertAt;
|
|
39
|
-
|
|
40
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
41
|
-
|
|
42
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
43
|
-
var style = document.createElement('style');
|
|
44
|
-
style.type = 'text/css';
|
|
45
|
-
|
|
46
|
-
if (insertAt === 'top') {
|
|
47
|
-
if (head.firstChild) {
|
|
48
|
-
head.insertBefore(style, head.firstChild);
|
|
49
|
-
} else {
|
|
50
|
-
head.appendChild(style);
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
head.appendChild(style);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (style.styleSheet) {
|
|
57
|
-
style.styleSheet.cssText = css;
|
|
58
|
-
} else {
|
|
59
|
-
style.appendChild(document.createTextNode(css));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
var css_248z = "/* Colors */\n/* Fonts */\n/* Gap */\n/* Media */\n/* 512 */\n/* 650 */\n/* 768 */\n/* 1024 */\n/* 1010 */\n/* 1200 */\n/* 511 */\n/* 1023 */\n/* Zindex */\n.Button-module_root__RpsiW {\n display: block;\n\n padding: 0;\n\n color: #fff;\n\n font-family: 'Proxima Nova', 'Arial', 'Helvetica Neue', sans-serif;\n line-height: 1;\n text-align: center;\n\n border-width: 0;\n outline: none;\n\n cursor: pointer;\n\n transition: background-color 0.15s ease-out;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.Button-module_root__RpsiW::-moz-focus-inner {\n border: 0;\n}\n.Button-module_root__RpsiW[disabled] {\n cursor: default;\n\n opacity: 0.5;\n\n pointer-events: none;\n}\n.Button-module_root__RpsiW > span:first-child {\n margin-right: 4px;\n}\n.Button-module_root__RpsiW > span:last-child {\n margin-left: 4px;\n}\n.Button-module_gold__ZMYg- {\n background: #b88b59;\n}\n.Button-module_gold__ZMYg-.Button-module_isLoading__1g6QO {\n fill: #b88b59;\n}\n.Button-module_gold__ZMYg-:hover {\n background-color: #9e784c\n}\n@media (hover: none) {\n.Button-module_gold__ZMYg-:hover {\n background-color: #b88b59\n}\n }\n.Button-module_gold__ZMYg-:active {\n background-color: #856440;\n}\n.Button-module_gray__3IM54 {\n color: #000;\n\n background-color: #f0f0f0;\n}\n.Button-module_gray__3IM54.Button-module_isLoading__1g6QO {\n fill: #545454;\n}\n.Button-module_gray__3IM54:hover {\n background-color: #ebebeb\n}\n@media (hover: none) {\n.Button-module_gray__3IM54:hover {\n background-color: #ebebeb\n}\n }\n.Button-module_gray__3IM54:active {\n background-color: #e3e3e3;\n}\n.Button-module_sand__2AqVq {\n background: #a18c68;\n}\n.Button-module_sand__2AqVq.Button-module_isLoading__1g6QO {\n fill: #a18c68;\n}\n.Button-module_sand__2AqVq:hover {\n background-color: #8a7654\n}\n@media (hover: none) {\n.Button-module_sand__2AqVq:hover {\n background-color: #a18c68\n}\n }\n.Button-module_sand__2AqVq:active {\n background-color: #7b6743;\n}\n.Button-module_dark__I0uXx {\n color: #adadad;\n\n background-color: #3a3a3a;\n box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.4);\n}\n.Button-module_dark__I0uXx:hover {\n background-color: #2e2e2e\n}\n@media (hover: none) {\n.Button-module_dark__I0uXx:hover {\n background-color: #3a3a3a\n}\n }\n.Button-module_dark__I0uXx:active {\n background-color: #242424;\n}\n.Button-module_dark__I0uXx.Button-module_isLoading__1g6QO {\n fill: #3a3a3a;\n}\n.Button-module_light__1Y4hG {\n color: #000;\n\n background-color: #fff;\n}\n.Button-module_light__1Y4hG:hover {\n background-color: #ebebeb\n}\n@media (hover: none) {\n.Button-module_light__1Y4hG:hover {\n background-color: #fff\n}\n }\n.Button-module_light__1Y4hG:active {\n background-color: #e3e3e3;\n}\n.Button-module_light__1Y4hG.Button-module_isLoading__1g6QO {\n fill: #fff;\n}\n.Button-module_black__3sG3Y {\n color: #7e7d7b;\n\n background-color: #000;\n}\n.Button-module_black__3sG3Y.Button-module_isLoading__1g6QO {\n fill: #7e7d7b;\n}\n.Button-module_black__3sG3Y:hover {\n background-color: #141414\n}\n@media (hover: none) {\n.Button-module_black__3sG3Y:hover {\n background: #141414\n}\n }\n.Button-module_black__3sG3Y:active {\n background-color: #242424;\n}\n.Button-module_red__3Niou {\n background-color: #f95a5a;\n}\n.Button-module_red__3Niou:hover {\n background-color: #e65353\n}\n@media (hover: none) {\n.Button-module_red__3Niou:hover {\n background: #f95a5a\n}\n }\n.Button-module_red__3Niou:active {\n background-color: #d44d4d;\n}\n.Button-module_red__3Niou.Button-module_isLoading__1g6QO {\n fill: #141414;\n}\n.Button-module_default__28Vo_ {\n width: 100%;\n height: 42px;\n padding: 7px 18px 6px;\n\n font-weight: 600;\n\n font-size: 12px;\n line-height: 22px;\n\n letter-spacing: 1px;\n text-transform: uppercase;\n\n border-radius: 8px\n}\n@media only screen and (min-device-width: 64em) {\n.Button-module_default__28Vo_ {\n font-size: 14px;\n line-height: 16px\n}\n }\n.Button-module_isInSpoiler__2Yl8c svg {\n margin-top: -2px;\n margin-left: 6px;\n}\n.Button-module_ghost__3awCW {\n\n color: inherit;\n font-weight: inherit;\n font-size: inherit;\n\n font-family: inherit;\n letter-spacing: inherit;\n text-transform: none;\n\n background-color: transparent;\n}\n.Button-module_isInDropdown__1ogKL {\n font-family: 'Proxima Nova', 'Arial', 'Helvetica Neue', sans-serif;\n}\n.Button-module_black__3sG3Y[disabled],\n.Button-module_sand__2AqVq[disabled] {\n opacity: 0.3;\n}\n/* LOADING */\n.Button-module_root__RpsiW.Button-module_isLoading__1g6QO {\n\n background-color: transparent;\n box-shadow: none;\n cursor: default;\n\n pointer-events: none;\n}\n.Button-module_loader__2pl6d {\n display: block;\n\n margin-top: -1px;\n}\n";
|
|
64
41
|
var styles = {"root":"Button-module_root__RpsiW","gold":"Button-module_gold__ZMYg-","isLoading":"Button-module_isLoading__1g6QO","gray":"Button-module_gray__3IM54","sand":"Button-module_sand__2AqVq","dark":"Button-module_dark__I0uXx","light":"Button-module_light__1Y4hG","black":"Button-module_black__3sG3Y","red":"Button-module_red__3Niou","default":"Button-module_default__28Vo_","isInSpoiler":"Button-module_isInSpoiler__2Yl8c","ghost":"Button-module_ghost__3awCW","isInDropdown":"Button-module_isInDropdown__1ogKL","loader":"Button-module_loader__2pl6d"};
|
|
65
|
-
styleInject(css_248z);
|
|
66
42
|
|
|
67
43
|
var Button = function Button(_ref) {
|
|
68
44
|
var _ref$theme = _ref.theme,
|
|
@@ -70,7 +46,7 @@ var Button = function Button(_ref) {
|
|
|
70
46
|
_ref$size = _ref.size,
|
|
71
47
|
size = _ref$size === void 0 ? 'default' : _ref$size,
|
|
72
48
|
_ref$state = _ref.state,
|
|
73
|
-
state = _ref$state === void 0 ? '
|
|
49
|
+
state = _ref$state === void 0 ? 'isDefault' : _ref$state,
|
|
74
50
|
_ref$styleContext = _ref.styleContext,
|
|
75
51
|
styleContext = _ref$styleContext === void 0 ? 'isInToolbar' : _ref$styleContext,
|
|
76
52
|
_ref$disabled = _ref.disabled,
|
|
@@ -97,5 +73,2136 @@ var Button = function Button(_ref) {
|
|
|
97
73
|
}, React.createElement(Loader, null)) : children);
|
|
98
74
|
};
|
|
99
75
|
|
|
100
|
-
|
|
76
|
+
var styles$1 = {"root":"SvgSymbol-module_root__2CsRW","small":"SvgSymbol-module_small__2g6oR","normal":"SvgSymbol-module_normal__9lFn1","medium":"SvgSymbol-module_medium__2eF5L","large":"SvgSymbol-module_large__2kQrt","adaptive":"SvgSymbol-module_adaptive__3_68T","fb":"SvgSymbol-module_fb__1whmw","vk":"SvgSymbol-module_vk__3VEuu","ok":"SvgSymbol-module_ok__2_1Qb","tw":"SvgSymbol-module_tw__2VRG5","tg":"SvgSymbol-module_tg__2xe2f","reaction":"SvgSymbol-module_reaction__rrJvf","card":"SvgSymbol-module_card__1XAqw","podcast":"SvgSymbol-module_podcast__3oPoo","read":"SvgSymbol-module_read__2V82i","listened":"SvgSymbol-module_listened__1oMFV","menu":"SvgSymbol-module_menu__2iYFt","cross":"SvgSymbol-module_cross__J2lCN","isInFeature":"SvgSymbol-module_isInFeature__cDeTI","isInCard":"SvgSymbol-module_isInCard__pKq4e","isInTopicBlockItem":"SvgSymbol-module_isInTopicBlockItem__3Te91","isInPageStatic":"SvgSymbol-module_isInPageStatic__H31Rd","isInMaterialMeta":"SvgSymbol-module_isInMaterialMeta__2IbAw","isInAudioPlayer":"SvgSymbol-module_isInAudioPlayer__2xlzW","isInEpisodeBlock":"SvgSymbol-module_isInEpisodeBlock__2vY3o","isInButtonPlaybackRate":"SvgSymbol-module_isInButtonPlaybackRate__1L3TW","isInButtonBackward":"SvgSymbol-module_isInButtonBackward__1Grf9","isInButtonForward":"SvgSymbol-module_isInButtonForward__D1AFL","isInToolbar":"SvgSymbol-module_isInToolbar__3SaIh","play":"SvgSymbol-module_play__pM-qY","meduzaLogo":"SvgSymbol-module_meduzaLogo__2Ouzp","arrow":"SvgSymbol-module_arrow__11naX","oil":"SvgSymbol-module_oil__hvHE5","search":"SvgSymbol-module_search__VK6p3","user":"SvgSymbol-module_user__1MGim","bookmark":"SvgSymbol-module_bookmark__2z7tX","receipt":"SvgSymbol-module_receipt__3Eqow","isInHeader":"SvgSymbol-module_isInHeader__1QHjL"};
|
|
77
|
+
|
|
78
|
+
var icons = {
|
|
79
|
+
meduzaLogo: {
|
|
80
|
+
width: 544,
|
|
81
|
+
height: 115,
|
|
82
|
+
content: '<path d="M59.1008614,49.65632 L59.1008614,106.01472 L84.9480411,114.24 L84.9480411,49.65632 L101.574882,49.65632 L101.574882,106.01472 L127.270909,114.24 L144.048902,91.392 L127.422062,91.392 L127.422062,35.7952 L101.726035,26.80832 L84.9480411,46.60992 L84.9480411,35.7952 L59.2520145,26.80832 L42.4740206,46.60992 L42.4740206,35.7952 L16.7779939,26.80832 L0,49.65632 L16.6268408,49.65632 L16.6268408,106.01472 L42.4740206,114.24 L42.4740206,49.65632 L59.1008614,49.65632 L59.1008614,49.65632 Z M336.61795,91.392 L336.61795,35.0336 L310.770769,26.80832 L310.770769,105.25312 L336.466796,114.24 L353.24479,94.4384 L353.24479,105.25312 L378.940817,114.24 L395.71881,91.392 L379.091969,91.392 L379.091969,35.0336 L353.24479,26.80832 L353.24479,91.392 L336.61795,91.392 L336.61795,91.392 Z M527.373159,38.08 L502.130592,26.80832 L472.202278,41.1264 L502.130592,52.39808 L461.016949,72.352 L461.016949,104.94848 L486.86413,114.24 L502.130592,94.28608 L502.130592,105.25312 L527.977771,114.24 L544,91.23968 L527.373159,91.23968 L527.373159,38.08 L527.373159,38.08 Z M177.453737,114.24 L207.079744,102.35904 L177.453737,91.23968 L177.453737,75.24608 L216.300083,56.3584 L194.231731,26.80832 L151.606557,47.37152 L151.606557,103.12064 L177.453737,114.24 L177.453737,114.24 Z M455.424284,89.56416 L423.984441,79.968 L453.459295,42.19264 L416.577937,26.80832 L397.230341,51.48416 L428.821339,61.23264 L398.741873,98.85568 L436.076687,114.24 L455.424284,89.56416 L455.424284,89.56416 Z M486.86413,91.392 L486.86413,68.84864 L502.130592,61.53728 L502.130592,91.392 L486.86413,91.392 L486.86413,91.392 Z M177.453737,41.58336 L190.452904,59.55712 L177.453737,65.80224 L177.453737,41.58336 L177.453737,41.58336 Z M222.95082,103.12064 L248.797999,114.24 L291.27202,97.18016 L291.27202,29.7024 L222.95082,0 L222.95082,26.30784 L265.424841,43.21536 L265.424841,97.33248 L248.797999,91.23968 L248.797999,43.71584 L222.95082,51.94112 L222.95082,103.12064 L222.95082,103.12064 Z" />'
|
|
83
|
+
},
|
|
84
|
+
menu: {
|
|
85
|
+
width: 24,
|
|
86
|
+
height: 24,
|
|
87
|
+
content: '<path d="M2 21h20M2 12h20M2 3h20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />'
|
|
88
|
+
},
|
|
89
|
+
fb: {
|
|
90
|
+
width: 16,
|
|
91
|
+
height: 18,
|
|
92
|
+
content: '<path d="M15.117 1H.883A.883.883 0 0 0 0 1.883v14.234A.883.883 0 0 0 .883 17h7.663v-6.196H6.461V8.389h2.085V6.61a2.91 2.91 0 0 1 3.106-3.192c.622-.003 1.244.03 1.863.095v2.16h-1.279c-1.002 0-1.196.476-1.196 1.176v1.541h2.39l-.31 2.415h-2.08V17h4.077a.883.883 0 0 0 .883-.883V1.883A.883.883 0 0 0 15.117 1" />'
|
|
93
|
+
},
|
|
94
|
+
tw: {
|
|
95
|
+
width: 20,
|
|
96
|
+
height: 18,
|
|
97
|
+
content: '<path d="M20 3.1c-.7.3-1.5.6-2.4.7.8-.5 1.5-1.4 1.8-2.4-.8.5-1.7.8-2.6 1-.7-.8-1.8-1.4-3-1.4-2.3 0-4.1 1.9-4.1 4.3 0 .3 0 .7.1 1-3.3-.1-6.4-1.8-8.4-4.4-.3.6-.5 1.4-.5 2.2 0 1.5.7 2.8 1.8 3.6-.7 0-1.3-.2-1.9-.5v.1c0 2.1 1.4 3.8 3.3 4.2-.3.1-.7.2-1.1.2-.3 0-.5 0-.8-.1.5 1.7 2 2.9 3.8 3-1.3 1-3.1 1.6-5 1.6-.3 0-.7 0-1-.1C1.8 17.3 4 18 6.3 18 13.8 18 18 11.5 18 5.8v-.6c.8-.5 1.5-1.2 2-2.1" fill-rule="nonzero"/>'
|
|
98
|
+
},
|
|
99
|
+
vk: {
|
|
100
|
+
width: 20,
|
|
101
|
+
height: 18,
|
|
102
|
+
content: '<path d="M16.517 9.851s2.587-3.768 2.886-5.058c.1-.396-.1-.694-.498-.694h-2.288c-.498 0-.697.199-.896.595 0 0-1.194 2.678-2.686 4.364-.498.496-.697.694-.995.694-.2 0-.299-.198-.299-.694V4.793c0-.595-.1-.793-.597-.793H7.463c-.2 0-.398.198-.398.397 0 .595.796.694.796 2.28v3.174c0 .595 0 .893-.299.893-.796 0-2.686-2.777-3.681-5.851-.2-.595-.398-.794-.995-.794H.597C.299 4.1 0 4.298 0 4.694c0 .595.697 3.471 3.483 7.34C5.373 14.611 7.86 16 10.05 16c1.393 0 1.691-.198 1.691-.793v-1.984c0-.496.2-.694.498-.694s.895.1 2.189 1.388C15.92 15.405 16.02 16 16.915 16h2.587c.299 0 .498-.1.498-.595 0-.595-.796-1.587-1.89-2.876-.498-.595-1.195-1.29-1.493-1.686-.398-.397-.299-.595-.1-.992" fill-rule="nonzero"/>'
|
|
103
|
+
},
|
|
104
|
+
ok: {
|
|
105
|
+
width: 9,
|
|
106
|
+
height: 18,
|
|
107
|
+
content: '<path d="M4.5 2c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4m0 5.7c-.9 0-1.6-.8-1.6-1.7 0-.9.7-1.6 1.6-1.6.9 0 1.7.7 1.7 1.7 0 .8-.8 1.6-1.7 1.6" fill-rule="nonzero"/> <path d="M6.127 12.982a9.194 9.194 0 0 0 2.307-.904c.602-.301.703-1.004.402-1.507-.301-.502-1.104-.703-1.605-.401-1.605 1.004-3.812 1.004-5.417 0-.502-.302-1.304-.201-1.605.3-.401.604-.2 1.206.401 1.608a9.194 9.194 0 0 0 2.307.904L.61 15.092c-.502.401-.502 1.104 0 1.607a1.357 1.357 0 0 0 1.705 0l2.207-2.11L6.73 16.7a1.357 1.357 0 0 0 1.705 0c.502-.402.502-1.105 0-1.608l-2.307-2.109" fill-rule="nonzero"/>'
|
|
108
|
+
},
|
|
109
|
+
tg: {
|
|
110
|
+
width: 18,
|
|
111
|
+
height: 18,
|
|
112
|
+
content: '<path d="M9 18c-5 0-9-4-9-9s4-9 9-9 9 4 9 9-4 9-9 9zm-1.5-7.4c1.1 1 2 3.3 2 3.3.4.2.7.1.8-.4l2.1-7.4c.1-.6-.2-.8-.6-.7L4 8.3c-.6.2-.6.5-.1.7 0 .1 2.4.6 3.6 1.6z" fill-rule="nonzero"/>'
|
|
113
|
+
},
|
|
114
|
+
meduzaSymbol: {
|
|
115
|
+
width: 24,
|
|
116
|
+
height: 18,
|
|
117
|
+
content: '<path d="M10.026233,17.0968697 L13.9737671,18.3530831 L13.9737671,10.9855851 L13.9737671,8.48948164 L16.5131165,8.48948164 L16.5131165,17.0968697 L20.4375656,18.3530831 L23,14.8636014 L20.4606507,14.8636014 L20.4606507,6.37252945 L16.5362015,5 L13.9737671,8.02421743 L13.9737671,6.37252945 L10.049318,5 L7.48688354,8.02421743 L7.48688354,6.37252945 L3.56243443,5 L1,8.48948164 L3.53934943,8.48948164 L3.53934943,17.0968697 L7.48688354,18.3530831 L7.48688354,8.48948164 L10.026233,8.48948164 L10.026233,17.0968697 Z" />'
|
|
118
|
+
},
|
|
119
|
+
backward: {
|
|
120
|
+
width: 25,
|
|
121
|
+
height: 27,
|
|
122
|
+
content: '<path d="M13 0v2.01c6.672.263 12 5.754 12 12.49C25 21.404 19.404 27 12.5 27S0 21.404 0 14.5c0-3.493 1.441-6.758 3.936-9.105a.75.75 0 111.028 1.092A10.965 10.965 0 001.5 14.5c0 6.075 4.925 11 11 11s11-4.925 11-11c0-5.907-4.656-10.727-10.499-10.989L13 6 8 3l5-3zm3.295 11.33v1.25h-3.16v1.63c.32-.32.86-.56 1.47-.56 1.13 0 2.14.81 2.14 2.16 0 1.42-1.06 2.31-2.67 2.31-1.16 0-2-.38-2.57-1l.79-.99c.45.47 1.07.73 1.77.73.79 0 1.24-.45 1.24-.99 0-.59-.44-.99-1.2-.99-.55 0-1 .16-1.4.54l-.99-.26v-3.83h4.58zm-5.94 0V18h-1.42v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24z" fill-rule="nonzero"/>'
|
|
123
|
+
},
|
|
124
|
+
forward: {
|
|
125
|
+
width: 25,
|
|
126
|
+
height: 27,
|
|
127
|
+
content: '<path d="M12 0l5 3-5 3V3.511C6.157 3.773 1.5 8.592 1.5 14.5c0 6.075 4.925 11 11 11s11-4.925 11-11c0-3.075-1.267-5.946-3.464-8.013a.75.75 0 011.028-1.092A12.465 12.465 0 0125 14.5C25 21.404 19.404 27 12.5 27S0 21.404 0 14.5C0 7.764 5.328 2.272 12 2.01V0zm4.295 11.33v1.25h-3.16v1.63c.32-.32.86-.56 1.47-.56 1.13 0 2.14.81 2.14 2.16 0 1.42-1.06 2.31-2.67 2.31-1.16 0-2-.38-2.57-1l.79-.99c.45.47 1.07.73 1.77.73.79 0 1.24-.45 1.24-.99 0-.59-.44-.99-1.2-.99-.55 0-1 .16-1.4.54l-.99-.26v-3.83h4.58zm-5.94 0V18h-1.42v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24z" fill-rule="nonzero"/>'
|
|
128
|
+
},
|
|
129
|
+
download: {
|
|
130
|
+
width: 25,
|
|
131
|
+
height: 27,
|
|
132
|
+
content: '<path d="M12.5 2C19.404 2 25 7.596 25 14.5S19.404 27 12.5 27 0 21.404 0 14.5 5.596 2 12.5 2zm0 1.5c-6.075 0-11 4.925-11 11s4.925 11 11 11 11-4.925 11-11-4.925-11-11-11zm6 15.75a.75.75 0 01.102 1.493l-.102.007h-12a.75.75 0 01-.102-1.493l.102-.007h12zm-6-12a.75.75 0 01.743.648L13.25 8v7.598l1.834-1.222a.75.75 0 11.832 1.248l-3 2a.75.75 0 01-.832 0l-3-2a.75.75 0 11.832-1.248l1.834 1.223V8a.75.75 0 01.648-.743l.102-.007z" fill-rule="nonzero" fill="currentColor" />'
|
|
133
|
+
},
|
|
134
|
+
play: {
|
|
135
|
+
width: 62,
|
|
136
|
+
height: 62,
|
|
137
|
+
content: '<path d="M24.35 41.772a.5.5 0 0 1-.739-.439V20.667a.5.5 0 0 1 .74-.44l18.944 10.334a.5.5 0 0 1 0 .878L24.351 41.772z" fill-rule="nonzero"/>'
|
|
138
|
+
},
|
|
139
|
+
pause: {
|
|
140
|
+
width: 22,
|
|
141
|
+
height: 22,
|
|
142
|
+
content: '<path d="M12.832 4h2.8c.276 0 .5.224.5.5v12.394c0 .277-.224.5-.5.5h-2.8c-.276 0-.5-.223-.5-.5V4.5c0-.276.224-.5.5-.5zM6.5 4h2.8c.277 0 .5.224.5.5v12.394c0 .277-.223.5-.5.5H6.5c-.276 0-.5-.223-.5-.5V4.5c0-.276.224-.5.5-.5z" />'
|
|
143
|
+
},
|
|
144
|
+
speedHalf: {
|
|
145
|
+
width: 25,
|
|
146
|
+
height: 27,
|
|
147
|
+
content: '<path d="M7.212 15.198V12.29l-.676.724L6 12.406 7.35 11h.825v4.198h-.963zM8.056 18H7.3l4.23-7h.765l-4.24 7zm2.99 0v-.735c1.717-1.27 2.134-1.679 2.134-2.14 0-.389-.288-.578-.665-.578-.467 0-.884.263-1.083.525l-.496-.64c.417-.493 1.053-.693 1.599-.693.913 0 1.599.462 1.599 1.312 0 .682-.556 1.28-1.708 2.14h1.737V18h-3.118zm5.998-2.918l-1.39 1.48-.567-.577 1.4-1.49-1.4-1.48.566-.588 1.39 1.49 1.4-1.49.557.588-1.4 1.48 1.4 1.49-.556.577-1.4-1.48z" /><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" />'
|
|
148
|
+
},
|
|
149
|
+
speedOne: {
|
|
150
|
+
width: 25,
|
|
151
|
+
height: 27,
|
|
152
|
+
content: '<path d="M9.955 18v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24V18h-1.42zm4.6-2.78l-1.4 1.41-.57-.55 1.41-1.42-1.41-1.41.57-.56 1.4 1.42 1.41-1.42.56.56-1.41 1.41 1.41 1.42-.56.55-1.41-1.41z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
|
|
153
|
+
},
|
|
154
|
+
speedOneHalf: {
|
|
155
|
+
width: 25,
|
|
156
|
+
height: 27,
|
|
157
|
+
content: '<path d="M5.62 18v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24V18H5.62zm3.37-2.67v-2.77l-.68.69-.54-.58 1.36-1.34h.83v4h-.97zM9.84 18h-.76l4.26-6.67h.77L9.84 18zm3.01 0v-.7c1.73-1.21 2.15-1.6 2.15-2.04 0-.37-.29-.55-.67-.55-.47 0-.89.25-1.09.5l-.5-.61c.42-.47 1.06-.66 1.61-.66.92 0 1.61.44 1.61 1.25 0 .65-.56 1.22-1.72 2.04h1.75V18h-3.14zm6.04-2.78l-1.4 1.41-.57-.55 1.41-1.42-1.41-1.41.57-.56 1.4 1.42 1.41-1.42.56.56-1.41 1.41 1.41 1.42-.56.55-1.41-1.41z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
|
|
158
|
+
},
|
|
159
|
+
speedTwo: {
|
|
160
|
+
width: 25,
|
|
161
|
+
height: 27,
|
|
162
|
+
content: '<path d="M7.147 18v-1.158c2.685-2.078 3.471-2.792 3.471-3.64 0-.6-.52-.9-1.061-.9-.748 0-1.318.311-1.76.797L7 12.127C7.64 11.352 8.613 11 9.527 11c1.396 0 2.507.827 2.507 2.202 0 1.18-.924 2.203-2.625 3.506h2.675V18H7.147zm7.916-2.874l-1.377 1.457-.56-.568 1.386-1.468-1.386-1.458.56-.58 1.377 1.469 1.386-1.468.551.579-1.386 1.458L17 16.015l-.55.568-1.387-1.457z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
|
|
163
|
+
},
|
|
164
|
+
podcastBookmark: {
|
|
165
|
+
width: 25,
|
|
166
|
+
height: 27,
|
|
167
|
+
content: '<path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" /> <path d="M17.071 8.25H8a.75.75 0 00-.75.75v11.545l.007.104a.75.75 0 001.228.468l4.05-3.437 4.051 3.437a.75.75 0 001.235-.572V9a.75.75 0 00-.75-.75zm-.75 1.499v9.176l-3.3-2.8-.098-.07a.75.75 0 00-.873.07l-3.3 2.799V9.749h7.571z" data-stroke="true" /> <path d="M17.071 8.25H8a.75.75 0 00-.75.75v11.545l.007.104a.75.75 0 001.228.468l4.05-3.437 4.051 3.437a.75.75 0 001.235-.572V9a.75.75 0 00-.75-.75z" data-fill="true" />'
|
|
168
|
+
},
|
|
169
|
+
reaction: {
|
|
170
|
+
width: 16,
|
|
171
|
+
height: 16,
|
|
172
|
+
content: '<path data-theme="light" fill="#D09959" d="M1 2h14v12H1z"/> <path d="M0 1.778C0 .8.8 0 1.778 0h12.444C15.2 0 16 .8 16 1.778v12.444C16 15.2 15.2 16 14.222 16H1.778C.8 16 0 15.2 0 14.222V1.778zM6.8 11.7l2.5.8V6.2h1.6v5.5l2.5.8 1.6-2.3h-1.6V4.8L10.9 4 9.3 5.9V4.8L6.8 4 5.1 5.9V4.8L2.6 4 1 6.2h1.6v5.5l2.5.8V6.2h1.7v5.5z" />'
|
|
173
|
+
},
|
|
174
|
+
cross: {
|
|
175
|
+
width: 18,
|
|
176
|
+
height: 18,
|
|
177
|
+
content: '<path fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" vector-effect="non-scaling-stroke" d="M2 2l14 14M16 2L2 16" />'
|
|
178
|
+
},
|
|
179
|
+
link: {
|
|
180
|
+
width: 24,
|
|
181
|
+
height: 24,
|
|
182
|
+
content: '<path d="M9.158 18.928c-1.065 0-2.13-.405-2.94-1.215-1.624-1.623-1.624-4.262 0-5.884l.643-.645c.327-.326.854-.326 1.18 0 .325.326.325.853 0 1.178l-.645.645c-.972.972-.972 2.554 0 3.526.973.972 2.554.973 3.526 0l2.842-2.84c.97-.972.97-2.555 0-3.527-.325-.325-.325-.854 0-1.18.325-.324.853-.324 1.178 0 1.623 1.625 1.623 4.264 0 5.885l-2.84 2.84c-.81.81-1.877 1.216-2.942 1.216" /> <path d="M10.578 14.184c-.213 0-.426-.082-.59-.244-.784-.785-1.217-1.83-1.217-2.94 0-1.113.433-2.158 1.22-2.944l2.84-2.84c1.622-1.62 4.26-1.62 5.883 0 1.622 1.623 1.622 4.262 0 5.883l-.645.643c-.325.326-.852.326-1.178 0-.325-.325-.325-.852 0-1.178l.645-.644c.972-.97.972-2.554 0-3.526s-2.556-.972-3.527 0l-2.84 2.842c-.47.47-.73 1.096-.73 1.762 0 .667.26 1.293.73 1.763.325.327.325.854 0 1.18-.163.162-.376.244-.59.244" />'
|
|
183
|
+
},
|
|
184
|
+
search: {
|
|
185
|
+
width: 16,
|
|
186
|
+
height: 16,
|
|
187
|
+
content: '<g transform="translate(2 1)" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" vector-effect="non-scaling-stroke"><circle cx="5.5" cy="5.5" r="5.5"/><path d="M11.37 13.442l-.995-1.272"/></g>'
|
|
188
|
+
},
|
|
189
|
+
card: {
|
|
190
|
+
width: 15,
|
|
191
|
+
height: 15,
|
|
192
|
+
content: '<path d="M9 5.5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5zm-.5 1h-4v4h4v-4zm2.5-3a.5.5 0 0 1 .5.5v5a.5.5 0 1 1-1 0V4.5H6a.5.5 0 0 1 0-1h5z" fill-rule="nonzero"/>'
|
|
193
|
+
},
|
|
194
|
+
podcast: {
|
|
195
|
+
width: 15,
|
|
196
|
+
height: 15,
|
|
197
|
+
content: '<path d="M5.252 11.432A.5.5 0 0 1 4.5 11V4a.5.5 0 0 1 .752-.432l6 3.5a.5.5 0 0 1 0 .864l-6 3.5zm.248-1.303L10.008 7.5 5.5 4.87v5.26z" fill-rule="nonzero" />'
|
|
198
|
+
},
|
|
199
|
+
arrow: {
|
|
200
|
+
width: 12,
|
|
201
|
+
height: 12,
|
|
202
|
+
content: '<path d="M3 7l3 3.5L9 7M6 10V1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2" vector-effect="non-scaling-stroke" />'
|
|
203
|
+
},
|
|
204
|
+
brent: {
|
|
205
|
+
width: 9,
|
|
206
|
+
height: 12,
|
|
207
|
+
content: '<g fill="#999" fill-rule="nonzero"><path d="M4.332 0l.528.606c2.528 2.902 3.804 5.07 3.804 6.634A4.332 4.332 0 110 7.24C0 5.676 1.276 3.508 3.804.606L4.332 0zm0 2.143l-.176.212C2.313 4.589 1.4 6.248 1.4 7.24a2.932 2.932 0 105.864 0c0-.992-.914-2.651-2.756-4.885l-.176-.212z"/><path d="M2.973 7.475c0 .415.417.863.835.924l.097.008v.7c-.79 0-1.548-.716-1.626-1.5l-.006-.132h.7z"/></g> '
|
|
208
|
+
},
|
|
209
|
+
user: {
|
|
210
|
+
width: 16,
|
|
211
|
+
height: 16,
|
|
212
|
+
content: '<path fill="currentColor" fill-rule="nonzero" d="M8 1a4.25 4.25 0 012.676 7.552 6.751 6.751 0 014.074 6.198.75.75 0 11-1.5 0 5.25 5.25 0 00-10.5 0 .75.75 0 11-1.5 0 6.752 6.752 0 014.074-6.199A4.25 4.25 0 018 1zm0 1.5A2.75 2.75 0 108 8a2.75 2.75 0 000-5.5z" />'
|
|
213
|
+
},
|
|
214
|
+
bookmark: {
|
|
215
|
+
width: 17,
|
|
216
|
+
height: 21,
|
|
217
|
+
content: '<path d="M16 20l-7.5-6.333L1 20V1h15z" stroke="currentColor" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"/>'
|
|
218
|
+
},
|
|
219
|
+
receipt: {
|
|
220
|
+
width: 10,
|
|
221
|
+
height: 13,
|
|
222
|
+
content: '<g fill="currentColor" fill-rule="nonzero"><path d="M10 0H0v13l2-1.74 1.5 1.305L5 11.26l1.5 1.305L8 11.26 10 13V0zM9 .997v9.81l-1-.87-1.5 1.304L5 9.937 3.5 11.24 2 9.937l-1 .87V.996h8z"/><path d="M7 3v1H3V3zM7 6v1H3V6z"/></g>'
|
|
223
|
+
},
|
|
224
|
+
read: {
|
|
225
|
+
width: 15,
|
|
226
|
+
height: 15,
|
|
227
|
+
content: '<g fill="none" fill-rule="evenodd"><path opacity=".98" d="M0 0h15v15H0z"/><path d="M13.085 1.694a.513.513 0 01.855.56l-.051.077-3.163 3.975a.514.514 0 01-.73.075l-.068-.069-1.812-2.208a.512.512 0 01.729-.716l.065.066 1.409 1.718 2.766-3.478z" fill="#6EAC65" fill-rule="nonzero"/><path d="M6.454 12.997l-.06-.01-.078-.023a.49.49 0 01-.266-.24l.011.015a2.349 2.349 0 00-.535-.607c-.89-.745-2.117-.917-3.813-.12a.5.5 0 01-.706-.37L1 11.558V4.568a.5.5 0 01.287-.453c2.053-.963 3.695-.733 4.88.26.327.272.556.548.698.77l.084.144.018.04.022.076.01.071L7 11.233l.126-.09c.95-.656 2.16-.857 3.608-.417l.266.087v-2.81a.5.5 0 01.41-.491l.09-.008a.5.5 0 01.492.41l.008.09v3.555a.5.5 0 01-.713.452c-1.696-.796-2.922-.624-3.813.12a2.533 2.533 0 00-.497.544l-.038.064a.486.486 0 01-.485.258zm-4.29-8.17L2 4.892v5.92c1.637-.572 2.977-.348 4 .42l.002-5.58a2.605 2.605 0 00-.476-.513c-.81-.677-1.897-.88-3.362-.314z" fill="currentColor" fill-rule="nonzero"/></g>'
|
|
228
|
+
},
|
|
229
|
+
listened: {
|
|
230
|
+
width: 15,
|
|
231
|
+
height: 15,
|
|
232
|
+
content: '<g fill-rule="nonzero"><path d="M4.978 4.354a.5.5 0 01-.332.624c-1.197.367-2.064 1.527-2.14 2.897l-.005.167a.749.749 0 01.999.708v3a.75.75 0 01-1.458.248L2 12a1 1 0 01-1-1v-1a1 1 0 01.5-.866V8.072c0-1.886 1.172-3.535 2.854-4.05a.5.5 0 01.624.332zM10 7a.5.5 0 01.492.41l.008.09.001 1.634a1 1 0 01.492.745L11 10v1a1 1 0 01-.883.993L10 12l-.042-.002a.75.75 0 01-1.451-.146L8.5 11.75v-3a.75.75 0 011.001-.707L9.5 7.5l.008-.09A.5.5 0 0110 7z" fill="currentColor" /><path d="M11.585 1.194a.513.513 0 01.855.56l-.051.077-3.163 3.975a.514.514 0 01-.73.075l-.068-.069-1.812-2.208a.512.512 0 01.729-.716l.065.066 1.409 1.718 2.766-3.478z" fill="#6EAC65" /></g>'
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
var SvgSymbol = function SvgSymbol(_ref) {
|
|
237
|
+
var icon = _ref.icon,
|
|
238
|
+
size = _ref.size,
|
|
239
|
+
styleContext = _ref.styleContext;
|
|
240
|
+
var data = icons[icon];
|
|
241
|
+
return React.createElement("svg", {
|
|
242
|
+
"data-testid": "svg-symbol",
|
|
243
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
244
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
245
|
+
className: makeClassName([[styles$1.root, true], [styles$1[size], !!styles$1[size]], [styles$1[icon], !!styles$1[icon]], [styles$1[styleContext], !!styles$1[styleContext]]]),
|
|
246
|
+
width: data.width,
|
|
247
|
+
height: data.height,
|
|
248
|
+
viewBox: "0 0 " + data.width + " " + data.height,
|
|
249
|
+
dangerouslySetInnerHTML: {
|
|
250
|
+
__html: data.content
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
var styles$2 = {"root":"Switcher-module_root__1Env1","dark":"Switcher-module_dark__1IzaH","control":"Switcher-module_control__1NTvY","input":"Switcher-module_input__jaMVF","knob":"Switcher-module_knob__3kEy5","children":"Switcher-module_children__147JP","left":"Switcher-module_left__2coeE","right":"Switcher-module_right__yWG7h","isInPanel":"Switcher-module_isInPanel__TumqY","isInMenu":"Switcher-module_isInMenu__3XJYj","isInLive":"Switcher-module_isInLive__2cLui"};
|
|
256
|
+
|
|
257
|
+
var Switcher = function Switcher(_ref) {
|
|
258
|
+
var enabled = _ref.enabled,
|
|
259
|
+
children = _ref.children,
|
|
260
|
+
_ref$childrenPosition = _ref.childrenPosition,
|
|
261
|
+
childrenPosition = _ref$childrenPosition === void 0 ? 'left' : _ref$childrenPosition,
|
|
262
|
+
onChange = _ref.onChange,
|
|
263
|
+
styleContext = _ref.styleContext,
|
|
264
|
+
_ref$theme = _ref.theme,
|
|
265
|
+
theme = _ref$theme === void 0 ? 'light' : _ref$theme;
|
|
266
|
+
return React.createElement("label", {
|
|
267
|
+
"data-testid": "switcher",
|
|
268
|
+
className: makeClassName([[styles$2.root, true], [styles$2[theme], !!styles$2[theme]], [styles$2[styleContext], !!styles$2[styleContext]]])
|
|
269
|
+
}, children && childrenPosition === 'left' && React.createElement("div", {
|
|
270
|
+
className: makeClassName([[styles$2.children, true], [styles$2.left, true]])
|
|
271
|
+
}, children), React.createElement("input", {
|
|
272
|
+
className: styles$2.input,
|
|
273
|
+
type: "checkbox",
|
|
274
|
+
checked: enabled,
|
|
275
|
+
onChange: onChange
|
|
276
|
+
}), React.createElement("span", {
|
|
277
|
+
className: styles$2.control
|
|
278
|
+
}, React.createElement("span", {
|
|
279
|
+
className: styles$2.knob
|
|
280
|
+
})), children && childrenPosition === 'right' && React.createElement("div", {
|
|
281
|
+
className: makeClassName([[styles$2.children, true], [styles$2.right, true]])
|
|
282
|
+
}, children));
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
var BlockContext = /*#__PURE__*/React.createContext({
|
|
286
|
+
lightBox: null
|
|
287
|
+
});
|
|
288
|
+
var BlockProvider = BlockContext.Provider;
|
|
289
|
+
|
|
290
|
+
var viewportSize = (function () {
|
|
291
|
+
return {
|
|
292
|
+
width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
|
|
293
|
+
height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
|
|
294
|
+
};
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
var MediaQuerySizes = {
|
|
298
|
+
MOBILE: 512,
|
|
299
|
+
PORTRAIT_TABLET: 768,
|
|
300
|
+
LANDSCAPE_TABLET: 1024,
|
|
301
|
+
DESKTOP: 1010,
|
|
302
|
+
WIDE_DESKTOP: 1200
|
|
303
|
+
};
|
|
304
|
+
var imageBreakpoints = {
|
|
305
|
+
325: '(min-width: 0)',
|
|
306
|
+
520: '(min-width: 325px)',
|
|
307
|
+
600: '(min-width: 600px)',
|
|
308
|
+
650: '(min-width: 650px)',
|
|
309
|
+
980: '(min-width: 1000px)',
|
|
310
|
+
1335: '(min-width: 1000px)'
|
|
311
|
+
};
|
|
312
|
+
var imageConditionalKeys = {
|
|
313
|
+
xs: [325],
|
|
314
|
+
superFull: [1335, 650, 520, 325],
|
|
315
|
+
full: [980, 650, 520, 325],
|
|
316
|
+
"default": [650, 520, 325],
|
|
317
|
+
narrow: [600, 325]
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
var styles$3 = {"root":"Lazy-module_root__2Z72l","visible":"Lazy-module_visible__3-SdX"};
|
|
321
|
+
|
|
322
|
+
var Lazy = function Lazy(_ref) {
|
|
323
|
+
var children = _ref.children,
|
|
324
|
+
threshold = _ref.threshold;
|
|
325
|
+
|
|
326
|
+
var _useInView = useInView({
|
|
327
|
+
threshold: threshold || 0
|
|
328
|
+
}),
|
|
329
|
+
ref = _useInView[0],
|
|
330
|
+
inView = _useInView[1],
|
|
331
|
+
entry = _useInView[2];
|
|
332
|
+
|
|
333
|
+
var _useState = useState(false),
|
|
334
|
+
visible = _useState[0],
|
|
335
|
+
setVisible = _useState[1];
|
|
336
|
+
|
|
337
|
+
useEffect(function () {
|
|
338
|
+
if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
|
|
339
|
+
setVisible(true);
|
|
340
|
+
}
|
|
341
|
+
}, [entry]);
|
|
342
|
+
useEffect(function () {
|
|
343
|
+
if (inView) {
|
|
344
|
+
setVisible(true);
|
|
345
|
+
}
|
|
346
|
+
}, [inView]);
|
|
347
|
+
return React.createElement("div", {
|
|
348
|
+
className: makeClassName([[styles$3.root, true], [styles$3.visible, visible]]),
|
|
349
|
+
ref: ref,
|
|
350
|
+
"data-testid": "lazy"
|
|
351
|
+
}, visible && children);
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
var toCamel = function toCamel(s) {
|
|
355
|
+
return s.replace(/([_][a-z])/gi, function (str) {
|
|
356
|
+
return str.toUpperCase().replace('_', '');
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
var RenderPicture = function RenderPicture(_ref) {
|
|
361
|
+
var source = _ref.source,
|
|
362
|
+
fallbackSource = _ref.fallbackSource,
|
|
363
|
+
optimized = _ref.optimized,
|
|
364
|
+
alt = _ref.alt,
|
|
365
|
+
display = _ref.display;
|
|
366
|
+
|
|
367
|
+
var _useState = useState(false),
|
|
368
|
+
fallback = _useState[0],
|
|
369
|
+
setFallback = _useState[1];
|
|
370
|
+
|
|
371
|
+
useEffect(function () {
|
|
372
|
+
setFallback(!window.HTMLPictureElement);
|
|
373
|
+
}, []);
|
|
374
|
+
var keys = imageConditionalKeys[toCamel(display)] || imageConditionalKeys["default"];
|
|
375
|
+
return React.createElement("picture", null, source && React.createElement("source", {
|
|
376
|
+
media: "(min-width: 325px)",
|
|
377
|
+
srcSet: source[1] + " 2x"
|
|
378
|
+
}), optimized && !optimized.w325 && React.createElement("source", {
|
|
379
|
+
media: "(min-width: 0)",
|
|
380
|
+
srcSet: "" + optimized.original
|
|
381
|
+
}), optimized && keys.map(function (key) {
|
|
382
|
+
var breakpoint = optimized["w" + key];
|
|
383
|
+
|
|
384
|
+
if (!breakpoint) {
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return React.createElement(React.Fragment, {
|
|
389
|
+
key: key
|
|
390
|
+
}, React.createElement("source", {
|
|
391
|
+
type: "image/webp",
|
|
392
|
+
media: imageBreakpoints[key],
|
|
393
|
+
srcSet: breakpoint['2x_webp'] + " 2x, " + breakpoint['1x_webp'] + " 1x "
|
|
394
|
+
}), React.createElement("source", {
|
|
395
|
+
type: "image/png",
|
|
396
|
+
media: imageBreakpoints[key],
|
|
397
|
+
srcSet: breakpoint['2x'] + " 2x, " + breakpoint['1x'] + " 1x "
|
|
398
|
+
}));
|
|
399
|
+
}), React.createElement("img", {
|
|
400
|
+
src: fallback ? fallbackSource : 'data:image/gif;base64,R0lGODlhAQABAPAAAPLy8gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==',
|
|
401
|
+
alt: alt
|
|
402
|
+
}));
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
var styles$4 = {"root":"Image-module_root__1vsA_","placeholder":"Image-module_placeholder__1p4ob","wrapper":"Image-module_wrapper__3fLjs","loaded":"Image-module_loaded__w9FVT","fullscreen":"Image-module_fullscreen__29apx"};
|
|
406
|
+
|
|
407
|
+
var Image = function Image(_ref) {
|
|
408
|
+
var alt = _ref.alt,
|
|
409
|
+
display = _ref.display,
|
|
410
|
+
optimized = _ref.optimized,
|
|
411
|
+
width = _ref.width,
|
|
412
|
+
height = _ref.height,
|
|
413
|
+
source = _ref.source,
|
|
414
|
+
lazy = _ref.lazy,
|
|
415
|
+
fullscreen = _ref.fullscreen,
|
|
416
|
+
ratio = _ref.ratio;
|
|
417
|
+
|
|
418
|
+
var _useContext = useContext(BlockContext),
|
|
419
|
+
lightBox = _useContext.lightBox;
|
|
420
|
+
|
|
421
|
+
var handleClick = function handleClick() {
|
|
422
|
+
var _viewportSize = viewportSize(),
|
|
423
|
+
viewportWidth = _viewportSize.width;
|
|
424
|
+
|
|
425
|
+
if (optimized && !optimized.original || !lightBox || viewportWidth >= MediaQuerySizes.LANDSCAPE_TABLET && !fullscreen) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
postMessage('fullscreen_click', 'click');
|
|
430
|
+
lightBox.show(optimized, width, height, alt);
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
var pictureStyles = {
|
|
434
|
+
paddingBottom: 100 / (ratio || width / height) + "%"
|
|
435
|
+
};
|
|
436
|
+
var blockStyles = {
|
|
437
|
+
maxWidth: width <= 649 ? width : '100%'
|
|
438
|
+
};
|
|
439
|
+
/* fallback w325 url until w6 was released */
|
|
440
|
+
|
|
441
|
+
var fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
|
|
442
|
+
return React.createElement("div", {
|
|
443
|
+
className: makeClassName([[styles$4.root, true], [styles$4.fullscreen, fullscreen]]),
|
|
444
|
+
style: blockStyles,
|
|
445
|
+
"data-testid": "image"
|
|
446
|
+
}, React.createElement("div", {
|
|
447
|
+
className: styles$4.wrapper,
|
|
448
|
+
style: pictureStyles,
|
|
449
|
+
onClick: function onClick() {
|
|
450
|
+
return handleClick();
|
|
451
|
+
},
|
|
452
|
+
onKeyPress: function onKeyPress() {
|
|
453
|
+
return handleClick();
|
|
454
|
+
},
|
|
455
|
+
role: "button",
|
|
456
|
+
tabIndex: 0
|
|
457
|
+
}, lazy ? React.createElement(React.Fragment, null, React.createElement(Lazy, {
|
|
458
|
+
threshold: 0.25
|
|
459
|
+
}, React.createElement(RenderPicture, {
|
|
460
|
+
fallbackSource: fallbackSource,
|
|
461
|
+
source: source,
|
|
462
|
+
optimized: optimized,
|
|
463
|
+
alt: alt,
|
|
464
|
+
display: display
|
|
465
|
+
})), React.createElement("noscript", null, React.createElement("img", {
|
|
466
|
+
src: fallbackSource,
|
|
467
|
+
alt: alt
|
|
468
|
+
}))) : React.createElement(RenderPicture, {
|
|
469
|
+
fallbackSource: fallbackSource,
|
|
470
|
+
source: source,
|
|
471
|
+
optimized: optimized,
|
|
472
|
+
alt: alt,
|
|
473
|
+
display: display
|
|
474
|
+
})));
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
var styles$5 = {"root":"DotsOnImage-module_root__2XP3Q","dot":"DotsOnImage-module_dot__H1wua","popover":"DotsOnImage-module_popover__35Cpj","popoverTitle":"DotsOnImage-module_popoverTitle__343d8"};
|
|
478
|
+
|
|
479
|
+
var DotsOnImage = function DotsOnImage(_ref) {
|
|
480
|
+
var block = _ref.block;
|
|
481
|
+
var optimized = block.optimized,
|
|
482
|
+
width = block.width,
|
|
483
|
+
height = block.height,
|
|
484
|
+
credit = block.credit,
|
|
485
|
+
display = block.display,
|
|
486
|
+
dots = block.dots;
|
|
487
|
+
|
|
488
|
+
var _useState = useState({
|
|
489
|
+
title: null,
|
|
490
|
+
body: null,
|
|
491
|
+
show: false,
|
|
492
|
+
id: null
|
|
493
|
+
}),
|
|
494
|
+
popover = _useState[0],
|
|
495
|
+
setPopover = _useState[1];
|
|
496
|
+
|
|
497
|
+
var handleDotClick = function handleDotClick(dot) {
|
|
498
|
+
var shouldShow = dot.id !== popover.id;
|
|
499
|
+
setPopover({
|
|
500
|
+
title: dot.title,
|
|
501
|
+
body: dot.body,
|
|
502
|
+
show: shouldShow,
|
|
503
|
+
id: shouldShow ? dot.id : null
|
|
504
|
+
});
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
return React.createElement("div", {
|
|
508
|
+
"data-testid": "dots-on-image",
|
|
509
|
+
className: makeClassName([[styles$5.root, true]])
|
|
510
|
+
}, React.createElement("div", {
|
|
511
|
+
className: styles$5.dots
|
|
512
|
+
}, dots.map(function (dot) {
|
|
513
|
+
return React.createElement("button", {
|
|
514
|
+
className: styles$5.dot,
|
|
515
|
+
type: "button",
|
|
516
|
+
key: dot.id,
|
|
517
|
+
style: {
|
|
518
|
+
top: dot.position.y + "%",
|
|
519
|
+
left: dot.position.x + "%",
|
|
520
|
+
backgroundColor: dot.icon.color
|
|
521
|
+
},
|
|
522
|
+
onClick: function onClick() {
|
|
523
|
+
return handleDotClick(dot);
|
|
524
|
+
}
|
|
525
|
+
}, dot.icon.type === 'svg' && React.createElement("div", {
|
|
526
|
+
className: styles$5.icon,
|
|
527
|
+
dangerouslySetInnerHTML: {
|
|
528
|
+
__html: dot.icon.svg_string
|
|
529
|
+
}
|
|
530
|
+
}), dot.icon.type === 'number' && dot.icon.number);
|
|
531
|
+
})), React.createElement("div", {
|
|
532
|
+
className: styles$5.image
|
|
533
|
+
}, React.createElement(Image, {
|
|
534
|
+
optimized: optimized,
|
|
535
|
+
width: width,
|
|
536
|
+
height: height,
|
|
537
|
+
alt: credit,
|
|
538
|
+
display: display
|
|
539
|
+
})), popover.show && React.createElement("div", {
|
|
540
|
+
className: styles$5.popover
|
|
541
|
+
}, React.createElement("div", {
|
|
542
|
+
className: styles$5.popoverTitle
|
|
543
|
+
}, popover.title), React.createElement("div", {
|
|
544
|
+
className: styles$5.popoverBody,
|
|
545
|
+
dangerouslySetInnerHTML: {
|
|
546
|
+
__html: popover.body
|
|
547
|
+
}
|
|
548
|
+
})));
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
var makeStyleContext = function makeStyleContext(classNames, styleContext, styles) {
|
|
552
|
+
var context = Array.isArray(styleContext) ? styleContext.filter(function (ctx) {
|
|
553
|
+
return styles[ctx];
|
|
554
|
+
}).map(function (ctx) {
|
|
555
|
+
return [[styles[ctx]], true];
|
|
556
|
+
}) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
|
|
557
|
+
return classNames.concat(context);
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
var styles$6 = {"root":"Tag-module_root__3IqWC","small":"Tag-module_small__2IAb7","large":"Tag-module_large__22z_o","dark":"Tag-module_dark__sgnt1","light":"Tag-module_light__1zUhp","gold":"Tag-module_gold__2ksA7","gray":"Tag-module_gray__mGAO_","inherit":"Tag-module_inherit__2QB5U","is1to1":"Tag-module_is1to1__3EDbC","is1to2":"Tag-module_is1to2__3xbC6","isInSuperBlock":"Tag-module_isInSuperBlock__38JE0","is1to3":"Tag-module_is1to3__3j5K-","is1to4":"Tag-module_is1to4__2vq4r","slide":"Tag-module_slide__2nMDw","game":"Tag-module_game__3j5yG","card":"Tag-module_card__1EAeF","live":"Tag-module_live__rwXuR","episode":"Tag-module_episode__3o6gg","podcast":"Tag-module_podcast__VPoll","rich":"Tag-module_rich__2URd9","isInDynamicBlock":"Tag-module_isInDynamicBlock__1YM9I","mobile":"Tag-module_mobile__QQxuv","desktop":"Tag-module_desktop__1Bjsy"};
|
|
561
|
+
|
|
562
|
+
var Tag = function Tag(_ref) {
|
|
563
|
+
var children = _ref.children,
|
|
564
|
+
_ref$size = _ref.size,
|
|
565
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
566
|
+
_ref$theme = _ref.theme,
|
|
567
|
+
theme = _ref$theme === void 0 ? 'gold' : _ref$theme,
|
|
568
|
+
styleContext = _ref.styleContext,
|
|
569
|
+
correlation = _ref.correlation,
|
|
570
|
+
onlyOn = _ref.onlyOn;
|
|
571
|
+
var classNames = [[styles$6.root, true], [styles$6[size], !!size && !!styles$6[size]], [styles$6[theme], !!theme && !!styles$6[theme]], [styles$6[onlyOn], !!onlyOn && !!styles$6[onlyOn]], [styles$6[correlation], !!correlation && !!styles$6[correlation]]];
|
|
572
|
+
|
|
573
|
+
if (styleContext) {
|
|
574
|
+
classNames = makeStyleContext(classNames, styleContext, styles$6);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
return React.createElement("div", {
|
|
578
|
+
"data-testid": "tag",
|
|
579
|
+
className: makeClassName(classNames)
|
|
580
|
+
}, children);
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
var styles$7 = {"root":"MediaCaption-module_root__KqTdw","caption":"MediaCaption-module_caption__1hr7Y","credit":"MediaCaption-module_credit__3ehAP","dark":"MediaCaption-module_dark__3tL1u","video":"MediaCaption-module_video__1KZ6k","picture":"MediaCaption-module_picture__3AAMH","desktop":"MediaCaption-module_desktop__3Saev"};
|
|
584
|
+
|
|
585
|
+
var MediaCaption = function MediaCaption(_ref) {
|
|
586
|
+
var credit = _ref.credit,
|
|
587
|
+
caption = _ref.caption,
|
|
588
|
+
styleContext = _ref.styleContext;
|
|
589
|
+
var classNames = [[styles$7.root, true]];
|
|
590
|
+
|
|
591
|
+
if (styleContext) {
|
|
592
|
+
classNames = makeStyleContext(classNames, styleContext, styles$7);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
return React.createElement("div", {
|
|
596
|
+
"data-testid": "media-caption",
|
|
597
|
+
className: makeClassName(classNames)
|
|
598
|
+
}, caption && React.createElement("div", {
|
|
599
|
+
className: styles$7.caption,
|
|
600
|
+
dangerouslySetInnerHTML: {
|
|
601
|
+
__html: caption
|
|
602
|
+
}
|
|
603
|
+
}), credit && React.createElement("div", {
|
|
604
|
+
className: styles$7.credit,
|
|
605
|
+
dangerouslySetInnerHTML: {
|
|
606
|
+
__html: credit
|
|
607
|
+
}
|
|
608
|
+
}));
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
var styles$8 = {"root":"Table-module_root__1VsG6","card":"Table-module_card__3gbok","table":"Table-module_table__nZIkV","slide":"Table-module_slide__nSGPC","wrapper":"Table-module_wrapper__1YTKM","tracks":"Table-module_tracks__2wrDB","default":"Table-module_default__3CGeE","full":"Table-module_full__S5pDB","row":"Table-module_row__3TH83","cell":"Table-module_cell__EFKDW","fixedColumn":"Table-module_fixedColumn__E1hN5","white":"Table-module_white__gzvo0","gray":"Table-module_gray__3da6S","pink":"Table-module_pink__3oH1l","blue":"Table-module_blue__GM27F","yellow":"Table-module_yellow__2jhvA","orange":"Table-module_orange__1c-oM","green":"Table-module_green__13OIM","violet":"Table-module_violet__2W-kO","header":"Table-module_header__1exlo","s":"Table-module_s__Vl_Eg","m":"Table-module_m__29G9r","l":"Table-module_l__1ZSMc","xs":"Table-module_xs__au2Oe"};
|
|
612
|
+
|
|
613
|
+
var Table = function Table(_ref) {
|
|
614
|
+
var styleContext = _ref.styleContext,
|
|
615
|
+
_ref$block = _ref.block,
|
|
616
|
+
rows = _ref$block.rows,
|
|
617
|
+
options = _ref$block.options,
|
|
618
|
+
display = _ref$block.display,
|
|
619
|
+
columnsWidth = _ref$block.columns_widths,
|
|
620
|
+
tableCredit = _ref$block.table_credit;
|
|
621
|
+
var colors = {
|
|
622
|
+
'#ffffff': 'white',
|
|
623
|
+
'#f5f5f5': 'gray',
|
|
624
|
+
'#feeeee': 'pink',
|
|
625
|
+
'#e6f3ff': 'blue',
|
|
626
|
+
'#fffde6': 'yellow',
|
|
627
|
+
'#fff9f2': 'orange',
|
|
628
|
+
'#e7f2ef': 'green',
|
|
629
|
+
'#f4f0f8': 'violet'
|
|
630
|
+
};
|
|
631
|
+
var classNames = [[styles$8.root, true], [styles$8[display], !!display && !!styles$8[display]]];
|
|
632
|
+
|
|
633
|
+
if (styleContext) {
|
|
634
|
+
classNames = makeStyleContext(classNames, styleContext, styles$8);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
return React.createElement("div", {
|
|
638
|
+
"data-testid": "table",
|
|
639
|
+
className: makeClassName(classNames)
|
|
640
|
+
}, React.createElement("div", {
|
|
641
|
+
className: styles$8.wrapper
|
|
642
|
+
}, React.createElement("div", {
|
|
643
|
+
className: styles$8.table
|
|
644
|
+
}, React.createElement("div", {
|
|
645
|
+
className: styles$8.tracks
|
|
646
|
+
}, rows.map(function (row, i) {
|
|
647
|
+
return React.createElement("div", {
|
|
648
|
+
key: row.key,
|
|
649
|
+
className: styles$8.row
|
|
650
|
+
}, row.cells.map(function (cell, j) {
|
|
651
|
+
return React.createElement("div", {
|
|
652
|
+
key: cell.key,
|
|
653
|
+
className: makeClassName([[styles$8.cell, true], [styles$8.header, options.header && i === 0], [styles$8[colors[cell.color]], true], [styles$8[columnsWidth[j]], true], [styles$8.fixedColumn, options.fixed_first_column && j === 0]]),
|
|
654
|
+
dangerouslySetInnerHTML: {
|
|
655
|
+
__html: cell.val
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
}));
|
|
659
|
+
})))), tableCredit && React.createElement(MediaCaption, {
|
|
660
|
+
credit: tableCredit,
|
|
661
|
+
styleContext: styleContext
|
|
662
|
+
}));
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
var styles$9 = {"root":"MaterialNote-module_root__1AcYe","dark":"MaterialNote-module_dark__xCry-","note_credit":"MaterialNote-module_note_credit__PuFyX","note_caption":"MaterialNote-module_note_caption__1ezSo","center":"MaterialNote-module_center__18RxI","default":"MaterialNote-module_default__1lQPl","card":"MaterialNote-module_card__OWXbQ","slide":"MaterialNote-module_slide__1ZBBq","game":"MaterialNote-module_game__cADMe","gameSurvey":"MaterialNote-module_gameSurvey__3SiG-"};
|
|
666
|
+
|
|
667
|
+
var MaterialNote = function MaterialNote(_ref) {
|
|
668
|
+
var data = _ref.block.data,
|
|
669
|
+
styleContext = _ref.styleContext;
|
|
670
|
+
var classNames = [[styles$9.root, true]];
|
|
671
|
+
|
|
672
|
+
if (styleContext) {
|
|
673
|
+
classNames = makeStyleContext(classNames, styleContext, styles$9);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
return React.createElement("div", {
|
|
677
|
+
"data-testid": "material-note",
|
|
678
|
+
className: makeClassName(classNames)
|
|
679
|
+
}, data && data.map(function (item) {
|
|
680
|
+
return React.createElement("p", {
|
|
681
|
+
className: styles$9[item.type],
|
|
682
|
+
key: item.id,
|
|
683
|
+
dangerouslySetInnerHTML: {
|
|
684
|
+
__html: item.data
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
}));
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
var styles$a = {"root":"BookmarkButton-module_root__3KmuY","control":"BookmarkButton-module_control__1A0ea","dark":"BookmarkButton-module_dark__1cwyi","light":"BookmarkButton-module_light__1uQyH","isInBookmarks":"BookmarkButton-module_isInBookmarks__1_5kB","isInGrid":"BookmarkButton-module_isInGrid__2pQ2B"};
|
|
691
|
+
|
|
692
|
+
var BookmarkButton = function BookmarkButton(_ref) {
|
|
693
|
+
var styleContext = _ref.styleContext,
|
|
694
|
+
theme = _ref.theme,
|
|
695
|
+
isInBookmarks = _ref.isInBookmarks,
|
|
696
|
+
_onClick = _ref.onClick;
|
|
697
|
+
var classNames = [[styles$a.root, true], [styles$a.isInBookmarks, isInBookmarks], [styles$a[theme], !!theme && !!styles$a[theme]]];
|
|
698
|
+
|
|
699
|
+
if (styleContext) {
|
|
700
|
+
classNames = makeStyleContext(classNames, styleContext, styles$a);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
return React.createElement("div", {
|
|
704
|
+
"data-testid": "bookmark-button",
|
|
705
|
+
className: makeClassName(classNames)
|
|
706
|
+
}, React.createElement("button", {
|
|
707
|
+
className: styles$a.control,
|
|
708
|
+
onClick: function onClick() {
|
|
709
|
+
return _onClick();
|
|
710
|
+
},
|
|
711
|
+
type: "button"
|
|
712
|
+
}, React.createElement(SvgSymbol, {
|
|
713
|
+
icon: "bookmark",
|
|
714
|
+
size: "unset"
|
|
715
|
+
})));
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
var styles$b = {"root":"MaterialTitle-module_root__18ku-","primary":"MaterialTitle-module_primary__2Sfmx","secondary":"MaterialTitle-module_secondary__3uDp4"};
|
|
719
|
+
|
|
720
|
+
var Primary = function Primary(_ref) {
|
|
721
|
+
var children = _ref.children;
|
|
722
|
+
return React.createElement("span", {
|
|
723
|
+
className: styles$b.primary
|
|
724
|
+
}, children);
|
|
725
|
+
};
|
|
726
|
+
var Secondary = function Secondary(_ref2) {
|
|
727
|
+
var children = _ref2.children;
|
|
728
|
+
return React.createElement("span", {
|
|
729
|
+
className: styles$b.secondary
|
|
730
|
+
}, children);
|
|
731
|
+
};
|
|
732
|
+
var MaterialTitle = function MaterialTitle(_ref3) {
|
|
733
|
+
var children = _ref3.children;
|
|
734
|
+
return React.createElement("h1", {
|
|
735
|
+
className: styles$b.root,
|
|
736
|
+
"data-testid": "material-title"
|
|
737
|
+
}, children);
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
var styles$c = {"root":"Dropdown-module_root__11PNk","active":"Dropdown-module_active__3IwAl","menu":"Dropdown-module_menu__3PIqD","isInAudioPanel":"Dropdown-module_isInAudioPanel__1zv7F"};
|
|
741
|
+
|
|
742
|
+
var Menu = function Menu(_ref) {
|
|
743
|
+
var children = _ref.children;
|
|
744
|
+
return React.createElement("div", {
|
|
745
|
+
"data-testid": "dropdown",
|
|
746
|
+
className: styles$c.menu
|
|
747
|
+
}, children);
|
|
748
|
+
};
|
|
749
|
+
var Dropdown = function Dropdown(_ref2) {
|
|
750
|
+
var children = _ref2.children,
|
|
751
|
+
active = _ref2.active,
|
|
752
|
+
styleContext = _ref2.styleContext;
|
|
753
|
+
var classNames = [[styles$c.root, true], [styles$c.active, !!active && !!styles$c.active]];
|
|
754
|
+
|
|
755
|
+
if (styleContext) {
|
|
756
|
+
classNames = makeStyleContext(classNames, styleContext, styles$c);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
return React.createElement("div", {
|
|
760
|
+
"data-testid": "dropdown",
|
|
761
|
+
className: makeClassName(classNames)
|
|
762
|
+
}, children);
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
var styles$d = {"root":"Toolbar-module_root__2HF2r","list":"Toolbar-module_list__1n5ny","item":"Toolbar-module_item__36x7d","isInTopbar":"Toolbar-module_isInTopbar__223iP","center":"Toolbar-module_center__3_H8M","game":"Toolbar-module_game__5-jY_","gameSurvey":"Toolbar-module_gameSurvey__1hQEz","dark":"Toolbar-module_dark__2Ejc9"};
|
|
766
|
+
|
|
767
|
+
var Toolbar = function Toolbar(_ref) {
|
|
768
|
+
var children = _ref.children,
|
|
769
|
+
styleContext = _ref.styleContext;
|
|
770
|
+
var classNames = [[styles$d.root, true]];
|
|
771
|
+
|
|
772
|
+
if (styleContext) {
|
|
773
|
+
classNames = makeStyleContext(classNames, styleContext, styles$d);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
var renderItems = function renderItems() {
|
|
777
|
+
return Children.map(children, function (item, index) {
|
|
778
|
+
return React.createElement("li", {
|
|
779
|
+
className: styles$d.item,
|
|
780
|
+
key: index + "-" + item.props.type
|
|
781
|
+
}, React.cloneElement(item));
|
|
782
|
+
});
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
return React.createElement("div", {
|
|
786
|
+
"data-testid": "toolbar",
|
|
787
|
+
className: makeClassName(classNames)
|
|
788
|
+
}, React.createElement("ul", {
|
|
789
|
+
className: styles$d.list
|
|
790
|
+
}, renderItems()));
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
var styles$e = {"root":"Popover-module_root__1v6f_","fadeOut":"Popover-module_fadeOut__3EZhx","visible":"Popover-module_visible__eK5ZQ","fadeIn":"Popover-module_fadeIn__AkrSN","overlay":"Popover-module_overlay__2SBL0","container":"Popover-module_container__FnZT-","disappear":"Popover-module_disappear__3Q9LI","dismiss":"Popover-module_dismiss__3RnLj","background":"Popover-module_background__1KKaP","appear":"Popover-module_appear__37vPd"};
|
|
794
|
+
|
|
795
|
+
var Popover = function Popover(_ref) {
|
|
796
|
+
var children = _ref.children,
|
|
797
|
+
onClose = _ref.onClose;
|
|
798
|
+
|
|
799
|
+
var _useState = useState(true),
|
|
800
|
+
visible = _useState[0],
|
|
801
|
+
setVisible = _useState[1];
|
|
802
|
+
|
|
803
|
+
var handleClose = function handleClose() {
|
|
804
|
+
setVisible(false);
|
|
805
|
+
setTimeout(onClose, 350);
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
var handleScroll = function handleScroll() {
|
|
809
|
+
handleClose();
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
var escFunction = function escFunction(event) {
|
|
813
|
+
if (event.key === 'Escape') {
|
|
814
|
+
handleClose();
|
|
815
|
+
}
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
useEffect(function () {
|
|
819
|
+
window.addEventListener('keydown', escFunction, false);
|
|
820
|
+
window.addEventListener('scroll', handleScroll, false);
|
|
821
|
+
return function () {
|
|
822
|
+
window.removeEventListener('keydown', escFunction, false);
|
|
823
|
+
window.removeEventListener('scroll', handleScroll, false);
|
|
824
|
+
};
|
|
825
|
+
}, [visible]);
|
|
826
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
|
|
827
|
+
|
|
828
|
+
return React.createElement("div", {
|
|
829
|
+
"data-testid": "popover",
|
|
830
|
+
className: makeClassName([[styles$e.root, true], [styles$e.visible, visible]])
|
|
831
|
+
}, React.createElement("div", {
|
|
832
|
+
className: styles$e.overlay,
|
|
833
|
+
onClick: function onClick() {
|
|
834
|
+
return handleClose();
|
|
835
|
+
}
|
|
836
|
+
}), React.createElement("div", {
|
|
837
|
+
className: styles$e.container
|
|
838
|
+
}, React.createElement("button", {
|
|
839
|
+
type: "button",
|
|
840
|
+
className: styles$e.dismiss,
|
|
841
|
+
onClick: function onClick() {
|
|
842
|
+
return handleClose();
|
|
843
|
+
},
|
|
844
|
+
"aria-label": "dismiss"
|
|
845
|
+
}), React.createElement("svg", {
|
|
846
|
+
width: "100%",
|
|
847
|
+
className: styles$e.background
|
|
848
|
+
}, React.createElement("defs", null, React.createElement("mask", {
|
|
849
|
+
id: "myMask",
|
|
850
|
+
x: "0",
|
|
851
|
+
y: "0",
|
|
852
|
+
width: "100%",
|
|
853
|
+
height: "100%"
|
|
854
|
+
}, React.createElement("rect", {
|
|
855
|
+
fill: "white",
|
|
856
|
+
y: "0",
|
|
857
|
+
width: "100%",
|
|
858
|
+
height: "100%",
|
|
859
|
+
x: "0"
|
|
860
|
+
}), React.createElement("svg", {
|
|
861
|
+
x: "50%",
|
|
862
|
+
overflow: "visible"
|
|
863
|
+
}, React.createElement("g", {
|
|
864
|
+
transform: "translate(-12 0)"
|
|
865
|
+
}, React.createElement("path", {
|
|
866
|
+
d: "M4.61852778e-14,9.76996262e-15 L9.84597532,5.80270273 C11.0992017,6.54128882 12.6546044,6.54128882 13.9078308,5.80270273 L23.7538061,9.76996262e-15 L4.61852778e-14,9.76996262e-15 Z"
|
|
867
|
+
}))))), React.createElement("rect", {
|
|
868
|
+
fill: "#F7F7F7",
|
|
869
|
+
id: "base-mask",
|
|
870
|
+
mask: "url(#myMask)",
|
|
871
|
+
x: "0",
|
|
872
|
+
y: "0",
|
|
873
|
+
width: "100%",
|
|
874
|
+
height: "100%"
|
|
875
|
+
})), children));
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
var styles$f = {"root":"Meta-module_root__12AG7","rich":"Meta-module_rich__1XBtZ","podcast":"Meta-module_podcast__1m4zo","episode":"Meta-module_episode__1K2Xv","simple":"Meta-module_simple__3vUiI","slide":"Meta-module_slide__3g6fG","card":"Meta-module_card__LE1RK","game":"Meta-module_game__3aNlZ","isInMaterial":"Meta-module_isInMaterial__zaYMy","isInSearchItem":"Meta-module_isInSearchItem__1wbpx","center":"Meta-module_center__3BBPr","half":"Meta-module_half__1xRkT","light":"Meta-module_light__2baE-","dark":"Meta-module_dark__24y9m","hasSource":"Meta-module_hasSource__2lXiN","bookmark":"Meta-module_bookmark__3ot3k","mobile":"Meta-module_mobile__22LGV","desktop":"Meta-module_desktop__1ZGUS"};
|
|
879
|
+
|
|
880
|
+
var Meta = function Meta(_ref) {
|
|
881
|
+
var hasSource = _ref.hasSource,
|
|
882
|
+
theme = _ref.theme,
|
|
883
|
+
children = _ref.children,
|
|
884
|
+
onlyOn = _ref.onlyOn,
|
|
885
|
+
styleContext = _ref.styleContext;
|
|
886
|
+
var classNames = [[styles$f.root, true], [styles$f[theme], !!theme && !!styles$f[theme]], [styles$f[onlyOn], !!onlyOn], [styles$f.hasSource, hasSource]];
|
|
887
|
+
|
|
888
|
+
if (styleContext) {
|
|
889
|
+
classNames = makeStyleContext(classNames, styleContext, styles$f);
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
return React.createElement("div", {
|
|
893
|
+
"data-testid": "meta",
|
|
894
|
+
className: makeClassName(classNames)
|
|
895
|
+
}, children);
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
var styles$g = {"root":"Timestamp-module_root__coOvT"};
|
|
899
|
+
|
|
900
|
+
var Timestamp = function Timestamp(_ref) {
|
|
901
|
+
var publishedAt = _ref.publishedAt,
|
|
902
|
+
_ref$locale = _ref.locale,
|
|
903
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
|
904
|
+
type = _ref.type;
|
|
905
|
+
var published;
|
|
906
|
+
var timeFormat = locale === 'ru' ? 'HH:mm, D MMMM YYYY' : 'h:mm a, MMMM D, YYYY';
|
|
907
|
+
var preparedPublishedAt = publishedAt * 1000;
|
|
908
|
+
dayjs.locale(locale);
|
|
909
|
+
dayjs.extend(relativeTime);
|
|
910
|
+
|
|
911
|
+
if (type === 'fromNow') {
|
|
912
|
+
published = dayjs(preparedPublishedAt).fromNow();
|
|
913
|
+
} else if (type === 'format') {
|
|
914
|
+
published = dayjs(preparedPublishedAt).format('HH:mm');
|
|
915
|
+
} else if (type === 'date') {
|
|
916
|
+
published = dayjs(preparedPublishedAt).format(timeFormat);
|
|
917
|
+
} else {
|
|
918
|
+
throw new Error('Unknown time type');
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
return React.createElement("time", {
|
|
922
|
+
"data-testid": "timestamp",
|
|
923
|
+
className: styles$g.root
|
|
924
|
+
}, published);
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
var DangerousHTML = function DangerousHTML(_ref) {
|
|
928
|
+
var _ref$className = _ref.className,
|
|
929
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
930
|
+
_ref$tagName = _ref.tagName,
|
|
931
|
+
TagName = _ref$tagName === void 0 ? 'div' : _ref$tagName,
|
|
932
|
+
html = _ref.html;
|
|
933
|
+
var element = useRef(null);
|
|
934
|
+
|
|
935
|
+
var _useState = useState(false),
|
|
936
|
+
canRenderHtml = _useState[0],
|
|
937
|
+
setCanRenderHtml = _useState[1];
|
|
938
|
+
|
|
939
|
+
useEffect(function () {
|
|
940
|
+
setCanRenderHtml(true);
|
|
941
|
+
}, []);
|
|
942
|
+
var replaceScriptElementsRecursive = useCallback(function (node) {
|
|
943
|
+
if (node.tagName === 'SCRIPT' && (!node.id || node.id.indexOf('script-') !== 0)) {
|
|
944
|
+
var script = document.createElement('script');
|
|
945
|
+
script.id = "script-" + Math.random().toString(16).slice(2);
|
|
946
|
+
script.innerHTML = node.innerHTML;
|
|
947
|
+
var attrs = node.attributes;
|
|
948
|
+
|
|
949
|
+
for (var i = 0; i < attrs.length; i += 1) {
|
|
950
|
+
var _attrs$i = attrs[i],
|
|
951
|
+
name = _attrs$i.name,
|
|
952
|
+
value = _attrs$i.value;
|
|
953
|
+
script.setAttribute(name, value);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
node.parentElement.replaceChild(script, node);
|
|
957
|
+
} else {
|
|
958
|
+
var _i = 0;
|
|
959
|
+
var children = node.childNodes;
|
|
960
|
+
|
|
961
|
+
while (_i < children.length) {
|
|
962
|
+
replaceScriptElementsRecursive(children[_i]);
|
|
963
|
+
_i += 1;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}, []);
|
|
967
|
+
var prepareAnchors = useCallback(function () {
|
|
968
|
+
var anchors = Array.from(element.current.querySelectorAll('a'));
|
|
969
|
+
anchors.forEach(function (a) {
|
|
970
|
+
a.setAttribute('target', '_blank');
|
|
971
|
+
});
|
|
972
|
+
}, []);
|
|
973
|
+
useEffect(function () {
|
|
974
|
+
if (canRenderHtml && html.indexOf('script') > -1 && element.current) {
|
|
975
|
+
element.current.innerHTML = html;
|
|
976
|
+
replaceScriptElementsRecursive(element.current);
|
|
977
|
+
prepareAnchors();
|
|
978
|
+
}
|
|
979
|
+
}, [canRenderHtml, element, html]);
|
|
980
|
+
return React.createElement(TagName // @ts-ignore
|
|
981
|
+
, {
|
|
982
|
+
// @ts-ignore
|
|
983
|
+
ref: element,
|
|
984
|
+
className: className,
|
|
985
|
+
dangerouslySetInnerHTML: {
|
|
986
|
+
__html: html
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
var styles$h = {"root":"EmbedBlock-module_root__28k9U","object":"EmbedBlock-module_object__2_UZ7","objectWrap":"EmbedBlock-module_objectWrap__1aDVd","proportional":"EmbedBlock-module_proportional__3lAv4","attachment":"EmbedBlock-module_attachment__2pE0t","default":"EmbedBlock-module_default__LSDny","xs":"EmbedBlock-module_xs__1hFgW","full":"EmbedBlock-module_full__1TEjx","super_full":"EmbedBlock-module_super_full__1Fn9A","figure":"EmbedBlock-module_figure__vAvcN","dark":"EmbedBlock-module_dark__1be2G","isInGroupedBlock":"EmbedBlock-module_isInGroupedBlock__3r_i-","gameEmbed":"EmbedBlock-module_gameEmbed__AZQSo","mobile":"EmbedBlock-module_mobile__1P-eo","desktop":"EmbedBlock-module_desktop__SF5a_","control":"EmbedBlock-module_control__xr8dZ","raw_html":"EmbedBlock-module_raw_html__MQoAA","youtube":"EmbedBlock-module_youtube__3gGQ5","vimeo":"EmbedBlock-module_vimeo__kpH1s","onetv":"EmbedBlock-module_onetv__3o33d","coub":"EmbedBlock-module_coub__38Mva","facebook_video":"EmbedBlock-module_facebook_video__1_M05","card":"EmbedBlock-module_card__KTbvp","slide":"EmbedBlock-module_slide__3cL3M","cc":"EmbedBlock-module_cc__1BQ5g","isInAnswer":"EmbedBlock-module_isInAnswer__tLlgs","picture":"EmbedBlock-module_picture__186q0","wrapper":"EmbedBlock-module_wrapper__33XvX"};
|
|
992
|
+
|
|
993
|
+
var EmbedBlock = function EmbedBlock(_ref) {
|
|
994
|
+
var block = _ref.block,
|
|
995
|
+
_ref$block = _ref.block,
|
|
996
|
+
data = _ref$block.data,
|
|
997
|
+
_ref$block$data = _ref$block.data,
|
|
998
|
+
display = _ref$block$data.display,
|
|
999
|
+
onlyOn = _ref$block$data.only_on,
|
|
1000
|
+
provider = _ref$block$data.provider,
|
|
1001
|
+
cc = _ref$block$data.cc,
|
|
1002
|
+
optimized = _ref$block$data.optimized,
|
|
1003
|
+
small = _ref$block$data.small_url,
|
|
1004
|
+
large = _ref$block$data.large_url,
|
|
1005
|
+
styleContext = _ref.styleContext,
|
|
1006
|
+
children = _ref.children;
|
|
1007
|
+
|
|
1008
|
+
var _useState = useState(false),
|
|
1009
|
+
isPopoverShown = _useState[0],
|
|
1010
|
+
setIsPopoverShown = _useState[1];
|
|
1011
|
+
|
|
1012
|
+
var _useState2 = useState(false),
|
|
1013
|
+
videoFrozen = _useState2[0],
|
|
1014
|
+
setVideoFrozen = _useState2[1];
|
|
1015
|
+
|
|
1016
|
+
var videoElem = useRef(null);
|
|
1017
|
+
var wrapperElem = useRef(null);
|
|
1018
|
+
|
|
1019
|
+
var handleVideoTouch = function handleVideoTouch() {
|
|
1020
|
+
videoElem.current.play();
|
|
1021
|
+
setVideoFrozen(false);
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
var handleVideoError = function handleVideoError() {
|
|
1025
|
+
var video = videoElem.current;
|
|
1026
|
+
video.setAttribute('poster', video.dataset.gif);
|
|
1027
|
+
setVideoFrozen(false);
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
useEffect(function () {
|
|
1031
|
+
var video = videoElem.current;
|
|
1032
|
+
|
|
1033
|
+
if (block.type === 'gif' && video) {
|
|
1034
|
+
var _viewportSize = viewportSize(),
|
|
1035
|
+
viewportWidth = _viewportSize.width;
|
|
1036
|
+
|
|
1037
|
+
enableInlineVideo(video);
|
|
1038
|
+
|
|
1039
|
+
if (viewportWidth >= MediaQuerySizes.MOBILE) {
|
|
1040
|
+
video.setAttribute('autoplay', true);
|
|
1041
|
+
video.play();
|
|
1042
|
+
} else {
|
|
1043
|
+
setVideoFrozen(true);
|
|
1044
|
+
video.pause();
|
|
1045
|
+
video.addEventListener('touchstart', handleVideoTouch);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
video.addEventListener('error', handleVideoError);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
return function () {
|
|
1052
|
+
if (video) {
|
|
1053
|
+
video.removeEventListener('touchstart', handleVideoTouch);
|
|
1054
|
+
video.removeEventListener('error', handleVideoError);
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
}, []);
|
|
1058
|
+
|
|
1059
|
+
var renderCC = function renderCC(context) {
|
|
1060
|
+
return React.createElement(MediaCaption, {
|
|
1061
|
+
credit: data.credit,
|
|
1062
|
+
caption: data.caption,
|
|
1063
|
+
styleContext: context || styleContext
|
|
1064
|
+
});
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
var renderEmbed = function renderEmbed(style) {
|
|
1068
|
+
var html = block.data.html;
|
|
1069
|
+
|
|
1070
|
+
switch (block.type) {
|
|
1071
|
+
case 'gif':
|
|
1072
|
+
{
|
|
1073
|
+
return React.createElement("div", {
|
|
1074
|
+
className: styles$h.figure
|
|
1075
|
+
}, React.createElement("div", {
|
|
1076
|
+
className: styles$h.objectWrap,
|
|
1077
|
+
style: style,
|
|
1078
|
+
ref: wrapperElem,
|
|
1079
|
+
"data-frozen": videoFrozen
|
|
1080
|
+
}, React.createElement("video", {
|
|
1081
|
+
playsInline: true,
|
|
1082
|
+
muted: true,
|
|
1083
|
+
loop: true,
|
|
1084
|
+
autoPlay: true,
|
|
1085
|
+
preload: "metadata",
|
|
1086
|
+
"data-gif": block.data.gif_url,
|
|
1087
|
+
ref: videoElem
|
|
1088
|
+
}, React.createElement("source", {
|
|
1089
|
+
src: "https://meduza.io" + block.data.mp4_url,
|
|
1090
|
+
type: "video/mp4"
|
|
1091
|
+
}))));
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
case 'image':
|
|
1095
|
+
{
|
|
1096
|
+
return React.createElement("div", {
|
|
1097
|
+
className: styles$h.figure
|
|
1098
|
+
}, (small || optimized) && React.createElement(Image, {
|
|
1099
|
+
fullscreen: block.data.fullscreen,
|
|
1100
|
+
source: !optimized && [small, large],
|
|
1101
|
+
optimized: block.data.optimized,
|
|
1102
|
+
width: block.data.width,
|
|
1103
|
+
height: block.data.height,
|
|
1104
|
+
alt: block.data.caption,
|
|
1105
|
+
display: block.data.display,
|
|
1106
|
+
lazy: block.data.lazy
|
|
1107
|
+
}));
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
case 'game_embed':
|
|
1111
|
+
{
|
|
1112
|
+
return React.createElement("div", {
|
|
1113
|
+
className: styles$h.gameEmbed
|
|
1114
|
+
}, React.createElement("iframe", {
|
|
1115
|
+
src: block.data.game_src,
|
|
1116
|
+
id: block.data.game_id,
|
|
1117
|
+
title: "Game embed"
|
|
1118
|
+
}));
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
default:
|
|
1122
|
+
{
|
|
1123
|
+
return React.createElement("div", {
|
|
1124
|
+
className: styles$h.object
|
|
1125
|
+
}, React.createElement("div", {
|
|
1126
|
+
className: styles$h.wrapper,
|
|
1127
|
+
style: style
|
|
1128
|
+
}, React.createElement(DangerousHTML, {
|
|
1129
|
+
className: styles$h.objectWrap,
|
|
1130
|
+
html: html
|
|
1131
|
+
})));
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
var style = {};
|
|
1137
|
+
var isProportional; // @TODO: Разобраться зачем это было нужно
|
|
1138
|
+
// const className = Object.keys(styleContext)
|
|
1139
|
+
// .filter(key => key.startsWith('isIn') && styles[key])
|
|
1140
|
+
// .reduce((acc, key) => {
|
|
1141
|
+
// acc.push([styles[key], true])
|
|
1142
|
+
// return acc
|
|
1143
|
+
// }, [])
|
|
1144
|
+
|
|
1145
|
+
/* eslint-disable react/no-array-index-key, no-mixed-operators */
|
|
1146
|
+
|
|
1147
|
+
if (block.data.height && block.data.width) {
|
|
1148
|
+
style.paddingBottom = block.data.height / block.data.width * 100 + "%";
|
|
1149
|
+
style.height = 0;
|
|
1150
|
+
isProportional = true;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
var classNames = [[styles$h.root, true], [styles$h.cc, cc], [styles$h[display], !!display && styles$h[display]], [styles$h[provider], !!provider && !!styles$h[provider]], [styles$h[onlyOn], !!onlyOn && styles$h[onlyOn]], [styles$h.proportional, !!styles$h.proportional && isProportional]];
|
|
1154
|
+
|
|
1155
|
+
if (styleContext) {
|
|
1156
|
+
classNames = makeStyleContext(classNames, styleContext, styles$h);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
return React.createElement("figure", {
|
|
1160
|
+
className: makeClassName(classNames)
|
|
1161
|
+
}, children && React.createElement("div", {
|
|
1162
|
+
className: styles$h.object
|
|
1163
|
+
}, React.createElement("div", {
|
|
1164
|
+
className: styles$h.wrapper,
|
|
1165
|
+
style: style
|
|
1166
|
+
}, React.createElement("div", {
|
|
1167
|
+
className: styles$h.objectWrap
|
|
1168
|
+
}, children))), !children && renderEmbed(style), cc === 'default' && React.createElement("figcaption", null, renderCC()), cc === 'button' && React.createElement("button", {
|
|
1169
|
+
className: styles$h.control,
|
|
1170
|
+
type: "button",
|
|
1171
|
+
"aria-label": "Open",
|
|
1172
|
+
onClick: function onClick() {
|
|
1173
|
+
setIsPopoverShown(!isPopoverShown);
|
|
1174
|
+
}
|
|
1175
|
+
}), cc === 'button' && isPopoverShown && React.createElement(Popover, {
|
|
1176
|
+
onClose: function onClose() {
|
|
1177
|
+
setIsPopoverShown(false);
|
|
1178
|
+
}
|
|
1179
|
+
}, renderCC('isInPopover')));
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
var IframeBlock = function IframeBlock(_ref) {
|
|
1183
|
+
var block = _ref.block,
|
|
1184
|
+
id = _ref.block.id,
|
|
1185
|
+
styleContext = _ref.styleContext,
|
|
1186
|
+
_ref$lang = _ref.lang,
|
|
1187
|
+
lang = _ref$lang === void 0 ? 'ru' : _ref$lang;
|
|
1188
|
+
var element = useRef(null);
|
|
1189
|
+
|
|
1190
|
+
var renderIframe = function renderIframe() {
|
|
1191
|
+
var rootEl = document.createElement('div');
|
|
1192
|
+
var contentEl = document.createElement('div');
|
|
1193
|
+
var scriptEl = document.createElement('script');
|
|
1194
|
+
var style = document.createElement('style');
|
|
1195
|
+
var range = document.createRange();
|
|
1196
|
+
range.setStart(contentEl, 0);
|
|
1197
|
+
contentEl.setAttribute('id', 'content');
|
|
1198
|
+
scriptEl.textContent = "\n function getDocHeight() {\n var doc = document;\n var body = doc.body;\n var html = doc.documentElement;\n var height = Math.max( body.scrollHeight, body.offsetHeight,\n html.clientHeight, html.scrollHeight, html.offsetHeight );\n\n doc.body.style.margin=\"0\";\n\n return document.getElementById('content') ? document.getElementById('content').offsetHeight : height;\n }\n\n function sendDocHeightMsg() {\n var height = getDocHeight();\n var message = JSON.stringify({\n action: {\n type: \"UPDATE_HEIGHT\",\n payload: {\n id: \"" + block.id + "\",\n height: height\n }\n }\n });\n parent.postMessage(\"mdzMaterialEmbedHeight=\" + message, '*');\n }\n\n setInterval(sendDocHeightMsg, 300);\n ";
|
|
1199
|
+
style.type = 'text/css';
|
|
1200
|
+
style.innerHTML = block.type === 'embed_code' ? '.twitter-tweet { padding-top: 15px; margin: 0 !important; }' : '.twitter-tweet { margin: 0 !important; } .fb-post { display: block; } .instagram-media { min-width: 0 !important; }';
|
|
1201
|
+
contentEl.appendChild(range.createContextualFragment(block.data.html));
|
|
1202
|
+
rootEl.appendChild(scriptEl);
|
|
1203
|
+
rootEl.appendChild(contentEl);
|
|
1204
|
+
contentEl.appendChild(style);
|
|
1205
|
+
var frame = element.current.querySelector('iframe').contentDocument;
|
|
1206
|
+
frame.open();
|
|
1207
|
+
frame.close();
|
|
1208
|
+
frame.documentElement.setAttribute('lang', lang);
|
|
1209
|
+
frame.body.appendChild(rootEl);
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1212
|
+
useEffect(function () {
|
|
1213
|
+
renderIframe();
|
|
1214
|
+
}, []);
|
|
1215
|
+
return React.createElement(EmbedBlock, {
|
|
1216
|
+
block: block,
|
|
1217
|
+
styleContext: styleContext
|
|
1218
|
+
}, React.createElement("div", {
|
|
1219
|
+
ref: element,
|
|
1220
|
+
dangerouslySetInnerHTML: {
|
|
1221
|
+
__html: "<iframe id=" + id + " frameBorder=\"0\" scrolling=\"no\"></iframe>"
|
|
1222
|
+
}
|
|
1223
|
+
}));
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1226
|
+
var EmbedBlockContainer = function EmbedBlockContainer(_ref) {
|
|
1227
|
+
var block = _ref.block,
|
|
1228
|
+
styleContext = _ref.styleContext,
|
|
1229
|
+
lang = _ref.lang;
|
|
1230
|
+
|
|
1231
|
+
if (block.data.wrap_with_iframe) {
|
|
1232
|
+
return React.createElement(IframeBlock, {
|
|
1233
|
+
block: block,
|
|
1234
|
+
styleContext: styleContext,
|
|
1235
|
+
lang: lang
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
return React.createElement(EmbedBlock, {
|
|
1240
|
+
block: block,
|
|
1241
|
+
styleContext: styleContext
|
|
1242
|
+
});
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
var styles$i = {"root":"QuoteBlock-module_root__2GrcC","center":"QuoteBlock-module_center__cTFNy"};
|
|
1246
|
+
|
|
1247
|
+
var QuoteBlock = function QuoteBlock(_ref) {
|
|
1248
|
+
var data = _ref.block.data,
|
|
1249
|
+
styleContext = _ref.styleContext;
|
|
1250
|
+
var classNames = [[styles$i.root, true]];
|
|
1251
|
+
|
|
1252
|
+
if (styleContext) {
|
|
1253
|
+
classNames = makeStyleContext(classNames, styleContext, styles$i);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
return React.createElement("div", {
|
|
1257
|
+
"data-testid": "quote-block",
|
|
1258
|
+
className: makeClassName(classNames)
|
|
1259
|
+
}, React.createElement("p", {
|
|
1260
|
+
dangerouslySetInnerHTML: {
|
|
1261
|
+
__html: data
|
|
1262
|
+
}
|
|
1263
|
+
}));
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
var styles$j = {"root":"CardTitle-module_root__1uqqF","index":"CardTitle-module_index__4FsTf","title":"CardTitle-module_title__2iTI6","mobile":"CardTitle-module_mobile__1_kij","desktop":"CardTitle-module_desktop__1l3_n"};
|
|
1267
|
+
|
|
1268
|
+
var CardTitle = function CardTitle(_ref) {
|
|
1269
|
+
var _ref$block = _ref.block,
|
|
1270
|
+
onlyOn = _ref$block.only_on,
|
|
1271
|
+
index = _ref$block.index,
|
|
1272
|
+
text = _ref$block.text,
|
|
1273
|
+
styleContext = _ref.styleContext;
|
|
1274
|
+
return React.createElement("div", {
|
|
1275
|
+
"data-testid": "card-title",
|
|
1276
|
+
className: makeClassName([[styles$j.root, true], [styles$j[onlyOn], !!onlyOn], [styles$j[styleContext], !!styleContext && !!styles$j[styleContext]]])
|
|
1277
|
+
}, React.createElement("div", {
|
|
1278
|
+
className: styles$j.index
|
|
1279
|
+
}, index), React.createElement("h3", {
|
|
1280
|
+
className: styles$j.title
|
|
1281
|
+
}, text));
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
var styles$k = {"root":"ChapterBlock-module_root__1WyVn","subtitle":"ChapterBlock-module_subtitle__3TXll","mobile":"ChapterBlock-module_mobile__CiO0w","desktop":"ChapterBlock-module_desktop__tk1Nk"};
|
|
1285
|
+
|
|
1286
|
+
var ChapterBlock = function ChapterBlock(_ref) {
|
|
1287
|
+
var block = _ref.block,
|
|
1288
|
+
onlyOn = _ref.block.only_on,
|
|
1289
|
+
styleContext = _ref.styleContext;
|
|
1290
|
+
return React.createElement("div", {
|
|
1291
|
+
"data-testid": "chapter-block",
|
|
1292
|
+
className: makeClassName([[styles$k.root, true], [styles$k[onlyOn], !!onlyOn]])
|
|
1293
|
+
}, React.createElement(DangerousHTML, {
|
|
1294
|
+
className: makeClassName([[styles$k.subtitle, true], [styles$k[styleContext], !!styleContext && !!styles$k[styleContext]]]),
|
|
1295
|
+
html: block.data
|
|
1296
|
+
}));
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
var generateGradient = function generateGradient(color) {
|
|
1300
|
+
var gradientSteps = [[0, 7], [0.08, 12], [0.16, 17], [0.22, 21], [0.32, 26], [0.42, 32], [0.52, 38], [0.62, 47], [0.72, 57], [0.82, 65], [1, 82]];
|
|
1301
|
+
var gradient = gradientSteps.map(function (i) {
|
|
1302
|
+
return "rgba(" + color + ", " + i[0] + ") " + i[1] + "%";
|
|
1303
|
+
});
|
|
1304
|
+
return "linear-gradient(-180deg, " + gradient + ")";
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
var styles$l = {"root":"Cover-module_root__18Z8J"};
|
|
1308
|
+
|
|
1309
|
+
var styles$m = {"root":"SimpleTitle-module_root__2jVQN","mobile":"SimpleTitle-module_mobile__11gBz","desktop":"SimpleTitle-module_desktop__3yXgy"};
|
|
1310
|
+
|
|
1311
|
+
var SimpleTitle = function SimpleTitle(_ref) {
|
|
1312
|
+
var _ref$block = _ref.block,
|
|
1313
|
+
first = _ref$block.data.first,
|
|
1314
|
+
onlyOn = _ref$block.only_on,
|
|
1315
|
+
styleContext = _ref.styleContext;
|
|
1316
|
+
var classNames = [[styles$m.root, true], [styles$m[onlyOn], true]];
|
|
1317
|
+
|
|
1318
|
+
if (styleContext) {
|
|
1319
|
+
classNames = makeStyleContext(classNames, styleContext, styles$m);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
return React.createElement("div", {
|
|
1323
|
+
"data-testid": "simple-title",
|
|
1324
|
+
className: makeClassName(classNames)
|
|
1325
|
+
}, first);
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
var styles$n = {"root":"RichTitle-module_root__BK_WT","slide":"RichTitle-module_slide__1A-gB","game":"RichTitle-module_game__1g8Bn","half":"RichTitle-module_half__10GRI","featured":"RichTitle-module_featured__wJfaQ","mobile":"RichTitle-module_mobile__1Cb6E","desktop":"RichTitle-module_desktop__2ixSQ"};
|
|
1329
|
+
|
|
1330
|
+
var RichTitle = function RichTitle(_ref) {
|
|
1331
|
+
var _ref$block = _ref.block,
|
|
1332
|
+
onlyOn = _ref$block.only_on,
|
|
1333
|
+
_ref$block$data = _ref$block.data,
|
|
1334
|
+
featured = _ref$block$data.featured,
|
|
1335
|
+
first = _ref$block$data.first,
|
|
1336
|
+
second = _ref$block$data.second,
|
|
1337
|
+
styleContext = _ref.styleContext;
|
|
1338
|
+
var classNames = [[styles$n.root, true], [styles$n[onlyOn], true], [styles$n.featured, !!featured]];
|
|
1339
|
+
|
|
1340
|
+
if (styleContext) {
|
|
1341
|
+
classNames = makeStyleContext(classNames, styleContext, styles$n);
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
return React.createElement("h1", {
|
|
1345
|
+
"data-testid": "rich-title",
|
|
1346
|
+
className: makeClassName(classNames)
|
|
1347
|
+
}, first, second && React.createElement("span", null, " ", second));
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1350
|
+
var styles$o = {"p":"SimpleBlock-module_p__Q3azD","h2":"SimpleBlock-module_h2__S0LRs","h3":"SimpleBlock-module_h3__2Kv7Y","h4":"SimpleBlock-module_h4__2TJO3","lead":"SimpleBlock-module_lead__35nXx","lead_hr":"SimpleBlock-module_lead_hr__1yD5v","context_p":"SimpleBlock-module_context_p__33saY","blockquote":"SimpleBlock-module_blockquote__pwpcX","game":"SimpleBlock-module_game__2sjgl","slide":"SimpleBlock-module_slide__Aqgfu","dark":"SimpleBlock-module_dark__1J_ov","isInIntro":"SimpleBlock-module_isInIntro__DfutD","center":"SimpleBlock-module_center__2rjif","isInImportantLead":"SimpleBlock-module_isInImportantLead__3VGzT","isInAnswer":"SimpleBlock-module_isInAnswer__3aX6X","mobile":"SimpleBlock-module_mobile__Ckgek","desktop":"SimpleBlock-module_desktop__2se2o"};
|
|
1351
|
+
|
|
1352
|
+
var SimpleBlock = function SimpleBlock(_ref) {
|
|
1353
|
+
var _ref$block = _ref.block,
|
|
1354
|
+
data = _ref$block.data,
|
|
1355
|
+
type = _ref$block.type,
|
|
1356
|
+
onlyOn = _ref$block.only_on,
|
|
1357
|
+
styleContext = _ref.styleContext;
|
|
1358
|
+
var tagName;
|
|
1359
|
+
var classNames = [[styles$o[type], !!type && !!styles$o[type]], [styles$o[onlyOn], true]];
|
|
1360
|
+
|
|
1361
|
+
if (styleContext) {
|
|
1362
|
+
classNames = makeStyleContext(classNames, styleContext, styles$o);
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
switch (type) {
|
|
1366
|
+
case 'context_p':
|
|
1367
|
+
case 'lead':
|
|
1368
|
+
case 'note_caption':
|
|
1369
|
+
case 'note_credit':
|
|
1370
|
+
{
|
|
1371
|
+
tagName = 'p';
|
|
1372
|
+
break;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
case 'lead_hr':
|
|
1376
|
+
{
|
|
1377
|
+
tagName = 'div';
|
|
1378
|
+
break;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
default:
|
|
1382
|
+
tagName = type;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
return React.createElement(DangerousHTML, {
|
|
1386
|
+
className: makeClassName(classNames),
|
|
1387
|
+
html: data || '',
|
|
1388
|
+
tagName: tagName
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
var styles$p = {"root":"ListBlock-module_root__3Q3Ga","ol":"ListBlock-module_ol__21CgV","ul":"ListBlock-module_ul__2MRrS","center":"ListBlock-module_center__tdIwd","isInImportantLead":"ListBlock-module_isInImportantLead__UP0ic","dark":"ListBlock-module_dark__3E3tV","mobile":"ListBlock-module_mobile__2-nuV","desktop":"ListBlock-module_desktop__1EE0g"};
|
|
1393
|
+
|
|
1394
|
+
var ListBlock = function ListBlock(_ref) {
|
|
1395
|
+
var _ref$block = _ref.block,
|
|
1396
|
+
type = _ref$block.type,
|
|
1397
|
+
data = _ref$block.data,
|
|
1398
|
+
onlyOn = _ref$block.only_on,
|
|
1399
|
+
styleContext = _ref.styleContext;
|
|
1400
|
+
var TagName = type;
|
|
1401
|
+
var classNames = [[styles$p.root, true], [styles$p[onlyOn], true], [styles$p[type], !!type && !!styles$p[type]]];
|
|
1402
|
+
|
|
1403
|
+
if (styleContext) {
|
|
1404
|
+
classNames = makeStyleContext(classNames, styleContext, styles$p);
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
return React.createElement(TagName, {
|
|
1408
|
+
className: makeClassName(classNames)
|
|
1409
|
+
}, data.map(function (item, index) {
|
|
1410
|
+
return React.createElement(DangerousHTML, {
|
|
1411
|
+
key: index,
|
|
1412
|
+
html: item,
|
|
1413
|
+
tagName: "li"
|
|
1414
|
+
});
|
|
1415
|
+
}));
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
var styles$q = {"root":"RelatedBlock-module_root__IKcQq","header":"RelatedBlock-module_header__2SuWP","items":"RelatedBlock-module_items__2V-Ap","rich":"RelatedBlock-module_rich__ddaHq","first":"RelatedBlock-module_first__BKItW","simple":"RelatedBlock-module_simple__29HVO","center":"RelatedBlock-module_center__1LmW8","isInSlideMaterial":"RelatedBlock-module_isInSlideMaterial__2YSYG","mobile":"RelatedBlock-module_mobile__2XM5a","desktop":"RelatedBlock-module_desktop__2mXeq"};
|
|
1419
|
+
|
|
1420
|
+
var RelatedBlock = function RelatedBlock(_ref) {
|
|
1421
|
+
var _ref$block = _ref.block,
|
|
1422
|
+
_ref$block$data = _ref$block.data,
|
|
1423
|
+
title = _ref$block$data.title,
|
|
1424
|
+
related = _ref$block$data.related,
|
|
1425
|
+
onlyOn = _ref$block.only_on,
|
|
1426
|
+
styleContext = _ref.styleContext;
|
|
1427
|
+
var classNames = [[styles$q.root, true], [styles$q[onlyOn], true]];
|
|
1428
|
+
|
|
1429
|
+
if (styleContext) {
|
|
1430
|
+
classNames = makeStyleContext(classNames, styleContext, styles$q);
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
return React.createElement("div", {
|
|
1434
|
+
"data-testid": "related-block",
|
|
1435
|
+
className: makeClassName(classNames)
|
|
1436
|
+
}, React.createElement("h3", {
|
|
1437
|
+
className: styles$q.header
|
|
1438
|
+
}, title), React.createElement("ul", {
|
|
1439
|
+
className: styles$q.items
|
|
1440
|
+
}, related.map(function (item, index) {
|
|
1441
|
+
return React.createElement("li", {
|
|
1442
|
+
key: item.id || index,
|
|
1443
|
+
className: styles$q[item.layout]
|
|
1444
|
+
}, React.createElement("a", {
|
|
1445
|
+
href: item.full_url || "/" + item.url,
|
|
1446
|
+
target: "_blank",
|
|
1447
|
+
rel: "noopener noreferrer"
|
|
1448
|
+
}, React.createElement("span", {
|
|
1449
|
+
className: styles$q.first
|
|
1450
|
+
}, item.title), item.second_title && ' ', item.second_title && React.createElement("span", null, item.second_title)));
|
|
1451
|
+
})));
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
var styles$r = {"root":"SourceBlock-module_root__1P3XD","text":"SourceBlock-module_text__Si4vm","origin":"SourceBlock-module_origin__l3JbO","center":"SourceBlock-module_center__3P93B","mobile":"SourceBlock-module_mobile__2gw4S","desktop":"SourceBlock-module_desktop__DecT6"};
|
|
1455
|
+
|
|
1456
|
+
var SourceBlock = function SourceBlock(_ref) {
|
|
1457
|
+
var _ref$block = _ref.block,
|
|
1458
|
+
onlyOn = _ref$block.only_on,
|
|
1459
|
+
quote = _ref$block.quote,
|
|
1460
|
+
origin = _ref$block.origin,
|
|
1461
|
+
url = _ref$block.url,
|
|
1462
|
+
styleContext = _ref.styleContext;
|
|
1463
|
+
var classNames = [[styles$r.root, true], [styles$r[onlyOn], true]];
|
|
1464
|
+
|
|
1465
|
+
if (styleContext) {
|
|
1466
|
+
classNames = makeStyleContext(classNames, styleContext, styles$r);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
return React.createElement("blockquote", {
|
|
1470
|
+
"data-testid": "source-block",
|
|
1471
|
+
cite: url,
|
|
1472
|
+
className: makeClassName(classNames)
|
|
1473
|
+
}, React.createElement("a", {
|
|
1474
|
+
className: styles$r.text,
|
|
1475
|
+
href: url,
|
|
1476
|
+
target: "_blank",
|
|
1477
|
+
rel: "noopener noreferrer"
|
|
1478
|
+
}, quote.map(function (item, index) {
|
|
1479
|
+
return React.createElement(DangerousHTML, {
|
|
1480
|
+
key: index,
|
|
1481
|
+
html: item.data,
|
|
1482
|
+
tagName: "p"
|
|
1483
|
+
});
|
|
1484
|
+
}), React.createElement("footer", null, React.createElement("cite", {
|
|
1485
|
+
className: styles$r.origin
|
|
1486
|
+
}, origin))));
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1489
|
+
var styles$s = {"root":"GroupedBlock-module_root__2qfQA","hasFigcaption":"GroupedBlock-module_hasFigcaption__2_mcf","item":"GroupedBlock-module_item__3sz9_","items":"GroupedBlock-module_items__2DV2X","figcaption":"GroupedBlock-module_figcaption__2Q_wf","default":"GroupedBlock-module_default__3ylw_","full":"GroupedBlock-module_full__1dzQR","super_full":"GroupedBlock-module_super_full__1PU72","mobile":"GroupedBlock-module_mobile__3n8Ub","desktop":"GroupedBlock-module_desktop__6ZRpA"};
|
|
1490
|
+
|
|
1491
|
+
var GroupedBlock = function GroupedBlock(_ref) {
|
|
1492
|
+
var block = _ref.block,
|
|
1493
|
+
onlyOn = _ref.block.only_on,
|
|
1494
|
+
styleContext = _ref.styleContext;
|
|
1495
|
+
var maxHeight = Math.min.apply(Math, block.data.map(function (item) {
|
|
1496
|
+
return item.data.height;
|
|
1497
|
+
}));
|
|
1498
|
+
var normalizedBoxesWidth = block.data.map(function (item) {
|
|
1499
|
+
return item.data.width / (item.data.height / maxHeight);
|
|
1500
|
+
});
|
|
1501
|
+
var sumWidth = normalizedBoxesWidth.reduce(function (sum, x) {
|
|
1502
|
+
return sum + x;
|
|
1503
|
+
});
|
|
1504
|
+
var classNames = [[styles$s.root, true], [styles$s[onlyOn], true], [styles$s.hasFigcaption, block.cc === 'default'], [styles$s[block.display], !!block.display && styles$s[block.display]]];
|
|
1505
|
+
|
|
1506
|
+
if (styleContext) {
|
|
1507
|
+
classNames = makeStyleContext(classNames, styleContext, styles$s);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
return React.createElement("div", {
|
|
1511
|
+
"data-testid": "grouped-block",
|
|
1512
|
+
className: makeClassName(classNames)
|
|
1513
|
+
}, React.createElement("div", {
|
|
1514
|
+
className: styles$s.items
|
|
1515
|
+
}, block.data.map(function (item, index) {
|
|
1516
|
+
var percentWidth = normalizedBoxesWidth[index] / sumWidth * 100;
|
|
1517
|
+
return React.createElement("div", {
|
|
1518
|
+
className: styles$s.item,
|
|
1519
|
+
key: item.id,
|
|
1520
|
+
style: {
|
|
1521
|
+
width: percentWidth + "%"
|
|
1522
|
+
}
|
|
1523
|
+
}, React.createElement(EmbedBlockContainer, {
|
|
1524
|
+
block: item,
|
|
1525
|
+
styleContext: "isInGroupedBlock"
|
|
1526
|
+
}));
|
|
1527
|
+
})), block.cc && React.createElement("figcaption", {
|
|
1528
|
+
className: styles$s.figcaption
|
|
1529
|
+
}, React.createElement(MediaCaption, {
|
|
1530
|
+
credit: block.credit,
|
|
1531
|
+
caption: block.caption,
|
|
1532
|
+
styleContext: styleContext
|
|
1533
|
+
})));
|
|
1534
|
+
};
|
|
1535
|
+
|
|
1536
|
+
var styles$t = {"root":"MetaItem-module_root__2VQom","hasBullets":"MetaItem-module_hasBullets__CkQPI","hasSource":"MetaItem-module_hasSource__1DmCI","listened":"MetaItem-module_listened__lwvAO","read":"MetaItem-module_read__5eAIG","datetime":"MetaItem-module_datetime__3tOWm"};
|
|
1537
|
+
|
|
1538
|
+
var MetaItem = function MetaItem(_ref) {
|
|
1539
|
+
var hasSource = _ref.hasSource,
|
|
1540
|
+
type = _ref.type,
|
|
1541
|
+
children = _ref.children,
|
|
1542
|
+
bullets = _ref.bullets;
|
|
1543
|
+
var classNames = [[styles$t.root, true], [styles$t[type], !!type && !!styles$t[type]], [styles$t.hasSource, !!hasSource], [styles$t.hasBullets, !!bullets]];
|
|
1544
|
+
return React.createElement("div", {
|
|
1545
|
+
"data-testid": "meta-item",
|
|
1546
|
+
className: makeClassName(classNames)
|
|
1547
|
+
}, children);
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1550
|
+
var styles$u = {"root":"MetaItemLive-module_root__2mpD3","gold":"MetaItemLive-module_gold__3yZEV","frame":"MetaItemLive-module_frame__1H_Ha","liveMiddle":"MetaItemLive-module_liveMiddle__wyuV3","liveFirstWave":"MetaItemLive-module_liveFirstWave__3dbvz","liveSecondWave":"MetaItemLive-module_liveSecondWave__12g57"};
|
|
1551
|
+
|
|
1552
|
+
var MetaItemLive = function MetaItemLive(_ref) {
|
|
1553
|
+
var _ref$theme = _ref.theme,
|
|
1554
|
+
theme = _ref$theme === void 0 ? 'gold' : _ref$theme;
|
|
1555
|
+
var classNames = [[styles$u.root, true], [styles$u[theme], !!theme && styles$u[theme]]];
|
|
1556
|
+
return React.createElement("div", {
|
|
1557
|
+
"data-testid": "meta-item-live",
|
|
1558
|
+
"data-meta": "live",
|
|
1559
|
+
className: makeClassName(classNames)
|
|
1560
|
+
}, React.createElement("div", {
|
|
1561
|
+
className: styles$u.frame
|
|
1562
|
+
}));
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1565
|
+
var pluralize = function pluralize(number, one, two, five) {
|
|
1566
|
+
var n = Math.abs(number);
|
|
1567
|
+
n %= 100;
|
|
1568
|
+
|
|
1569
|
+
if (n >= 5 && n <= 20) {
|
|
1570
|
+
return five;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
n %= 10;
|
|
1574
|
+
|
|
1575
|
+
if (n === 1) {
|
|
1576
|
+
return one;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
if (n >= 2 && n <= 4) {
|
|
1580
|
+
return two;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
return five;
|
|
1584
|
+
};
|
|
1585
|
+
|
|
1586
|
+
var styles$v = {"root":"DocumentItemsCount-module_root__P3q-z","items":"DocumentItemsCount-module_items__3pfxW"};
|
|
1587
|
+
|
|
1588
|
+
var DocumentItemsCount = function DocumentItemsCount(_ref) {
|
|
1589
|
+
var type = _ref.type,
|
|
1590
|
+
_ref$lang = _ref.lang,
|
|
1591
|
+
lang = _ref$lang === void 0 ? 'ru' : _ref$lang,
|
|
1592
|
+
items = _ref.items,
|
|
1593
|
+
children = _ref.children;
|
|
1594
|
+
var i18n = {
|
|
1595
|
+
ru: {
|
|
1596
|
+
card: {
|
|
1597
|
+
one: 'карточка',
|
|
1598
|
+
two: 'карточки',
|
|
1599
|
+
five: 'карточек'
|
|
1600
|
+
},
|
|
1601
|
+
podcast: {
|
|
1602
|
+
one: 'эпизод',
|
|
1603
|
+
two: 'эпизода',
|
|
1604
|
+
five: 'эпизодов'
|
|
1605
|
+
}
|
|
1606
|
+
},
|
|
1607
|
+
en: {
|
|
1608
|
+
card: {
|
|
1609
|
+
one: 'card',
|
|
1610
|
+
two: 'cards',
|
|
1611
|
+
five: 'cards'
|
|
1612
|
+
},
|
|
1613
|
+
podcast: {
|
|
1614
|
+
one: 'episode',
|
|
1615
|
+
two: 'episodes',
|
|
1616
|
+
five: 'episodes'
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
var itemsCount = items + " " + pluralize(items, i18n[lang][type].one, i18n[lang][type].two, i18n[lang][type].five);
|
|
1621
|
+
return React.createElement("div", {
|
|
1622
|
+
"data-testid": "document-items-count",
|
|
1623
|
+
className: styles$v.root
|
|
1624
|
+
}, children, React.createElement("span", {
|
|
1625
|
+
className: styles$v.items
|
|
1626
|
+
}, itemsCount));
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1629
|
+
var MetaContainer = function MetaContainer(_ref) {
|
|
1630
|
+
var lang = _ref.lang,
|
|
1631
|
+
block = _ref.block,
|
|
1632
|
+
isRead = _ref.isRead,
|
|
1633
|
+
isListened = _ref.isListened,
|
|
1634
|
+
bookmarkAction = _ref.bookmarkAction,
|
|
1635
|
+
isInBookmarks = _ref.isInBookmarks,
|
|
1636
|
+
_ref$block$data = _ref.block.data,
|
|
1637
|
+
components = _ref$block$data.components,
|
|
1638
|
+
theme = _ref$block$data.theme,
|
|
1639
|
+
styleContext = _ref.styleContext;
|
|
1640
|
+
var themeColor = styleContext && styleContext.indexOf('dark') !== -1 ? 'light' : 'unset';
|
|
1641
|
+
var isPodcast = styleContext && styleContext.indexOf('podcast') !== -1;
|
|
1642
|
+
var isSlides = styleContext && styleContext.indexOf('slide') !== -1;
|
|
1643
|
+
var hasSource = !!components.find(function (item) {
|
|
1644
|
+
return item.type === 'source_name';
|
|
1645
|
+
});
|
|
1646
|
+
return React.createElement(Meta, {
|
|
1647
|
+
styleContext: styleContext,
|
|
1648
|
+
theme: theme || themeColor,
|
|
1649
|
+
onlyOn: block.only_on,
|
|
1650
|
+
hasSource: hasSource
|
|
1651
|
+
}, components.map(function (component) {
|
|
1652
|
+
switch (component.type) {
|
|
1653
|
+
case 'source_name':
|
|
1654
|
+
{
|
|
1655
|
+
return React.createElement(MetaItem, {
|
|
1656
|
+
hasSource: hasSource,
|
|
1657
|
+
bullets: true,
|
|
1658
|
+
key: component.id
|
|
1659
|
+
}, React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && React.createElement("a", {
|
|
1660
|
+
href: component.url,
|
|
1661
|
+
rel: "noopener noreferrer",
|
|
1662
|
+
target: "_blank"
|
|
1663
|
+
}, component.text), !component.url && component.text));
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
case 'duration':
|
|
1667
|
+
{
|
|
1668
|
+
return React.createElement(MetaItem, {
|
|
1669
|
+
hasSource: hasSource,
|
|
1670
|
+
bullets: true,
|
|
1671
|
+
key: component.id
|
|
1672
|
+
}, React.createElement(React.Fragment, null, React.createElement(SvgSymbol, {
|
|
1673
|
+
icon: "podcast",
|
|
1674
|
+
size: "small"
|
|
1675
|
+
}), component.text));
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
case 'datetime':
|
|
1679
|
+
{
|
|
1680
|
+
return React.createElement(MetaItem, {
|
|
1681
|
+
hasSource: hasSource,
|
|
1682
|
+
bullets: true,
|
|
1683
|
+
key: component.id,
|
|
1684
|
+
type: "datetime"
|
|
1685
|
+
}, React.createElement(Timestamp, {
|
|
1686
|
+
publishedAt: component.datetime,
|
|
1687
|
+
type: "date",
|
|
1688
|
+
locale: lang
|
|
1689
|
+
}));
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
case 'items_count':
|
|
1693
|
+
{
|
|
1694
|
+
return React.createElement(MetaItem, {
|
|
1695
|
+
hasSource: hasSource,
|
|
1696
|
+
bullets: true,
|
|
1697
|
+
key: component.id
|
|
1698
|
+
}, React.createElement(DocumentItemsCount, {
|
|
1699
|
+
items: component.count,
|
|
1700
|
+
type: isPodcast ? 'podcast' : 'card',
|
|
1701
|
+
lang: lang
|
|
1702
|
+
}, React.createElement(SvgSymbol, {
|
|
1703
|
+
icon: "card",
|
|
1704
|
+
size: "unset"
|
|
1705
|
+
})));
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
case 'broadcast_active':
|
|
1709
|
+
{
|
|
1710
|
+
return React.createElement(MetaItem, {
|
|
1711
|
+
hasSource: hasSource,
|
|
1712
|
+
bullets: true,
|
|
1713
|
+
key: component.id
|
|
1714
|
+
}, React.createElement(React.Fragment, null, React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
case 'broadcast':
|
|
1718
|
+
{
|
|
1719
|
+
return React.createElement(MetaItem, {
|
|
1720
|
+
hasSource: hasSource,
|
|
1721
|
+
bullets: true,
|
|
1722
|
+
key: component.id
|
|
1723
|
+
}, React.createElement(React.Fragment, null, component.with_icon && React.createElement(MetaItemLive, null), component.label));
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
default:
|
|
1727
|
+
{
|
|
1728
|
+
return null;
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
}), (isRead || isListened) && React.createElement(MetaItem, {
|
|
1732
|
+
hasSource: hasSource,
|
|
1733
|
+
bullets: true,
|
|
1734
|
+
type: isListened ? 'listened' : 'read'
|
|
1735
|
+
}, React.createElement(SvgSymbol, {
|
|
1736
|
+
icon: isListened ? 'listened' : 'read',
|
|
1737
|
+
size: "unset"
|
|
1738
|
+
})), isSlides && lang === 'ru' && React.createElement("div", {
|
|
1739
|
+
className: styles$f.bookmark
|
|
1740
|
+
}, React.createElement(BookmarkButton, {
|
|
1741
|
+
isInBookmarks: isInBookmarks,
|
|
1742
|
+
onClick: function onClick() {
|
|
1743
|
+
return bookmarkAction('bookmark', 'top');
|
|
1744
|
+
}
|
|
1745
|
+
})));
|
|
1746
|
+
};
|
|
1747
|
+
|
|
1748
|
+
var RenderBlocks = function RenderBlocks(_ref) {
|
|
1749
|
+
var block = _ref.block,
|
|
1750
|
+
styleContext = _ref.styleContext,
|
|
1751
|
+
lang = _ref.lang,
|
|
1752
|
+
isRead = _ref.isRead,
|
|
1753
|
+
isListened = _ref.isListened,
|
|
1754
|
+
bookmarkAction = _ref.bookmarkAction,
|
|
1755
|
+
isInBookmarks = _ref.isInBookmarks;
|
|
1756
|
+
|
|
1757
|
+
switch (block.type) {
|
|
1758
|
+
case 'tag':
|
|
1759
|
+
{
|
|
1760
|
+
return React.createElement(Tag, {
|
|
1761
|
+
size: "large",
|
|
1762
|
+
onlyOn: block.only_on,
|
|
1763
|
+
theme: block.data.theme,
|
|
1764
|
+
styleContext: styleContext
|
|
1765
|
+
}, block.data.text);
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
case 'simple_title':
|
|
1769
|
+
{
|
|
1770
|
+
return React.createElement(SimpleTitle, {
|
|
1771
|
+
block: block,
|
|
1772
|
+
styleContext: styleContext
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
case 'rich_title':
|
|
1777
|
+
{
|
|
1778
|
+
return React.createElement(RichTitle, {
|
|
1779
|
+
block: block,
|
|
1780
|
+
styleContext: styleContext
|
|
1781
|
+
});
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
case 'meta':
|
|
1785
|
+
{
|
|
1786
|
+
return React.createElement(MetaContainer, {
|
|
1787
|
+
block: block,
|
|
1788
|
+
lang: block.data.lang,
|
|
1789
|
+
styleContext: styleContext,
|
|
1790
|
+
isRead: isRead,
|
|
1791
|
+
isListened: isListened,
|
|
1792
|
+
isInBookmarks: isInBookmarks,
|
|
1793
|
+
bookmarkAction: bookmarkAction
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
case 'h1':
|
|
1798
|
+
case 'h2':
|
|
1799
|
+
case 'h3':
|
|
1800
|
+
case 'h4':
|
|
1801
|
+
case 'blockquote':
|
|
1802
|
+
case 'p':
|
|
1803
|
+
case 'context_p':
|
|
1804
|
+
case 'lead':
|
|
1805
|
+
case 'lead_hr':
|
|
1806
|
+
{
|
|
1807
|
+
return React.createElement(SimpleBlock, {
|
|
1808
|
+
block: block,
|
|
1809
|
+
styleContext: styleContext
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
case 'quote':
|
|
1814
|
+
return React.createElement(QuoteBlock, {
|
|
1815
|
+
block: block,
|
|
1816
|
+
styleContext: styleContext
|
|
1817
|
+
});
|
|
1818
|
+
|
|
1819
|
+
case 'ol':
|
|
1820
|
+
case 'ul':
|
|
1821
|
+
{
|
|
1822
|
+
return React.createElement(ListBlock, {
|
|
1823
|
+
block: block,
|
|
1824
|
+
styleContext: styleContext
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
case 'chapter-subtitle':
|
|
1829
|
+
{
|
|
1830
|
+
return React.createElement(ChapterBlock, {
|
|
1831
|
+
block: block,
|
|
1832
|
+
styleContext: styleContext
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
case 'card_title':
|
|
1837
|
+
{
|
|
1838
|
+
return React.createElement(CardTitle, {
|
|
1839
|
+
block: block,
|
|
1840
|
+
styleContext: styleContext
|
|
1841
|
+
});
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
case 'related':
|
|
1845
|
+
{
|
|
1846
|
+
return React.createElement(RelatedBlock, {
|
|
1847
|
+
block: block,
|
|
1848
|
+
styleContext: styleContext
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
case 'source':
|
|
1853
|
+
return React.createElement(SourceBlock, {
|
|
1854
|
+
block: block,
|
|
1855
|
+
styleContext: styleContext
|
|
1856
|
+
});
|
|
1857
|
+
|
|
1858
|
+
case 'table':
|
|
1859
|
+
return React.createElement(Table, {
|
|
1860
|
+
block: block,
|
|
1861
|
+
styleContext: styleContext
|
|
1862
|
+
});
|
|
1863
|
+
|
|
1864
|
+
case 'embed':
|
|
1865
|
+
case 'embed_code':
|
|
1866
|
+
case 'game_embed':
|
|
1867
|
+
case 'image':
|
|
1868
|
+
case 'gif':
|
|
1869
|
+
return React.createElement(EmbedBlockContainer, {
|
|
1870
|
+
block: block,
|
|
1871
|
+
styleContext: styleContext,
|
|
1872
|
+
lang: lang
|
|
1873
|
+
});
|
|
1874
|
+
|
|
1875
|
+
case 'grouped':
|
|
1876
|
+
return React.createElement(GroupedBlock, {
|
|
1877
|
+
block: block,
|
|
1878
|
+
styleContext: styleContext
|
|
1879
|
+
});
|
|
1880
|
+
|
|
1881
|
+
case 'material_note':
|
|
1882
|
+
return React.createElement(MaterialNote, {
|
|
1883
|
+
block: block,
|
|
1884
|
+
styleContext: styleContext
|
|
1885
|
+
});
|
|
1886
|
+
|
|
1887
|
+
default:
|
|
1888
|
+
{
|
|
1889
|
+
return null;
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
};
|
|
1893
|
+
|
|
1894
|
+
var Cover = function Cover(_ref) {
|
|
1895
|
+
var _ref$block = _ref.block,
|
|
1896
|
+
onlyOn = _ref$block.only_on,
|
|
1897
|
+
_ref$block$data = _ref$block.data,
|
|
1898
|
+
blocks = _ref$block$data.blocks,
|
|
1899
|
+
_ref$block$data$cover = _ref$block$data.cover,
|
|
1900
|
+
credit = _ref$block$data$cover.credit,
|
|
1901
|
+
caption = _ref$block$data$cover.caption,
|
|
1902
|
+
urls = _ref$block$data$cover.urls,
|
|
1903
|
+
mobileRatio = _ref$block$data$cover.mobile_ratio,
|
|
1904
|
+
gradients = _ref$block$data$cover.gradients,
|
|
1905
|
+
cc = _ref$block$data$cover.cc,
|
|
1906
|
+
styleContext = _ref.styleContext;
|
|
1907
|
+
|
|
1908
|
+
var _useState = useState(false),
|
|
1909
|
+
isPopoverShown = _useState[0],
|
|
1910
|
+
setIsPopoverShown = _useState[1];
|
|
1911
|
+
|
|
1912
|
+
var style = {};
|
|
1913
|
+
var theme;
|
|
1914
|
+
var classNames = [[styles$l.root, true], [styles$l[theme], true], [styles$l[onlyOn], !!onlyOn && !!styles$l[onlyOn]]];
|
|
1915
|
+
|
|
1916
|
+
if (styleContext) {
|
|
1917
|
+
classNames = makeStyleContext(classNames, styleContext, styles$l);
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
if (gradients) {
|
|
1921
|
+
theme = gradients.text_rgb === '0,0,0' ? 'dark' : 'light';
|
|
1922
|
+
style.backgroundImage = generateGradient(gradients.bg_rgb);
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
var renderCC = function renderCC(context) {
|
|
1926
|
+
return React.createElement(MediaCaption, {
|
|
1927
|
+
credit: credit,
|
|
1928
|
+
caption: caption,
|
|
1929
|
+
styleContext: context || styleContext
|
|
1930
|
+
});
|
|
1931
|
+
};
|
|
1932
|
+
|
|
1933
|
+
return React.createElement("div", {
|
|
1934
|
+
"data-testid": "cover",
|
|
1935
|
+
className: makeClassName(classNames)
|
|
1936
|
+
}, React.createElement("div", {
|
|
1937
|
+
className: styles$l.image
|
|
1938
|
+
}, React.createElement(Image, {
|
|
1939
|
+
optimized: urls,
|
|
1940
|
+
ratio: mobileRatio,
|
|
1941
|
+
display: "narrow"
|
|
1942
|
+
})), React.createElement("div", {
|
|
1943
|
+
className: styles$l.body,
|
|
1944
|
+
style: style
|
|
1945
|
+
}, blocks.map(function (item) {
|
|
1946
|
+
return React.createElement(RenderBlocks, {
|
|
1947
|
+
key: item.id,
|
|
1948
|
+
block: item,
|
|
1949
|
+
styleContext: styleContext
|
|
1950
|
+
});
|
|
1951
|
+
})), cc === 'button' && React.createElement("button", {
|
|
1952
|
+
className: styles$l.control,
|
|
1953
|
+
type: "button",
|
|
1954
|
+
"aria-label": "Open",
|
|
1955
|
+
onClick: function onClick() {
|
|
1956
|
+
setIsPopoverShown(!isPopoverShown);
|
|
1957
|
+
}
|
|
1958
|
+
}), cc === 'button' && isPopoverShown && React.createElement(Popover, {
|
|
1959
|
+
onClose: function onClose() {
|
|
1960
|
+
setIsPopoverShown(false);
|
|
1961
|
+
}
|
|
1962
|
+
}, renderCC('isInPopover')));
|
|
1963
|
+
};
|
|
1964
|
+
|
|
1965
|
+
var styles$w = {"root":"HalfBlock-module_root__2frv2","main":"HalfBlock-module_main__2XX73","body":"HalfBlock-module_body__3MnEN","footer":"HalfBlock-module_footer__1C0yp","image":"HalfBlock-module_image__2lYel","mobile":"HalfBlock-module_mobile__2latf","desktop":"HalfBlock-module_desktop__3B1Ej"};
|
|
1966
|
+
|
|
1967
|
+
var HalfBlock = function HalfBlock(_ref) {
|
|
1968
|
+
var _ref$block = _ref.block,
|
|
1969
|
+
onlyOn = _ref$block.only_on,
|
|
1970
|
+
data = _ref$block.data,
|
|
1971
|
+
_ref$block$data$cover = _ref$block.data.cover,
|
|
1972
|
+
optimized = _ref$block$data$cover.optimized,
|
|
1973
|
+
ratio = _ref$block$data$cover.ratio,
|
|
1974
|
+
credit = _ref$block$data$cover.credit,
|
|
1975
|
+
caption = _ref$block$data$cover.caption,
|
|
1976
|
+
styleContext = _ref.styleContext;
|
|
1977
|
+
var classNames = [[styles$w.root, true], [styles$w[onlyOn], true]];
|
|
1978
|
+
|
|
1979
|
+
if (styleContext) {
|
|
1980
|
+
classNames = makeStyleContext(classNames, styleContext, styles$w);
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
return React.createElement("div", {
|
|
1984
|
+
"data-testid": "half-block",
|
|
1985
|
+
className: makeClassName(classNames)
|
|
1986
|
+
}, React.createElement("div", {
|
|
1987
|
+
className: styles$w.main
|
|
1988
|
+
}, React.createElement("div", {
|
|
1989
|
+
className: styles$w.image
|
|
1990
|
+
}, React.createElement(Image, {
|
|
1991
|
+
optimized: optimized,
|
|
1992
|
+
ratio: ratio,
|
|
1993
|
+
display: "super_full"
|
|
1994
|
+
})), React.createElement("div", {
|
|
1995
|
+
className: styles$w.body
|
|
1996
|
+
}, data.blocks.map(function (item) {
|
|
1997
|
+
return React.createElement(RenderBlocks, {
|
|
1998
|
+
key: item.id,
|
|
1999
|
+
block: item,
|
|
2000
|
+
styleContext: ['rich']
|
|
2001
|
+
});
|
|
2002
|
+
}))), React.createElement("div", {
|
|
2003
|
+
className: styles$w.footer
|
|
2004
|
+
}, React.createElement(MediaCaption, {
|
|
2005
|
+
credit: credit,
|
|
2006
|
+
caption: caption,
|
|
2007
|
+
styleContext: styleContext
|
|
2008
|
+
})));
|
|
2009
|
+
};
|
|
2010
|
+
|
|
2011
|
+
var styles$x = {"root":"ImportantLead-module_root__2BdT3","slide":"ImportantLead-module_slide__3kQ9x","mobile":"ImportantLead-module_mobile__3BXbm","desktop":"ImportantLead-module_desktop__3Zljc"};
|
|
2012
|
+
|
|
2013
|
+
var ImportantLead = function ImportantLead(_ref) {
|
|
2014
|
+
var _ref$block = _ref.block,
|
|
2015
|
+
onlyOn = _ref$block.only_on,
|
|
2016
|
+
data = _ref$block.data,
|
|
2017
|
+
styleContext = _ref.styleContext;
|
|
2018
|
+
var classNames = [[styles$x.root, true], [styles$x[onlyOn], !!onlyOn]];
|
|
2019
|
+
|
|
2020
|
+
if (styleContext) {
|
|
2021
|
+
classNames = makeStyleContext(classNames, styleContext, styles$x);
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
return React.createElement("div", {
|
|
2025
|
+
"data-testid": "important-lead",
|
|
2026
|
+
className: makeClassName(classNames)
|
|
2027
|
+
}, data.map(function (item) {
|
|
2028
|
+
return React.createElement(RenderBlocks, {
|
|
2029
|
+
key: item.id,
|
|
2030
|
+
block: item,
|
|
2031
|
+
styleContext: "isInImportantLead"
|
|
2032
|
+
});
|
|
2033
|
+
}));
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
var POST_MESSAGE_PREFIX = 'mdzKitMsg';
|
|
2037
|
+
|
|
2038
|
+
var postMessage$1 = function postMessage(element, action) {
|
|
2039
|
+
var target = window.top;
|
|
2040
|
+
var msg = POST_MESSAGE_PREFIX + "=" + JSON.stringify({
|
|
2041
|
+
element: element,
|
|
2042
|
+
action: action
|
|
2043
|
+
});
|
|
2044
|
+
|
|
2045
|
+
if (typeof target !== 'undefined') {
|
|
2046
|
+
target.postMessage(msg, '*');
|
|
2047
|
+
}
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
var styles$y = {"root":"Spoiler-module_root__1OfSR","header":"Spoiler-module_header__1rZUs","body":"Spoiler-module_body__Q1e_c","spoiled":"Spoiler-module_spoiled__1A5r4","footer":"Spoiler-module_footer__23mh7","spoilerSticky":"Spoiler-module_spoilerSticky__3Kd30","center":"Spoiler-module_center__tq1m0","full":"Spoiler-module_full__1QFqR","default":"Spoiler-module_default__2Kjx8","mobile":"Spoiler-module_mobile__2BPt8","desktop":"Spoiler-module_desktop__1BIFJ"};
|
|
2051
|
+
|
|
2052
|
+
var Spoiler = function Spoiler(_ref) {
|
|
2053
|
+
var _ref$block = _ref.block,
|
|
2054
|
+
display = _ref$block.display,
|
|
2055
|
+
button = _ref$block.button,
|
|
2056
|
+
onlyOn = _ref$block.only_on,
|
|
2057
|
+
buttonTitle = _ref$block.btn_title,
|
|
2058
|
+
title = _ref$block.title,
|
|
2059
|
+
blocks = _ref$block.blocks,
|
|
2060
|
+
styleContext = _ref.styleContext;
|
|
2061
|
+
|
|
2062
|
+
var _useState = useState(false),
|
|
2063
|
+
spoiled = _useState[0],
|
|
2064
|
+
setSpoiled = _useState[1];
|
|
2065
|
+
|
|
2066
|
+
var ref = useRef(null);
|
|
2067
|
+
|
|
2068
|
+
var handleButtonClick = function handleButtonClick() {
|
|
2069
|
+
setSpoiled(!spoiled);
|
|
2070
|
+
|
|
2071
|
+
if (spoiled) {
|
|
2072
|
+
postMessage$1('closeSpoiler', 'click');
|
|
2073
|
+
var rect = ref.current.getBoundingClientRect();
|
|
2074
|
+
|
|
2075
|
+
if (rect.top < 0) {
|
|
2076
|
+
ref.current.scrollIntoView({
|
|
2077
|
+
behavior: 'smooth'
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
} else {
|
|
2081
|
+
postMessage$1('openSpoiler', 'click');
|
|
2082
|
+
}
|
|
2083
|
+
};
|
|
2084
|
+
|
|
2085
|
+
var classNames = [[styles$y.root, true], [styles$y[onlyOn], !!onlyOn], [styles$y[display], !!display && styles$y[display]], [[styles$y.spoiled], !!spoiled]];
|
|
2086
|
+
|
|
2087
|
+
if (styleContext) {
|
|
2088
|
+
classNames = makeStyleContext(classNames, styleContext, styles$y);
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
var buttonCollapse = button ? button.collapse : 'Свернуть';
|
|
2092
|
+
var buttonExpande = button ? button.expand : buttonTitle;
|
|
2093
|
+
return React.createElement("div", {
|
|
2094
|
+
ref: ref,
|
|
2095
|
+
className: makeClassName(classNames),
|
|
2096
|
+
"data-testid": "spoiler"
|
|
2097
|
+
}, React.createElement("div", {
|
|
2098
|
+
className: styles$y.header
|
|
2099
|
+
}, title && React.createElement("h3", null, title)), React.createElement("div", {
|
|
2100
|
+
className: styles$y.body
|
|
2101
|
+
}, blocks.map(function (item) {
|
|
2102
|
+
return React.createElement(RenderBlocks, {
|
|
2103
|
+
key: item.id,
|
|
2104
|
+
block: item,
|
|
2105
|
+
styleContext: styleContext
|
|
2106
|
+
});
|
|
2107
|
+
})), React.createElement("div", {
|
|
2108
|
+
className: styles$y.footer
|
|
2109
|
+
}, React.createElement(Button, {
|
|
2110
|
+
size: "default",
|
|
2111
|
+
theme: "gray",
|
|
2112
|
+
onClick: function onClick() {
|
|
2113
|
+
return handleButtonClick();
|
|
2114
|
+
},
|
|
2115
|
+
styleContext: "isInSpoiler"
|
|
2116
|
+
}, spoiled ? buttonCollapse : buttonExpande, React.createElement(SvgSymbol, {
|
|
2117
|
+
icon: "arrow"
|
|
2118
|
+
}))));
|
|
2119
|
+
};
|
|
2120
|
+
|
|
2121
|
+
var RawHtmlBlock = function RawHtmlBlock(_ref) {
|
|
2122
|
+
var block = _ref.block,
|
|
2123
|
+
styleContext = _ref.styleContext,
|
|
2124
|
+
isRead = _ref.isRead,
|
|
2125
|
+
isListened = _ref.isListened,
|
|
2126
|
+
isInBookmarks = _ref.isInBookmarks,
|
|
2127
|
+
bookmarkAction = _ref.bookmarkAction,
|
|
2128
|
+
lightBox = _ref.lightBox;
|
|
2129
|
+
var context = {
|
|
2130
|
+
lightBox: lightBox || null
|
|
2131
|
+
};
|
|
2132
|
+
|
|
2133
|
+
switch (block.type) {
|
|
2134
|
+
case 'important_lead':
|
|
2135
|
+
{
|
|
2136
|
+
return React.createElement(ImportantLead, {
|
|
2137
|
+
block: block,
|
|
2138
|
+
styleContext: styleContext
|
|
2139
|
+
});
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
case 'spoiler':
|
|
2143
|
+
{
|
|
2144
|
+
return React.createElement(Spoiler, {
|
|
2145
|
+
block: block,
|
|
2146
|
+
styleContext: styleContext
|
|
2147
|
+
});
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
case 'cover':
|
|
2151
|
+
{
|
|
2152
|
+
return React.createElement(Cover, {
|
|
2153
|
+
block: block,
|
|
2154
|
+
styleContext: styleContext
|
|
2155
|
+
});
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
case 'half':
|
|
2159
|
+
{
|
|
2160
|
+
return React.createElement(HalfBlock, {
|
|
2161
|
+
block: block,
|
|
2162
|
+
styleContext: styleContext
|
|
2163
|
+
});
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
default:
|
|
2167
|
+
{
|
|
2168
|
+
return React.createElement(BlockProvider, {
|
|
2169
|
+
value: context
|
|
2170
|
+
}, React.createElement(RenderBlocks, {
|
|
2171
|
+
block: block,
|
|
2172
|
+
styleContext: styleContext,
|
|
2173
|
+
isRead: isRead,
|
|
2174
|
+
isListened: isListened,
|
|
2175
|
+
isInBookmarks: isInBookmarks,
|
|
2176
|
+
bookmarkAction: bookmarkAction
|
|
2177
|
+
}));
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
|
|
2182
|
+
var styles$z = {"root":"ToolbarButton-module_root__xN-fq","dark":"ToolbarButton-module_dark__GrIOr","bookmark":"ToolbarButton-module_bookmark__3369b","isActive":"ToolbarButton-module_isActive__3NLAE","text":"ToolbarButton-module_text__32m6s"};
|
|
2183
|
+
|
|
2184
|
+
var ToolbarButton = function ToolbarButton(_ref) {
|
|
2185
|
+
var children = _ref.children,
|
|
2186
|
+
type = _ref.type,
|
|
2187
|
+
theme = _ref.theme,
|
|
2188
|
+
isActive = _ref.isActive,
|
|
2189
|
+
_onClick = _ref.onClick;
|
|
2190
|
+
var classNames = [[styles$z.root, true], [styles$z[type], !!styles$z[type]], [styles$z[theme], !!styles$z[theme] && !!theme], [styles$z.isActive, !!isActive]];
|
|
2191
|
+
return React.createElement("button", {
|
|
2192
|
+
"data-testid": "toolbar-button",
|
|
2193
|
+
className: makeClassName(classNames),
|
|
2194
|
+
type: "button",
|
|
2195
|
+
onClick: function onClick() {
|
|
2196
|
+
return _onClick(type);
|
|
2197
|
+
}
|
|
2198
|
+
}, React.createElement(SvgSymbol, {
|
|
2199
|
+
size: "medium",
|
|
2200
|
+
icon: type,
|
|
2201
|
+
styleContext: "isInToolbar"
|
|
2202
|
+
}), children && React.createElement("span", {
|
|
2203
|
+
className: styles$z.text
|
|
2204
|
+
}, children));
|
|
2205
|
+
};
|
|
2206
|
+
|
|
2207
|
+
export { BookmarkButton, Button, CardTitle, ChapterBlock, Cover, DocumentItemsCount, DotsOnImage, Dropdown, EmbedBlockContainer, GroupedBlock, HalfBlock, Image, ImportantLead, Lazy, ListBlock, MaterialNote, MaterialTitle, MediaCaption, Menu, Meta, MetaItem, MetaItemLive, Popover, Primary, QuoteBlock, RawHtmlBlock, RelatedBlock, RenderBlocks, RichTitle, Secondary, SimpleBlock, SimpleTitle, SourceBlock, Spoiler, SvgSymbol, Switcher, Table, Tag, Timestamp, Toolbar, ToolbarButton };
|
|
101
2208
|
//# sourceMappingURL=ui-kit-2.esm.js.map
|