@tap-payments/apple-pay-button 0.0.64-development → 0.0.66-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/build/@types/ApplePayButtonProps.d.ts +1 -2
  2. package/build/@types/enums.d.ts +2 -8
  3. package/build/@types/enums.js +1 -8
  4. package/build/api.d.ts +34 -0
  5. package/build/{api/app.service.js → api.js} +36 -107
  6. package/build/constants/index.d.ts +2 -7
  7. package/build/constants/index.js +2 -7
  8. package/build/features/ApplePayButton/ApplePayButton.d.ts +0 -1
  9. package/build/features/ApplePayButton/ApplePayButton.js +9 -8
  10. package/build/hooks/index.d.ts +0 -1
  11. package/build/hooks/index.js +0 -1
  12. package/build/hooks/useApplePay.d.ts +9 -13
  13. package/build/hooks/useApplePay.js +25 -58
  14. package/build/hooks/useMerchantApplePay.js +2 -2
  15. package/build/index.d.ts +2 -2
  16. package/build/index.js +2 -3
  17. package/build/utils/config.d.ts +0 -2
  18. package/build/utils/config.js +0 -18
  19. package/build/utils/defaultValues.d.ts +1 -71
  20. package/build/utils/defaultValues.js +1 -23
  21. package/package.json +3 -4
  22. package/build/api/app.service.d.ts +0 -27
  23. package/build/api/base.d.ts +0 -9
  24. package/build/api/base.js +0 -45
  25. package/build/api/httpClient.d.ts +0 -22
  26. package/build/api/httpClient.js +0 -36
  27. package/build/assets/gif/error-black.gif +0 -0
  28. package/build/assets/gif/error-white.gif +0 -0
  29. package/build/assets/gif/success-black.gif +0 -0
  30. package/build/assets/gif/success-white.gif +0 -0
  31. package/build/assets/lottie/Dark_Mode_Loader.json +0 -255
  32. package/build/assets/lottie/Light_Mode_Loader.json +0 -255
  33. package/build/components/ActionButton/ActionButton.d.ts +0 -24
  34. package/build/components/ActionButton/ActionButton.js +0 -62
  35. package/build/components/ActionButton/index.d.ts +0 -2
  36. package/build/components/ActionButton/index.js +0 -2
  37. package/build/components/InitialLoader/InitialLoader.d.ts +0 -9
  38. package/build/components/InitialLoader/InitialLoader.js +0 -26
  39. package/build/components/InitialLoader/index.d.ts +0 -2
  40. package/build/components/InitialLoader/index.js +0 -2
  41. package/build/components/Loader/Loader.d.ts +0 -24
  42. package/build/components/Loader/Loader.js +0 -48
  43. package/build/components/Loader/index.d.ts +0 -2
  44. package/build/components/Loader/index.js +0 -2
  45. package/build/components/PayButton/PayButton.d.ts +0 -16
  46. package/build/components/PayButton/PayButton.js +0 -40
  47. package/build/components/PayButton/index.d.ts +0 -2
  48. package/build/components/PayButton/index.js +0 -2
  49. package/build/components/PayButton/style.d.ts +0 -5
  50. package/build/components/PayButton/style.js +0 -19
  51. package/build/features/ApplePayButton/ApplePayButton.css +0 -21
  52. package/build/features/ApplePayButton/style.d.ts +0 -5
  53. package/build/features/ApplePayButton/style.js +0 -20
  54. package/build/hooks/useScript.d.ts +0 -3
  55. package/build/hooks/useScript.js +0 -40
@@ -1,40 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- export function useScript(src, async) {
3
- if (async === void 0) { async = true; }
4
- var _a = useState(src ? 'loading' : 'idle'), status = _a[0], setStatus = _a[1];
5
- useEffect(function () {
6
- if (!src) {
7
- setStatus('idle');
8
- return;
9
- }
10
- var script = document.querySelector("script[src=\"".concat(src, "\"]"));
11
- if (!script) {
12
- script = document.createElement('script');
13
- script.src = src;
14
- script.async = async;
15
- script.setAttribute('data-status', 'loading');
16
- document.body.appendChild(script);
17
- var setAttributeFromEvent = function (event) {
18
- script === null || script === void 0 ? void 0 : script.setAttribute('data-status', event.type === 'load' ? 'ready' : 'error');
19
- };
20
- script.addEventListener('load', setAttributeFromEvent);
21
- script.addEventListener('error', setAttributeFromEvent);
22
- }
23
- else {
24
- var status_1 = script === null || script === void 0 ? void 0 : script.getAttribute('data-status');
25
- setStatus(status_1);
26
- }
27
- var setStateFromEvent = function (event) {
28
- setStatus(event.type === 'load' ? 'ready' : 'error');
29
- };
30
- script.addEventListener('load', setStateFromEvent);
31
- script.addEventListener('error', setStateFromEvent);
32
- return function () {
33
- if (script) {
34
- script.removeEventListener('load', setStateFromEvent);
35
- script.removeEventListener('error', setStateFromEvent);
36
- }
37
- };
38
- }, [src]);
39
- return status;
40
- }