@tagadapay/plugin-sdk 2.4.0 → 2.4.3
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.
|
@@ -167,7 +167,10 @@ export function useGoogleAutocomplete(options) {
|
|
|
167
167
|
if (types.includes('route')) {
|
|
168
168
|
extracted.route = component.long_name;
|
|
169
169
|
}
|
|
170
|
-
if (types.includes('locality')
|
|
170
|
+
if (types.includes('locality')) {
|
|
171
|
+
extracted.locality = component.long_name;
|
|
172
|
+
}
|
|
173
|
+
if (types.includes('administrative_area_level_2') && !!!extracted.locality) {
|
|
171
174
|
extracted.locality = component.long_name;
|
|
172
175
|
}
|
|
173
176
|
if (types.includes('administrative_area_level_1')) {
|
|
@@ -22,9 +22,7 @@ export function useTranslations(targetLanguageCode) {
|
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
let cancelled = false;
|
|
24
24
|
async function fetchMessages() {
|
|
25
|
-
|
|
26
|
-
const desiredLanguage = selectedLanguage;
|
|
27
|
-
const targetLocale = `${desiredLanguage}-${region}`;
|
|
25
|
+
console.log('🔄 [useTranslations] Fetching messages for locale:', selectedLanguage);
|
|
28
26
|
try {
|
|
29
27
|
const storeId = pluginConfig?.storeId;
|
|
30
28
|
if (!storeId) {
|
|
@@ -33,7 +31,7 @@ export function useTranslations(targetLanguageCode) {
|
|
|
33
31
|
}
|
|
34
32
|
const data = await apiService.fetch('/api/v1/translation-messages', {
|
|
35
33
|
method: 'GET',
|
|
36
|
-
params: { locale:
|
|
34
|
+
params: { locale: selectedLanguage, storeId },
|
|
37
35
|
});
|
|
38
36
|
if (!cancelled) {
|
|
39
37
|
setFetchedMessages(data || {});
|
|
@@ -61,17 +59,11 @@ export function useTranslations(targetLanguageCode) {
|
|
|
61
59
|
return interpolate(raw, vars);
|
|
62
60
|
};
|
|
63
61
|
}, [messages]);
|
|
64
|
-
const computedLocale = useMemo(() => {
|
|
65
|
-
if (selectedLanguage === locale.language)
|
|
66
|
-
return locale.locale;
|
|
67
|
-
const region = locale.region || 'US';
|
|
68
|
-
return `${selectedLanguage}-${region}`;
|
|
69
|
-
}, [selectedLanguage, locale.locale, locale.language, locale.region]);
|
|
70
62
|
return {
|
|
71
63
|
t,
|
|
72
64
|
messages,
|
|
73
|
-
locale:
|
|
65
|
+
locale: selectedLanguage,
|
|
74
66
|
language: selectedLanguage,
|
|
75
|
-
region:
|
|
67
|
+
region: selectedLanguage,
|
|
76
68
|
};
|
|
77
69
|
}
|
|
@@ -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
|
package/package.json
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tagadapay/plugin-sdk",
|
|
3
|
-
"version": "2.4.
|
|
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
|
-
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc",
|
|
21
|
-
"clean": "rm -rf dist",
|
|
22
|
-
"lint": "echo \"No linting configured\"",
|
|
23
|
-
"test": "echo \"No tests yet\" && exit 0",
|
|
24
|
-
"dev": "tsc --watch",
|
|
25
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
26
|
-
"publish:patch": "npm version patch && npm publish",
|
|
27
|
-
"publish:minor": "npm version minor && npm publish",
|
|
28
|
-
"publish:major": "npm version major && npm publish",
|
|
29
|
-
"publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
|
|
30
|
-
"publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
31
|
-
"version:patch": "npm version patch",
|
|
32
|
-
"version:minor": "npm version minor",
|
|
33
|
-
"version:major": "npm version major",
|
|
34
|
-
"version:beta": "npm version prerelease --preid=beta",
|
|
35
|
-
"version:alpha": "npm version prerelease --preid=alpha",
|
|
36
|
-
"version:check": "node version-sync.js check",
|
|
37
|
-
"version:sync": "node version-sync.js sync",
|
|
38
|
-
"version:list": "node version-sync.js list",
|
|
39
|
-
"version:next": "node version-sync.js next",
|
|
40
|
-
"postversion": "echo \"✅ Version updated to $(node -p 'require(\"./package.json\").version')\" && git push && git push --tags"
|
|
41
|
-
},
|
|
42
|
-
"keywords": [
|
|
43
|
-
"tagadapay",
|
|
44
|
-
"cms",
|
|
45
|
-
"plugin",
|
|
46
|
-
"sdk",
|
|
47
|
-
"react",
|
|
48
|
-
"typescript"
|
|
49
|
-
],
|
|
50
|
-
"author": "Tagada Pay",
|
|
51
|
-
"license": "MIT",
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"@basis-theory/apple-pay-js": "^2.0.2",
|
|
54
|
-
"@basis-theory/basis-theory-js": "^4.30.0",
|
|
55
|
-
"@basis-theory/basis-theory-react": "^1.32.5",
|
|
56
|
-
"@basis-theory/web-threeds": "^1.0.1",
|
|
57
|
-
"axios": "^1.6.0",
|
|
58
|
-
"iso3166-2-db": "^2.3.11",
|
|
59
|
-
"react-intl": "^7.1.11"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@types/node": "^18.0.0",
|
|
63
|
-
"@types/react": "^19",
|
|
64
|
-
"@types/react-dom": "^19",
|
|
65
|
-
"typescript": "^5.0.0"
|
|
66
|
-
},
|
|
67
|
-
"peerDependencies": {
|
|
68
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
69
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
70
|
-
},
|
|
71
|
-
"files": [
|
|
72
|
-
"dist/**/*",
|
|
73
|
-
"README.md"
|
|
74
|
-
],
|
|
75
|
-
"repository": {
|
|
76
|
-
"type": "git",
|
|
77
|
-
"url": "git+https://github.com/tagadapay/plugin-sdk.git"
|
|
78
|
-
},
|
|
79
|
-
"bugs": {
|
|
80
|
-
"url": "https://github.com/tagadapay/plugin-sdk/issues"
|
|
81
|
-
},
|
|
82
|
-
"homepage": "https://github.com/tagadapay/plugin-sdk#readme"
|
|
83
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tagadapay/plugin-sdk",
|
|
3
|
+
"version": "2.4.3",
|
|
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
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"clean": "rm -rf dist",
|
|
22
|
+
"lint": "echo \"No linting configured\"",
|
|
23
|
+
"test": "echo \"No tests yet\" && exit 0",
|
|
24
|
+
"dev": "tsc --watch",
|
|
25
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
26
|
+
"publish:patch": "npm version patch && npm publish",
|
|
27
|
+
"publish:minor": "npm version minor && npm publish",
|
|
28
|
+
"publish:major": "npm version major && npm publish",
|
|
29
|
+
"publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
|
|
30
|
+
"publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
31
|
+
"version:patch": "npm version patch",
|
|
32
|
+
"version:minor": "npm version minor",
|
|
33
|
+
"version:major": "npm version major",
|
|
34
|
+
"version:beta": "npm version prerelease --preid=beta",
|
|
35
|
+
"version:alpha": "npm version prerelease --preid=alpha",
|
|
36
|
+
"version:check": "node version-sync.js check",
|
|
37
|
+
"version:sync": "node version-sync.js sync",
|
|
38
|
+
"version:list": "node version-sync.js list",
|
|
39
|
+
"version:next": "node version-sync.js next",
|
|
40
|
+
"postversion": "echo \"✅ Version updated to $(node -p 'require(\"./package.json\").version')\" && git push && git push --tags"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"tagadapay",
|
|
44
|
+
"cms",
|
|
45
|
+
"plugin",
|
|
46
|
+
"sdk",
|
|
47
|
+
"react",
|
|
48
|
+
"typescript"
|
|
49
|
+
],
|
|
50
|
+
"author": "Tagada Pay",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@basis-theory/apple-pay-js": "^2.0.2",
|
|
54
|
+
"@basis-theory/basis-theory-js": "^4.30.0",
|
|
55
|
+
"@basis-theory/basis-theory-react": "^1.32.5",
|
|
56
|
+
"@basis-theory/web-threeds": "^1.0.1",
|
|
57
|
+
"axios": "^1.6.0",
|
|
58
|
+
"iso3166-2-db": "^2.3.11",
|
|
59
|
+
"react-intl": "^7.1.11"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/node": "^18.0.0",
|
|
63
|
+
"@types/react": "^19",
|
|
64
|
+
"@types/react-dom": "^19",
|
|
65
|
+
"typescript": "^5.0.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
69
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
70
|
+
},
|
|
71
|
+
"files": [
|
|
72
|
+
"dist/**/*",
|
|
73
|
+
"README.md"
|
|
74
|
+
],
|
|
75
|
+
"repository": {
|
|
76
|
+
"type": "git",
|
|
77
|
+
"url": "git+https://github.com/tagadapay/plugin-sdk.git"
|
|
78
|
+
},
|
|
79
|
+
"bugs": {
|
|
80
|
+
"url": "https://github.com/tagadapay/plugin-sdk/issues"
|
|
81
|
+
},
|
|
82
|
+
"homepage": "https://github.com/tagadapay/plugin-sdk#readme"
|
|
83
|
+
}
|