| 1 |
import {useFormContext, useFormState, useWatch} from 'react-hook-form'; |
| 2 |
import useCurrencyFormatter from '@givewp/forms/app/hooks/useCurrencyFormatter'; |
| 3 |
import useDonationSummary from '@givewp/forms/app/hooks/useDonationSummary'; |
| 4 |
import {useDonationFormSettings} from '@givewp/forms/app/store/form-settings'; |
| 5 |
import useFormSubmitButton from '@givewp/forms/app/hooks/useFormSubmitButton'; |
| 6 |
import useFormData from '@givewp/forms/app/hooks/useFormData'; |
| 7 |
|
| 8 |
/** |
| 9 |
* |
| 10 |
* This mounts data to the window object, so it can be accessed by form designs and add-ons |
| 11 |
* |
| 12 |
* @since 3.0.0 |
| 13 |
*/ |
| 14 |
export default function mountWindowData(): void { |
| 15 |
window.givewp.form.hooks = { |
| 16 |
useFormContext, |
| 17 |
useWatch, |
| 18 |
useFormState, |
| 19 |
useCurrencyFormatter, |
| 20 |
useDonationSummary, |
| 21 |
useDonationFormSettings, |
| 22 |
useFormSubmitButton, |
| 23 |
useFormData |
| 24 |
}; |
| 25 |
} |
| 26 |
|