hd-wallet-ui 2.0.15 → 2.0.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hd-wallet-ui",
3
- "version": "2.0.15",
3
+ "version": "2.0.18",
4
4
  "description": "HD Wallet modal UI — login, keys, identity, trust map, and security bond. Attach to any button in your app.",
5
5
  "type": "module",
6
6
  "main": "src/app.js",
@@ -40,7 +40,7 @@
40
40
  "buffer": "^6.0.3",
41
41
  "flatbuffers": "^25.9.23",
42
42
  "flatc-wasm": "^26.1.32",
43
- "hd-wallet-wasm": "^2.0.15",
43
+ "hd-wallet-wasm": "^2.0.18",
44
44
  "qrcode": "^1.5.3",
45
45
  "spacedatastandards.org": "^1.93.3",
46
46
  "vcard-cryptoperson": "^1.1.11"
package/src/app.js CHANGED
@@ -3836,8 +3836,8 @@ function isPasskeySupported() {
3836
3836
 
3837
3837
  // Track selected remember method (pin or passkey) for each login type
3838
3838
  const rememberMethod = {
3839
- password: 'passkey',
3840
- seed: 'passkey'
3839
+ password: 'pin',
3840
+ seed: 'pin'
3841
3841
  };
3842
3842
 
3843
3843
  function setupLoginHandlers() {
@@ -6024,14 +6024,27 @@ export async function createWalletUI(rootElement, options = {}) {
6024
6024
  return {
6025
6025
  /** Open the login modal */
6026
6026
  openLogin() {
6027
- const modal = document.getElementById('login-modal');
6028
- if (modal) modal.classList.add('active');
6027
+ if (state.loggedIn) {
6028
+ const accountModal = document.getElementById('keys-modal');
6029
+ if (accountModal) accountModal.classList.add('active');
6030
+ return;
6031
+ }
6032
+ const loginModal = document.getElementById('login-modal');
6033
+ if (loginModal) {
6034
+ loginModal.classList.add('active');
6035
+ const storedTab = loginModal.querySelector('[data-method="stored"]');
6036
+ if (storedTab && storedTab.style.display !== 'none') storedTab.click();
6037
+ }
6029
6038
  },
6030
6039
  /** Open the account / keys modal (requires login first) */
6031
6040
  openAccount() {
6032
6041
  const modal = document.getElementById('keys-modal');
6033
6042
  if (modal) modal.classList.add('active');
6034
6043
  },
6044
+ /** Clear the wallet session; host applications own any visible logout control */
6045
+ logout() {
6046
+ logout();
6047
+ },
6035
6048
  /** Remove all injected wallet UI elements from the DOM */
6036
6049
  destroy() {
6037
6050
  const container = document.getElementById('hd-wallet-ui-container');
package/src/template.js CHANGED
@@ -562,11 +562,11 @@ export function getModalHTML() {
562
562
  <span class="entropy-label"><span id="entropy-bits">0</span> bits entropy</span>
563
563
  </div>
564
564
  <div class="remember-wallet-group">
565
- <label class="glass-checkbox"><input type="checkbox" id="remember-wallet-password"><span class="checkmark"></span><span>Remember wallet</span></label>
566
- <div class="remember-options" id="remember-options-password" style="display: none;">
567
- <div class="remember-method-selector"><button type="button" class="remember-method-btn" data-method="pin" data-target="password">PIN</button><button type="button" class="remember-method-btn active" data-method="passkey" data-target="password" id="passkey-btn-password">Passkey</button></div>
568
- <div class="pin-input-group" id="pin-group-password" style="display: none;"><input type="password" id="pin-input-password" class="glass-input pin-input" placeholder="6-digit PIN" maxlength="6" inputmode="numeric" pattern="[0-9]*"></div>
569
- <div class="passkey-info" id="passkey-info-password"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a5 5 0 0 1 5 5v3H7V7a5 5 0 0 1 5-5z"/><rect x="3" y="10" width="18" height="12" rx="2"/><circle cx="12" cy="16" r="1"/></svg><span>Use Face ID, Touch ID, or device PIN</span></div>
565
+ <label class="glass-checkbox"><input type="checkbox" id="remember-wallet-password" checked><span class="checkmark"></span><span>Remember wallet</span></label>
566
+ <div class="remember-options" id="remember-options-password">
567
+ <div class="remember-method-selector"><button type="button" class="remember-method-btn active" data-method="pin" data-target="password">PIN</button><button type="button" class="remember-method-btn" data-method="passkey" data-target="password" id="passkey-btn-password">Passkey</button></div>
568
+ <div class="pin-input-group" id="pin-group-password"><input type="password" id="pin-input-password" class="glass-input pin-input" placeholder="6-digit PIN" maxlength="6" inputmode="numeric" pattern="[0-9]*"></div>
569
+ <div class="passkey-info" id="passkey-info-password" style="display: none;"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a5 5 0 0 1 5 5v3H7V7a5 5 0 0 1 5-5z"/><rect x="3" y="10" width="18" height="12" rx="2"/><circle cx="12" cy="16" r="1"/></svg><span>Use Face ID, Touch ID, or device PIN</span></div>
570
570
  </div>
571
571
  </div>
572
572
  <button id="derive-from-password" class="glass-btn primary full-width" disabled type="button">Login</button>
@@ -574,11 +574,11 @@ export function getModalHTML() {
574
574
  <div id="seed-method" class="method-content">
575
575
  <div class="glass-input-group"><textarea id="seed-phrase" class="glass-input glass-textarea" rows="3" placeholder="Enter 12 or 24 word seed phrase..."></textarea><div class="seed-actions"><button id="generate-seed" class="glass-btn small">Generate</button><button id="validate-seed" class="glass-btn small">Validate</button></div></div>
576
576
  <div class="remember-wallet-group">
577
- <label class="glass-checkbox"><input type="checkbox" id="remember-wallet-seed"><span class="checkmark"></span><span>Remember wallet</span></label>
578
- <div class="remember-options" id="remember-options-seed" style="display: none;">
579
- <div class="remember-method-selector"><button type="button" class="remember-method-btn" data-method="pin" data-target="seed">PIN</button><button type="button" class="remember-method-btn active" data-method="passkey" data-target="seed" id="passkey-btn-seed">Passkey</button></div>
580
- <div class="pin-input-group" id="pin-group-seed" style="display: none;"><input type="password" id="pin-input-seed" class="glass-input pin-input" placeholder="6-digit PIN" maxlength="6" inputmode="numeric" pattern="[0-9]*"></div>
581
- <div class="passkey-info" id="passkey-info-seed"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a5 5 0 0 1 5 5v3H7V7a5 5 0 0 1 5-5z"/><rect x="3" y="10" width="18" height="12" rx="2"/><circle cx="12" cy="16" r="1"/></svg><span>Use Face ID, Touch ID, or device PIN</span></div>
577
+ <label class="glass-checkbox"><input type="checkbox" id="remember-wallet-seed" checked><span class="checkmark"></span><span>Remember wallet</span></label>
578
+ <div class="remember-options" id="remember-options-seed">
579
+ <div class="remember-method-selector"><button type="button" class="remember-method-btn active" data-method="pin" data-target="seed">PIN</button><button type="button" class="remember-method-btn" data-method="passkey" data-target="seed" id="passkey-btn-seed">Passkey</button></div>
580
+ <div class="pin-input-group" id="pin-group-seed"><input type="password" id="pin-input-seed" class="glass-input pin-input" placeholder="6-digit PIN" maxlength="6" inputmode="numeric" pattern="[0-9]*"></div>
581
+ <div class="passkey-info" id="passkey-info-seed" style="display: none;"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a5 5 0 0 1 5 5v3H7V7a5 5 0 0 1 5-5z"/><rect x="3" y="10" width="18" height="12" rx="2"/><circle cx="12" cy="16" r="1"/></svg><span>Use Face ID, Touch ID, or device PIN</span></div>
582
582
  </div>
583
583
  </div>
584
584
  <button id="derive-from-seed" class="glass-btn primary full-width" disabled>Login</button>
package/styles/main.css CHANGED
@@ -977,9 +977,10 @@ body:has(.modal.active) .nav-bar {
977
977
 
978
978
  .wallet-info-expanded {
979
979
  display: flex;
980
- align-items: flex-start;
980
+ align-items: center;
981
981
  gap: 8px;
982
- padding: 12px 24px;
982
+ min-height: 30px;
983
+ padding: 6px 24px;
983
984
  background: rgba(59, 130, 246, 0.1);
984
985
  font-size: 13px;
985
986
  line-height: 1.5;
@@ -995,12 +996,17 @@ body:has(.modal.active) .nav-bar {
995
996
  }
996
997
 
997
998
  .wallet-info-close {
999
+ display: inline-flex;
1000
+ align-items: center;
1001
+ justify-content: center;
998
1002
  background: none;
999
1003
  border: none;
1000
1004
  color: rgba(255, 255, 255, 0.5);
1001
1005
  font-size: 18px;
1002
1006
  cursor: pointer;
1003
- padding: 0 2px;
1007
+ padding: 0;
1008
+ width: 22px;
1009
+ height: 22px;
1004
1010
  line-height: 1;
1005
1011
  flex-shrink: 0;
1006
1012
  }
@@ -1235,11 +1241,12 @@ body:has(.modal.active) .nav-bar {
1235
1241
  .account-wallet-balance-line {
1236
1242
  display: flex;
1237
1243
  align-items: center;
1238
- gap: 8px;
1244
+ gap: 16px;
1239
1245
  }
1240
1246
 
1241
1247
  .account-wallet-summary .ph-portfolio-value {
1242
1248
  color: #4ade80;
1249
+ font-size: 25px;
1243
1250
  }
1244
1251
 
1245
1252
  .account-wallet-summary .ph-portfolio-label {
package/styles/widget.css CHANGED
@@ -979,9 +979,10 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
979
979
 
980
980
  #hd-wallet-ui-container .wallet-info-expanded {
981
981
  display: flex;
982
- align-items: flex-start;
982
+ align-items: center;
983
983
  gap: 8px;
984
- padding: 12px 24px;
984
+ min-height: 30px;
985
+ padding: 6px 24px;
985
986
  background: rgba(59, 130, 246, 0.1);
986
987
  font-size: 13px;
987
988
  line-height: 1.5;
@@ -997,12 +998,17 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
997
998
  }
998
999
 
999
1000
  #hd-wallet-ui-container .wallet-info-close {
1001
+ display: inline-flex;
1002
+ align-items: center;
1003
+ justify-content: center;
1000
1004
  background: none;
1001
1005
  border: none;
1002
1006
  color: rgba(255, 255, 255, 0.5);
1003
1007
  font-size: 18px;
1004
1008
  cursor: pointer;
1005
- padding: 0 2px;
1009
+ padding: 0;
1010
+ width: 22px;
1011
+ height: 22px;
1006
1012
  line-height: 1;
1007
1013
  flex-shrink: 0;
1008
1014
  }
@@ -1237,11 +1243,12 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
1237
1243
  #hd-wallet-ui-container .account-wallet-balance-line {
1238
1244
  display: flex;
1239
1245
  align-items: center;
1240
- gap: 8px;
1246
+ gap: 16px;
1241
1247
  }
1242
1248
 
1243
1249
  #hd-wallet-ui-container .account-wallet-summary .ph-portfolio-value {
1244
1250
  color: #4ade80;
1251
+ font-size: 25px;
1245
1252
  }
1246
1253
 
1247
1254
  #hd-wallet-ui-container .account-wallet-summary .ph-portfolio-label {