@meduza/ui-kit-2 0.1.51 → 0.1.52

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.51",
2
+ "version": "0.1.52",
3
3
  "license": "MIT",
4
4
  "description": "UIKit for Meduza",
5
5
  "repository": "https://github.com/meduza-corp/ui-kit-2.git",
@@ -70,7 +70,6 @@ export const EmbedBlock: React.FC<EmbedBlockProps> = ({
70
70
  alt={block.data.caption}
71
71
  display={block.data.display}
72
72
  lazy={block.data.lazy}
73
- fullscreen={block.data.fullscreen}
74
73
  styleContext={styleContext}
75
74
  />
76
75
  </div>
@@ -16,7 +16,6 @@ export interface ImageProps {
16
16
  source?: string[]
17
17
  lazy?: boolean
18
18
  ratio?: number
19
- fullscreen?: boolean | undefined
20
19
  styleContext?: string[] | string
21
20
  }
22
21
 
@@ -4,9 +4,6 @@ import { makeClassName, ClassNames } from '../utils/makeClassName'
4
4
  import makeStyleContext from '../utils/makeStyleContext'
5
5
  import BlockContext from '../utils/BlockContext'
6
6
  import postMessage from '../utils/postMessage'
7
- import viewportSize from '../utils/viewportSize'
8
- import { MediaQuerySizes } from '../constants'
9
-
10
7
  import { Lazy } from '../Lazy'
11
8
  import RenderPicture from './RenderPicture'
12
9
 
@@ -21,22 +18,13 @@ export const Image: React.FC<ImageProps> = ({
21
18
  source,
22
19
  lazy,
23
20
  ratio,
24
- styleContext,
25
- fullscreen
21
+ styleContext
26
22
  }) => {
27
23
  const { lightBox } = useContext(BlockContext)
28
24
  const [isLoaded, setIsLoaded] = useState(lazy ? false : true)
29
25
 
30
26
  const handleClick = (): void => {
31
- const { width: viewportWidth } = viewportSize()
32
- const disableFullscreenDesktop =
33
- viewportWidth >= MediaQuerySizes.LANDSCAPE_TABLET && !fullscreen
34
-
35
- if (
36
- disableFullscreenDesktop ||
37
- !lightBox ||
38
- (optimized && !optimized.original)
39
- ) {
27
+ if (!lightBox || (optimized && !optimized.original)) {
40
28
  return
41
29
  }
42
30
 
@@ -61,10 +49,7 @@ export const Image: React.FC<ImageProps> = ({
61
49
  let classNames: ClassNames = [
62
50
  [styles.root, true],
63
51
  [styles.isLoaded, isLoaded],
64
- [
65
- styles.fullscreen,
66
- fullscreen && lightBox && optimized && optimized.original
67
- ]
52
+ [styles.fullscreen, lightBox && optimized && optimized.original]
68
53
  ]
69
54
 
70
55
  if (styleContext) {
@@ -4,7 +4,7 @@ import { makeClassName, ClassNames } from '../utils/makeClassName'
4
4
  import makeStyleContext from '../utils/makeStyleContext'
5
5
 
6
6
  import postMessage from '../utils/postMessage'
7
- import { RawHtmlBlock } from '../RawHtmlBlock'
7
+ import { RenderBlocks } from '../RenderBlocks'
8
8
  import { Button } from '../Button'
9
9
  import { SvgSymbol } from '../SvgSymbol'
10
10
 
@@ -60,7 +60,7 @@ export const Spoiler: React.FC<SpoilerProps> = ({
60
60
  <div className={styles.header}>{title && <h3>{title}</h3>}</div>
61
61
  <div className={styles.body}>
62
62
  {blocks.map((item) => (
63
- <RawHtmlBlock key={item.id} block={item} styleContext={context} />
63
+ <RenderBlocks key={item.id} block={item} styleContext={context} />
64
64
  ))}
65
65
  </div>
66
66
  <div className={styles.footer}>