@xyo-network/react-embed 3.0.1 → 3.0.3

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.
Files changed (138) 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 +57 -54
  103. package/src/components/EmbedPlugin.tsx +9 -5
  104. package/src/components/EmbedResolver.tsx +4 -2
  105. package/src/components/controls/EmbedFormControl.tsx +6 -3
  106. package/src/components/controls/ListModeSelect.tsx +4 -2
  107. package/src/components/controls/RenderSelect.tsx +5 -2
  108. package/src/components/embed-card/EmbedCardResolver.tsx +11 -4
  109. package/src/components/embed-card/EmbedPluginCard.tsx +9 -4
  110. package/src/components/embed-card/card/BusyCard.tsx +7 -4
  111. package/src/components/embed-card/card/EmbedCardHeader.tsx +10 -3
  112. package/src/components/embed-card/card/EmbedPluginCard.tsx +5 -2
  113. package/src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx +6 -4
  114. package/src/components/embed-card/error-handling/EmbedErrorCard.tsx +14 -5
  115. package/src/components/embed-card/menu/EmbedMenu.tsx +2 -1
  116. package/src/components/embed-card/menu/JsonMenuItem.tsx +4 -1
  117. package/src/components/stories/XyoEmbedPlugin.examples.stories.tsx +1 -1
  118. package/src/components/stories/XyoEmbedPlugin.states.stories.tsx +4 -2
  119. package/src/components/stories/storyPayload.ts +60 -12
  120. package/src/components/stories/storyShared.tsx +1 -11
  121. package/src/components/stories/xyoEmbedStoryBase.ts +9 -0
  122. package/src/components/validation-alerts/ValidatePayload.tsx +6 -3
  123. package/src/components/validation-alerts/ValidatePlugins.tsx +3 -2
  124. package/src/contexts/EmbedPluginContext/Context.ts +1 -1
  125. package/src/contexts/EmbedPluginContext/Provider.tsx +3 -3
  126. package/src/contexts/EmbedPluginContext/State.ts +3 -3
  127. package/src/contexts/RefreshPayloadContext/Context.ts +1 -1
  128. package/src/contexts/RefreshPayloadContext/Provider.tsx +8 -3
  129. package/src/contexts/RefreshPayloadContext/State.ts +2 -2
  130. package/src/contexts/ResolvePayloadContext/Context.ts +1 -1
  131. package/src/contexts/ResolvePayloadContext/Provider.tsx +14 -6
  132. package/src/contexts/ResolvePayloadContext/State.ts +3 -3
  133. package/src/contexts/ValidatePayloadContext/Context.ts +1 -1
  134. package/src/contexts/ValidatePayloadContext/Provider.stories.tsx +15 -6
  135. package/src/contexts/ValidatePayloadContext/Provider.tsx +7 -3
  136. package/src/contexts/ValidatePayloadContext/State.ts +1 -1
  137. package/src/types/EmbedPluginProps.ts +2 -2
  138. package/xy.config.ts +2 -4
@@ -1,10 +1,12 @@
1
- import { FlexBoxProps } from '@xylabs/react-flexbox'
2
- import { WithChildren } from '@xylabs/react-shared'
1
+ import type { FlexBoxProps } from '@xylabs/react-flexbox'
2
+ 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'
7
- import { EmbedPluginProps } from '../types/index.ts'
6
+ import {
7
+ EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider,
8
+ } from '../contexts/index.ts'
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'
10
12
 
@@ -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}>
@@ -1,11 +1,13 @@
1
- import { WithChildren } from '@xylabs/react-shared'
1
+ import type { WithChildren } from '@xylabs/react-shared'
2
2
  import { LoadResult } from '@xyo-network/react-shared'
3
3
  import React from 'react'
