@stellar-expert/ui-framework 1.13.1 → 1.13.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.
@@ -22,9 +22,9 @@ export default function InvocationInfoView({contract, func, args, result, sac})
22
22
  <code>{func}({args.map((arg, i) => <ScValStruct key={i} separate={args.length - i}>
23
23
  <ScVal value={arg} nested/>
24
24
  </ScValStruct>)})<InvocationResult result={result}/></code>
25
- <Tooltip trigger={<i className="trigger icon-info"/>} desiredPlace="top" activation="click" maxWidth="90vw">
25
+ <Tooltip trigger={<i className="trigger icon-info"/>} desiredPlace="top" activation="click" maxWidth="Min(60em, 40vw)">
26
26
  <ExtendedInvocationInfoView {...{contract, func, args, result, sac}}/>
27
- </Tooltip>
27
+ </Tooltip>&nbsp;
28
28
  </>
29
29
  }
30
30
 
@@ -68,7 +68,7 @@ const ExtendedInvocationInfoView = React.memo(function ({contract, func, args, r
68
68
  <div className="text-small space">
69
69
  {fd.doc ?
70
70
  <>{fd.doc.split('\n').filter(v => !!v).map((v, i) => <div key={i}>{v}</div>)}</> :
71
- <span className="dimmed">Function documentation is not included into the WASM</span>}
71
+ <span className="dimmed text-tiny">No function documentation is available in the contract WASM</span>}
72
72
  </div>
73
73
  </div>
74
74
  })
@@ -5,7 +5,7 @@ import {Tooltip} from './tooltip'
5
5
  import './info-tooltip.scss'
6
6
 
