action-buttons
2 years ago
action-fields-map
2 years ago
action-modal
2 years ago
actions
2 years ago
block-conditions
2 years ago
blocks
2 years ago
components
2 years ago
context
2 years ago
dynamic.value
2 years ago
events
2 years ago
gateways
2 years ago
hooks
2 years ago
macros.button
2 years ago
migrations
2 years ago
preset
2 years ago
repeater
2 years ago
validation
2 years ago
manager.js
2 years ago
store.manager.js
2 years ago
tools.js
2 years ago
store.manager.js
55 lines
| 1 | import actions from './actions/store'; |
| 2 | import gateways from './gateways/store'; |
| 3 | import events from './events/store'; |
| 4 | import blockConditions from './block-conditions/store'; |
| 5 | import actionButtons from './action-buttons/store'; |
| 6 | import macros from './macros.button/store'; |
| 7 | import validation from './validation/store'; |
| 8 | import fields from './blocks/store'; |
| 9 | import './migrations/migrate.gateways.settings'; |
| 10 | |
| 11 | const { |
| 12 | register, |
| 13 | dispatch, |
| 14 | } = wp.data; |
| 15 | const { |
| 16 | addAction, |
| 17 | } = wp.hooks; |
| 18 | |
| 19 | const stores = [ |
| 20 | gateways, |
| 21 | events, |
| 22 | actions, |
| 23 | actionButtons, |
| 24 | blockConditions, |
| 25 | macros, |
| 26 | validation, |
| 27 | fields, |
| 28 | ]; |
| 29 | |
| 30 | stores.forEach( register ); |
| 31 | |
| 32 | dispatch( 'jet-forms/events' ).register( window.jetFormEvents.types ); |
| 33 | dispatch( 'jet-forms/events' ).lockActions(); |
| 34 | dispatch( 'jet-forms/validation' ).register( window.jetFormValidation ); |
| 35 | |
| 36 | addAction( |
| 37 | 'jet.fb.change.blockConditions.renderState', |
| 38 | 'jet-form-builder/events', |
| 39 | function ( states ) { |
| 40 | dispatch( 'jet-forms/events' ).clearDynamicEvents(); |
| 41 | |
| 42 | const events = states.map( ( { value } ) => { |
| 43 | value = 'ON.' + value; |
| 44 | |
| 45 | return { value, label: value, isDynamic: true }; |
| 46 | } ); |
| 47 | |
| 48 | dispatch( 'jet-forms/events' ).register( events ); |
| 49 | }, |
| 50 | ); |
| 51 | |
| 52 | dispatch( 'jet-forms/block-conditions' ).register( |
| 53 | window.jetFormBlockConditions, |
| 54 | ); |
| 55 |