| 1 |
import {addFilter} from '@wordpress/hooks'; |
| 2 |
|
| 3 |
import addOfflineAttributes from './addOfflineAttributes'; |
| 4 |
import withOfflineInspectorControls from "./withOfflineInspectorControls"; |
| 5 |
|
| 6 |
declare const window: { |
| 7 |
giveOfflineGatewaySettings: { |
| 8 |
offlineEnabled: string; |
| 9 |
}; |
| 10 |
} & Window; |
| 11 |
|
| 12 |
addFilter( |
| 13 |
'blocks.registerBlockType', |
| 14 |
'givewp/stripe-payment-element', |
| 15 |
addOfflineAttributes |
| 16 |
); |
| 17 |
|
| 18 |
if (window.giveOfflineGatewaySettings.offlineEnabled) { |
| 19 |
addFilter('editor.BlockEdit', 'givewp/stripe-payment-element', withOfflineInspectorControls); |
| 20 |
} |
| 21 |
|