shogun-button-react 1.5.36 → 1.7.2
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/CHANGELOG.md +73 -0
- package/README.md +0 -0
- package/dist/components/ShogunButton.d.ts +1 -0
- package/dist/components/ShogunButton.js +4 -1
- package/dist/connector.d.ts +0 -0
- package/dist/connector.js +0 -0
- package/dist/dist/styles/index.css +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/styles/index.css +0 -0
- package/dist/types/connector-options.d.ts +0 -0
- package/dist/types/connector-options.js +0 -0
- package/package.json +2 -2
- package/src/styles/index.css +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Version 1.5.36
|
|
4
|
+
|
|
5
|
+
### 🔧 Improvements
|
|
6
|
+
|
|
7
|
+
- Align peer/internal dependency to `shogun-core@^1.7.0` to leverage official `loginWithPair()` and `exportPair()` APIs where available.
|
|
8
|
+
- Hardened imports by removing explicit `.js` extensions in TypeScript sources for better resolver compatibility.
|
|
9
|
+
|
|
10
|
+
### 🐛 Fixes
|
|
11
|
+
|
|
12
|
+
- Avoid double JSON encoding when exporting pair from sessionStorage fallback.
|
|
13
|
+
|
|
14
|
+
## Version 1.3.4 (Latest)
|
|
15
|
+
|
|
16
|
+
### 🐛 Bug Fixes
|
|
17
|
+
|
|
18
|
+
- **Export Gun Pair Fix**: Fixed issue where "Export Pair" option was not accessible from user dropdown - now works correctly without requiring disconnect
|
|
19
|
+
- **Modal Logic Improvement**: Enhanced modal rendering logic to allow export functionality when user is already authenticated
|
|
20
|
+
- **UX Enhancement**: Improved back button behavior in export modal - now properly closes modal when user is logged in instead of showing unnecessary auth options
|
|
21
|
+
|
|
22
|
+
### 🔧 Technical Changes
|
|
23
|
+
|
|
24
|
+
- Modified component render logic to show modal even when user is logged in
|
|
25
|
+
- Improved export form navigation for better user experience
|
|
26
|
+
- Reordered dropdown menu items for better flow (Export Pair before Disconnect)
|
|
27
|
+
|
|
28
|
+
## Version 1.3.3
|
|
29
|
+
|
|
30
|
+
### ✨ New Features
|
|
31
|
+
|
|
32
|
+
- **Import Gun Pair Login**: Aggiunta possibilità di effettuare login tramite importazione di un Gun pair esistente
|
|
33
|
+
- **Export Gun Pair**: Funzionalità per esportare il proprio Gun pair con opzione di crittografia tramite password
|
|
34
|
+
- **Improved UX**: Migliorata l'interfaccia utente con feedback visivi e messaggi informativi
|
|
35
|
+
|
|
36
|
+
### 🔧 Improvements
|
|
37
|
+
|
|
38
|
+
- **Navigation Fix**: Il toggle "Don't have account? Sign up" ora porta alla selezione dei metodi di autenticazione invece che direttamente al form password
|
|
39
|
+
- **Visual Feedback**: Sostituiti gli alert con feedback visivi eleganti per export/import
|
|
40
|
+
- **Better Icons**: Aggiunte icone SVG personalizzate per import/export
|
|
41
|
+
- **Auto-copy**: L'export del pair viene automaticamente copiato negli appunti (quando supportato dal browser)
|
|
42
|
+
- **Enhanced Security**: Messaggi informativi per guidare l'utente nell'uso sicuro delle funzionalità
|
|
43
|
+
|
|
44
|
+
### 🛠 Technical Changes
|
|
45
|
+
|
|
46
|
+
- Rimosso l'uso del metodo `on` non disponibile in ShogunCore
|
|
47
|
+
- Definiti tipi locali per `AuthResult` per compatibilità
|
|
48
|
+
- Migliorata gestione degli stati nel provider
|
|
49
|
+
- Aggiunto reset completo degli stati quando si chiude il modal
|
|
50
|
+
|
|
51
|
+
### 🎨 UI/UX Enhancements
|
|
52
|
+
|
|
53
|
+
- Box informativi colorati per import/export
|
|
54
|
+
- Feedback di successo con timer automatico
|
|
55
|
+
- Indicatori di caricamento migliorati
|
|
56
|
+
- Messaggi di fallback per browser senza supporto clipboard
|
|
57
|
+
|
|
58
|
+
## Version 1.3.2
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
- Basic Gun pair export/import functionality
|
|
63
|
+
- Multi-authentication support (Password, MetaMask, WebAuthn, Nostr, OAuth)
|
|
64
|
+
- Dark mode support
|
|
65
|
+
- Responsive design
|
|
66
|
+
|
|
67
|
+
## Version 1.3.1
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
- Initial release
|
|
72
|
+
- Basic authentication flow
|
|
73
|
+
- Provider integration
|
package/README.md
CHANGED
|
File without changes
|
|
@@ -6,6 +6,7 @@ const defaultShogunContext = {
|
|
|
6
6
|
sdk: null,
|
|
7
7
|
options: {},
|
|
8
8
|
isLoggedIn: false,
|
|
9
|
+
isConnected: false,
|
|
9
10
|
userPub: null,
|
|
10
11
|
username: null,
|
|
11
12
|
login: async () => ({}),
|
|
@@ -24,6 +25,7 @@ export const useShogun = () => useContext(ShogunContext);
|
|
|
24
25
|
// Provider component
|
|
25
26
|
export function ShogunButtonProvider({ children, sdk, options, onLoginSuccess, onSignupSuccess, onError, onLogout, // AGGIUNTA
|
|
26
27
|
}) {
|
|
28
|
+
var _a, _b;
|
|
27
29
|
// Use React's useState directly
|
|
28
30
|
const [isLoggedIn, setIsLoggedIn] = useState(false);
|
|
29
31
|
const [userPub, setUserPub] = useState(null);
|
|
@@ -426,6 +428,7 @@ export function ShogunButtonProvider({ children, sdk, options, onLoginSuccess, o
|
|
|
426
428
|
sdk,
|
|
427
429
|
options,
|
|
428
430
|
isLoggedIn,
|
|
431
|
+
isConnected: !!((_b = (_a = sdk === null || sdk === void 0 ? void 0 : sdk.gun.user()) === null || _a === void 0 ? void 0 : _a.is) === null || _b === void 0 ? void 0 : _b.pub), // Verifica corretta se l'utente Gun è autenticato
|
|
429
432
|
userPub,
|
|
430
433
|
username,
|
|
431
434
|
login,
|
|
@@ -596,7 +599,7 @@ export const ShogunButton = (() => {
|
|
|
596
599
|
const result = await signUp("password", formUsername, formPassword, formPasswordConfirm);
|
|
597
600
|
if (result && result.success) {
|
|
598
601
|
if (sdk === null || sdk === void 0 ? void 0 : sdk.db) {
|
|
599
|
-
await sdk.db.setPasswordHint(
|
|
602
|
+
await sdk.db.setPasswordHint(formHint);
|
|
600
603
|
}
|
|
601
604
|
setModalIsOpen(false);
|
|
602
605
|
}
|
package/dist/connector.d.ts
CHANGED
|
File without changes
|
package/dist/connector.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/styles/index.css
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shogun-button-react",
|
|
3
3
|
"description": "Shogun connector button",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.2",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src/styles/index.css"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"ethers": "^6.13.5",
|
|
35
35
|
"prettier": "^3.5.3",
|
|
36
36
|
"rxjs": "^7.8.1",
|
|
37
|
-
"shogun-core": "^1.7.
|
|
37
|
+
"shogun-core": "^1.7.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "^18.0.0",
|
package/src/styles/index.css
CHANGED
|
File without changes
|