@xyo-network/react-embed 3.0.2 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. package/dist/browser/components/EmbedPlugin.d.ts +5 -0
  2. package/dist/browser/components/EmbedPlugin.d.ts.map +1 -0
  3. package/dist/browser/components/EmbedResolver.d.ts +4 -0
  4. package/dist/browser/components/EmbedResolver.d.ts.map +1 -0
  5. package/dist/browser/components/controls/EmbedFormControl.d.ts +10 -0
  6. package/dist/browser/components/controls/EmbedFormControl.d.ts.map +1 -0
  7. package/dist/browser/components/controls/ListModeSelect.d.ts +6 -0
  8. package/dist/browser/components/controls/ListModeSelect.d.ts.map +1 -0
  9. package/dist/browser/components/controls/RenderSelect.d.ts +4 -0
  10. package/dist/browser/components/controls/RenderSelect.d.ts.map +1 -0
  11. package/dist/browser/components/controls/index.d.ts +4 -0
  12. package/dist/browser/components/controls/index.d.ts.map +1 -0
  13. package/dist/browser/components/embed-card/EmbedCardResolver.d.ts +5 -0
  14. package/dist/browser/components/embed-card/EmbedCardResolver.d.ts.map +1 -0
  15. package/dist/browser/components/embed-card/EmbedPluginCard.d.ts +10 -0
  16. package/dist/browser/components/embed-card/EmbedPluginCard.d.ts.map +1 -0
  17. package/dist/browser/components/embed-card/card/BusyCard.d.ts +11 -0
  18. package/dist/browser/components/embed-card/card/BusyCard.d.ts.map +1 -0
  19. package/dist/browser/components/embed-card/card/EmbedCardHeader.d.ts +4 -0
  20. package/dist/browser/components/embed-card/card/EmbedCardHeader.d.ts.map +1 -0
  21. package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts +4 -0
  22. package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts.map +1 -0
  23. package/dist/browser/components/embed-card/card/index.d.ts +4 -0
  24. package/dist/browser/components/embed-card/card/index.d.ts.map +1 -0
  25. package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.d.ts +10 -0
  26. package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.d.ts.map +1 -0
  27. package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts +14 -0
  28. package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts.map +1 -0
  29. package/dist/browser/components/embed-card/error-handling/index.d.ts +3 -0
  30. package/dist/browser/components/embed-card/error-handling/index.d.ts.map +1 -0
  31. package/dist/browser/components/embed-card/index.d.ts +3 -0
  32. package/dist/browser/components/embed-card/index.d.ts.map +1 -0
  33. package/dist/browser/components/embed-card/menu/EmbedMenu.d.ts +4 -0
  34. package/dist/browser/components/embed-card/menu/EmbedMenu.d.ts.map +1 -0
  35. package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts +4 -0
  36. package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts.map +1 -0
  37. package/dist/browser/components/embed-card/menu/index.d.ts +2 -0
  38. package/dist/browser/components/embed-card/menu/index.d.ts.map +1 -0
  39. package/dist/browser/components/index.d.ts +3 -0
  40. package/dist/browser/components/index.d.ts.map +1 -0
  41. package/dist/browser/components/stories/storyPayload.d.ts +126 -0
  42. package/dist/browser/components/stories/storyPayload.d.ts.map +1 -0
  43. package/dist/browser/components/stories/storyShared.d.ts +4 -0
  44. package/dist/browser/components/stories/storyShared.d.ts.map +1 -0
  45. package/dist/browser/components/stories/xyoEmbedStoryBase.d.ts +3 -0
  46. package/dist/browser/components/stories/xyoEmbedStoryBase.d.ts.map +1 -0
  47. package/dist/browser/components/validation-alerts/ValidatePayload.d.ts +5 -0
  48. package/dist/browser/components/validation-alerts/ValidatePayload.d.ts.map +1 -0
  49. package/dist/browser/components/validation-alerts/ValidatePlugins.d.ts +5 -0
  50. package/dist/browser/components/validation-alerts/ValidatePlugins.d.ts.map +1 -0
  51. package/dist/browser/components/validation-alerts/index.d.ts +3 -0
  52. package/dist/browser/components/validation-alerts/index.d.ts.map +1 -0
  53. package/dist/browser/contexts/EmbedPluginContext/Context.d.ts +3 -0
  54. package/dist/browser/contexts/EmbedPluginContext/Context.d.ts.map +1 -0
  55. package/dist/browser/contexts/EmbedPluginContext/Provider.d.ts +6 -0
  56. package/dist/browser/contexts/EmbedPluginContext/Provider.d.ts.map +1 -0
  57. package/dist/browser/contexts/EmbedPluginContext/State.d.ts +28 -0
  58. package/dist/browser/contexts/EmbedPluginContext/State.d.ts.map +1 -0
  59. package/dist/browser/contexts/EmbedPluginContext/index.d.ts +5 -0
  60. package/dist/browser/contexts/EmbedPluginContext/index.d.ts.map +1 -0
  61. package/dist/browser/contexts/EmbedPluginContext/use.d.ts +2 -0
  62. package/dist/browser/contexts/EmbedPluginContext/use.d.ts.map +1 -0
  63. package/dist/browser/contexts/RefreshPayloadContext/Context.d.ts +3 -0
  64. package/dist/browser/contexts/RefreshPayloadContext/Context.d.ts.map +1 -0
  65. package/dist/browser/contexts/RefreshPayloadContext/Provider.d.ts +8 -0
  66. package/dist/browser/contexts/RefreshPayloadContext/Provider.d.ts.map +1 -0
  67. package/dist/browser/contexts/RefreshPayloadContext/State.d.ts +8 -0
  68. package/dist/browser/contexts/RefreshPayloadContext/State.d.ts.map +1 -0
  69. package/dist/browser/contexts/RefreshPayloadContext/index.d.ts +4 -0
  70. package/dist/browser/contexts/RefreshPayloadContext/index.d.ts.map +1 -0
  71. package/dist/browser/contexts/RefreshPayloadContext/use.d.ts +2 -0
  72. package/dist/browser/contexts/RefreshPayloadContext/use.d.ts.map +1 -0
  73. package/dist/browser/contexts/ResolvePayloadContext/Context.d.ts +3 -0
  74. package/dist/browser/contexts/ResolvePayloadContext/Context.d.ts.map +1 -0
  75. package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts +6 -0
  76. package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts.map +1 -0
  77. package/dist/browser/contexts/ResolvePayloadContext/State.d.ts +13 -0
  78. package/dist/browser/contexts/ResolvePayloadContext/State.d.ts.map +1 -0
  79. package/dist/browser/contexts/ResolvePayloadContext/index.d.ts +5 -0
  80. package/dist/browser/contexts/ResolvePayloadContext/index.d.ts.map +1 -0
  81. package/dist/browser/contexts/ResolvePayloadContext/use.d.ts +2 -0
  82. package/dist/browser/contexts/ResolvePayloadContext/use.d.ts.map +1 -0
  83. package/dist/browser/contexts/ValidatePayloadContext/Context.d.ts +3 -0
  84. package/dist/browser/contexts/ValidatePayloadContext/Context.d.ts.map +1 -0
  85. package/dist/browser/contexts/ValidatePayloadContext/Provider.d.ts +7 -0
  86. package/dist/browser/contexts/ValidatePayloadContext/Provider.d.ts.map +1 -0
  87. package/dist/browser/contexts/ValidatePayloadContext/State.d.ts +7 -0
  88. package/dist/browser/contexts/ValidatePayloadContext/State.d.ts.map +1 -0
  89. package/dist/browser/contexts/ValidatePayloadContext/index.d.ts +4 -0
  90. package/dist/browser/contexts/ValidatePayloadContext/index.d.ts.map +1 -0
  91. package/dist/browser/contexts/ValidatePayloadContext/use.d.ts +2 -0
  92. package/dist/browser/contexts/ValidatePayloadContext/use.d.ts.map +1 -0
  93. package/dist/browser/contexts/index.d.ts +5 -0
  94. package/dist/browser/contexts/index.d.ts.map +1 -0
  95. package/dist/browser/index.d.ts +4 -112
  96. package/dist/browser/index.d.ts.map +1 -0
  97. package/dist/browser/index.mjs.map +1 -1
  98. package/dist/browser/types/EmbedPluginProps.d.ts +9 -0
  99. package/dist/browser/types/EmbedPluginProps.d.ts.map +1 -0
  100. package/dist/browser/types/index.d.ts +2 -0
  101. package/dist/browser/types/index.d.ts.map +1 -0
  102. package/package.json +52 -49
  103. package/src/components/EmbedPlugin.tsx +6 -2
  104. package/src/components/EmbedResolver.tsx +3 -1
  105. package/src/components/controls/EmbedFormControl.tsx +3 -1
  106. package/src/components/controls/RenderSelect.tsx +3 -1
  107. package/src/components/embed-card/EmbedCardResolver.tsx +8 -2
  108. package/src/components/embed-card/EmbedPluginCard.tsx +5 -1
  109. package/src/components/embed-card/card/BusyCard.tsx +2 -1
  110. package/src/components/embed-card/card/EmbedCardHeader.tsx +9 -3
  111. package/src/components/embed-card/card/EmbedPluginCard.tsx +3 -1
  112. package/src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx +3 -1
  113. package/src/components/embed-card/error-handling/EmbedErrorCard.tsx +12 -4
  114. package/src/components/embed-card/menu/JsonMenuItem.tsx +3 -1
  115. package/src/components/stories/XyoEmbedPlugin.states.stories.tsx +3 -1
  116. package/src/components/stories/storyPayload.ts +60 -12
  117. package/src/components/stories/storyShared.tsx +1 -11
  118. package/src/components/stories/xyoEmbedStoryBase.ts +9 -0
  119. package/src/components/validation-alerts/ValidatePayload.tsx +3 -1
  120. package/src/contexts/RefreshPayloadContext/Provider.tsx +7 -2
  121. package/src/contexts/ResolvePayloadContext/Provider.tsx +10 -3
  122. package/src/contexts/ValidatePayloadContext/Provider.stories.tsx +9 -3
  123. package/src/contexts/ValidatePayloadContext/Provider.tsx +4 -1
  124. package/xy.config.ts +1 -3
