options.js
117 lines
| 1 | import { applyFilters } from '@wordpress/hooks'; |
| 2 | import { __ } from '@wordpress/i18n'; |
| 3 | |
| 4 | const flexOptions = { |
| 5 | flexDirection: [ |
| 6 | { |
| 7 | label: __( 'Row', 'generateblocks' ), |
| 8 | value: 'row', |
| 9 | }, |
| 10 | { |
| 11 | label: __( 'Column', 'generateblocks' ), |
| 12 | value: 'column', |
| 13 | }, |
| 14 | ], |
| 15 | flexWrap: [ |
| 16 | { |
| 17 | label: __( 'No Wrap', 'generateblocks' ), |
| 18 | value: 'nowrap', |
| 19 | }, |
| 20 | { |
| 21 | label: __( 'Wrap', 'generateblocks' ), |
| 22 | value: 'wrap', |
| 23 | }, |
| 24 | { |
| 25 | label: __( 'Reverse Wrap', 'generateblocks' ), |
| 26 | value: 'wrap-reverse', |
| 27 | }, |
| 28 | ], |
| 29 | alignItems: [ |
| 30 | { |
| 31 | value: 'flex-start', |
| 32 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M0 0h16v1H0z" /><path fill="currentColor" stroke="currentColor" d="M3.5 2.5h3v7h-3zm5 0h3v5h-3z" /></svg>, |
| 33 | }, |
| 34 | { |
| 35 | value: 'center', |
| 36 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" stroke="currentColor" d="M3.5 3.5h3v8h-3zm5 1h3v6h-3z" /><path fill="currentColor" d="M0 7h16v1H0z" /></svg>, |
| 37 | }, |
| 38 | { |
| 39 | value: 'flex-end', |
| 40 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M0 15h16v1H0z" /><path fill="currentColor" stroke="currentColor" d="M3.5 6.5h3v7h-3zm5 2h3v5h-3z" /></svg>, |
| 41 | }, |
| 42 | { |
| 43 | value: 'stretch', |
| 44 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M0 0h16v1H0zm0 15h16v1H0z" /><path fill="currentColor" stroke="currentColor" d="M3.5 2.5h3v11h-3zm5 0h3v11h-3z" /></svg>, |
| 45 | }, |
| 46 | { |
| 47 | value: 'baseline', |
| 48 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M0 7h16v1H0z" /><path fillRule="evenodd" clipRule="evenodd" d="M12 3H8v7h4V3zm-1 1H9v3h2V4zM7 3H3v9h4V3zM6 4H4v3h2V4z" fill="currentColor" /></svg>, |
| 49 | }, |
| 50 | ], |
| 51 | justifyContent: [ |
| 52 | { |
| 53 | value: 'flex-start', |
| 54 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" stroke="currentColor" d="M2.5 4.5h3v7h-3zm5 0h3v7h-3z" /><path fill="currentColor" d="M0 0h1v16H0z" /></svg>, |
| 55 | }, |
| 56 | { |
| 57 | value: 'center', |
| 58 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" stroke="currentColor" d="M2.5 4.5h3v7h-3zm7 0h3v7h-3z" /><path fill="currentColor" d="M7 0h1v16H7z" /></svg>, |
| 59 | }, |
| 60 | { |
| 61 | value: 'flex-end', |
| 62 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M15 0h1v16h-1z" /><path fill="currentColor" stroke="currentColor" d="M5.5 4.5h3v7h-3zm5 0h3v7h-3z" /></svg>, |
| 63 | }, |
| 64 | { |
| 65 | value: 'space-between', |
| 66 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M15 0h1v16h-1zM0 0h1v16H0z" /><path fill="currentColor" stroke="currentColor" d="M10.5 4.5h3v7h-3zm-8 0h3v7h-3z" /></svg>, |
| 67 | }, |
| 68 | { |
| 69 | value: 'space-around', |
| 70 | icon: <svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M15 0h1v16h-1zM0 0h1v16H0z" /><path fill="currentColor" stroke="currentColor" d="M9.5 4.5h3v7h-3zm-6 0h3v7h-3z" /></svg>, |
| 71 | }, |
| 72 | ], |
| 73 | }; |
| 74 | |
| 75 | const positionOptions = applyFilters( |
| 76 | 'generateblocks.editor.layoutPositionOptions', |
| 77 | [ |
| 78 | { |
| 79 | label: __( 'Default', 'generateblocks' ), |
| 80 | value: '', |
| 81 | }, |
| 82 | { |
| 83 | label: __( 'Relative', 'generateblocks' ), |
| 84 | value: 'relative', |
| 85 | }, |
| 86 | ] |
| 87 | ); |
| 88 | |
| 89 | const overflowOptions = [ |
| 90 | { |
| 91 | label: __( 'Default', 'generateblocks' ), |
| 92 | value: '', |
| 93 | }, |
| 94 | { |
| 95 | label: __( 'Visible', 'generateblocks' ), |
| 96 | value: 'visible', |
| 97 | }, |
| 98 | { |
| 99 | label: __( 'Hidden', 'generateblocks' ), |
| 100 | value: 'hidden', |
| 101 | }, |
| 102 | { |
| 103 | label: __( 'Scroll', 'generateblocks' ), |
| 104 | value: 'scroll', |
| 105 | }, |
| 106 | { |
| 107 | label: __( 'Auto', 'generateblocks' ), |
| 108 | value: 'auto', |
| 109 | }, |
| 110 | ]; |
| 111 | |
| 112 | export { |
| 113 | flexOptions, |
| 114 | positionOptions, |
| 115 | overflowOptions, |
| 116 | }; |
| 117 |