| 1 |
import getIcon from '../../utils/get-icon'; |
| 2 |
import metadata from './block.json'; |
| 3 |
import edit from './edit'; |
| 4 |
import save from './save'; |
| 5 |
import transforms from './transforms'; |
| 6 |
|
| 7 |
const { name } = metadata; |
| 8 |
export { metadata, name }; |
| 9 |
|
| 10 |
import { __ } from '@wordpress/i18n'; |
| 11 |
|
| 12 |
export const settings = { |
| 13 |
icon: getIcon('block-video', true), |
| 14 |
ghostkit: { |
| 15 |
previewUrl: 'https://www.ghostkit.io/docs/blocks/video/', |
| 16 |
customStylesCallback(attributes) { |
| 17 |
const { videoBackgroundColor, videoBackgroundGradient } = |
| 18 |
attributes; |
| 19 |
|
| 20 |
const styles = { |
| 21 |
video: { |
| 22 |
'background-color': videoBackgroundColor || undefined, |
| 23 |
'background-image': videoBackgroundGradient || undefined, |
| 24 |
}, |
| 25 |
}; |
| 26 |
|
| 27 |
return styles; |
| 28 |
}, |
| 29 |
}, |
| 30 |
example: { |
| 31 |
attributes: { |
| 32 |
poster: 1, |
| 33 |
posterUrl: |
| 34 |
'https://s.w.org/images/core/5.3/Glacial_lakes,_Bhutan.jpg', |
| 35 |
}, |
| 36 |
}, |
| 37 |
styles: [ |
| 38 |
{ |
| 39 |
name: 'default', |
| 40 |
label: __('Plain', 'ghostkit'), |
| 41 |
isDefault: true, |
| 42 |
}, |
| 43 |
{ |
| 44 |
name: 'icon-only', |
| 45 |
label: __('Icon Only', 'ghostkit'), |
| 46 |
}, |
| 47 |
], |
| 48 |
edit, |
| 49 |
save, |
| 50 |
transforms, |
| 51 |
}; |
| 52 |
|