diff --git a/package-lock.json b/package-lock.json index d4f55677..04e446c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3318,12 +3318,12 @@ } }, "@quarkly/components": { - "version": "0.2.50", - "resolved": "https://registry.npmjs.org/@quarkly/components/-/components-0.2.50.tgz", - "integrity": "sha512-BqwjUvgZKLm40LwjsXrVm6A0ItI3u0F/jsWzQ3MHjKX3vtNOivHDpMjcxk/IHBdWUefyCsnB7FrY3eDslOT3fg==", + "version": "0.2.68", + "resolved": "https://registry.npmjs.org/@quarkly/components/-/components-0.2.68.tgz", + "integrity": "sha512-o/IomgsEaISr1P6EdCDsUZFMSo8FLR4PTbsbxz4j9yRUdse1ZoW3/a4pIFtOoZrcas73PpD3glYQ+BohoP4dKw==", "dev": true, "requires": { - "@quarkly/widgets": "^0.2.50", + "@quarkly/widgets": "^0.2.68", "@reach/router": "^1.3.4" } }, diff --git a/package.json b/package.json index 647bf76b..d0756393 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@babel/preset-env": "^7.14.2", "@babel/preset-react": "^7.13.13", "@quarkly/atomize": "^1.0.8", - "@quarkly/components": "^0.2.50", + "@quarkly/components": "^0.2.68", "@quarkly/sdk": "^0.5.4", "@quarkly/theme": "^0.1.3", "@quarkly/widgets": "^0.2.68", diff --git a/preview/docs/Picture.md b/preview/docs/Picture.md index c9aa2670..99eb678e 100644 --- a/preview/docs/Picture.md +++ b/preview/docs/Picture.md @@ -4,7 +4,7 @@ This container component provides an optimized image version for different scree ## ⚙️ Usage -Add the component to the page, than add an Image and/or Source components (optionally) to it, and see how it works in the preview mode. +Add the component to the page, than add an Source components (optionally) to it, and see how it works in the preview mode. ## 🗓 Changelog diff --git a/preview/docs/Vimeo.md b/preview/docs/Vimeo.md index db998bfa..5c2bb196 100644 --- a/preview/docs/Vimeo.md +++ b/preview/docs/Vimeo.md @@ -8,6 +8,12 @@ Use this component to add the Vimeo video player. 2. Specify the `Video link or ID` on the Props panel 3. See how it works in the preview mode +### Setting up the video player + +Some video player settings are supported for Plus or PRO accounts. + +Learn more: [Supported Player Parameters](https://help.vimeo.com/hc/en-us/articles/360001494447-Using-Player-Parameters#h_01FNYA7F7GKWE17XDQJPMBC058) + ### Playing in the background If the `Play in the background` prop is enabled, the video will be played in the background. In this case, all the controls are hidden, automatic playback is enabled, and the video loops. diff --git a/preview/docs/ru/Picture.md b/preview/docs/ru/Picture.md index eaa5e011..075a011b 100644 --- a/preview/docs/ru/Picture.md +++ b/preview/docs/ru/Picture.md @@ -4,7 +4,7 @@ ## ⚙️ Использование -Добавьте компонент на страницу, поместите в него компоненты `Image` и `Source` (опционально), затем посмотрите как он работает в режиме превью. +Добавьте компонент на страницу, поместите в него компоненты `Source` (опционально), затем посмотрите как он работает в режиме превью. ## 🗓 Changelog diff --git a/src/BeforeAfterImage.js b/src/BeforeAfterImage.js index 0baf825c..ddd46b6f 100644 --- a/src/BeforeAfterImage.js +++ b/src/BeforeAfterImage.js @@ -210,7 +210,11 @@ const BeforeAfterImage = ({ }} > - + - + + - {children} + + {children} + {!imageURL && ( + + )} + ); }; diff --git a/src/CardFlip/CardFlip.js b/src/CardFlip/CardFlip.js index 1e34489d..04a1a650 100644 --- a/src/CardFlip/CardFlip.js +++ b/src/CardFlip/CardFlip.js @@ -1,7 +1,7 @@ -import React, { useCallback, useState, useEffect } from 'react'; +import React, { useCallback, useState, useEffect, useRef } from 'react'; import { useOverrides } from '@quarkly/components'; -import { Box, Image } from '@quarkly/widgets'; -import { parseTime } from '../utils'; +import { Box, Placeholder } from '@quarkly/widgets'; +import { isEmptyChildren, parseTime } from '../utils'; const overrides = { 'Card Flip Content': { @@ -37,17 +37,6 @@ const overrides = { position: 'absolute', }, }, - 'Card Flip Item Face': { - kind: 'Box', - }, - 'Card Flip Item Back': { - kind: 'Box', - props: { - padding: '24px 16px', - background: '--color-lightD2', - 'box-sizing': 'border-box', - }, - }, }; const flipStyles = { @@ -83,26 +72,50 @@ const CardFlip = ({ isFlippedProp, ...props }) => { - const { override, children, rest } = useOverrides(props, overrides); + const { override, ChildPlaceholder, rest } = useOverrides(props, overrides); const [isFlipped, setFlipped] = useState(isFlippedProp); + const [isFlipEnd, setFlipEnd] = useState(true); const flipTrigger = flipTriggerProp === 'click'; const flipDuration = parseTime(flipDurationProp); const onClickFlip = useCallback(() => { - if (flipTrigger) setFlipped((prevFlipped) => !prevFlipped); + if (flipTrigger) { + setFlipped((prevFlipped) => !prevFlipped); + setFlipEnd(false); + } }, [flipTrigger]); const onHoverFlip = useCallback(() => { - if (!flipTrigger) setFlipped((prevFlipped) => !prevFlipped); + if (!flipTrigger) { + setFlipped((prevFlipped) => !prevFlipped); + setFlipEnd(false); + } }, [flipTrigger]); useEffect(() => { setFlipped(isFlippedProp); }, [isFlippedProp]); + const boxRef = useRef(); + + useEffect(() => { + if (!boxRef.current) return; + const box = boxRef.current; + + const handle = () => { + setFlipEnd(true); + }; + + box.addEventListener('transitionend', handle); + + return () => { + box.removeEventListener('transitionend', handle); + }; + }, []); + return ( - - + + + {isEmptyChildren( + override('Card Flip Item Face').children + ) && } - {children} + + {isEmptyChildren( + override('Card Flip Item Back').children + ) && } diff --git a/src/Collapse/Collapse.js b/src/Collapse/Collapse.js index f3503196..2b6f5f05 100644 --- a/src/Collapse/Collapse.js +++ b/src/Collapse/Collapse.js @@ -96,6 +96,10 @@ const Collapse = ({ ref.current.addEventListener('transitionend', handle); }, [animFunction, collapsedHeight, destination, duration, handle, mode]); + const buttonOveride = `Button ${ + isOpen !== isCollapsing ? ':open' : ':close' + }`; + return ( -