@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.
@@ -9,7 +9,6 @@ export interface MetaContainerProps {
9
9
  bookmarkAction?: (service: CallToActions, place: string) => void;
10
10
  lightBox?: () => void;
11
11
  lang: 'ru' | 'en';
12
- type?: any;
13
12
  }
14
13
  export interface MetaProps {
15
14
  onlyOn?: string;
@@ -14,5 +14,4 @@ export interface RawHtmlBlockProps {
14
14
  bookmarkAction?: (service: CallToActions, place: string) => void;
15
15
  lightBox?: LightboxContext | null | undefined;
16
16
  lang?: 'ru' | 'en';
17
- type?: any;
18
17
  }
@@ -8,5 +8,4 @@ export interface RenderBlocksProps {
8
8
  bookmarkAction?: (service: CallToActions, place: string) => void;
9
9
  lightBox?: LightboxContext | null | undefined;
10
10
  lang?: 'ru' | 'en';
11
- type?: any;
12
11
  }
@@ -1856,7 +1856,6 @@ const MetaContainer = ({
1856
1856
  }
1857
1857
  },
1858
1858
  styleContext
1859
- // type
1860
1859
  }) => {
1861
1860
  const themeColor = styleContext && styleContext.indexOf('dark') !== -1 ? 'light' : 'unset';
1862
1861
  const isPodcast = styleContext && styleContext.indexOf('podcast') !== -1;
@@ -1868,134 +1867,107 @@ const MetaContainer = ({
1868
1867
  });
1869
1868
  }
1870
1869
  const hasSource = !!components.find(item => item.type === 'source_name');
1871
- // const classNames: ClassNames = [
1872
- // [
1873
- // styles.containerInDynamicBlock,
1874
- // styleContext === 'isInDynamicBlock' || styleContext.includes('episode')
1875
- // ],
1876
- // [
1877
- // styles.containerInDynamicBlockAndMaterial,
1878
- // styleContext === 'isInDynamicBlock' && type === 'isInMaterial'
1879
- // ]
1880
- // ]
1881
- return (
1882
- /*#__PURE__*/
1883
- // <div className={makeClassName(classNames)}>
1884
- React.createElement(Meta, {
1885
- styleContext: context,
1886
- theme: theme || themeColor,
1887
- onlyOn: block.only_on,
1888
- hasSource: hasSource
1889
- }, components.map(component => {
1890
- switch (component.type) {
1891
- case 'source_name':
1892
- {
1893
- return /*#__PURE__*/React.createElement(MetaItem, {
1894
- hasSource: hasSource,
1895
- bullets: true,
1896
- key: component.id
1897
- }, /*#__PURE__*/React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && ( /*#__PURE__*/React.createElement("a", {
1898
- href: component.url,
1899
- rel: "noopener noreferrer",
1900
- target: "_blank"
1901
- }, component.text)), !component.url && component.text));
1902
- }
1903
- case 'duration':
1904
- {
1905
- // if (styleContext === 'isInDynamicBlock') {
1906
- // return (
1907
- // <MetaItem hasSource={hasSource} bullets key={component.id}>
1908
- // {component.text}
1909
- // </MetaItem>
1910
- // )
1911
- // }
1912
- return /*#__PURE__*/React.createElement(MetaItem, {
1913
- hasSource: hasSource,
1914
- bullets: true,
1915
- key: component.id
1916
- }, /*#__PURE__*/React.createElement(React.Fragment, null, styleContext !== 'isInDynamicBlock' && ( /*#__PURE__*/React.createElement(SvgSymbol, {
1917
- icon: "podcast",
1918
- size: "small"
1919
- })), component.text));
1920
- }
1921
- case 'datetime':
1922
- {
1923
- const format = component.format && toCamel(component.format) || 'date';
1924
- return /*#__PURE__*/React.createElement(MetaItem, {
1925
- hasSource: hasSource,
1926
- bullets: true,
1927
- key: component.id,
1928
- type: "datetime"
1929
- }, /*#__PURE__*/React.createElement(Timestamp, {
1930
- publishedAt: component.datetime,
1931
- // type={
1932
- // styleContext === 'isInDynamicBlock'
1933
- // ? 'fromNow'
1934
- // : format || 'date'
1935
- // }
1936
- type: format || 'date',
1937
- locale: lang
1938
- }));
1939
- }
1940
- case 'items_count':
1941
- {
1942
- return /*#__PURE__*/React.createElement(MetaItem, {
1943
- hasSource: hasSource,
1944
- bullets: true,
1945
- key: component.id
1946
- }, /*#__PURE__*/React.createElement(DocumentItemsCount, {
1947
- items: component.count,
1948
- type: isPodcast ? 'podcast' : 'card',
1949
- lang: lang
1950
- }, /*#__PURE__*/React.createElement(SvgSymbol, {
1951
- icon: "card",
1952
- size: "unset"
1953
- })));
1954
- }
1955
- case 'broadcast_active':
1956
- {
1957
- return /*#__PURE__*/React.createElement(MetaItem, {
1958
- hasSource: hasSource,
1959
- bullets: true,
1960
- key: component.id
1961
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
1962
- }
1963
- case 'broadcast':
1964
- {
1965
- return /*#__PURE__*/React.createElement(MetaItem, {
1966
- hasSource: hasSource,
1967
- bullets: true,
1968
- key: component.id
1969
- }, /*#__PURE__*/React.createElement(React.Fragment, null, component.with_icon && /*#__PURE__*/React.createElement(MetaItemLive, null), component.label));
1970
- }
1971
- case 'string':
1972
- {
1973
- return /*#__PURE__*/React.createElement(MetaItem, {
1974
- hasSource: hasSource,
1975
- bullets: true,
1976
- key: component.id
1977
- }, component.text);
1978
- }
1979
- default:
1980
- {
1981
- return null;
1982
- }
1983
- }
1984
- }), (isRead || isListened) && ( /*#__PURE__*/React.createElement(MetaItem, {
1985
- hasSource: hasSource,
1986
- bullets: true,
1987
- type: isListened ? 'listened' : 'read'
1988
- }, /*#__PURE__*/React.createElement(SvgSymbol, {
1989
- icon: isListened ? 'listened' : 'read',
1990
- size: "unset"
1991
- }))), isSlides && lang === 'ru' && ( /*#__PURE__*/React.createElement("div", {
1992
- className: styles$s.bookmark
1993
- }, /*#__PURE__*/React.createElement(BookmarkButton, {
1994
- isInBookmarks: isInBookmarks,
1995
- onClick: () => bookmarkAction('bookmark', 'top')
1996
- }))))
1997
- // </div>
1998
- );
1870
+ return /*#__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
+ return /*#__PURE__*/React.createElement(MetaItem, {
1892
+ hasSource: hasSource,
1893
+ bullets: true,
1894
+ key: component.id
1895
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, styleContext !== 'isInDynamicBlock' && ( /*#__PURE__*/React.createElement(SvgSymbol, {
1896
+ icon: "podcast",
1897
+ size: "small"
1898
+ })), component.text));
1899
+ }
1900
+ case 'datetime':
1901
+ {
1902
+ const format = component.format && toCamel(component.format) || 'date';
1903
+ return /*#__PURE__*/React.createElement(MetaItem, {
1904
+ hasSource: hasSource,
1905
+ bullets: true,
1906
+ key: component.id,
1907
+ type: "datetime"
1908
+ }, /*#__PURE__*/React.createElement(Timestamp, {
1909
+ publishedAt: component.datetime,
1910
+ type: format || 'date',
1911
+ locale: lang
1912
+ }));
1913
+ }
1914
+ case 'items_count':
1915
+ {
1916
+ return /*#__PURE__*/React.createElement(MetaItem, {
1917
+ hasSource: hasSource,
1918
+ bullets: true,
1919
+ key: component.id
1920
+ }, /*#__PURE__*/React.createElement(DocumentItemsCount, {
1921
+ items: component.count,
1922
+ type: isPodcast ? 'podcast' : 'card',
1923
+ lang: lang
1924
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1925
+ icon: "card",
1926
+ size: "unset"
1927
+ })));
1928
+ }
1929
+ case 'broadcast_active':
1930
+ {
1931
+ return /*#__PURE__*/React.createElement(MetaItem, {
1932
+ hasSource: hasSource,
1933
+ bullets: true,
1934
+ key: component.id
1935
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
1936
+ }
1937
+ case 'broadcast':
1938
+ {
1939
+ return /*#__PURE__*/React.createElement(MetaItem, {
1940
+ hasSource: hasSource,
1941
+ bullets: true,
1942
+ key: component.id
1943
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, component.with_icon && /*#__PURE__*/React.createElement(MetaItemLive, null), component.label));
1944
+ }
1945
+ case 'string':
1946
+ {
1947
+ return /*#__PURE__*/React.createElement(MetaItem, {
1948
+ hasSource: hasSource,
1949
+ bullets: true,
1950
+ key: component.id
1951
+ }, component.text);
1952
+ }
1953
+ default:
1954
+ {
1955
+ return null;
1956
+ }
1957
+ }
1958
+ }), (isRead || isListened) && ( /*#__PURE__*/React.createElement(MetaItem, {
1959
+ hasSource: hasSource,
1960
+ bullets: true,
1961
+ type: isListened ? 'listened' : 'read'
1962
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1963
+ icon: isListened ? 'listened' : 'read',
1964
+ size: "unset"
1965
+ }))), isSlides && lang === 'ru' && ( /*#__PURE__*/React.createElement("div", {
1966
+ className: styles$s.bookmark
1967
+ }, /*#__PURE__*/React.createElement(BookmarkButton, {
1968
+ isInBookmarks: isInBookmarks,
1969
+ onClick: () => bookmarkAction('bookmark', 'top')
1970
+ }))));
1999
1971
  };
