@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/dist/Image/Image.types.d.ts +0 -1
- package/dist/ui-kit-2.cjs.development.js +34 -41
- 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 +34 -41
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1678 -1678
- package/package.json +1 -1
- package/src/EmbedBlock/EmbedBlock.tsx +0 -1
- package/src/Image/Image.types.ts +0 -1
- package/src/Image/index.tsx +3 -18
- package/src/Spoiler/index.tsx +2 -2
package/package.json
CHANGED
package/src/Image/Image.types.ts
CHANGED
package/src/Image/index.tsx
CHANGED
|
@@ -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
|
-
|
|
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) {
|
package/src/Spoiler/index.tsx
CHANGED
|
@@ -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 {
|
|
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
|
-
<
|
|
63
|
+
<RenderBlocks key={item.id} block={item} styleContext={context} />
|
|
64
64
|
))}
|
|
65
65
|
</div>
|
|
66
66
|
<div className={styles.footer}>
|