4
4
 
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}>
@@ -1,5 +1,6 @@
1
- import { FormControl, FormControlProps, InputLabel } from '@mui/material'
2
- import { WithChildren } from '@xylabs/react-shared'
1
+ import type { FormControlProps } from '@mui/material'
2
+ import { FormControl, InputLabel } from '@mui/material'
3
+ import type { WithChildren } from '@xylabs/react-shared'
3
4
  import React from 'react'
4
5
 
5
6
  interface EmbedFormControlProps extends FormControlProps {
@@ -7,7 +8,9 @@ interface EmbedFormControlProps extends FormControlProps {
7
8
  formLabel?: string
8
9
  }
9
10
 
10
- 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
+ }) => {
11
14
  return (
12
15
  <FormControl {...props}>
13
16
  <InputLabel id={formId}>{formLabel}</InputLabel>
@@ -1,6 +1,8 @@
1
1
  import { MenuItem } from '@mui/material'
2
- import { SelectEx, SelectExProps } from '@xylabs/react-select'
3
- import { ListMode, useListMode } from '@xyo-network/react-shared'
2
+ import type { SelectExProps } from '@xylabs/react-select'
3
+ import { SelectEx } from '@xylabs/react-select'
4
+ import type { ListMode } from '@xyo-network/react-shared'
5
+ import { useListMode } from '@xyo-network/react-shared'
4
6
  import React from 'react'
5
7
 
6
8
  import { EmbedFormControl } from './EmbedFormControl.tsx'
@@ -1,5 +1,6 @@
1
1
  import { MenuItem } from '@mui/material'
2
- import { SelectEx, SelectExProps } from '@xylabs/react-select'
2
+ import type { SelectExProps } from '@xylabs/react-select'
3
+ import { SelectEx } from '@xylabs/react-select'
3
4
  import React from 'react'
4
5
 
5
6
  import { useEmbedPluginState } from '../../contexts/index.ts'
@@ -9,7 +10,9 @@ const renderSelectId = 'render-select-id'
9
10
  const renderSelectLabel = 'Renderer'
10
11
 
11
12
  export const EmbedRenderSelect: React.FC<SelectExProps<string>> = (props) => {
12
- const { activePlugin, setActivePlugin, plugins } = useEmbedPluginState()
13
+ const {
14
+ activePlugin, setActivePlugin, plugins,
15
+ } = useEmbedPluginState()
13
16
  return (
14
17
  <EmbedFormControl formId={renderSelectId} formLabel={renderSelectLabel}>
15
18
  <SelectEx size="small" value={activePlugin?.name} {...props}>
@@ -1,6 +1,7 @@
1
1
  import { useTheme } from '@mui/material'
2
- import { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'
3
- import { WithChildren } from '@xylabs/react-shared'
2
+ import type { FlexBoxProps } from '@xylabs/react-flexbox'
3
+ import { FlexCol } from '@xylabs/react-flexbox'
4
+ import type { WithChildren } from '@xylabs/react-shared'
4
5
  import { LoadResult } from '@xyo-network/react-shared'
5
6
  import React from 'react'
6
7
 
@@ -8,7 +9,9 @@ import { useRefreshPayload, useResolvePayload } from '../../contexts/index.ts'
8
9
  import { EmbedCardApiErrorRenderer } from './error-handling/index.ts'
9
10
 
10
11
  export const EmbedCardResolverFlexBox: React.FC<WithChildren<FlexBoxProps>> = ({ children, ...props }) => {
11
- const { payload, notFound, huriError } = useResolvePayload()
12
+ const {
13
+ payload, notFound, huriError,
14
+ } = useResolvePayload()
12
15
  const { refreshPayload } = useRefreshPayload()
13
16
  const theme = useTheme()
14
17
 
@@ -20,7 +23,11 @@ export const EmbedCardResolverFlexBox: React.FC<WithChildren<FlexBoxProps>> = ({
20
23
  alignItems="stretch"
21
24
  justifyContent="start"
22
25
  busy={Boolean(!refreshPayload && payload)}
23
- 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
+ }}
24
31
  {...props}
25
32
  >
26
33
  {children}
@@ -1,11 +1,12 @@
1
1
  import { useTheme } from '@mui/material'
2
- import { WithChildren } from '@xylabs/react-shared'
2
+ import type { WithChildren } from '@xylabs/react-shared'
3
3
  import React from 'react'
4
4
 
5
5
  import { useRefreshPayload, useResolvePayload } from '../../contexts/index.ts'
6
- import { EmbedPluginProps } from '../../types/index.ts'
6
+ import type { EmbedPluginProps } from '../../types/index.ts'
7
7
  import { EmbedPluginInner } from '../EmbedPlugin.tsx'
8
- import { BusyCardProps, EmbedPluginCard } from './card/index.ts'
8
+ import type { BusyCardProps } from './card/index.ts'
9
+ import { EmbedPluginCard } from './card/index.ts'
9
10
  import { EmbedCardApiErrorRenderer } from './error-handling/index.ts'
10
11
 
11
12
  export interface EmbedPluginCardProps extends WithChildren, EmbedPluginProps, BusyCardProps {}
@@ -53,7 +54,11 @@ export const EmbedPluginCardInner: React.FC<BusyCardProps> = (props) => {
53
54
  elevation={3}
54
55
  variant="elevation"
55
56
  busy={Boolean(!refreshPayload && payload)}
56
- 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
+ }}
57
62
  sx={{ position: 'relative' }}
58
63
  {...props}
59
64
  />
@@ -1,13 +1,16 @@
1
- import { Card, CardProps } from '@mui/material'
1
+ import type { CardProps } from '@mui/material'
2
+ import { Card } from '@mui/material'
2
3
  import { useBusyTiming } from '@xylabs/react-flexbox'
3
- import {
4
- BusyCircularProgress,
4
+ import type {
5
5
  BusyCircularProgressProps,
6
- BusyLinearProgress,
7
6
  BusyLinearProgressProps,
8
7
  BusyVariant,
9
8
  WithChildren,
10
9
  } from '@xylabs/react-shared'
10
+ import {
11
+ BusyCircularProgress,
12
+ BusyLinearProgress,
13
+ } from '@xylabs/react-shared'
11
14
  import React from 'react'
12
15
 
13
16
  export interface BusyCardProps extends CardProps {
@@ -1,5 +1,8 @@
1
1
  import { Refresh as RefreshIcon } from '@mui/icons-material'
2
- import { Avatar, CardHeader, CardHeaderProps, Chip, Theme } from '@mui/material'
2
+ import type { CardHeaderProps, Theme } from '@mui/material'
3
+ import {
4
+ Avatar, CardHeader, Chip,
5
+ } from '@mui/material'
3
6
  import { FlexRow } from '@xylabs/react-flexbox'
4
7
  import React from 'react'
5
8
 
@@ -8,8 +11,12 @@ import { EmbedMenu } from '../menu/index.ts'
8
11
 
9
12
  export const EmbedCardHeader: React.FC<CardHeaderProps> = () => {
10
13
  const { refreshHuri, huri } = useResolvePayload()
11
- const { activePlugin, timestampLabel, hideElementsConfig } = useEmbedPluginState()
12
- 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 ?? {}
13
20
  // this is temporary so that we can add the ability to get a timestamp via diviner later
14
21
  const timestamp = Date.now()
15
22
  return (
@@ -5,12 +5,15 @@ import React from 'react'
5
5
 
6
6
  import { useEmbedPluginState, useResolvePayload } from '../../../contexts/index.ts'
7
7
  import { EmbedRenderSelect, ListModeSelectFormControl } from '../../controls/index.ts'
8
- import { BusyCard, BusyCardProps } from './BusyCard.tsx'
8
+ import type { BusyCardProps } from './BusyCard.tsx'
9
+ import { BusyCard } from './BusyCard.tsx'
9
10
  import { EmbedCardHeader } from './EmbedCardHeader.tsx'
10
11
 
11
12
  export const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {
12
13
  const { payload } = useResolvePayload()
13
- const { activePlugin: ActivePlugin, plugins, hideElementsConfig } = useEmbedPluginState()
14
+ const {
15
+ activePlugin: ActivePlugin, plugins, hideElementsConfig,
16
+ } = useEmbedPluginState()
14
17
  const { listMode } = useListMode()
15
18
  const supportsListMode = ActivePlugin?.components?.box?.listModes?.length ?? 0 > 1
16
19
 
@@ -1,6 +1,6 @@
1
- import { CardProps } from '@mui/material'
2
- import { WithChildren } from '@xylabs/react-shared'
3
- import { ModuleError } from '@xyo-network/payload-model'
1
+ import type { CardProps } from '@mui/material'
2
+ import type { WithChildren } from '@xylabs/react-shared'
3
+ import type { ModuleError } from '@xyo-network/payload-model'
4
4
  import { ErrorAlert, ErrorRender } from '@xyo-network/react-error'
5
5
  import React from 'react'
6
6
 
@@ -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,8 @@
1
- import { Alert, AlertProps, AlertTitle, Card, CardContent, CardProps, Typography } from '@mui/material'
2
- import { WithChildren } from '@xylabs/react-shared'
1
+ import type { AlertProps, CardProps } from '@mui/material'
2
+ import {
3
+ Alert, AlertTitle, Card, CardContent, Typography,
4
+ } from '@mui/material'
5
+ import type { WithChildren } from '@xylabs/react-shared'
3
6
  import React from 'react'
4
7
 
5
8
  interface EmbedErrorCardBaseProps {
@@ -12,8 +15,12 @@ interface EmbedErrorCardBaseProps {
12
15
  interface EmbedErrorCardProps extends EmbedErrorCardBaseProps, CardProps {}
13
16
 
14
17
  export const EmbedErrorCard: React.FC<WithChildren<EmbedErrorCardProps>> = (props) => {
15
- const { alertProps, error, scope, hideErrorDetails = true, children, ...cardProps } = props
16
- 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
+ }
17
24
  return (
18
25
  <Card {...cardProps}>
19
26
  <CardContent>{children ?? <DefaultErrorAlert {...errorProps} />}</CardContent>
@@ -21,7 +28,9 @@ export const EmbedErrorCard: React.FC<WithChildren<EmbedErrorCardProps>> = (prop
21
28
  )
22
29
  }
23
30
 
24
- const DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({ alertProps, scope, hideErrorDetails, error }) => {
31
+ const DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({
32
+ alertProps, scope, hideErrorDetails, error,
33
+ }) => {
25
34
  return (
26
35
  <Alert severity="error" {...alertProps}>
27
36
  <AlertTitle>Whoops! Something went wrong</AlertTitle>
@@ -1,5 +1,6 @@
1
1
  import { MoreVert as MoreVertIcon } from '@mui/icons-material'
2
- import { IconButton, IconButtonProps, Menu } from '@mui/material'
2
+ import type { IconButtonProps } from '@mui/material'
3
+ import { IconButton, Menu } from '@mui/material'
3
4
  import React, { useState } from 'react'
4
5
 
5
6
  import { JsonMenuItem } from './JsonMenuItem.tsx'
@@ -1,5 +1,8 @@
1
1
  import { OpenInNew as OpenInNewIcon } from '@mui/icons-material'
2
- import { ListItemIcon, ListItemText, MenuItem, MenuItemProps } from '@mui/material'
2
+ import type { MenuItemProps } from '@mui/material'
3
+ import {
4
+ ListItemIcon, ListItemText, MenuItem,
5
+ } from '@mui/material'
3
6
  import React from 'react'
4
7
 
5
8
  import { useResolvePayload } from '../../../contexts/index.ts'
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/react'
1
+ import type { Meta } from '@storybook/react'
2
2
  import { CryptoAssetRenderPlugin } from '@xyo-network/react-aggregate-price-plugin'
3
3
  import { UniswapPairsRenderPlugin } from '@xyo-network/react-crypto-market-uniswap-plugin'
4
4
 
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/react'
1
+ import type { Meta } from '@storybook/react'
2
2
  import { CryptoAssetRenderPlugin } from '@xyo-network/react-aggregate-price-plugin'
3
3
  import { UniswapPairsRenderPlugin } from '@xyo-network/react-crypto-market-uniswap-plugin'
4
4
  import { createPayloadRenderPlugin } from '@xyo-network/react-payload-plugin'
@@ -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 { 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
+ }
@@ -1,11 +1,14 @@
1
- import { Alert, AlertProps } from '@mui/material'
2
- import { WithChildren } from '@xylabs/react-shared'
1
+ import type { AlertProps } from '@mui/material'
2
+ import { Alert } from '@mui/material'
3
+ import type { WithChildren } from '@xylabs/react-shared'
3
4
  import React from 'react'
4
5
 
5
6
  import { useValidatePayload } from '../../contexts/index.ts'
6
7
 
7
8
  export const ValidatePayloadAlert: React.FC<WithChildren<AlertProps>> = ({ children, ...props }) => {
8
- const { validPayload, enabled, schema } = useValidatePayload()
9
+ const {
10
+ validPayload, enabled, schema,
11
+ } = useValidatePayload()
9
12
 
10
13
  if (enabled && validPayload === false) {
11
14
  return (
@@ -1,5 +1,6 @@
1
- import { Alert, AlertProps, AlertTitle } from '@mui/material'
2
- import { WithChildren } from '@xylabs/react-shared'
1
+ import type { AlertProps } from '@mui/material'
2
+ import { Alert, AlertTitle } from '@mui/material'
3
+ import type { WithChildren } from '@xylabs/react-shared'
3
4
  import React from 'react'
4
5
 
5
6
  import { useEmbedPluginState, useResolvePayload } from '../../contexts/index.ts'
@@ -1,5 +1,5 @@
1
1
  import { createContextEx } from '@xyo-network/react-shared'
2
2
 
3
- import { EmbedPluginState } from './State.ts'
3
+ import type { EmbedPluginState } from './State.ts'
4
4
 
5
5
  export const EmbedPluginContext = createContextEx<EmbedPluginState>()
@@ -1,9 +1,9 @@
1
- import { WithChildren } from '@xylabs/react-shared'
2
- import { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'
1
+ import type { WithChildren } from '@xylabs/react-shared'
2
+ import type { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'
3
3
  import React, { useEffect, useState } from 'react'
4
4
 
5
5
  import { EmbedPluginContext } from './Context.ts'
6
- import { EmbedPluginBase } from './State.ts'
6
+ import type { EmbedPluginBase } from './State.ts'
7
7
 
8
8
  export type EmbedPluginProviderProps = EmbedPluginBase
9
9
 
@@ -1,6 +1,6 @@
1
- import { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'
2
- import { ContextExState, ListMode } from '@xyo-network/react-shared'
3
- import { Dispatch, SetStateAction } from 'react'
1
+ import type { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'
2
+ import type { ContextExState, ListMode } from '@xyo-network/react-shared'
3
+ import type { Dispatch, SetStateAction } from 'react'
4
4
 
5
5
  export interface EmbedPluginVisibilityConfig {
6
6
  hideAvatar?: boolean
@@ -1,5 +1,5 @@
1
1
  import { createContextEx } from '@xyo-network/react-shared'
2
2
 
3
- import { RefreshPayloadState } from './State.ts'
3
+ import type { RefreshPayloadState } from './State.ts'
4
4
 
5
5
  export const RefreshPayloadContext = createContextEx<RefreshPayloadState>()
@@ -1,4 +1,4 @@
1
- import { WithChildren } from '@xylabs/react-shared'
1
+ import type { WithChildren } from '@xylabs/react-shared'
2
2
  import React, { useState } from 'react'
3
3
 
4
4
  import { RefreshPayloadContext } from './Context.ts'
@@ -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
  )
@@ -1,5 +1,5 @@
1
- import { ContextExState } from '@xyo-network/react-shared'
2
- import { Dispatch, SetStateAction } from 'react'
1
+ import type { ContextExState } from '@xyo-network/react-shared'
2
+ import type { Dispatch, SetStateAction } from 'react'
3
3
 
4
4
  export interface RefreshPayloadState extends ContextExState {
5
5
  onRefresh?: () => void
@@ -1,5 +1,5 @@
1
1
  import { createContextEx } from '@xyo-network/react-shared'
2
2
 
3
- import { ResolvePayloadState } from './State.ts'
3
+ import type { ResolvePayloadState } from './State.ts'
4
4
 
5
5
  export const ResolvePayloadContext = createContextEx<ResolvePayloadState>()
@@ -1,20 +1,23 @@
1
1
  import { delay } from '@xylabs/delay'
2
2
  import { useAsyncEffect } from '@xylabs/react-async-effect'
3
- import { WithChildren } from '@xylabs/react-shared'
3
+ import type { WithChildren } from '@xylabs/react-shared'
4
4
  import { Huri } from '@xyo-network/huri'
5
- import { ModuleError, ModuleErrorSchema, Payload } from '@xyo-network/payload-model'
5
+ import type { ModuleError, Payload } from '@xyo-network/payload-model'
6
+ import { ModuleErrorSchema } from '@xyo-network/payload-model'
6
7
  import React, { useEffect, useState } from 'react'
7
8
 
8
9
  import { useRefreshPayload } from '../RefreshPayloadContext/index.ts'
9
10
  import { ResolvePayloadContext } from './Context.ts'
10
- import { ResolvePayloadState } from './State.ts'
11
+ import type { ResolvePayloadState } from './State.ts'
11
12
 
12
13
  export type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>
13
14
 
14
15
  export const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {
15
16
  const [payload, setPayload] = useState<Payload>()
16
17
  const [huri, setHuri] = useState<string>()
17
- const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload()
18
+ const {
19
+ refreshPayload, setRefreshPayload, onRefresh,
20
+ } = useRefreshPayload()
18
21
 
19
22
  useEffect(() => {
20
23
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
@@ -44,7 +47,9 @@ export const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProvide
44
47
  }
45
48
  } catch (e) {
46
49
  const error = e as Error
47
- setHuriError({ message: error.message, schema: ModuleErrorSchema, sources: [] })
50
+ setHuriError({
51
+ message: error.message, schema: ModuleErrorSchema, sources: [],
52
+ })
48
53
  }
49
54
  }
50
55
  },
@@ -60,7 +65,10 @@ export const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProvide
60
65
 
61
66
  return (
62
67
  // eslint-disable-next-line @eslint-react/no-unstable-context-value
63
- <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
+ >
64
72
  {children}
65
73
  </ResolvePayloadContext.Provider>
66
74
  )
@@ -1,6 +1,6 @@
1
- import { ModuleError, Payload } from '@xyo-network/payload-model'
2
- import { ContextExState } from '@xyo-network/react-shared'
3
- import { Dispatch, SetStateAction } from 'react'
1
+ import type { ModuleError, Payload } from '@xyo-network/payload-model'
2
+ import type { ContextExState } from '@xyo-network/react-shared'
3
+ import type { Dispatch, SetStateAction } from 'react'
4
4
 
5
5
  export interface ResolvePayloadState extends ContextExState {
6
6
  huri?: string
@@ -1,5 +1,5 @@
1
1
  import { createContextEx } from '@xyo-network/react-shared'
2
2
 
3
- import { ValidatePayloadState } from './State.ts'
3
+ import type { ValidatePayloadState } from './State.ts'
4
4
 
5
5
  export const ValidatePayloadContext = createContextEx<ValidatePayloadState>()