@meduza/ui-kit-2 0.8.628 → 0.8.629

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.
@@ -1852,7 +1852,6 @@ const MetaContainer = ({
1852
1852
  }
1853
1853
  },
1854
1854
  styleContext
1855
- // type
1856
1855
  }) => {
1857
1856
  const themeColor = styleContext && styleContext.indexOf('dark') !== -1 ? 'light' : 'unset';
1858
1857
  const isPodcast = styleContext && styleContext.indexOf('podcast') !== -1;
@@ -1864,134 +1863,107 @@ const MetaContainer = ({
1864
1863
  });
1865
1864
  }
1866
1865
  const hasSource = !!components.find(item => item.type === 'source_name');
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
- // )
1907
- // }
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
- );
1866
+ return /*#__PURE__*/React.createElement(Meta, {
1867
+ styleContext: context,
1868
+ theme: theme || themeColor,
1869
+ onlyOn: block.only_on,
1870
+ hasSource: hasSource
1871
+ }, components.map(component => {
1872
+ switch (component.type) {
1873
+ case 'source_name':
1874
+ {
1875
+ return /*#__PURE__*/React.createElement(MetaItem, {
1876
+ hasSource: hasSource,
1877
+ bullets: true,
1878
+ key: component.id
1879
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && ( /*#__PURE__*/React.createElement("a", {
1880
+ href: component.url,
1881
+ rel: "noopener noreferrer",
1882
+ target: "_blank"
1883
+ }, component.text)), !component.url && component.text));
1884
+ }
1885
+ case 'duration':
1886
+ {
1887
+ return /*#__PURE__*/React.createElement(MetaItem, {
1888
+ hasSource: hasSource,
1889
+ bullets: true,
1890
+ key: component.id
1891
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, styleContext !== 'isInDynamicBlock' && ( /*#__PURE__*/React.createElement(SvgSymbol, {
1892
+ icon: "podcast",
1893
+ size: "small"
1894
+ })), component.text));
1895
+ }
1896
+ case 'datetime':
1897
+ {
1898
+ const format = component.format && toCamel(component.format) || 'date';
1899
+ return /*#__PURE__*/React.createElement(MetaItem, {
1900
+ hasSource: hasSource,
1901
+ bullets: true,
1902
+ key: component.id,
1903
+ type: "datetime"
1904
+ }, /*#__PURE__*/React.createElement(Timestamp, {
1905
+ publishedAt: component.datetime,
1906
+ type: format || 'date',
1907
+ locale: lang
1908
+ }));
1909
+ }
1910
+ case 'items_count':
1911
+ {
1912
+ return /*#__PURE__*/React.createElement(MetaItem, {
1913
+ hasSource: hasSource,
1914
+ bullets: true,
1915
+ key: component.id
1916
+ }, /*#__PURE__*/React.createElement(DocumentItemsCount, {
1917
+ items: component.count,
1918
+ type: isPodcast ? 'podcast' : 'card',
1919
+ lang: lang
1920
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1921
+ icon: "card",
1922
+ size: "unset"
1923
+ })));
1924
+ }
1925
+ case 'broadcast_active':
1926
+ {
1927
+ return /*#__PURE__*/React.createElement(MetaItem, {
1928
+ hasSource: hasSource,
1929
+ bullets: true,
1930
+ key: component.id
1931
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
1932
+ }
1933
+ case 'broadcast':
1934
+ {
1935
+ return /*#__PURE__*/React.createElement(MetaItem, {
1936
+ hasSource: hasSource,
1937
+ bullets: true,
1938
+ key: component.id
1939
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, component.with_icon && /*#__PURE__*/React.createElement(MetaItemLive, null), component.label));
1940
+ }
1941
+ case 'string':
1942
+ {
1943
+ return /*#__PURE__*/React.createElement(MetaItem, {
1944
+ hasSource: hasSource,
1945
+ bullets: true,
1946
+ key: component.id
1947
+ }, component.text);
1948
+ }
1949
+ default:
1950
+ {
1951
+ return null;
1952
+ }
1953
+ }
1954
+ }), (isRead || isListened) && ( /*#__PURE__*/React.createElement(MetaItem, {
1955
+ hasSource: hasSource,
1956
+ bullets: true,
1957
+ type: isListened ? 'listened' : 'read'
1958
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1959
+ icon: isListened ? 'listened' : 'read',
1960
+ size: "unset"
1961
+ }))), isSlides && lang === 'ru' && ( /*#__PURE__*/React.createElement("div", {
1962
+ className: styles$s.bookmark
1963
+ }, /*#__PURE__*/React.createElement(BookmarkButton, {
1964
+ isInBookmarks: isInBookmarks,
1965
+ onClick: () => bookmarkAction('bookmark', 'top')
1966
+ }))));
1995
1967
  };
1996
1968
 
1997
1969
  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"};
@@ -2126,8 +2098,7 @@ const RenderBlocks = ({
2126
2098
  isRead,
2127
2099
  isListened,
2128
2100
  bookmarkAction,
2129
- isInBookmarks,
2130
- type = 'default'
2101
+ isInBookmarks
2131
2102
  }) => {
2132
2103
  switch (block.type) {
2133
2104
  case 'tag':
@@ -2162,8 +2133,7 @@ const RenderBlocks = ({
2162
2133
  isRead: isRead,
2163
2134
  isListened: isListened,
2164
2135
  isInBookmarks: isInBookmarks,
2165
- bookmarkAction: bookmarkAction,
2166
- type: type
2136
+ bookmarkAction: bookmarkAction
2167
2137
  });
2168
2138
  }
2169
2139
  case 'blockquote':
@@ -2702,8 +2672,7 @@ const RawHtmlBlock = ({
2702
2672
  isInBookmarks,
2703
2673
  bookmarkAction,
2704
2674
  lightBox,
2705
- lang,
2706
- type = 'default'
2675
+ lang
2707
2676
  }) => {
2708
2677
  const context = {
2709
2678
  lightBox: lightBox || null
@@ -2771,8 +2740,7 @@ const RawHtmlBlock = ({
2771
2740
  isListened: isListened,
2772
2741
  isInBookmarks: isInBookmarks,
2773
2742
  bookmarkAction: bookmarkAction,
2774
- lang: lang,
2775
- type: type
2743
+ lang: lang
2776
2744
  }));
2777
2745
  }
2778
2746
  }