@meduza/ui-kit-2 0.8.627 → 0.8.628

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.
@@ -997,7 +997,7 @@ const Toolbar = ({
997
997
  }, children));
998
998
  };
999
999
 
1000
- var styles$s = {"containerInDynamicBlock":"Meta-module_containerInDynamicBlock__YSh66","containerInDynamicBlockAndMaterial":"Meta-module_containerInDynamicBlockAndMaterial__4v4A9","root":"Meta-module_root__H-Q4d","rich":"Meta-module_rich__dCkJK","podcast":"Meta-module_podcast__MI8gD","episode":"Meta-module_episode__0n9CF","simple":"Meta-module_simple__tztcr","slide":"Meta-module_slide__3OyIN","card":"Meta-module_card__2vqfN","game":"Meta-module_game__HNcgr","isInMaterial":"Meta-module_isInMaterial__vKcTK","isInSearchItem":"Meta-module_isInSearchItem__ENqHo","isInMediaBlock":"Meta-module_isInMediaBlock__TENZG","center":"Meta-module_center__seHro","half":"Meta-module_half__aoa9h","podcastMaterial":"Meta-module_podcastMaterial__GTPyD","light":"Meta-module_light__oW3kc","dark":"Meta-module_dark__tLQNJ","isDark":"Meta-module_isDark__xSl1J","hasSource":"Meta-module_hasSource__OZJ0y","bookmark":"Meta-module_bookmark__jcFWn","isInBookRelated":"Meta-module_isInBookRelated__Ohidg","mobile":"Meta-module_mobile__PbG8N","desktop":"Meta-module_desktop__W5AB7"};
1000
+ var styles$s = {"root":"Meta-module_root__H-Q4d","rich":"Meta-module_rich__dCkJK","podcast":"Meta-module_podcast__MI8gD","episode":"Meta-module_episode__0n9CF","simple":"Meta-module_simple__tztcr","slide":"Meta-module_slide__3OyIN","card":"Meta-module_card__2vqfN","game":"Meta-module_game__HNcgr","isInMaterial":"Meta-module_isInMaterial__vKcTK","isInSearchItem":"Meta-module_isInSearchItem__ENqHo","isInMediaBlock":"Meta-module_isInMediaBlock__TENZG","center":"Meta-module_center__seHro","half":"Meta-module_half__aoa9h","podcastMaterial":"Meta-module_podcastMaterial__GTPyD","light":"Meta-module_light__oW3kc","dark":"Meta-module_dark__tLQNJ","isDark":"Meta-module_isDark__xSl1J","hasSource":"Meta-module_hasSource__OZJ0y","bookmark":"Meta-module_bookmark__jcFWn","isInBookRelated":"Meta-module_isInBookRelated__Ohidg","mobile":"Meta-module_mobile__PbG8N","desktop":"Meta-module_desktop__W5AB7"};
1001
1001
 
1002
1002
  const Meta = ({
1003
1003
  hasSource,
@@ -1851,8 +1851,8 @@ const MetaContainer = ({
1851
1851
  theme
1852
1852
  }
1853
1853
  },
1854
- styleContext,
1855
- type
1854
+ styleContext
1855
+ // type
1856
1856
  }) => {
1857
1857
  const themeColor = styleContext && styleContext.indexOf('dark') !== -1 ? 'light' : 'unset';
1858
1858
  const isPodcast = styleContext && styleContext.indexOf('podcast') !== -1;
@@ -1864,122 +1864,134 @@ const MetaContainer = ({
1864
1864
  });
1865
1865
  }
1866
1866
  const hasSource = !!components.find(item => item.type === 'source_name');
