@tagadapay/plugin-sdk 2.8.8 → 2.8.9

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 (41) hide show
  1. package/dist/react/config/environment.d.ts +1 -22
  2. package/dist/react/config/environment.js +1 -132
  3. package/dist/react/utils/deviceInfo.d.ts +1 -39
  4. package/dist/react/utils/deviceInfo.js +1 -163
  5. package/dist/react/utils/jwtDecoder.d.ts +1 -14
  6. package/dist/react/utils/jwtDecoder.js +1 -86
  7. package/dist/react/utils/tokenStorage.d.ts +1 -16
  8. package/dist/react/utils/tokenStorage.js +1 -53
  9. package/dist/v2/core/client.d.ts +92 -0
  10. package/dist/v2/core/client.js +386 -0
  11. package/dist/v2/core/config/environment.d.ts +22 -0
  12. package/dist/v2/core/config/environment.js +140 -0
  13. package/dist/v2/core/pathRemapping.js +61 -3
  14. package/dist/v2/core/resources/apiClient.d.ts +8 -0
  15. package/dist/v2/core/resources/apiClient.js +30 -9
  16. package/dist/v2/core/resources/funnel.d.ts +14 -0
  17. package/dist/v2/core/resources/payments.d.ts +23 -0
  18. package/dist/v2/core/types.d.ts +271 -0
  19. package/dist/v2/core/types.js +4 -0
  20. package/dist/v2/core/utils/deviceInfo.d.ts +39 -0
  21. package/dist/v2/core/utils/deviceInfo.js +162 -0
  22. package/dist/v2/core/utils/eventDispatcher.d.ts +10 -0
  23. package/dist/v2/core/utils/eventDispatcher.js +24 -0
  24. package/dist/v2/core/utils/jwtDecoder.d.ts +14 -0
  25. package/dist/v2/core/utils/jwtDecoder.js +85 -0
  26. package/dist/v2/core/utils/pluginConfig.js +6 -0
  27. package/dist/v2/core/utils/tokenStorage.d.ts +19 -0
  28. package/dist/v2/core/utils/tokenStorage.js +52 -0
  29. package/dist/v2/react/components/DebugDrawer.js +90 -1
  30. package/dist/v2/react/hooks/__examples__/FunnelContextExample.d.ts +12 -0
  31. package/dist/v2/react/hooks/__examples__/FunnelContextExample.js +54 -0
  32. package/dist/v2/react/hooks/useFunnel.d.ts +1 -1
  33. package/dist/v2/react/hooks/useFunnel.js +209 -32
  34. package/dist/v2/react/hooks/useGoogleAutocomplete.js +26 -18
  35. package/dist/v2/react/hooks/useISOData.js +4 -2
  36. package/dist/v2/react/hooks/useOffersQuery.d.ts +24 -29
  37. package/dist/v2/react/hooks/useOffersQuery.js +164 -204
  38. package/dist/v2/react/hooks/usePaymentQuery.js +99 -6
  39. package/dist/v2/react/providers/TagadaProvider.d.ts +8 -21
  40. package/dist/v2/react/providers/TagadaProvider.js +79 -673
  41. package/package.json +1 -1
@@ -1,23 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
- import { PluginConfig, RawPluginConfig } from '../../../react/hooks/usePluginConfig';
2
+ import { TagadaState } from '../../core/client';
3
+ import { RawPluginConfig } from '../../core/utils/pluginConfig';
4
+ import { Environment, EnvironmentConfig } from '../../core/types';
3
5
  import { ApiService } from '../../../react/services/apiService';
4
- import { AuthState, Currency, Customer, Environment, EnvironmentConfig, Locale, Session, Store } from '../../../react/types';
5
- import { convertCurrency, formatMoney, formatMoneyWithoutSymbol, formatSimpleMoney, getCurrencyInfo, minorUnitsToMajorUnits, moneyStringOrNumberToMinorUnits } from '../../../react/utils/money';
6
- interface TagadaContextValue {
7
- auth: AuthState;
8
- session: Session | null;
9
- customer: Customer | null;
10
- locale: Locale;
11
- currency: Currency;
12
- store: Store | null;
13
- environment: EnvironmentConfig;
6
+ import { formatMoney, formatMoneyWithoutSymbol, formatSimpleMoney, getCurrencyInfo, minorUnitsToMajorUnits, moneyStringOrNumberToMinorUnits, convertCurrency } from '../../../react/utils/money';
7
+ interface TagadaContextValue extends TagadaState {
14
8
  apiService: ApiService;
15
- isLoading: boolean;
16
- isInitialized: boolean;
17
- isSessionInitialized: boolean;
18
- debugMode: boolean;
19
- pluginConfig: PluginConfig;
20
- pluginConfigLoading: boolean;
21
9
  debugCheckout: {
22
10
  isActive: boolean;
23
11
  data: any;
@@ -40,7 +28,7 @@ interface TagadaContextValue {
40
28
  notifyCheckoutChanged: () => Promise<void>;
41
29
  notifyOrderBumpChanged: () => Promise<void>;
42
30
  unregisterCheckoutRefresh: (refreshFn?: () => Promise<void>) => void;
43
- unregisterOrderBumpRefresh: () => void;
31
+ unregisterOrderBumpRefresh: (refreshFn?: () => Promise<void>) => void;
44
32
  };
45
33
  money: {
46
34
  formatMoney: typeof formatMoney;
@@ -61,8 +49,7 @@ interface TagadaProviderProps {
61
49
  blockUntilSessionReady?: boolean;
62
50
  rawPluginConfig?: RawPluginConfig;
63
51
  }
64
- export declare function TagadaProvider({ children, environment, customApiConfig, debugMode, // Remove default, will be set based on environment
65
- localConfig, blockUntilSessionReady, // Default to new non-blocking behavior
66
- rawPluginConfig, }: TagadaProviderProps): import("react/jsx-runtime").JSX.Element;
52
+ export declare function TagadaProvider({ children, environment, customApiConfig, // Ignored for now in TagadaClient, or need to add support
53
+ debugMode, localConfig, blockUntilSessionReady, rawPluginConfig, }: TagadaProviderProps): import("react/jsx-runtime").JSX.Element;
67
54
  export declare function useTagadaContext(): TagadaContextValue;
68
55
  export {};