| @@ -1,7 +1,7 @@ | ||
| 1 | -import blockStyleVariations from '@launch/_data/block-style-variations.json'; | |
| 2 | 1 | import themeJSON from '@launch/_data/theme-processed.json'; |
| 3 | 2 | import { usePreviewIframe } from '@launch/hooks/usePreviewIframe'; |
| 3 | +import { useVibeCss } from '@launch/hooks/useVibeCss'; | |
| 4 | 4 | import { getFontOverrides } from '@launch/lib/preview-helpers'; |
| 5 | 5 | import { hexTomatrixValues, lowerImageQuality } from '@launch/lib/util'; |
| 6 | 6 | import { pageNames } from '@shared/lib/pages'; |
| 7 | 7 | import { BlockPreview } from '@wordpress/block-editor'; |
| @@ -28,14 +28,13 @@ | ||
| 28 | 28 | const vibe = useMemo( |
| 29 | 29 | () => style?.siteStyle?.vibe, |
| 30 | 30 | [style?.siteStyle?.vibe], |
| 31 | 31 | ); |
| 32 | - const blockVariationCSS = useMemo(() => { | |
| 33 | - if (vibe && blockStyleVariations[vibe]) { | |
| 34 | - return blockStyleVariations[vibe]; | |
| 35 | - } | |
| 36 | - return blockStyleVariations['natural-1'] || ''; | |
| 37 | - }, [vibe]); | |
| 32 | + const { data: vibeCss } = useVibeCss(); | |
| 33 | + const blockVariationCSS = useMemo( | |
| 34 | + () => vibeCss?.[vibe] ?? vibeCss?.['natural-1'] ?? '', | |
| 35 | + [vibe, vibeCss], | |
| 36 | + ); | |
| 38 | 37 | |
| 39 | 38 | const onLoad = useCallback( |
| 40 | 39 | (frame) => { |
| 41 | 40 | frame.contentDocument?.getElementById('ext-tj')?.remove(); |