1867
- const classNames = [[styles$s.containerInDynamicBlock, styleContext === 'isInDynamicBlock' || styleContext.includes('episode')], [styles$s.containerInDynamicBlockAndMaterial, styleContext === 'isInDynamicBlock' && type === 'isInMaterial']];
1868
- return /*#__PURE__*/React.createElement("div", {
1869
- className: makeClassName(classNames)
1870
- }, /*#__PURE__*/React.createElement(Meta, {
1871
- styleContext: context,
1872
- theme: theme || themeColor,
1873
- onlyOn: block.only_on,
1874
- hasSource: hasSource
1875
- }, components.map(component => {
1876
- switch (component.type) {
1877
- case 'source_name':
1878
- {
1879
- return /*#__PURE__*/React.createElement(MetaItem, {
1880
- hasSource: hasSource,
1881
- bullets: true,
1882
- key: component.id
1883
- }, /*#__PURE__*/React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && ( /*#__PURE__*/React.createElement("a", {
1884
- href: component.url,
1885
- rel: "noopener noreferrer",
1886
- target: "_blank"
1887
- }, component.text)), !component.url && component.text));
1888
- }
1889
- case 'duration':
1890
- {
1891
- // if (styleContext === 'isInDynamicBlock') {
1892
- // return (
1893
- // <MetaItem hasSource={hasSource} bullets key={component.id}>
1894
- // {component.text}
1895
- // </MetaItem>
1896
- // )
1897
- // }
1898
- return /*#__PURE__*/React.createElement(MetaItem, {
1899
- hasSource: hasSource,
1900
- bullets: true,
1901
- key: component.id
1902
- }, /*#__PURE__*/React.createElement(React.Fragment, null, styleContext !== 'isInDynamicBlock' && ( /*#__PURE__*/React.createElement(SvgSymbol, {
1903
- icon: "podcast",
1904
- size: "small"
1905
- })), component.text));
1906
- }
1907
- case 'datetime':
1908
- {
1909
- const format = component.format && toCamel(component.format) || 'date';
1910
- return /*#__PURE__*/React.createElement(MetaItem, {
1911
- hasSource: hasSource,
1912
- bullets: true,
1913
- key: component.id,
1914
- type: "datetime"
1915
- }, /*#__PURE__*/React.createElement(Timestamp, {
1916
- publishedAt: component.datetime,
1917
- // type={
1918
- // styleContext === 'isInDynamicBlock'
1919
- // ? 'fromNow'
1920
- // : format || 'date'
1867
+ // const classNames: ClassNames = [
1868
+ // [
1869
+ // styles.containerInDynamicBlock,
1870
+ // styleContext === 'isInDynamicBlock' || styleContext.includes('episode')
1871
+ // ],
1872
+ // [
1873
+ // styles.containerInDynamicBlockAndMaterial,
1874
+ // styleContext === 'isInDynamicBlock' && type === 'isInMaterial'
1875
+ // ]
1876
+ // ]
1877
+ return (
1878
+ /*#__PURE__*/
1879
+ // <div className={makeClassName(classNames)}>
1880
+ React.createElement(Meta, {
1881
+ styleContext: context,
1882
+ theme: theme || themeColor,
1883
+ onlyOn: block.only_on,
1884
+ hasSource: hasSource
1885
+ }, components.map(component => {
1886
+ switch (component.type) {
1887
+ case 'source_name':
1888
+ {
1889
+ return /*#__PURE__*/React.createElement(MetaItem, {
1890
+ hasSource: hasSource,
1891
+ bullets: true,
1892
+ key: component.id
1893
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && ( /*#__PURE__*/React.createElement("a", {
1894
+ href: component.url,
1895
+ rel: "noopener noreferrer",
1896
+ target: "_blank"
1897
+ }, component.text)), !component.url && component.text));
1898
+ }
1899
+ case 'duration':
1900
+ {
1901
+ // if (styleContext === 'isInDynamicBlock') {
1902
+ // return (
1903
+ // <MetaItem hasSource={hasSource} bullets key={component.id}>
1904
+ // {component.text}
1905
+ // </MetaItem>
1906
+ // )
1921
1907
  // }
1922
- type: format || 'date',
1923
- locale: lang
1924
- }));
1925
- }
1926
- case 'items_count':
1927
- {
1928
- return /*#__PURE__*/React.createElement(MetaItem, {
1929
- hasSource: hasSource,
1930
- bullets: true,
1931
- key: component.id
1932
- }, /*#__PURE__*/React.createElement(DocumentItemsCount, {
1933
- items: component.count,
1934
- type: isPodcast ? 'podcast' : 'card',
1935
- lang: lang
1936
- }, /*#__PURE__*/React.createElement(SvgSymbol, {
1937
- icon: "card",
1938
- size: "unset"
1939
- })));
1940
- }
1941
- case 'broadcast_active':
1942
- {
1943
- return /*#__PURE__*/React.createElement(MetaItem, {
1944
- hasSource: hasSource,
1945
- bullets: true,
1946
- key: component.id
1947
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
1948
- }
1949
- case 'broadcast':
1950
- {
1951
- return /*#__PURE__*/React.createElement(MetaItem, {
1952
- hasSource: hasSource,
1953
- bullets: true,
1954
- key: component.id
1955
- }, /*#__PURE__*/React.createElement(React.Fragment, null, component.with_icon && /*#__PURE__*/React.createElement(MetaItemLive, null), component.label));
1956
- }
1957
- case 'string':
1958
- {
1959
- return /*#__PURE__*/React.createElement(MetaItem, {
1960
- hasSource: hasSource,
1961
- bullets: true,
1962
- key: component.id
1963
- }, component.text);
1964
- }
1965
- default:
1966
- {
1967
- return null;
1968
- }
1969
- }
1970
- }), (isRead || isListened) && ( /*#__PURE__*/React.createElement(MetaItem, {
1971
- hasSource: hasSource,
1972
- bullets: true,
1973
- type: isListened ? 'listened' : 'read'
1974
- }, /*#__PURE__*/React.createElement(SvgSymbol, {
1975
- icon: isListened ? 'listened' : 'read',
1976
- size: "unset"
1977
- }))), isSlides && lang === 'ru' && ( /*#__PURE__*/React.createElement("div", {
1978
- className: styles$s.bookmark
1979
- }, /*#__PURE__*/React.createElement(BookmarkButton, {
1980
- isInBookmarks: isInBookmarks,
1981
- onClick: () => bookmarkAction('bookmark', 'top')
1982
- })))));
1908
+ return /*#__PURE__*/React.createElement(MetaItem, {
1909
+ hasSource: hasSource,
1910
+ bullets: true,
1911
+ key: component.id
1912
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, styleContext !== 'isInDynamicBlock' && ( /*#__PURE__*/React.createElement(SvgSymbol, {
1913
+ icon: "podcast",
1914
+ size: "small"
1915
+ })), component.text));
1916
+ }
1917
+ case 'datetime':
1918
+ {
1919
+ const format = component.format && toCamel(component.format) || 'date';
1920
+ return /*#__PURE__*/React.createElement(MetaItem, {
1921
+ hasSource: hasSource,
1922
+ bullets: true,
1923
+ key: component.id,
1924
+ type: "datetime"
1925
+ }, /*#__PURE__*/React.createElement(Timestamp, {
1926
+ publishedAt: component.datetime,
1927
+ // type={
1928
+ // styleContext === 'isInDynamicBlock'
1929
+ // ? 'fromNow'
1930
+ // : format || 'date'
1931
+ // }
1932
+ type: format || 'date',
1933
+ locale: lang
1934
+ }));
1935
+ }
1936
+ case 'items_count':
1937
+ {
1938
+ return /*#__PURE__*/React.createElement(MetaItem, {
1939
+ hasSource: hasSource,
1940
+ bullets: true,
1941
+ key: component.id
1942
+ }, /*#__PURE__*/React.createElement(DocumentItemsCount, {
1943
+ items: component.count,
1944
+ type: isPodcast ? 'podcast' : 'card',
1945
+ lang: lang
1946
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1947
+ icon: "card",
1948
+ size: "unset"
1949
+ })));
1950
+ }
1951
+ case 'broadcast_active':
1952
+ {
1953
+ return /*#__PURE__*/React.createElement(MetaItem, {
1954
+ hasSource: hasSource,
1955
+ bullets: true,
1956
+ key: component.id
1957
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
1958
+ }
1959
+ case 'broadcast':
1960
+ {
1961
+ return /*#__PURE__*/React.createElement(MetaItem, {
1962
+ hasSource: hasSource,
1963
+ bullets: true,
1964
+ key: component.id
1965
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, component.with_icon && /*#__PURE__*/React.createElement(MetaItemLive, null), component.label));
1966
+ }
1967
+ case 'string':
1968
+ {
1969
+ return /*#__PURE__*/React.createElement(MetaItem, {
1970
+ hasSource: hasSource,
1971
+ bullets: true,
1972
+ key: component.id
1973
+ }, component.text);
1974
+ }
1975
+ default:
1976
+ {
1977
+ return null;
1978
+ }
1979
+ }
1980
+ }), (isRead || isListened) && ( /*#__PURE__*/React.createElement(MetaItem, {
1981
+ hasSource: hasSource,
1982
+ bullets: true,
1983
+ type: isListened ? 'listened' : 'read'
1984
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1985
+ icon: isListened ? 'listened' : 'read',
1986
+ size: "unset"
1987
+ }))), isSlides && lang === 'ru' && ( /*#__PURE__*/React.createElement("div", {
1988
+ className: styles$s.bookmark
1989
+ }, /*#__PURE__*/React.createElement(BookmarkButton, {
1990
+ isInBookmarks: isInBookmarks,
1991
+ onClick: () => bookmarkAction('bookmark', 'top')
1992
+ }))))
1993
+ // </div>
1994
+ );
1983
1995
  };
1984
1996
 
1985
1997
  var styles$b = {"root":"DonatesTeaser-module_root__XQCVy","main":"DonatesTeaser-module_main__eN9kd","title":"DonatesTeaser-module_title__9umo1","text":"DonatesTeaser-module_text__s6tyf","cta":"DonatesTeaser-module_cta__-50aB","center":"DonatesTeaser-module_center__gxLvW","isInCard":"DonatesTeaser-module_isInCard__vaUhd","isInSlide":"DonatesTeaser-module_isInSlide__Dh4NH","ru":"DonatesTeaser-module_ru__y-PlJ","en":"DonatesTeaser-module_en__0Iisr"};