2000
1972
 
2001
1973
  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"};
@@ -2130,8 +2102,7 @@ const RenderBlocks = ({
2130
2102
  isRead,
2131
2103
  isListened,
2132
2104
  bookmarkAction,
2133
- isInBookmarks,
2134
- type = 'default'
2105
+ isInBookmarks
2135
2106
  }) => {
2136
2107
  switch (block.type) {
2137
2108
  case 'tag':
@@ -2166,8 +2137,7 @@ const RenderBlocks = ({
2166
2137
  isRead: isRead,
2167
2138
  isListened: isListened,
2168
2139
  isInBookmarks: isInBookmarks,
2169
- bookmarkAction: bookmarkAction,
2170
- type: type
2140
+ bookmarkAction: bookmarkAction
2171
2141
  });
2172
2142
  }
2173
2143
  case 'blockquote':
@@ -2706,8 +2676,7 @@ const RawHtmlBlock = ({
2706
2676
  isInBookmarks,
2707
2677
  bookmarkAction,
2708
2678
  lightBox,
2709
- lang,
2710
- type = 'default'
2679
+ lang
2711
2680
  }) => {
2712
2681
  const context = {
2713
2682
  lightBox: lightBox || null
@@ -2775,8 +2744,7 @@ const RawHtmlBlock = ({
2775
2744
  isListened: isListened,
2776
2745
  isInBookmarks: isInBookmarks,
2777
2746
  bookmarkAction: bookmarkAction,
2778
- lang: lang,
2779
- type: type
2747
+ lang: lang
2780
2748
  }));
2781
2749
  }
2782
2750
  }