@@ -3,7 +3,9 @@ import type { WithChildren } from '@xylabs/react-shared'
3
3
  import { ErrorBoundary, ListModeProvider } from '@xyo-network/react-shared'
4
4
  import React from 'react'
5
5
 
6
- import { EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider } from '../contexts/index.ts'
6
+ import {
7
+ EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider,
8
+ } from '../contexts/index.ts'
7
9
  import type { EmbedPluginProps } from '../types/index.ts'
8
10
  import { EmbedResolver } from './EmbedResolver.tsx'
9
11
  import { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts/index.ts'
@@ -40,7 +42,9 @@ export const EmbedPluginInner: React.FC<WithChildren<EmbedPluginProps>> = ({
40
42
 
41
43
  interface WithResolversProps extends Pick<EmbedPluginProps, 'onRefresh' | 'huriPayload'>, FlexBoxProps {}
42
44
 
43
- const WithResolvers: React.FC<WithChildren<WithResolversProps>> = ({ children, onRefresh, huriPayload }) => {
45
+ const WithResolvers: React.FC<WithChildren<WithResolversProps>> = ({
46
+ children, onRefresh, huriPayload,
47
+ }) => {
44
48
  return (
45
49
  <RefreshPayloadProvider onRefresh={onRefresh}>
46
50
  <ResolvePayloadProvider huriPayload={huriPayload}>
@@ -5,7 +5,9 @@ import React from 'react'
5
5
  import { useResolvePayload } from '../contexts/index.ts'
6
6
 
7
7
  export const EmbedResolver: React.FC<WithChildren> = ({ children }) => {
8
- const { payload, notFound, huriError } = useResolvePayload()
8
+ const {
9
+ payload, notFound, huriError,
10
+ } = useResolvePayload()
9
11
 
10
12
  return (
11
13
  <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>
@@ -8,7 +8,9 @@ interface EmbedFormControlProps extends FormControlProps {
8
8
  formLabel?: string
9
9
  }
10
10
 
11
- export const EmbedFormControl: React.FC<WithChildren<EmbedFormControlProps>> = ({ formId, formLabel, children, ...props }) => {
11
+ export const EmbedFormControl: React.FC<WithChildren<EmbedFormControlProps>> = ({
12
+ formId, formLabel, children, ...props
13
+ }) => {
12
14
  return (
13
15
  <FormControl {...props}>
14
16
  <InputLabel id={formId}>{formLabel}</InputLabel>
@@ -10,7 +10,9 @@ const renderSelectId = 'render-select-id'
10
10
  const renderSelectLabel = 'Renderer'
11
11
 
12
12
  export const EmbedRenderSelect: React.FC<SelectExProps<string>> = (props) => {
13
- const { activePlugin, setActivePlugin, plugins } = useEmbedPluginState()
13
+ const {
14
+ activePlugin, setActivePlugin, plugins,
15
+ } = useEmbedPluginState()
14
16
  return (
15
17
  <EmbedFormControl formId={renderSelectId} formLabel={renderSelectLabel}>
16
18
  <SelectEx size="small" value={activePlugin?.name} {...props}>
@@ -9,7 +9,9 @@ import { useRefreshPayload, useResolvePayload } from '../../contexts/index.ts'
9
9
  import { EmbedCardApiErrorRenderer } from './error-handling/index.ts'
10
10
 
11
11
  export const EmbedCardResolverFlexBox: React.FC<WithChildren<FlexBoxProps>> = ({ children, ...props }) => {
12
- const { payload, notFound, huriError } = useResolvePayload()
12
+ const {
13
+ payload, notFound, huriError,
14
+ } = useResolvePayload()
13
15
  const { refreshPayload } = useRefreshPayload()
14
16
  const theme = useTheme()
15
17
 
@@ -21,7 +23,11 @@ export const EmbedCardResolverFlexBox: React.FC<WithChildren<FlexBoxProps>> = ({
21
23
  alignItems="stretch"
22
24
  justifyContent="start"
23
25
  busy={Boolean(!refreshPayload && payload)}
24
- busyCircularProps={{ style: { alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2 } }}
26
+ busyCircularProps={{
27
+ style: {
28
+ alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2,
29
+ },
30
+ }}
25
31
  {...props}
26
32
  >
27
33
  {children}
@@ -54,7 +54,11 @@ export const EmbedPluginCardInner: React.FC<BusyCardProps> = (props) => {
54
54
  elevation={3}
55
55
  variant="elevation"
56
56
  busy={Boolean(!refreshPayload && payload)}
57
- busyVariantProps={{ style: { alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2 } }}
57
+ busyVariantProps={{
58
+ style: {
59
+ alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2,
60
+ },
61
+ }}
58
62
  sx={{ position: 'relative' }}
59
63
  {...props}
60
64
  />
@@ -5,7 +5,8 @@ import type {
5
5
  BusyCircularProgressProps,
6
6
  BusyLinearProgressProps,
7
7
  BusyVariant,
8
- WithChildren } from '@xylabs/react-shared'
8
+ WithChildren,
9
+ } from '@xylabs/react-shared'
9
10
  import {
10
11
  BusyCircularProgress,
11
12
  BusyLinearProgress,
@@ -1,6 +1,8 @@
1
1
  import { Refresh as RefreshIcon } from '@mui/icons-material'
2
2
  import type { CardHeaderProps, Theme } from '@mui/material'
3
- import { Avatar, CardHeader, Chip } from '@mui/material'
3
+ import {
4
+ Avatar, CardHeader, Chip,
5
+ } from '@mui/material'
4
6
  import { FlexRow } from '@xylabs/react-flexbox'
5
7
  import React from 'react'
6
8
 
@@ -9,8 +11,12 @@ import { EmbedMenu } from '../menu/index.ts'
9
11
 
10
12
  export const EmbedCardHeader: React.FC<CardHeaderProps> = () => {
11
13
  const { refreshHuri, huri } = useResolvePayload()
12
- const { activePlugin, timestampLabel, hideElementsConfig } = useEmbedPluginState()
13
- const { hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions } = hideElementsConfig ?? {}
14
+ const {
15
+ activePlugin, timestampLabel, hideElementsConfig,
16
+ } = useEmbedPluginState()
17
+ const {
18
+ hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions,
19
+ } = hideElementsConfig ?? {}
14
20
  // this is temporary so that we can add the ability to get a timestamp via diviner later
15
21
  const timestamp = Date.now()
16
22
  return (
@@ -11,7 +11,9 @@ import { EmbedCardHeader } from './EmbedCardHeader.tsx'
11
11
 
12
12
  export const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {
13
13
  const { payload } = useResolvePayload()
14
- const { activePlugin: ActivePlugin, plugins, hideElementsConfig } = useEmbedPluginState()
14
+ const {
15
+ activePlugin: ActivePlugin, plugins, hideElementsConfig,
16
+ } = useEmbedPluginState()
15
17
  const { listMode } = useListMode()
16
18
  const supportsListMode = ActivePlugin?.components?.box?.listModes?.length ?? 0 > 1
17
19
 
@@ -10,7 +10,9 @@ interface EmbedCardApiErrorRendererProps extends CardProps {
10
10
  xyoError?: ModuleError
11
11
  }
12
12
 
13
- export const EmbedCardApiErrorRenderer: React.FC<WithChildren<EmbedCardApiErrorRendererProps>> = ({ xyoError, children, ...props }) => {
13
+ export const EmbedCardApiErrorRenderer: React.FC<WithChildren<EmbedCardApiErrorRendererProps>> = ({
14
+ xyoError, children, ...props
15
+ }) => {
14
16
  return (
15
17
  <ErrorRender error={xyoError} noReAuth noErrorDisplay customError={<CustomApiErrorCard xyoError={xyoError} {...props} />}>
16
18
  {children}
@@ -1,5 +1,7 @@
1
1
  import type { AlertProps, CardProps } from '@mui/material'
2
- import { Alert, AlertTitle, Card, CardContent, Typography } from '@mui/material'
2
+ import {
3
+ Alert, AlertTitle, Card, CardContent, Typography,
4
+ } from '@mui/material'
3
5
  import type { WithChildren } from '@xylabs/react-shared'
4
6
  import React from 'react'
5
7
 
@@ -13,8 +15,12 @@ interface EmbedErrorCardBaseProps {
13
15
  interface EmbedErrorCardProps extends EmbedErrorCardBaseProps, CardProps {}
14
16
 
15
17
  export const EmbedErrorCard: React.FC<WithChildren<EmbedErrorCardProps>> = (props) => {
16
- const { alertProps, error, scope, hideErrorDetails = true, children, ...cardProps } = props
17
- const errorProps = { alertProps, error, hideErrorDetails, scope }
18
+ const {
19
+ alertProps, error, scope, hideErrorDetails = true, children, ...cardProps
20
+ } = props
21
+ const errorProps = {
22
+ alertProps, error, hideErrorDetails, scope,
23
+ }
18
24
  return (
19
25
  <Card {...cardProps}>
20
26
  <CardContent>{children ?? <DefaultErrorAlert {...errorProps} />}</CardContent>
@@ -22,7 +28,9 @@ export const EmbedErrorCard: React.FC<WithChildren<EmbedErrorCardProps>> = (prop
22
28
  )
23
29
  }
24
30
 
25
- const DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({ alertProps, scope, hideErrorDetails, error }) => {
31
+ const DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({
32
+ alertProps, scope, hideErrorDetails, error,
33
+ }) => {
26
34
  return (
27
35
  <Alert severity="error" {...alertProps}>
28
36
  <AlertTitle>Whoops! Something went wrong</AlertTitle>
@@ -1,6 +1,8 @@
1
1
  import { OpenInNew as OpenInNewIcon } from '@mui/icons-material'
2
2
  import type { MenuItemProps } from '@mui/material'
3
- import { ListItemIcon, ListItemText, MenuItem } from '@mui/material'
3
+ import {
4
+ ListItemIcon, ListItemText, MenuItem,
5
+ } from '@mui/material'
4
6
  import React from 'react'
5
7
 
6
8
  import { useResolvePayload } from '../../../contexts/index.ts'
@@ -87,4 +87,6 @@ WithOnRefresh.args = {
87
87
  plugins: [CryptoAssetRenderPlugin],
88
88
  }
89
89
 
90
- export { ApiError, Default, HiddenElements, ThrownError, WithOnRefresh, WithPassedPayload, WithSetBusyExternally }
90
+ export {
91
+ ApiError, Default, HiddenElements, ThrownError, WithOnRefresh, WithPassedPayload, WithSetBusyExternally,
92
+ }
@@ -1,20 +1,68 @@
1
1
  export const payloadData = {
2
2
  assets: {
3
- ada: { value: { btc: '0.00002192', eth: '0.00031141', eur: '0.491867', usd: '0.502045' } },
4
- btc: { value: { btc: '1', eth: '14.213346', eur: '22450', usd: '22914' } },
5
- busd: { value: { btc: '0.00004369', eth: '0.00062074', eur: '0.980451', usd: '1.001' } },
3
+ ada: {
4
+ value: {
5
+ btc: '0.00002192', eth: '0.00031141', eur: '0.491867', usd: '0.502045',
6
+ },
7
+ },
8
+ btc: {
9
+ value: {
10
+ btc: '1', eth: '14.213346', eur: '22450', usd: '22914',
11
+ },
12
+ },
13
+ busd: {
14
+ value: {
15
+ btc: '0.00004369', eth: '0.00062074', eur: '0.980451', usd: '1.001',
16
+ },
17
+ },
6
18
  dai: { value: { usdc: '1.00004', xyo: '114.394' } },
7
- doge: { value: { btc: '0.00000293', eth: '0.00004157', eur: '0.065655', usd: '0.067013' } },
8
- dot: { value: { btc: '0.00035508', eth: '0.00504454', eur: '7.97', usd: '8.13' } },
9
- eth: { value: { btc: '0.0703878', eth: '1', eur: '1579.47', usd: '1612.16' } },
19
+ doge: {
20
+ value: {
21
+ btc: '0.00000293', eth: '0.00004157', eur: '0.065655', usd: '0.067013',
22
+ },
23
+ },
24
+ dot: {
25
+ value: {
26
+ btc: '0.00035508', eth: '0.00504454', eur: '7.97', usd: '8.13',
27
+ },
28
+ },
29
+ eth: {
30
+ value: {
31
+ btc: '0.0703878', eth: '1', eur: '1579.47', usd: '1612.16',
32
+ },
33
+ },
10
34
  frax: { value: { usdc: '0.999738' } },
11
35
  link: { value: { xyo: '837.731' } },
12
- sol: { value: { btc: '0.00169369', eth: '0.02406215', eur: '38.01', usd: '38.79' } },
13
- usdc: { value: { btc: '0.0000436965', dai: '0.999963', eth: '0.0006204464999999999', eur: '0.979419', frax: '1.00026', usd: '0.999732' } },
14
- usdt: { value: { btc: '0.00004367', eth: '0.0006204', eur: '0.979881', usd: '1.001', usdc: '1.00022', xyo: '113.28' } },
15
- wbtc: { value: { btc: '0.99903669', eth: '14.2015745', eur: '22418', usd: '22882', usdc: '22860.8', xyo: '2617950' } },
16
- weth: { value: { btc: '0.0703735', usdc: '1610.82', xyo: '186652' } },
17
- xyo: { value: { btc: '3.79226e-7', dai: '0.00874169', eth: '0.000005353785', eur: '0.00844792', link: '0.0011937', usd: '0.00872519' } },
36
+ sol: {
37
+ value: {
38
+ btc: '0.00169369', eth: '0.02406215', eur: '38.01', usd: '38.79',
39
+ },
40
+ },
41
+ usdc: {
42
+ value: {
43
+ btc: '0.0000436965', dai: '0.999963', eth: '0.0006204464999999999', eur: '0.979419', frax: '1.00026', usd: '0.999732',
44
+ },
45
+ },
46
+ usdt: {
47
+ value: {
48
+ btc: '0.00004367', eth: '0.0006204', eur: '0.979881', usd: '1.001', usdc: '1.00022', xyo: '113.28',
49
+ },
50
+ },
51
+ wbtc: {
52
+ value: {
53
+ btc: '0.99903669', eth: '14.2015745', eur: '22418', usd: '22882', usdc: '22860.8', xyo: '2617950',
54
+ },
55
+ },
56
+ weth: {
57
+ value: {
58
+ btc: '0.0703735', usdc: '1610.82', xyo: '186652',
59
+ },
60
+ },
61
+ xyo: {
62
+ value: {
63
+ btc: '3.79226e-7', dai: '0.00874169', eth: '0.000005353785', eur: '0.00844792', link: '0.0011937', usd: '0.00872519',
64
+ },
65
+ },
18
66
  },
19
67
  schema: 'network.xyo.crypto.asset',
20
68
  timestamp: 1_659_625_815_232,
@@ -1,19 +1,9 @@
1
- import type { Meta, StoryFn } from '@storybook/react'
1
+ import type { StoryFn } from '@storybook/react'
2
2
  import React from 'react'
3
3
  import { BrowserRouter } from 'react-router-dom'
4
4
 
5
5
  import { ApiEmbedPluginCard } from '../embed-card/index.ts'
6
6
 
7
- export const xyoEmbedStoryBase: Meta = {
8
- argTypes: {},
9
- component: ApiEmbedPluginCard,
10
- parameters: {
11
- docs: {
12
- page: null,
13
- },
14
- },
15
- }
16
-
17
7
  export const Template: StoryFn<typeof ApiEmbedPluginCard> = (args) => {
18
8
  return (
19
9
  <BrowserRouter>
@@ -0,0 +1,9 @@
1
+ import type { Meta } from '@storybook/react'
2
+
3
+ import { ApiEmbedPluginCard } from '../embed-card/index.ts'
4
+
5
+ export const xyoEmbedStoryBase: Meta = {
6
+ argTypes: {},
7
+ component: ApiEmbedPluginCard,
8
+ parameters: { docs: { page: null } },
9
+ }
@@ -6,7 +6,9 @@ import React from 'react'
6
6
  import { useValidatePayload } from '../../contexts/index.ts'
7
7
 
8
8
  export const ValidatePayloadAlert: React.FC<WithChildren<AlertProps>> = ({ children, ...props }) => {
9
- const { validPayload, enabled, schema } = useValidatePayload()
9
+ const {
10
+ validPayload, enabled, schema,
11
+ } = useValidatePayload()
10
12
 
11
13
  if (enabled && validPayload === false) {
12
14
  return (
@@ -8,12 +8,17 @@ export interface RefreshPayloadProps {
8
8
  refreshPayload?: boolean
9
9
  }
10
10
 
11
- export const RefreshPayloadProvider: React.FC<WithChildren<RefreshPayloadProps>> = ({ children, onRefresh, refreshPayload }) => {
11
+ export const RefreshPayloadProvider: React.FC<WithChildren<RefreshPayloadProps>> = ({
12
+ children, onRefresh, refreshPayload,
13
+ }) => {
12
14
  const [localRefreshPayload, setRefreshPayload] = useState(refreshPayload)
13
15
 
14
16
  return (
15
17
  // eslint-disable-next-line @eslint-react/no-unstable-context-value
16
- <RefreshPayloadContext.Provider value={{ onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload }}>
18
+ <RefreshPayloadContext.Provider value={{
19
+ onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload,
20
+ }}
21
+ >
17
22
  {children}
18
23
  </RefreshPayloadContext.Provider>
19
24
  )
@@ -15,7 +15,9 @@ export type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>
15
15
  export const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {
16
16
  const [payload, setPayload] = useState<Payload>()
17
17
  const [huri, setHuri] = useState<string>()
18
- const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload()
18
+ const {
19
+ refreshPayload, setRefreshPayload, onRefresh,
20
+ } = useRefreshPayload()
19
21
 
20
22
  useEffect(() => {
21
23
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
@@ -45,7 +47,9 @@ export const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProvide
45
47
  }
46
48
  } catch (e) {
47
49
  const error = e as Error
48
- setHuriError({ message: error.message, schema: ModuleErrorSchema, sources: [] })
50
+ setHuriError({
51
+ message: error.message, schema: ModuleErrorSchema, sources: [],
52
+ })
49
53
  }
50
54
  }
51
55
  },
@@ -61,7 +65,10 @@ export const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProvide
61
65
 
62
66
  return (
63
67
  // eslint-disable-next-line @eslint-react/no-unstable-context-value
64
- <ResolvePayloadContext.Provider value={{ huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }}>
68
+ <ResolvePayloadContext.Provider value={{
69
+ huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload,
70
+ }}
71
+ >
65
72
  {children}
66
73
  </ResolvePayloadContext.Provider>
67
74
  )
@@ -1,5 +1,7 @@
1
1
  import { Typography } from '@mui/material'
2
- import type { Decorator, Meta, StoryFn } from '@storybook/react'
2
+ import type {
3
+ Decorator, Meta, StoryFn,
4
+ } from '@storybook/react'
3
5
  import React from 'react'
4
6
 
5
7
  import type { EmbedPluginState } from '../EmbedPluginContext/index.ts'
@@ -12,7 +14,9 @@ import { ValidatePayloadProvider } from './Provider.tsx'
12
14
  import { useValidatePayload } from './use.ts'
13
15
 
14
16
  const EmbedDecorator: Decorator<ValidatePayloadProviderPropsEx> = (Story, { args }) => {
15
- const { xyoEmbedPluginContext, resolvePayloadContext, ...props } = args
17
+ const {
18
+ xyoEmbedPluginContext, resolvePayloadContext, ...props
19
+ } = args
16
20
  console.log(resolvePayloadContext)
17
21
  return (
18
22
  <RefreshPayloadProvider>
@@ -72,6 +76,8 @@ ValidationFailed.args = {
72
76
  xyoEmbedPluginContext: stubProviderDefaultValue,
73
77
  }
74
78
 
75
- export { Default, ValidationFailed, ValidationSucceeded }
79
+ export {
80
+ Default, ValidationFailed, ValidationSucceeded,
81
+ }
76
82
 
77
83
  export default StorybookEntry
@@ -37,7 +37,10 @@ export const ValidatePayloadProvider: React.FC<WithChildren<ValidatePayloadProvi
37
37
 
38
38
  return (
39
39
  // eslint-disable-next-line @eslint-react/no-unstable-context-value
40
- <ValidatePayloadContext.Provider value={{ enabled, provided: true, schema: payload?.schema, validPayload: valid }}>
40
+ <ValidatePayloadContext.Provider value={{
41
+ enabled, provided: true, schema: payload?.schema, validPayload: valid,
42
+ }}
43
+ >
41
44
  {enabled
42
45
  ? <>{initialized ? children : <Chip label="Validating Payload..." />}</>
43
46
  : children}
package/xy.config.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
2
  const config: XyTsupConfig = {
3
3
  compile: {
4
- browser: {
5
- src: true,
6
- },
4
+ browser: { src: true },
7
5
  node: {},
8
6
  neutral: {},
9
7
  },