7
7
  export const InfoTooltip = React.memo(function InfoTooltip({children, link, icon = 'icon-help', ...otherProps}) {
8
- return <Tooltip trigger={<i className={cn('trigger icon info-tooltip small', icon)} {...otherProps}/>}>
8
+ return <Tooltip trigger={<i className={cn('trigger icon info-tooltip small', icon)} {...otherProps}/>} maxWidth="30em">
9
9
  {children}
10
10
  {!!link && <a href={link} className="info-tooltip-link" target="_blank">Read more&hellip;</a>}
11
11
  </Tooltip>
@@ -166,7 +166,7 @@ export const Tooltip = React.memo(function Tooltip({
166
166
  offset = {},
167
167
  activation = 'hover',
168
168
  children,
169
- maxWidth = '20em',
169
+ maxWidth,
170
170
  ...op
171
171
  }) {
172
172
  const [visible, setVisible] = useState(false)
@@ -187,7 +187,7 @@ export const Tooltip = React.memo(function Tooltip({
187
187
  setVisible(true)
188
188
  setPosition(position)
189
189
  setPlace(place)
190
- }, 250)
190
+ }, 400)
191
191
  }
192
192
 
193
193
  function onMouseLeave(e) {
@@ -206,13 +206,16 @@ export const Tooltip = React.memo(function Tooltip({
206
206
  } else {
207
207
  triggerProps.onClick = activate
208
208
  }
209
- const contentStyle = {
210
- maxWidth,
209
+ const containerStyle = {
211
210
  left: position.left + 'px',
212
211
  top: position.top + 'px'
213
212
  }
213
+ if (maxWidth) {
214
+ containerStyle.width = '100vw'
215
+ containerStyle.maxWidth = maxWidth
216
+ }
214
217
 
215
- return React.cloneElement(trigger, triggerProps, <div className="tooltip-wrapper" style={contentStyle}>
218
+ return React.cloneElement(trigger, triggerProps, <div className="tooltip-wrapper" style={containerStyle}>
216
219
  <div ref={content} className={cn('tooltip', place, {visible})}>
217
220
  <div className="tooltip-content">{rendered ? children : null}</div>
218
221
  </div>
@@ -4,7 +4,7 @@ $tooltip-notch-shadow-color: var(--color-border-shadow);
4
4
 
5
5
  .tooltip-wrapper {
6
6
  width: 40rem;
7
- max-width: Min(40rem, 80vw);
7
+ max-width: Min(40rem, 60vw);
8
8
  position: absolute;
9
9
  visibility: hidden;
10
10
  opacity: 0;
@@ -17,7 +17,6 @@ $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: Min(40rem, 80vw);
21
20
  background: var(--color-bg);
22
21
  border-color: var(--color-contrast-border);
23
22
  border-radius: $border-radius-input;
@@ -76,11 +75,11 @@ $tooltip-notch-shadow-color: var(--color-border-shadow);
76
75
  }
77
76
 
78
77
  .trigger {
79
- vertical-align: text-top;
78
+ position: absolute;
80
79
  font-size: 1.2rem;
81
- position: relative;
82
- top: -.3rem;
83
- left: .2rem;
80
+ margin-top: -.3rem;
81
+ margin-left: .1rem;
82
+ margin-right: .1rem;
84
83
  color: var(--color-primary);
85
84
 
86
85
  &:before {
@@ -92,10 +91,10 @@ $tooltip-notch-shadow-color: var(--color-border-shadow);
92
91
  position: absolute;
93
92
  opacity: 0.01;
94
93
  display: block;
95
- width: 200%;
96
- height: 200%;
97
- left: -50%;
98
- top: -50%;
94
+ width: 2em;
95
+ height: 2em;
96
+ left: -0.4em;
97
+ top: -0.2em;
99
98
  }
100
99
 
101
100
  &:hover {
@@ -232,8 +232,12 @@ export function EffectDescription({effect, operation}) {
232
232
  case 'contractDataRemoved':
233
233
  return <>Contract <AccountAddress account={effect.owner}/> removed {effect.durability} data <ScVal value={effect.key}/></>
234
234
  case 'contractError':
235
- return <>Execution error {effect.code ? effect.code + ': ' : ''}"{effect.details[0]}"{' '}
236
- <code>{JSON.stringify(effect.details.slice(1))}</code> in <AccountAddress account={effect.contract}/></>
235
+ let errCode = effect.code
236
+ if (errCode?.name) {
237
+ errCode = errCode.name
238
+ }
239
+ return <>Execution error {errCode ? <><code>{errCode}</code> </> : null}in <AccountAddress account={effect.contract}/>{': '}
240
+ <code>{JSON.stringify(effect.details)}</code> </>
237
241
  case 'feeCharged':
238
242
  return <><Amount asset="XLM" amount={effect.charged} adjust/> fee charged from <AccountAddress account={effect.source}/> (
239
243
  bid <Amount asset="XLM" amount={effect.bid} adjust/>)</>
@@ -1,4 +1,5 @@
1
1
  import React from 'react'
2
+ import cn from 'classnames'
2
3
  import {EffectDescription} from './effect-description'
3
4
  import SorobanTxMetricsView from './soroban-tx-metrics-view'
4
5
  import './op-effects.scss'
@@ -14,7 +15,7 @@ export function OpEffectsView({operation}) {
14
15
  if (e.type === 'contractMetrics')
15
16
  return null
16
17
  return <div key={i}>
17
- <i className={e.type === 'contractError' ? 'icon-warning' : 'icon-puzzle'}/>
18
+ <i className={cn('effect-icon', e.type === 'contractError' ? 'icon-warning' : 'icon-puzzle')}/>&thinsp;
18
19
  <EffectDescription effect={e} operation={operation}/>
19
20
  </div>
20
21
  })}
@@ -35,7 +36,7 @@ function sortContractEffects(effects) {
35
36
  const bInvocation = b.type === 'contractInvoked'
36
37
  if (aInvocation && bInvocation)
37
38
  return 0
38
- if (!aInvocation && !bInvocation){
39
+ if (!aInvocation && !bInvocation) {
39
40
  const aData = a.type.startsWith('contractData')
40
41
  const bData = b.type.startsWith('contractData')
41
42
  if (aData === bData)
@@ -2,7 +2,7 @@
2
2
  padding: 0.2em 0 0 2.6em;
3
3
  line-height: 1.8;
4
4
 
5
- .icon-puzzle {
5
+ .effect-icon {
6
6
  margin-left: -1.4em;
7
7
  }
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-expert/ui-framework",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "StellarExpert shared UI components library",
5
5
  "main": "index.js",
6
6
  "module": "./index.js",
@@ -22,7 +22,7 @@
22
22
  "@stellar-expert/contract-wasm-interface-parser": "^3.1.0",
23
23
  "@stellar-expert/formatter": "^2.3.0",
24
24
  "@stellar-expert/navigation": "github:stellar-expert/navigation#v1.0.2",
25
- "@stellar-expert/tx-meta-effects-parser": "5.6.5",
25
+ "@stellar-expert/tx-meta-effects-parser": "5.7.0",
26
26
  "classnames": ">=2",
27
27
  "prop-types": ">=15",
28
28
  "qrcode.react": "^3.1.0",
@@ -43,7 +43,7 @@ import TxMatcher from './tx-matcher'
43
43
  * @return {ParsedTxDetails}
44
44
  */
45
45
  export function parseTxDetails({network, txEnvelope, result, meta, id, context, createdAt, skipUnrelated, protocol}) {
46
- const parsedTx = parseTxOperationsMeta({network, tx: txEnvelope, meta, result, protocol, processSystemEvents: true, mapSac: true})
46
+ const parsedTx = parseTxOperationsMeta({network, tx: txEnvelope, meta, result, protocol, processSystemEvents: true, processFailedOpEffects: true, mapSac: true})
47
47
  const {tx, effects, operations, isEphemeral, failed} = parsedTx
48
48
  const txHash = tx.hash().toString('hex')
49
49
  const txMatcher = new TxMatcher(context, skipUnrelated)