@tagadapay/plugin-sdk 2.7.41 → 2.8.0
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.
- package/README.md +1129 -1129
- package/dist/react/providers/TagadaProvider.js +5 -5
- package/dist/v2/core/utils/pluginConfig.js +9 -0
- package/dist/v2/index.d.ts +1 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/react/providers/TagadaProvider.js +5 -6
- package/package.json +97 -97
|
@@ -38,11 +38,11 @@ const InitializationLoader = () => (_jsxs("div", { style: {
|
|
|
38
38
|
borderTop: '1.5px solid #9ca3af',
|
|
39
39
|
borderRadius: '50%',
|
|
40
40
|
animation: 'tagada-spin 1s linear infinite',
|
|
41
|
-
} }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
|
|
42
|
-
@keyframes tagada-spin {
|
|
43
|
-
0% { transform: rotate(0deg); }
|
|
44
|
-
100% { transform: rotate(360deg); }
|
|
45
|
-
}
|
|
41
|
+
} }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
|
|
42
|
+
@keyframes tagada-spin {
|
|
43
|
+
0% { transform: rotate(0deg); }
|
|
44
|
+
100% { transform: rotate(360deg); }
|
|
45
|
+
}
|
|
46
46
|
` })] }));
|
|
47
47
|
const TagadaContext = createContext(null);
|
|
48
48
|
export function TagadaProvider({ children, environment, customApiConfig, debugMode, // Remove default, will be set based on environment
|
|
@@ -210,6 +210,15 @@ export async function loadLocalConfig(configName = 'default', defaultConfig) {
|
|
|
210
210
|
*/
|
|
211
211
|
export async function createRawPluginConfig() {
|
|
212
212
|
try {
|
|
213
|
+
// Only run in true localhost - production should use meta tags
|
|
214
|
+
const isLocalhost = typeof window !== 'undefined' &&
|
|
215
|
+
(window.location.hostname === 'localhost' ||
|
|
216
|
+
window.location.hostname.includes('.localhost') ||
|
|
217
|
+
window.location.hostname.includes('127.0.0.1'));
|
|
218
|
+
if (!isLocalhost) {
|
|
219
|
+
console.log('[createRawPluginConfig] Not localhost, skipping - will use meta tags in production');
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
213
222
|
const storeId = resolveEnvValue('TAGADA_STORE_ID');
|
|
214
223
|
const accountId = resolveEnvValue('TAGADA_ACCOUNT_ID');
|
|
215
224
|
const basePath = resolveEnvValue('TAGADA_BASE_PATH');
|
package/dist/v2/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type { ToggleOrderBumpResponse, VipOffer, VipPreviewResponse } from './co
|
|
|
23
23
|
export type { StoreConfig } from './core/resources/storeConfig';
|
|
24
24
|
export { FunnelEventType } from './core/resources/funnel';
|
|
25
25
|
export type { BackNavigationEventData, DirectNavigationEventData, FunnelContextUpdateRequest, FunnelContextUpdateResponse, FunnelAction as FunnelEvent, FunnelInitializeRequest, FunnelInitializeResponse, FunnelNavigateRequest, FunnelNavigateResponse, FunnelNavigationAction, FunnelNavigationResult, NextEvent, PaymentSuccessEventData, SimpleFunnelContext } from './core/resources/funnel';
|
|
26
|
-
export { ApplePayButton, ExpressPaymentMethodsProvider,
|
|
26
|
+
export { ApplePayButton, ExpressPaymentMethodsProvider, formatMoney, getAvailableLanguages, GooglePayButton, queryKeys, TagadaProvider, useApiMutation, useApiQuery, useAuth, useCheckout, useCheckoutToken, useClubOffers, useCountryOptions, useCurrency, useCustomer, useCustomerInfos, useCustomerOrders, useCustomerSubscriptions, useDiscounts, useExpressPaymentMethods, useFunnel, useGeoLocation, useGoogleAutocomplete, useInvalidateQuery, useISOData, useLanguageImport, useLogin, useOffers, useOrder, useOrderBump, usePayment, usePluginConfig, usePostPurchases, usePreloadQuery, useProducts, usePromotions, useRegionOptions, useRemappableParams, useShippingRates, useSimpleFunnel, useStoreConfig, useTagadaContext, useThreeds, useThreedsModal, useTranslation, useVipOffers } from './react';
|
|
27
27
|
export type { TranslateFunction, TranslationText, UseTranslationOptions, UseTranslationResult } from './react/hooks/useTranslation';
|
|
28
28
|
export type { ClubOffer, ClubOfferItem, ClubOfferLineItem, ClubOfferSummary, UseClubOffersOptions, UseClubOffersResult } from './react/hooks/useClubOffers';
|
|
29
29
|
export type { UseLoginOptions, UseLoginResult } from './react/hooks/useLogin';
|
package/dist/v2/index.js
CHANGED
|
@@ -15,4 +15,4 @@ export * from './core/utils/products';
|
|
|
15
15
|
export * from './core/pathRemapping';
|
|
16
16
|
export { FunnelEventType } from './core/resources/funnel';
|
|
17
17
|
// React exports (hooks and components only, types are exported above)
|
|
18
|
-
export { ApplePayButton, ExpressPaymentMethodsProvider,
|
|
18
|
+
export { ApplePayButton, ExpressPaymentMethodsProvider, formatMoney, getAvailableLanguages, GooglePayButton, queryKeys, TagadaProvider, useApiMutation, useApiQuery, useAuth, useCheckout, useCheckoutToken, useClubOffers, useCountryOptions, useCurrency, useCustomer, useCustomerInfos, useCustomerOrders, useCustomerSubscriptions, useDiscounts, useExpressPaymentMethods, useFunnel, useGeoLocation, useGoogleAutocomplete, useInvalidateQuery, useISOData, useLanguageImport, useLogin, useOffers, useOrder, useOrderBump, usePayment, usePluginConfig, usePostPurchases, usePreloadQuery, useProducts, usePromotions, useRegionOptions, useRemappableParams, useShippingRates, useSimpleFunnel, useStoreConfig, useTagadaContext, useThreeds, useThreedsModal, useTranslation, useVipOffers } from './react';
|
|
@@ -42,11 +42,11 @@ const InitializationLoader = () => (_jsxs("div", { style: {
|
|
|
42
42
|
borderTop: '1.5px solid #9ca3af',
|
|
43
43
|
borderRadius: '50%',
|
|
44
44
|
animation: 'tagada-spin 1s linear infinite',
|
|
45
|
-
} }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
|
|
46
|
-
@keyframes tagada-spin {
|
|
47
|
-
0% { transform: rotate(0deg); }
|
|
48
|
-
100% { transform: rotate(360deg); }
|
|
49
|
-
}
|
|
45
|
+
} }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
|
|
46
|
+
@keyframes tagada-spin {
|
|
47
|
+
0% { transform: rotate(0deg); }
|
|
48
|
+
100% { transform: rotate(360deg); }
|
|
49
|
+
}
|
|
50
50
|
` })] }));
|
|
51
51
|
const isEnvironment = (value) => value === 'production' || value === 'development' || value === 'local';
|
|
52
52
|
const resolveEnvironmentFromVariables = () => {
|
|
@@ -177,7 +177,6 @@ rawPluginConfig, }) {
|
|
|
177
177
|
const config = getEnvironmentConfig(detectedEnv);
|
|
178
178
|
console.log('envFromVariables', envFromVariables);
|
|
179
179
|
console.log('detectedEnv', detectedEnv);
|
|
180
|
-
console.log('config', config);
|
|
181
180
|
// Log environment detection for debugging
|
|
182
181
|
if (environment) {
|
|
183
182
|
console.log(`[TagadaSDK] Using explicit environment: ${environment}`);
|
package/package.json
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tagadapay/plugin-sdk",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Modern React SDK for building Tagada Pay plugins",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"import": "./dist/index.js",
|
|
11
|
-
"require": "./dist/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./react": {
|
|
14
|
-
"types": "./dist/react/index.d.ts",
|
|
15
|
-
"import": "./dist/react/index.js",
|
|
16
|
-
"require": "./dist/react/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./v2": {
|
|
19
|
-
"types": "./dist/v2/index.d.ts",
|
|
20
|
-
"import": "./dist/v2/index.js",
|
|
21
|
-
"require": "./dist/v2/index.js"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "tsc",
|
|
26
|
-
"clean": "rm -rf dist",
|
|
27
|
-
"lint": "echo \"No linting configured\"",
|
|
28
|
-
"test": "jest --no-watchman",
|
|
29
|
-
"test:watch": "jest --watch --no-watchman",
|
|
30
|
-
"test:coverage": "jest --coverage --no-watchman",
|
|
31
|
-
"dev": "tsc --watch",
|
|
32
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
33
|
-
"publish:patch": "npm version patch && npm publish",
|
|
34
|
-
"publish:minor": "npm version minor && npm publish",
|
|
35
|
-
"publish:major": "npm version major && npm publish",
|
|
36
|
-
"publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
|
|
37
|
-
"publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
38
|
-
"version:patch": "npm version patch",
|
|
39
|
-
"version:minor": "npm version minor",
|
|
40
|
-
"version:major": "npm version major",
|
|
41
|
-
"version:beta": "npm version prerelease --preid=beta",
|
|
42
|
-
"version:alpha": "npm version prerelease --preid=alpha",
|
|
43
|
-
"version:check": "node version-sync.js check",
|
|
44
|
-
"version:sync": "node version-sync.js sync",
|
|
45
|
-
"version:list": "node version-sync.js list",
|
|
46
|
-
"version:next": "node version-sync.js next",
|
|
47
|
-
"postversion": "echo \"✅ Version updated to $(node -p 'require(\"./package.json\").version')\" && (git push && git push --tags || echo \"⚠️ Git push failed - you may need to pull and push manually\")"
|
|
48
|
-
},
|
|
49
|
-
"keywords": [
|
|
50
|
-
"tagadapay",
|
|
51
|
-
"cms",
|
|
52
|
-
"plugin",
|
|
53
|
-
"sdk",
|
|
54
|
-
"react",
|
|
55
|
-
"typescript"
|
|
56
|
-
],
|
|
57
|
-
"author": "Tagada Pay",
|
|
58
|
-
"license": "MIT",
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@basis-theory/apple-pay-js": "^2.0.2",
|
|
61
|
-
"@basis-theory/basis-theory-js": "^4.30.0",
|
|
62
|
-
"@basis-theory/basis-theory-react": "^1.32.5",
|
|
63
|
-
"@basis-theory/web-threeds": "^1.0.1",
|
|
64
|
-
"@google-pay/button-react": "^3.0.10",
|
|
65
|
-
"@tanstack/react-query": "^5.90.2",
|
|
66
|
-
"axios": "^1.10.0",
|
|
67
|
-
"iso3166-2-db": "^2.3.11",
|
|
68
|
-
"path-to-regexp": "^8.2.0",
|
|
69
|
-
"react-intl": "^7.1.11",
|
|
70
|
-
"swr": "^2.3.6"
|
|
71
|
-
},
|
|
72
|
-
"devDependencies": {
|
|
73
|
-
"@types/jest": "^29.5.0",
|
|
74
|
-
"@types/node": "^18.0.0",
|
|
75
|
-
"@types/react": "^19",
|
|
76
|
-
"@types/react-dom": "^19",
|
|
77
|
-
"jest": "^29.5.0",
|
|
78
|
-
"ts-jest": "^29.1.0",
|
|
79
|
-
"typescript": "^5.0.0"
|
|
80
|
-
},
|
|
81
|
-
"peerDependencies": {
|
|
82
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
83
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
84
|
-
},
|
|
85
|
-
"files": [
|
|
86
|
-
"dist/**/*",
|
|
87
|
-
"README.md"
|
|
88
|
-
],
|
|
89
|
-
"repository": {
|
|
90
|
-
"type": "git",
|
|
91
|
-
"url": "git+https://github.com/tagadapay/plugin-sdk.git"
|
|
92
|
-
},
|
|
93
|
-
"bugs": {
|
|
94
|
-
"url": "https://github.com/tagadapay/plugin-sdk/issues"
|
|
95
|
-
},
|
|
96
|
-
"homepage": "https://github.com/tagadapay/plugin-sdk#readme"
|
|
97
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tagadapay/plugin-sdk",
|
|
3
|
+
"version": "2.8.0",
|
|
4
|
+
"description": "Modern React SDK for building Tagada Pay plugins",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./react": {
|
|
14
|
+
"types": "./dist/react/index.d.ts",
|
|
15
|
+
"import": "./dist/react/index.js",
|
|
16
|
+
"require": "./dist/react/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./v2": {
|
|
19
|
+
"types": "./dist/v2/index.d.ts",
|
|
20
|
+
"import": "./dist/v2/index.js",
|
|
21
|
+
"require": "./dist/v2/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"lint": "echo \"No linting configured\"",
|
|
28
|
+
"test": "jest --no-watchman",
|
|
29
|
+
"test:watch": "jest --watch --no-watchman",
|
|
30
|
+
"test:coverage": "jest --coverage --no-watchman",
|
|
31
|
+
"dev": "tsc --watch",
|
|
32
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
33
|
+
"publish:patch": "npm version patch && npm publish",
|
|
34
|
+
"publish:minor": "npm version minor && npm publish",
|
|
35
|
+
"publish:major": "npm version major && npm publish",
|
|
36
|
+
"publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
|
|
37
|
+
"publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
38
|
+
"version:patch": "npm version patch",
|
|
39
|
+
"version:minor": "npm version minor",
|
|
40
|
+
"version:major": "npm version major",
|
|
41
|
+
"version:beta": "npm version prerelease --preid=beta",
|
|
42
|
+
"version:alpha": "npm version prerelease --preid=alpha",
|
|
43
|
+
"version:check": "node version-sync.js check",
|
|
44
|
+
"version:sync": "node version-sync.js sync",
|
|
45
|
+
"version:list": "node version-sync.js list",
|
|
46
|
+
"version:next": "node version-sync.js next",
|
|
47
|
+
"postversion": "echo \"✅ Version updated to $(node -p 'require(\"./package.json\").version')\" && (git push && git push --tags || echo \"⚠️ Git push failed - you may need to pull and push manually\")"
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"tagadapay",
|
|
51
|
+
"cms",
|
|
52
|
+
"plugin",
|
|
53
|
+
"sdk",
|
|
54
|
+
"react",
|
|
55
|
+
"typescript"
|
|
56
|
+
],
|
|
57
|
+
"author": "Tagada Pay",
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@basis-theory/apple-pay-js": "^2.0.2",
|
|
61
|
+
"@basis-theory/basis-theory-js": "^4.30.0",
|
|
62
|
+
"@basis-theory/basis-theory-react": "^1.32.5",
|
|
63
|
+
"@basis-theory/web-threeds": "^1.0.1",
|
|
64
|
+
"@google-pay/button-react": "^3.0.10",
|
|
65
|
+
"@tanstack/react-query": "^5.90.2",
|
|
66
|
+
"axios": "^1.10.0",
|
|
67
|
+
"iso3166-2-db": "^2.3.11",
|
|
68
|
+
"path-to-regexp": "^8.2.0",
|
|
69
|
+
"react-intl": "^7.1.11",
|
|
70
|
+
"swr": "^2.3.6"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@types/jest": "^29.5.0",
|
|
74
|
+
"@types/node": "^18.0.0",
|
|
75
|
+
"@types/react": "^19",
|
|
76
|
+
"@types/react-dom": "^19",
|
|
77
|
+
"jest": "^29.5.0",
|
|
78
|
+
"ts-jest": "^29.1.0",
|
|
79
|
+
"typescript": "^5.0.0"
|
|
80
|
+
},
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
83
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
84
|
+
},
|
|
85
|
+
"files": [
|
|
86
|
+
"dist/**/*",
|
|
87
|
+
"README.md"
|
|
88
|
+
],
|
|
89
|
+
"repository": {
|
|
90
|
+
"type": "git",
|
|
91
|
+
"url": "git+https://github.com/tagadapay/plugin-sdk.git"
|
|
92
|
+
},
|
|
93
|
+
"bugs": {
|
|
94
|
+
"url": "https://github.com/tagadapay/plugin-sdk/issues"
|
|
95
|
+
},
|
|
96
|
+
"homepage": "https://github.com/tagadapay/plugin-sdk#readme"
|
|
97
|
+
}
|