index.js
37 lines
| 1 | import FormBreakStart from './edit'; |
| 2 | import metadata from '@blocks/form-break-start/block.json'; |
| 3 | |
| 4 | const { name, icon = '' } = metadata; |
| 5 | |
| 6 | const { |
| 7 | __, |
| 8 | } = wp.i18n; |
| 9 | |
| 10 | /** |
| 11 | * Available items for `useEditProps`: |
| 12 | * - uniqKey |
| 13 | * - formFields |
| 14 | * - blockName |
| 15 | * - attrHelp |
| 16 | */ |
| 17 | const settings = { |
| 18 | icon: <span dangerouslySetInnerHTML={ { __html: icon } }></span>, |
| 19 | description: __( |
| 20 | `Add the Form Page Start block after the two first form fields |
| 21 | to start the new page not from the form beginning but from the block.`, |
| 22 | 'jet-form-builder', |
| 23 | ), |
| 24 | edit: FormBreakStart, |
| 25 | useEditProps: [ 'uniqKey', 'attrHelp', 'blockName' ], |
| 26 | example: { |
| 27 | attributes: { |
| 28 | isPreview: true, |
| 29 | }, |
| 30 | }, |
| 31 | }; |
| 32 | |
| 33 | export { |
| 34 | metadata, |
| 35 | name, |
| 36 | settings, |
| 37 | }; |