@stellar-expert/ui-framework 1.10.4 → 1.11.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.
@@ -3,8 +3,8 @@
3
3
  $tooltip-notch-shadow-color: var(--color-border-shadow);
4
4
 
5
5
  .tooltip-wrapper {
6
- width: 30rem;
7
- max-width: 30rem;
6
+ width: 40rem;
7
+ max-width: min(40rem, 80vw);
8
8
  position: absolute;
9
9
  visibility: hidden;
10
10
  opacity: 0;
@@ -17,7 +17,7 @@ $tooltip-notch-shadow-color: var(--color-border-shadow);
17
17
  font-size: 0.9*$font-size-base;
18
18
  font-style: normal;
19
19
  line-height: 1.3;
20
- max-width: 30rem;
20
+ max-width: min(40rem, 80vw);
21
21
  background: var(--color-bg);
22
22
  border-color: var(--color-contrast-border);
23
23
  border-radius: $border-radius-input;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-expert/ui-framework",
3
- "version": "1.10.4",
3
+ "version": "1.11.0",
4
4
  "description": "StellarExpert shared UI components library",
5
5
  "main": "index.js",
6
6
  "module": "./index.js",
@@ -21,7 +21,7 @@
21
21
  "@stellar-expert/client-cache": "github:stellar-expert/client-cache",
22
22
  "@stellar-expert/formatter": "^2.3.0",
23
23
  "@stellar-expert/navigation": "github:stellar-expert/navigation#v1.0.2",
24
- "@stellar-expert/tx-meta-effects-parser": "^5.0.4",
24
+ "@stellar-expert/tx-meta-effects-parser": "^5.2.0",
25
25
  "classnames": ">=2",
26
26
  "prop-types": ">=15",
27
27
  "qrcode.react": "^3.1.0",
@@ -117,8 +117,10 @@ function PathPaymentDescriptionView({op, compact}) {
117
117
  if (sendMax !== undefined) {
118
118
  if (isSwap && sendAssetId === destAssetId && effects.length) { //circular trades yield accountCredited/Debited effect
119
119
  const changeEffect = effects.find(e => e.source === source && e.asset === sendAssetId && (e.type === 'accountCredited' || e.type === 'accountDebited'))
120
- const change = BigInt(changeEffect.amount)
121
- src = fromStroops(toStroops(destAmount) + (changeEffect.type === 'accountCredited' ? -change : change))
120
+ if (changeEffect) { //arbitrage successful, otherwise src = dst and no account changes happened
121
+ const change = BigInt(changeEffect.amount)
122
+ src = fromStroops(toStroops(destAmount) + (changeEffect.type === 'accountCredited' ? -change : change))
123
+ }
122
124
  } else {
123
125
  const debitedEffect = effects.find(e => e.source === source && e.type === 'accountDebited' && e.asset === sendAssetId)
124
126
  if (debitedEffect) {
@@ -129,8 +131,10 @@ function PathPaymentDescriptionView({op, compact}) {
129
131
  if (destMin !== undefined) {
130
132
  if (isSwap && sendAssetId === destAssetId && effects.length) { //circular trades yield accountCredited/Debited effect
131
133
  const changeEffect = effects.find(e => e.source === source && e.asset === destAssetId && (e.type === 'accountCredited' || e.type === 'accountDebited'))
132
- const change = BigInt(changeEffect.amount)
133
- dst = fromStroops(toStroops(destAmount) + (changeEffect.type === 'accountCredited' ? change : -change))
134
+ if (changeEffect) { //arbitrage successful, otherwise src = dst and no account changes happened
135
+ const change = BigInt(changeEffect.amount)
136
+ dst = fromStroops(toStroops(destAmount) + (changeEffect.type === 'accountCredited' ? change : -change))
137
+ }
134
138
  } else {
135
139
  const creditedEffect = effects.find(e => e.source === destination && e.type === 'accountCredited' && e.asset === destAssetId)
136
140
  if (creditedEffect) {
@@ -844,15 +848,15 @@ function InvokeHostFunctionView({op, compact}) {
844
848
  * @param {Boolean} compact
845
849
  * @constructor
846
850
  */
847
- function BumpFootprintExpirationView({op}) {
848
- const {ledgersToExpire} = op.operation
851
+ function ExtendFootprintTTLView({op}) {
852
+ const {extendTo} = op.operation
849
853
  if (op.isEphemeral)
850
854
  return <>
851
- <b>Bump state expiration</b> for {ledgersToExpire} ledgers
855
+ <b>Extend ledger state expiration</b> to sequence {extendTo}
852
856
  <OpSourceAccount op={op}/>
853
857
  </>
854
858
  return <>
855
- <OpSourceAccount op={op}/> bumped state expiration for {ledgersToExpire} ledgers
859
+ <OpSourceAccount op={op}/> extended ledger state expiration to sequence {extendTo}
856
860
  </>
857
861
  }
858
862
 
@@ -866,10 +870,10 @@ function RestoreFootprintView({op}) {
866
870
  const {ledgersToExpire} = op.operation
867
871
  if (op.isEphemeral)
868
872
  return <>
869
- <b>Restore state</b><OpSourceAccount op={op}/>
873
+ <b>Restore ledger state entry</b> <OpSourceAccount op={op}/>
870
874
  </>
871
875
  return <>
872
- <OpSourceAccount op={op}/> restored state
876
+ <OpSourceAccount op={op}/> restored ledger state entry
873
877
  </>
874
878
  }
875
879
 
@@ -905,7 +909,7 @@ const typeMapping = {
905
909
  liquidityPoolDeposit: DepositLiquidityDescriptionView,
906
910
  liquidityPoolWithdraw: WithdrawLiquidityDescriptionView,
907
911
  invokeHostFunction: InvokeHostFunctionView,
908
- bumpFootprintExpiration: BumpFootprintExpirationView,
912
+ extendFootprintTTL: ExtendFootprintTTLView,
909
913
  restoreFootprint: RestoreFootprintView
910
914
  }
911
915
 
@@ -70,13 +70,25 @@ export const TxOperationsList = React.memo(function TxOperationsList({
70
70
  showEffects
71
71
  }) {
72
72
  const [effectsExpanded, setEffectsExpanded] = useState(false)
73
+ const [opsExpanded, setOpsExpanded] = useState(false)
73
74
  const toggleEffects = useCallback(e => setEffectsExpanded(e.expanded), [])
75
+ const toggleAdditionalOps = useCallback(e => setOpsExpanded(e.expanded), [])
74
76
  let {operations} = parsedTx
75
77
  let opdiff = 0
76
- //filter operations if filtered output is requested
77
- if (filter) {
78
- operations = operations.filter(filter)
79
- opdiff = parsedTx.operations.length - operations.length
78
+ if (!opsExpanded) {
79
+ //filter operations if filtered output is requested
80
+ if (filter) {
81
+ const visibleOps = operations.filter(filter)
82
+ if (visibleOps.length) {
83
+ operations = visibleOps
84
+ opdiff = parsedTx.operations.length - operations.length
85
+ }
86
+ }
87
+ //hide some operations in large transactions to prevent interface hanging
88
+ if (operations.length > 5) {
89
+ operations = operations.subarray(0, 5)
90
+ opdiff = parsedTx.operations.length - operations.length
91
+ }
80
92
  }
81
93
 
82
94
  return <div>
@@ -97,9 +109,8 @@ export const TxOperationsList = React.memo(function TxOperationsList({
97
109
  {effectsExpanded && <OpEffectsView effects={op.operation.effects}/>}
98
110
  </div>)}
99
111
  {showFees && <TxChargedFee {...{parsedTx, compact}}/>}
100
- {opdiff > 0 && <div className="dimmed text-small block-indent">
101
- {opdiff} more operation{opdiff > 1 && 's'} hidden
102
- </div>}
112
+ {(opsExpanded || opdiff > 0) && <Spoiler expanded={opsExpanded} onChange={toggleAdditionalOps}
113
+ showMore={`${opdiff} more operation${opdiff > 1 && 's'} hidden`} showLess="Hide extra operations"/>}
103
114
  </div>
104
115
  </div>
105
116
  })