@xyo-network/os-react-runtime 7.2.0 → 7.3.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.
Files changed (322) hide show
  1. package/dist/browser/helpers/BridgeActivityHelper.d.ts +3 -5
  2. package/dist/browser/helpers/BridgeActivityHelper.d.ts.map +1 -1
  3. package/dist/browser/helpers/BrowserLocator.d.ts +1 -1
  4. package/dist/browser/helpers/BrowserLocator.d.ts.map +1 -1
  5. package/dist/browser/helpers/widget/Caller.d.ts.map +1 -1
  6. package/dist/browser/img/backgrounds/index.d.ts +18 -18
  7. package/dist/browser/img/backgrounds/index.d.ts.map +1 -1
  8. package/dist/browser/index.mjs +2664 -2504
  9. package/dist/browser/index.mjs.map +1 -1
  10. package/dist/browser/modules/Dapp/Alert/RenderErrorWithSupportLink.d.ts.map +1 -1
  11. package/dist/browser/modules/Dapp/Button/StyledComponents.d.ts +3 -3
  12. package/dist/browser/modules/Dapp/Button/StyledComponents.d.ts.map +1 -1
  13. package/dist/browser/modules/Dapp/Button/StyledDappIconBuilder.d.ts +1 -1
  14. package/dist/browser/modules/Dapp/Button/StyledDappIconBuilder.d.ts.map +1 -1
  15. package/dist/browser/modules/Dapp/Button/hooks/useLaunchPoint.d.ts +1 -1
  16. package/dist/browser/modules/Dapp/Button/hooks/useLaunchPoint.d.ts.map +1 -1
  17. package/dist/browser/modules/Dapp/Button/lib/decomposeProps.d.ts +9 -1098
  18. package/dist/browser/modules/Dapp/Button/lib/decomposeProps.d.ts.map +1 -1
  19. package/dist/browser/modules/Dapp/Page/DappPathSwitcher.d.ts.map +1 -1
  20. package/dist/browser/modules/Dapp/Page/Row.d.ts +1 -1
  21. package/dist/browser/modules/Dapp/Page/Row.d.ts.map +1 -1
  22. package/dist/browser/modules/Dapp/modules/Window/LoadingFlexbox.d.ts.map +1 -1
  23. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts +1 -1
  24. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts.map +1 -1
  25. package/dist/browser/modules/Dapp/modules/Window/components/menu/BottomNavigation.d.ts.map +1 -1
  26. package/dist/browser/modules/Dapp/modules/Window/components/menu/Drawer.d.ts.map +1 -1
  27. package/dist/browser/modules/Dapp/modules/Window/components/menu/SocialData.d.ts.map +1 -1
  28. package/dist/browser/modules/Dapp/modules/Window/components/menu/StyledListItems.d.ts +2 -2
  29. package/dist/browser/modules/Dapp/modules/Window/components/menu/StyledListItems.d.ts.map +1 -1
  30. package/dist/browser/modules/Dapp/modules/Window/components/menu/img/index.d.ts +2 -2
  31. package/dist/browser/modules/Dapp/modules/Window/components/menu/img/index.d.ts.map +1 -1
  32. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenu.d.ts.map +1 -1
  33. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.d.ts +2 -2
  34. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.d.ts.map +1 -1
  35. package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.d.ts.map +1 -1
  36. package/dist/browser/modules/Dapp/modules/Window/hooks/useSyncOsRegisteredAccessInterfaces.d.ts +1 -1
  37. package/dist/browser/modules/Dapp/modules/access-interface/components/Dialog.d.ts.map +1 -1
  38. package/dist/browser/modules/LoadingOsLogo/img/index.d.ts +1 -1
  39. package/dist/browser/modules/LoadingOsLogo/img/index.d.ts.map +1 -1
  40. package/dist/browser/modules/XyOsUi/lib/XyOsUi.d.ts.map +1 -1
  41. package/dist/browser/modules/bios/hooks/useKernel.d.ts +1 -1
  42. package/dist/browser/modules/bios/hooks/useKernel.d.ts.map +1 -1
  43. package/dist/browser/modules/dapps/accounts/components/AccountCard.d.ts +1 -1
  44. package/dist/browser/modules/dapps/accounts/components/AccountCard.d.ts.map +1 -1
  45. package/dist/browser/modules/dapps/accounts/models/CreditCardInput.d.ts +5 -3
  46. package/dist/browser/modules/dapps/accounts/models/CreditCardInput.d.ts.map +1 -1
  47. package/dist/browser/modules/dapps/table/head/Schema.d.ts +3 -1
  48. package/dist/browser/modules/dapps/table/head/Schema.d.ts.map +1 -1
  49. package/dist/browser/modules/dapps/table/head/components/StyledTableRowHeader.d.ts +1 -1
  50. package/dist/browser/modules/dapps/table/head/components/StyledTableRowHeader.d.ts.map +1 -1
  51. package/dist/browser/modules/intent/useDappIntentListener2.d.ts.map +1 -1
  52. package/dist/browser/modules/intent/useNavigateIntent.d.ts +2 -2
  53. package/dist/browser/modules/intent/useNavigateIntent.d.ts.map +1 -1
  54. package/dist/browser/modules/network/components/LoadingIndicator.d.ts.map +1 -1
  55. package/dist/browser/modules/network/components/StyledLoadingIndicator.d.ts +1 -1
  56. package/dist/browser/modules/network/components/StyledLoadingIndicator.d.ts.map +1 -1
  57. package/dist/browser/modules/os/hooks/useDappContextCreator.d.ts +0 -1
  58. package/dist/browser/modules/os/hooks/useDappContextCreator.d.ts.map +1 -1
  59. package/dist/browser/modules/os/hooks/useDappRegistrationResults.d.ts.map +1 -1
  60. package/dist/browser/modules/os/hooks/useDappRegistry.d.ts.map +1 -1
  61. package/dist/browser/modules/os/hooks/useDappSeedPhraseRepository.d.ts +1 -1
  62. package/dist/browser/modules/os/hooks/useDappSeedPhraseRepository.d.ts.map +1 -1
  63. package/dist/browser/modules/resource/ResourceHooks.d.ts.map +1 -1
  64. package/dist/browser/modules/resource/useSyncExternalPayloadStore.d.ts.map +1 -1
  65. package/dist/browser/modules/stack/useStackReady.d.ts.map +1 -1
  66. package/dist/browser/modules/widgets/Types/BarGraph/StyledLinearProgress.d.ts +1 -1
  67. package/dist/browser/modules/widgets/Types/BarGraph/StyledLinearProgress.d.ts.map +1 -1
  68. package/dist/browser/modules/widgets/Types/Stat/Subtitle.d.ts +1 -1
  69. package/dist/browser/modules/widgets/Types/Stat/Subtitle.d.ts.map +1 -1
  70. package/dist/browser/modules/widgets/Types/Stat/Unit.d.ts +1 -1
  71. package/dist/browser/modules/widgets/Types/Stat/Unit.d.ts.map +1 -1
  72. package/dist/browser/modules/widgets/Types/Stat/Value.d.ts +1 -1
  73. package/dist/browser/modules/widgets/Types/Stat/Value.d.ts.map +1 -1
  74. package/dist/browser/modules/widgets/Types/Tables/BooleanTable.d.ts +4 -4
  75. package/dist/browser/modules/widgets/Types/Tables/BooleanTable.d.ts.map +1 -1
  76. package/dist/browser/settings/Theme/ThemeCssVars.d.ts +1 -1
  77. package/dist/browser/settings/Theme/ThemeCssVars.d.ts.map +1 -1
  78. package/package.json +323 -75
  79. package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/DefaultData.d.ts +0 -10
  80. package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/DefaultData.d.ts.map +0 -1
  81. package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.d.ts +0 -6
  82. package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.d.ts.map +0 -1
  83. package/src/helpers/BridgeActivityHelper.ts +0 -40
  84. package/src/helpers/BrowserLocator.ts +0 -18
  85. package/src/helpers/NodePalettes.ts +0 -84
  86. package/src/helpers/index.ts +0 -5
  87. package/src/helpers/monitor/XyOsBrowserMonitor.ts +0 -14
  88. package/src/helpers/monitor/index.ts +0 -1
  89. package/src/helpers/widget/Caller.tsx +0 -124
  90. package/src/helpers/widget/index.ts +0 -1
  91. package/src/img/backgrounds/candy-dark@3x.webp +0 -0
  92. package/src/img/backgrounds/candy-light@3x.webp +0 -0
  93. package/src/img/backgrounds/candyApple-dark@3x.webp +0 -0
  94. package/src/img/backgrounds/candyApple-light@3x.webp +0 -0
  95. package/src/img/backgrounds/images.d.ts +0 -5
  96. package/src/img/backgrounds/index.ts +0 -18
  97. package/src/img/backgrounds/moss-dark@3x.webp +0 -0
  98. package/src/img/backgrounds/moss-light@3x.webp +0 -0
  99. package/src/img/backgrounds/ocean-dark@3x.webp +0 -0
  100. package/src/img/backgrounds/ocean-light@3x.webp +0 -0
  101. package/src/img/backgrounds/peachYogurt-dark@3x.webp +0 -0
  102. package/src/img/backgrounds/peachYogurt-light@3x.webp +0 -0
  103. package/src/img/backgrounds/sherbet-dark@3x.webp +0 -0
  104. package/src/img/backgrounds/sherbet-light@3x.webp +0 -0
  105. package/src/img/backgrounds/spring-dark@3x.webp +0 -0
  106. package/src/img/backgrounds/spring-light@3x.webp +0 -0
  107. package/src/img/backgrounds/sunset-dark@3x.webp +0 -0
  108. package/src/img/backgrounds/sunset-light@3x.webp +0 -0
  109. package/src/img/backgrounds/xyo-dark@3x.webp +0 -0
  110. package/src/img/backgrounds/xyo-light@3x.webp +0 -0
  111. package/src/img/index.ts +0 -1
  112. package/src/index.ts +0 -5
  113. package/src/interfaces/StackReady.ts +0 -6
  114. package/src/interfaces/index.ts +0 -1
  115. package/src/modules/Dapp/Alert/RenderErrorWithSupportLink.tsx +0 -50
  116. package/src/modules/Dapp/Alert/index.ts +0 -1
  117. package/src/modules/Dapp/Button/IconEx.tsx +0 -96
  118. package/src/modules/Dapp/Button/LaunchFrame.tsx +0 -77
  119. package/src/modules/Dapp/Button/StyledComponents.tsx +0 -55
  120. package/src/modules/Dapp/Button/StyledDappIconBuilder.tsx +0 -17
  121. package/src/modules/Dapp/Button/hooks/index.ts +0 -1
  122. package/src/modules/Dapp/Button/hooks/useLaunchPoint.tsx +0 -31
  123. package/src/modules/Dapp/Button/index.ts +0 -4
  124. package/src/modules/Dapp/Button/lib/decomposeProps.tsx +0 -15
  125. package/src/modules/Dapp/Button/lib/index.ts +0 -1
  126. package/src/modules/Dapp/Container.tsx +0 -63
  127. package/src/modules/Dapp/ContainerFlexbox.tsx +0 -30
  128. package/src/modules/Dapp/Debug/Dialog.tsx +0 -54
  129. package/src/modules/Dapp/Debug/index.ts +0 -1
  130. package/src/modules/Dapp/EnterAnimation.tsx +0 -54
  131. package/src/modules/Dapp/Page/DappPage.tsx +0 -115
  132. package/src/modules/Dapp/Page/DappPathSwitcher.tsx +0 -58
  133. package/src/modules/Dapp/Page/DividerChip.tsx +0 -31
  134. package/src/modules/Dapp/Page/Row.tsx +0 -69
  135. package/src/modules/Dapp/Page/index.ts +0 -3
  136. package/src/modules/Dapp/RenderHtml.tsx +0 -12
  137. package/src/modules/Dapp/index.ts +0 -8
  138. package/src/modules/Dapp/lib/DappState.ts +0 -5
  139. package/src/modules/Dapp/lib/DefaultIconSize.ts +0 -1
  140. package/src/modules/Dapp/lib/deriveDappState.ts +0 -16
  141. package/src/modules/Dapp/lib/index.ts +0 -3
  142. package/src/modules/Dapp/modules/Window/AppBar.tsx +0 -115
  143. package/src/modules/Dapp/modules/Window/Chrome.tsx +0 -79
  144. package/src/modules/Dapp/modules/Window/DappWindow.tsx +0 -39
  145. package/src/modules/Dapp/modules/Window/LoadingFlexbox.tsx +0 -99
  146. package/src/modules/Dapp/modules/Window/MetaTags.tsx +0 -27
  147. package/src/modules/Dapp/modules/Window/NodeManifest.tsx +0 -16
  148. package/src/modules/Dapp/modules/Window/Rendered.tsx +0 -101
  149. package/src/modules/Dapp/modules/Window/Trail.tsx +0 -33
  150. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.tsx +0 -82
  151. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/DeveloperLinkSection.tsx +0 -27
  152. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/InstallButtonSection.tsx +0 -34
  153. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/SummarySection.tsx +0 -73
  154. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/index.ts +0 -1
  155. package/src/modules/Dapp/modules/Window/components/index.ts +0 -2
  156. package/src/modules/Dapp/modules/Window/components/menu/BottomMenuArea.tsx +0 -130
  157. package/src/modules/Dapp/modules/Window/components/menu/BottomNavigation.tsx +0 -66
  158. package/src/modules/Dapp/modules/Window/components/menu/Drawer.tsx +0 -160
  159. package/src/modules/Dapp/modules/Window/components/menu/SocialData.tsx +0 -71
  160. package/src/modules/Dapp/modules/Window/components/menu/StyledListItems.tsx +0 -36
  161. package/src/modules/Dapp/modules/Window/components/menu/img/index.ts +0 -2
  162. package/src/modules/Dapp/modules/Window/components/menu/img/xyoOS-Icon-Black.svg +0 -1
  163. package/src/modules/Dapp/modules/Window/components/menu/img/xyoOS-Icon-White.svg +0 -1
  164. package/src/modules/Dapp/modules/Window/components/menu/index.ts +0 -3
  165. package/src/modules/Dapp/modules/Window/components/menu/stories/DefaultData.tsx +0 -118
  166. package/src/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.tsx +0 -36
  167. package/src/modules/Dapp/modules/Window/components/menu/stories/default.manifest.json +0 -20
  168. package/src/modules/Dapp/modules/Window/hooks/index.ts +0 -8
  169. package/src/modules/Dapp/modules/Window/hooks/lib/DappPathHelpers.ts +0 -34
  170. package/src/modules/Dapp/modules/Window/hooks/lib/detectCustomer.ts +0 -21
  171. package/src/modules/Dapp/modules/Window/hooks/lib/index.ts +0 -2
  172. package/src/modules/Dapp/modules/Window/hooks/menu/index.ts +0 -5
  173. package/src/modules/Dapp/modules/Window/hooks/menu/useAddDappMenuItems.ts +0 -25
  174. package/src/modules/Dapp/modules/Window/hooks/menu/useBuildDappMenuResource.ts +0 -39
  175. package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenu.ts +0 -71
  176. package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.ts +0 -22
  177. package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenuDependencies.ts +0 -16
  178. package/src/modules/Dapp/modules/Window/hooks/route/helpers/RoutingNodes.md +0 -7
  179. package/src/modules/Dapp/modules/Window/hooks/route/helpers/index.ts +0 -4
  180. package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.tsx +0 -56
  181. package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappIntentRequest.tsx +0 -68
  182. package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.tsx +0 -75
  183. package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.tsx +0 -51
  184. package/src/modules/Dapp/modules/Window/hooks/route/index.ts +0 -1
  185. package/src/modules/Dapp/modules/Window/hooks/useDebugClick.ts +0 -61
  186. package/src/modules/Dapp/modules/Window/hooks/useDecomposeDapp.tsx +0 -21
  187. package/src/modules/Dapp/modules/Window/hooks/useExposedNode.ts +0 -6
  188. package/src/modules/Dapp/modules/Window/hooks/useSkipLoadingScreen.tsx +0 -17
  189. package/src/modules/Dapp/modules/Window/hooks/useSyncOsRegisteredAccessInterfaces.tsx +0 -36
  190. package/src/modules/Dapp/modules/Window/index.ts +0 -7
  191. package/src/modules/Dapp/modules/Window/types/DappMenuProperties.ts +0 -9
  192. package/src/modules/Dapp/modules/Window/types/DappWindowProps.ts +0 -14
  193. package/src/modules/Dapp/modules/Window/types/index.ts +0 -2
  194. package/src/modules/Dapp/modules/access-interface/components/Dialog.tsx +0 -132
  195. package/src/modules/Dapp/modules/access-interface/components/Flexbox.tsx +0 -29
  196. package/src/modules/Dapp/modules/access-interface/components/index.ts +0 -2
  197. package/src/modules/Dapp/modules/access-interface/hooks/index.ts +0 -1
  198. package/src/modules/Dapp/modules/access-interface/hooks/useDialogState.tsx +0 -28
  199. package/src/modules/Dapp/modules/access-interface/index.ts +0 -2
  200. package/src/modules/Dapp/modules/index.ts +0 -2
  201. package/src/modules/Dapp/useDappCaller.ts +0 -16
  202. package/src/modules/LoadingOsLogo/LoadingOsLogo.tsx +0 -54
  203. package/src/modules/LoadingOsLogo/img/index.ts +0 -1
  204. package/src/modules/LoadingOsLogo/img/xyoOS-Icon.svg +0 -1
  205. package/src/modules/LoadingOsLogo/index.ts +0 -1
  206. package/src/modules/XyOsUi/contexts/XyOsUiContext.ts +0 -10
  207. package/src/modules/XyOsUi/contexts/index.ts +0 -1
  208. package/src/modules/XyOsUi/index.ts +0 -2
  209. package/src/modules/XyOsUi/lib/XyOsUi.ts +0 -51
  210. package/src/modules/XyOsUi/lib/index.ts +0 -1
  211. package/src/modules/access-requests/NameServiceRegistrationHooks.ts +0 -36
  212. package/src/modules/access-requests/index.ts +0 -2
  213. package/src/modules/access-requests/useBuildDappAccessRequestResource.ts +0 -38
  214. package/src/modules/bios/hooks/index.ts +0 -2
  215. package/src/modules/bios/hooks/useBios.ts +0 -25
  216. package/src/modules/bios/hooks/useKernel.ts +0 -36
  217. package/src/modules/bios/index.ts +0 -1
  218. package/src/modules/dapps/accounts/components/AccountCard.tsx +0 -57
  219. package/src/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/ShiftAnimation.tsx +0 -116
  220. package/src/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/index.ts +0 -1
  221. package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPoint.tsx +0 -23
  222. package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPointList.tsx +0 -24
  223. package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/index.ts +0 -2
  224. package/src/modules/dapps/accounts/components/AnimatedComponents/index.ts +0 -2
  225. package/src/modules/dapps/accounts/components/InputFields/CoinbaseEmail.tsx +0 -41
  226. package/src/modules/dapps/accounts/components/InputFields/PrimaryCryptowallet.tsx +0 -42
  227. package/src/modules/dapps/accounts/components/InputFields/SecondaryCryptowallet.tsx +0 -42
  228. package/src/modules/dapps/accounts/components/InputFields/index.ts +0 -3
  229. package/src/modules/dapps/accounts/components/PaymentMethods.tsx +0 -51
  230. package/src/modules/dapps/accounts/components/index.ts +0 -3
  231. package/src/modules/dapps/accounts/hooks/index.ts +0 -1
  232. package/src/modules/dapps/accounts/hooks/useAccountArchivist.ts +0 -5
  233. package/src/modules/dapps/accounts/icon/Icon.tsx +0 -49
  234. package/src/modules/dapps/accounts/icon/custom-accounts-icon.svg +0 -1
  235. package/src/modules/dapps/accounts/icon/index.ts +0 -1
  236. package/src/modules/dapps/accounts/index.ts +0 -3
  237. package/src/modules/dapps/accounts/models/CreditCardInput.ts +0 -20
  238. package/src/modules/dapps/accounts/models/index.ts +0 -1
  239. package/src/modules/dapps/index.ts +0 -3
  240. package/src/modules/dapps/name-service/DomainIcon.tsx +0 -12
  241. package/src/modules/dapps/name-service/index.ts +0 -1
  242. package/src/modules/dapps/table/NextIteratorFlexbox.tsx +0 -33
  243. package/src/modules/dapps/table/head/Payload.ts +0 -11
  244. package/src/modules/dapps/table/head/Schema.ts +0 -2
  245. package/src/modules/dapps/table/head/components/Head.tsx +0 -47
  246. package/src/modules/dapps/table/head/components/StyledTableRowHeader.tsx +0 -6
  247. package/src/modules/dapps/table/head/components/index.ts +0 -1
  248. package/src/modules/dapps/table/head/hooks/index.ts +0 -1
  249. package/src/modules/dapps/table/head/hooks/useVisibleColumns.tsx +0 -15
  250. package/src/modules/dapps/table/head/index.ts +0 -4
  251. package/src/modules/dapps/table/index.ts +0 -2
  252. package/src/modules/index.ts +0 -12
  253. package/src/modules/intent/DappIntentResourceHooks.ts +0 -35
  254. package/src/modules/intent/index.ts +0 -7
  255. package/src/modules/intent/useClearIntents.ts +0 -14
  256. package/src/modules/intent/useDappIntentCaller.ts +0 -17
  257. package/src/modules/intent/useDappIntentListener.ts +0 -53
  258. package/src/modules/intent/useDappIntentListener2.ts +0 -48
  259. package/src/modules/intent/useNavigateIntent.ts +0 -51
  260. package/src/modules/intent/useSendDappIntent.ts +0 -38
  261. package/src/modules/network/components/LoadingIndicator.tsx +0 -51
  262. package/src/modules/network/components/NetworkButton.tsx +0 -27
  263. package/src/modules/network/components/NetworkReady.tsx +0 -31
  264. package/src/modules/network/components/StyledLoadingIndicator.tsx +0 -49
  265. package/src/modules/network/components/index.ts +0 -3
  266. package/src/modules/network/hooks/index.ts +0 -2
  267. package/src/modules/network/hooks/lib/NetworkState.ts +0 -8
  268. package/src/modules/network/hooks/lib/createNetworkState.ts +0 -20
  269. package/src/modules/network/hooks/lib/index.ts +0 -2
  270. package/src/modules/network/hooks/useOsNetwork.tsx +0 -17
  271. package/src/modules/network/hooks/useXyoPublicNetwork.tsx +0 -17
  272. package/src/modules/network/index.ts +0 -2
  273. package/src/modules/os/hooks/index.ts +0 -8
  274. package/src/modules/os/hooks/useDappContextCreator.ts +0 -90
  275. package/src/modules/os/hooks/useDappRegistrationResults.ts +0 -30
  276. package/src/modules/os/hooks/useDappRegistry.ts +0 -19
  277. package/src/modules/os/hooks/useDappSeedPhraseRepository.ts +0 -19
  278. package/src/modules/os/hooks/useOsSettingsCaller.ts +0 -19
  279. package/src/modules/os/hooks/usePhraseFile.ts +0 -33
  280. package/src/modules/os/hooks/useTabs.ts +0 -14
  281. package/src/modules/os/hooks/useWidgetDapps.ts +0 -23
  282. package/src/modules/os/index.ts +0 -1
  283. package/src/modules/resource/ResourceHooks.ts +0 -45
  284. package/src/modules/resource/index.ts +0 -3
  285. package/src/modules/resource/useCleanup.ts +0 -10
  286. package/src/modules/resource/useSyncExternalPayloadStore.ts +0 -37
  287. package/src/modules/stack/index.ts +0 -1
  288. package/src/modules/stack/useStackReady.ts +0 -48
  289. package/src/modules/widgets/StackOfWidgets.tsx +0 -149
  290. package/src/modules/widgets/Types/BarGraph/HorizontalBarGraph.tsx +0 -58
  291. package/src/modules/widgets/Types/BarGraph/StyledLinearProgress.tsx +0 -12
  292. package/src/modules/widgets/Types/BarGraph/index.ts +0 -2
  293. package/src/modules/widgets/Types/DataColumns/TwoColFourStat.tsx +0 -34
  294. package/src/modules/widgets/Types/DataColumns/TwoColTwoStat.tsx +0 -39
  295. package/src/modules/widgets/Types/DataColumns/index.ts +0 -1
  296. package/src/modules/widgets/Types/Examples/BarGraph.tsx +0 -10
  297. package/src/modules/widgets/Types/Examples/BooleanTable.tsx +0 -27
  298. package/src/modules/widgets/Types/Examples/TwoColTwoStat.tsx +0 -27
  299. package/src/modules/widgets/Types/Examples/index.ts +0 -3
  300. package/src/modules/widgets/Types/Stat/Insight.ts +0 -9
  301. package/src/modules/widgets/Types/Stat/InsightStatProps.ts +0 -7
  302. package/src/modules/widgets/Types/Stat/Stat.tsx +0 -41
  303. package/src/modules/widgets/Types/Stat/Subtitle.tsx +0 -14
  304. package/src/modules/widgets/Types/Stat/Unit.tsx +0 -13
  305. package/src/modules/widgets/Types/Stat/Value.tsx +0 -16
  306. package/src/modules/widgets/Types/Stat/index.ts +0 -3
  307. package/src/modules/widgets/Types/Tables/BooleanTable.tsx +0 -88
  308. package/src/modules/widgets/Types/Tables/index.ts +0 -1
  309. package/src/modules/widgets/Types/index.ts +0 -4
  310. package/src/modules/widgets/WidgetCard.tsx +0 -111
  311. package/src/modules/widgets/WidgetCardExamples.tsx +0 -31
  312. package/src/modules/widgets/index.ts +0 -2
  313. package/src/settings/Theme/ThemeCssVars.ts +0 -228
  314. package/src/settings/Theme/ThemeProvider.tsx +0 -20
  315. package/src/settings/Theme/index.ts +0 -1
  316. package/src/settings/index.ts +0 -1
  317. package/src/types/global.d.ts +0 -11
  318. package/src/types/images.d.ts +0 -4
  319. package/src/utils/DappInstallTypeFilters.ts +0 -27
  320. package/src/utils/getApiDomain.ts +0 -14
  321. package/src/utils/index.ts +0 -3
  322. package/src/utils/useOnWindowResize.tsx +0 -18
@@ -1,124 +0,0 @@
1
- import { assertEx } from '@xylabs/assert'
2
- import type { Hash } from '@xylabs/hex'
3
- import { fulfilled, rejected } from '@xylabs/promise'
4
- import type {
5
- DappWidgetConfig, WidgetTray, WidgetTrayLayout, XyOsContext,
6
- } from '@xyo-network/os-model'
7
- import { WidgetTraySchema } from '@xyo-network/os-model'
8
- import type { RegisteredReactDappSet } from '@xyo-network/os-react-model'
9
- import { OsCallerBase } from '@xyo-network/os-runtime'
10
- import type { Payload } from '@xyo-network/payload-model'
11
- import type { FC, JSX } from 'react'
12
- import React from 'react'
13
-
14
- type WidgetResults = [(JSX.Element | undefined)[] | undefined, (Error | undefined)[]] | undefined
15
-
16
- export class WidgetCaller extends OsCallerBase {
17
- private _registeredDappSets?: RegisteredReactDappSet[]
18
- private _widgetTrayLayout?: WidgetTrayLayout
19
- constructor(
20
- context: XyOsContext,
21
- _registeredDappSets?: RegisteredReactDappSet[],
22
- _widgetTrayLayout?: WidgetTrayLayout,
23
- ) {
24
- super(context)
25
- this._registeredDappSets = _registeredDappSets
26
- this._widgetTrayLayout = _widgetTrayLayout
27
- }
28
-
29
- get dappsAsObject() {
30
- const acc = {} as Record<string, RegisteredReactDappSet>
31
- for (const dapp of this.registeredDappSets) {
32
- acc[dapp.dapp.config.name] = dapp
33
- }
34
- return acc
35
- }
36
-
37
- get registeredDappSets() {
38
- return assertEx(this._registeredDappSets, () => 'Registered Dapp Sets not available')
39
- }
40
-
41
- get widgetTrayLayout() {
42
- return assertEx(this._widgetTrayLayout, () => 'Widget Tray Layout not available')
43
- }
44
-
45
- async buildWidgetComponents() {
46
- const widgetTray = this.widgetTrayFromLayout(this.widgetTrayLayout)
47
-
48
- const results = await Promise.allSettled(
49
- widgetTray.widgetConfigs.map(async (config) => {
50
- // Find the widget component in the registered Dapps
51
- const Param: FC<{
52
- payload?: Payload
53
- }> | undefined = this.dappsAsObject[config.dappId].dapp.params.modes[config.mode ?? config.dappId]?.component
54
-
55
- // Try to find the config payload
56
- let payload: Payload | undefined
57
- if (config.configHash) {
58
- const archivist = await this.getDappsArchivist()
59
- const foundConfig = assertEx((await archivist.get([config.configHash]))?.[0], () => `Config - ${config.configHash} not found`)
60
- payload = foundConfig
61
- }
62
-
63
- // Return the widget component
64
- return Param ? <Param payload={payload} /> : undefined
65
- }),
66
- )
67
-
68
- const successfulResults = results.filter(fulfilled).map(result => result.value)
69
- const failedResults = results.filter(rejected).map(result => new Error(result.reason))
70
-
71
- return [successfulResults, failedResults] as WidgetResults
72
- }
73
-
74
- // build a new widget config from the base provided by the dapp
75
- // and pass the config hash from the widgetLayout to the new widgetConfig
76
- private buildWidgetConfig(widgetConfigToBuild: DappWidgetConfig, configHash?: Hash): DappWidgetConfig {
77
- const clonedWidgetConfig = this.cloneWidgetConfig(widgetConfigToBuild)
78
- return {
79
- ...clonedWidgetConfig,
80
- configHash,
81
- }
82
- }
83
-
84
- private cloneWidgetConfig(widgetConfig: DappWidgetConfig) {
85
- return structuredClone(widgetConfig)
86
- }
87
-
88
- private widgetTrayFromLayout(widgetLayout: WidgetTrayLayout): WidgetTray {
89
- const targetWidgetConfigs: DappWidgetConfig[] = []
90
-
91
- const { layout, label: trayLabel } = widgetLayout
92
- for (const dappWidgetLayout of layout) {
93
- const {
94
- dappId, mode, configHash,
95
- } = dappWidgetLayout
96
-
97
- // find the dapp set for the dappWidgetLayout
98
- const dappSet = this.registeredDappSets.find(dappSet => dappSet.dapp.config.name === dappId)
99
- if (!dappSet) {
100
- console.error('unable to find registered dapp set for', dappId)
101
- continue
102
- }
103
-
104
- // find the widgetConfig for the dapp based on a match of mode or dappId in the dapp's widgetConfig
105
- const widgetConfigToBuild = dappSet.dapp.widgetConfigs.find(config => (config.mode ? config.mode === mode : mode === config.dappId))
106
- if (!widgetConfigToBuild) {
107
- console.error('unable to find widget config for', mode)
108
- continue
109
- }
110
-
111
- const config = this.buildWidgetConfig(widgetConfigToBuild, configHash)
112
-
113
- // add the foundWidgetConfig to the targetWidgetConfigs
114
- targetWidgetConfigs.push(config)
115
- }
116
-
117
- return {
118
- label: trayLabel ?? 'Widget Tray',
119
- position: 'bottom',
120
- schema: WidgetTraySchema,
121
- widgetConfigs: targetWidgetConfigs,
122
- }
123
- }
124
- }
@@ -1 +0,0 @@
1
- export * from './Caller.js'
@@ -1,5 +0,0 @@
1
- declare module '*.png'
2
- declare module '*.jpg'
3
- declare module '*.svg'
4
- declare module '*.gif'
5
- declare module '*.webp'
@@ -1,18 +0,0 @@
1
- export { default as candyDark } from './candy-dark@3x.webp'
2
- export { default as candyLight } from './candy-light@3x.webp'
3
- export { default as candyAppleDark } from './candyApple-dark@3x.webp'
4
- export { default as candyAppleLight } from './candyApple-light@3x.webp'
5
- export { default as mossDark } from './moss-dark@3x.webp'
6
- export { default as mossLight } from './moss-light@3x.webp'
7
- export { default as oceanDark } from './ocean-dark@3x.webp'
8
- export { default as oceanLight } from './ocean-light@3x.webp'
9
- export { default as peachYogurtDark } from './peachYogurt-dark@3x.webp'
10
- export { default as peachYogurtLight } from './peachYogurt-light@3x.webp'
11
- export { default as sherbetDark } from './sherbet-dark@3x.webp'
12
- export { default as sherbetLight } from './sherbet-light@3x.webp'
13
- export { default as springDark } from './spring-dark@3x.webp'
14
- export { default as springLight } from './spring-light@3x.webp'
15
- export { default as sunsetDark } from './sunset-dark@3x.webp'
16
- export { default as sunsetLight } from './sunset-light@3x.webp'
17
- export { default as xyoDark } from './xyo-dark@3x.webp'
18
- export { default as xyoLight } from './xyo-light@3x.webp'
package/src/img/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './backgrounds/index.ts'
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './helpers/index.ts'
2
- export * from './interfaces/index.ts'
3
- export * from './modules/index.ts'
4
- export * from './settings/index.ts'
5
- export * from './utils/index.ts'
@@ -1,6 +0,0 @@
1
- import type { AttachableNodeInstance } from '@xyo-network/node-model'
2
-
3
- export interface StackReady {
4
- ready: boolean
5
- stack?: AttachableNodeInstance
6
- }
@@ -1 +0,0 @@
1
- export * from './StackReady.ts'
@@ -1,50 +0,0 @@
1
- import { ButtonEx } from '@xylabs/react-button'
2
- import type { ErrorAlertProps } from '@xylabs/react-error'
3
- import { ErrorAlert } from '@xylabs/react-error'
4
- import type { ModuleError } from '@xyo-network/payload-model'
5
- import React, { useEffect } from 'react'
6
- import { useLocation } from 'react-router-dom'
7
-
8
- export interface ErrorRenderWithSupportProps extends ErrorAlertProps<ModuleError> {
9
- supportHref?: string
10
- supportLinkText?: string
11
- supportTo?: string
12
- }
13
-
14
- export const ErrorRenderWithSupport: React.FC<ErrorRenderWithSupportProps> = ({
15
- supportHref = '',
16
- supportTo,
17
- supportLinkText = 'Support',
18
- error,
19
- onCancel,
20
- ...props
21
- }) => {
22
- const location = useLocation()
23
- useEffect(() => {
24
- // ensure we end up at the same place we are now after logging in
25
- location.state = { from: { pathname: globalThis.location.pathname } }
26
- }, [location])
27
- return (
28
- <ErrorAlert
29
- action={supportTo
30
- ? (
31
- <ButtonEx target="_blank" to={supportTo} color="inherit" size="small">
32
- {supportLinkText}
33
- </ButtonEx>
34
- )
35
- : (
36
- <ButtonEx target="_blank" href={supportHref} color="inherit" size="small">
37
- {supportLinkText}
38
- </ButtonEx>
39
- )}
40
- error={error}
41
- onCancel={onCancel}
42
- {...props}
43
- >
44
- </ErrorAlert>
45
- )
46
- }
47
-
48
- export const ErrorRenderWithSupportDefault: React.FC<ErrorRenderWithSupportProps> = (props) => {
49
- return <ErrorRenderWithSupport supportHref="https://discord.com/channels/935586624392298547/1228436997375393885" {...props} />
50
- }
@@ -1 +0,0 @@
1
- export * from './RenderErrorWithSupportLink.tsx'
@@ -1,96 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-misused-promises */
2
- import { Circle } from '@mui/icons-material'
3
- import type { ButtonExProps } from '@xylabs/react-button'
4
- import { FlexCol } from '@xylabs/react-flexbox'
5
- import type {
6
- DappIcon,
7
- DappName,
8
- } from '@xyo-network/os-model'
9
- import { DappIntentTypes } from '@xyo-network/os-model'
10
- import { DappIntentCaller, XyOsMonitor } from '@xyo-network/os-runtime'
11
- import React, { useRef } from 'react'
12
-
13
- import { useSendDappIntent } from '../../intent/index.ts'
14
- import type { DappState } from '../lib/index.ts'
15
- import { DEFAULT_ICON_SIZE } from '../lib/index.ts'
16
- import { RenderHtml } from '../RenderHtml.tsx'
17
- import { useLaunchPoint } from './hooks/index.ts'
18
- import { DappLaunchFrame } from './LaunchFrame.js'
19
- import { decomposeProps } from './lib/index.ts'
20
- import {
21
- StyledDappIconButtonEx, StyledDappName, StyledDefaultDappIcon,
22
- } from './StyledComponents.js'
23
-
24
- export type DappIconButtonProps = ButtonExProps & {
25
- dappIcon?: DappIcon
26
- dappIconSvg?: string
27
- dappName?: DappName
28
- dappState?: DappState
29
- }
30
-
31
- export const DappIconButton: React.FC<DappIconButtonProps> = ({
32
- children, dappIcon, dappIconSvg, dappName, dappState, ...props
33
- }) => {
34
- const {
35
- DappIconSize, color, nonSxProps, sx,
36
- } = decomposeProps(dappIcon, props)
37
- const iconSize = DEFAULT_ICON_SIZE
38
-
39
- const { active, minimized } = dappState ?? {}
40
-
41
- // Functions to invoke Dapp intents
42
- const sendIntent = useSendDappIntent()
43
-
44
- // Use the DappIconButton to calculate the launch point for the DappWindow
45
- const iconButtonRef = useRef<HTMLButtonElement>(null)
46
- const { left: launchLeft, top: launchTop } = useLaunchPoint(iconButtonRef)
47
-
48
- const MiddleEllipsisFunction = (str: DappName | undefined) => {
49
- if (str && str.length > 25) {
50
- // console.log(str)
51
- // console.log(str.slice(0, 15))
52
- // console.log(str.slice(-10, str.length - 10 + str.length))
53
- return str.slice(0, 15) + '...' + str.slice(-7, str.length - 7 + str.length)
54
- }
55
- return str
56
- }
57
-
58
- const onClickIcon = async () => {
59
- XyOsMonitor.trackEvent('Launch dApp', { 'Dapp Name': `${dappName}` })
60
- await sendIntent?.(DappIntentCaller.buildIntent(DappIntentCaller.OsDappName, DappIntentTypes.Launch, dappName))
61
- }
62
-
63
- return (
64
- <FlexCol alignItems="stretch" justifyContent="stretch">
65
- <DappLaunchFrame id="dapp-launch-frame" open={!!active} launchLeft={launchLeft} launchTop={launchTop}>
66
- {children}
67
- </DappLaunchFrame>
68
- <span
69
- style={{ cursor: 'pointer' }}
70
- onClick={onClickIcon}
71
- >
72
- <StyledDappIconButtonEx
73
- iconBgBaseColor={color}
74
- ref={iconButtonRef}
75
- sx={{
76
- height: iconSize, mb: 0.75, width: iconSize, ...sx,
77
- }}
78
- {...nonSxProps}
79
- >
80
- {dappIconSvg
81
- ? <RenderHtml htmlString={dappIconSvg} />
82
- : <StyledDefaultDappIcon fontSize={DappIconSize}>{dappIcon?.name.at(0)}</StyledDefaultDappIcon>}
83
- </StyledDappIconButtonEx>
84
- <FlexCol gap={0.25}>
85
- <StyledDappName variant="body2" maxWidth={iconSize}>
86
- {MiddleEllipsisFunction(dappIcon?.name)}
87
- </StyledDappName>
88
- <Circle sx={{
89
- height: 8, opacity: minimized ? 1 : 0, transition: 'opacity .5s',
90
- }}
91
- />
92
- </FlexCol>
93
- </span>
94
- </FlexCol>
95
- )
96
- }
@@ -1,77 +0,0 @@
1
- import { useTheme } from '@mui/material'
2
- import {
3
- animated, config, useSpring,
4
- } from '@react-spring/web'
5
- import type { PropsWithChildren, Ref } from 'react'
6
- import React, { useMemo } from 'react'
7
-
8
- export interface DappLaunchFrameProps extends PropsWithChildren {
9
- bgColor?: string
10
- id?: string
11
- launchLeft?: number
12
- launchTop?: number
13
- open: boolean
14
- ref?: Ref<HTMLDivElement>
15
- }
16
-
17
- export const DappLaunchFrame: React.FC<DappLaunchFrameProps> = ({
18
- bgColor, children, id, launchLeft, open, launchTop, ref,
19
- }) => {
20
- const theme = useTheme()
21
-
22
- const frameOpenSpringConfig = useMemo(
23
- () => ({
24
- config: config.stiff,
25
- from: { height: '0%', width: '0%' },
26
- to: {
27
- height: open ? '100dvh' : '0%',
28
- left: open ? 0 : launchLeft,
29
- top: open ? 0 : launchTop,
30
- width: open ? '100vw' : '0%',
31
- },
32
- }),
33
- [launchLeft, launchTop, open],
34
- )
35
-
36
- const {
37
- height, width, ...frameProps
38
- } = useSpring(frameOpenSpringConfig)
39
- const { transform, ...scaleProps } = useSpring({
40
- config: config.stiff,
41
- from: { transform: 'scale(0)' },
42
- to: { transform: open ? 'scale(1)' : 'scale(0)' },
43
- })
44
-
45
- return (
46
- <div id={id} ref={ref}>
47
- <animated.div
48
- id="dapp-launch-frame-transition-width-height"
49
- style={{
50
- ...frameProps,
51
- height,
52
- overflow: 'hidden',
53
- position: 'fixed',
54
- width,
55
- // Set to one above the mui app bar
56
- zIndex: 1101,
57
- }}
58
- >
59
- <animated.div
60
- id="dapp-launch-frame-transition-scale"
61
- style={{
62
- ...scaleProps,
63
- alignItems: 'start',
64
- background: bgColor ?? theme.vars?.palette.background.default,
65
- display: 'flex',
66
- height: '100%',
67
- justifyContent: 'start',
68
- transform,
69
- width: '100%',
70
- }}
71
- >
72
- {children}
73
- </animated.div>
74
- </animated.div>
75
- </div>
76
- )
77
- }
@@ -1,55 +0,0 @@
1
- import { styled } from '@mui/material'
2
- import { ButtonEx } from '@xylabs/react-button'
3
- import { alphaCss } from '@xylabs/react-theme'
4
- import { TypographyEx } from '@xyo-network/react-shared'
5
-
6
- const borderRadiusFactor = 1.5
7
-
8
- export const StyledDappIconButtonEx = styled(ButtonEx, {
9
- name: 'DappIconButton',
10
- shouldForwardProp: prop => !['iconBgBaseColor'].includes(prop as string),
11
- })<{
12
- iconBgBaseColor?: string
13
- }>(({ theme }) => {
14
- return {
15
- // :before hack in place since css transitions not supported in css
16
- '&:before': {
17
- WebkitBackdropFilter: 'blur(20px)',
18
- backdropFilter: 'blur(20px)',
19
- backgroundColor: alphaCss(theme.vars?.palette.background.paper ?? '#fff', 0.5),
20
- borderRadius: theme.spacing(borderRadiusFactor),
21
- content: "''",
22
- inset: 0,
23
- opacity: 0,
24
- position: 'absolute',
25
- transition: 'transform 0.15s linear, opacity 0.15s linear',
26
- zIndex: '-1',
27
- },
28
- '&:hover': { transform: 'translateY(-2px)' },
29
- '&:hover:before': { opacity: 1 },
30
- 'WebkitBackdropFilter': 'blur(20px)',
31
- 'backdropFilter': 'blur(20px)',
32
- 'backgroundColor': alphaCss(theme.vars?.palette.background.paper ?? '#fff', 0.5),
33
- 'borderRadius': theme.spacing(borderRadiusFactor),
34
- 'color': theme.vars?.palette.text.primary,
35
- 'position': 'relative',
36
- 'transition': 'transform 0.15s linear',
37
- }
38
- })
39
-
40
- export const StyledDappName = styled(TypographyEx, { name: 'StyledDappName' })(({ theme }) => ({
41
- // WebkitBoxOrient: 'vertical',
42
- WebkitLineClamp: 2,
43
- color: theme.vars?.palette.text.primary,
44
- flexWrap: 'wrap',
45
- fontWeight: 700,
46
- letterSpacing: '-0.5px',
47
- lineClamp: 2,
48
- textAlign: 'center',
49
- textOverflow: 'ellipsis',
50
- textShadow: `1px 1px 3px ${alphaCss(theme.vars?.palette.common.black ?? '#000', 0.3)}`,
51
- whiteSpace: 'initial',
52
- wordWrap: 'break-word',
53
- }))
54
-
55
- export const StyledDefaultDappIcon = styled(TypographyEx, { name: 'StyledDappName' })(() => ({ lineHeight: 1 }))
@@ -1,17 +0,0 @@
1
- import type { SvgIconComponent } from '@mui/icons-material'
2
- import type { SvgIcon } from '@mui/material'
3
- import { styled } from '@mui/material'
4
-
5
- export interface StyledDappIconBuilderProps {
6
- iconSize?: number
7
- }
8
-
9
- export const StyledDappIconBuilder = (DappIcon: SvgIconComponent) =>
10
- styled<typeof SvgIcon>(DappIcon, {
11
- name: 'StyledDappIcon',
12
- shouldForwardProp: key => !['iconSize'].includes(key as string),
13
- })<StyledDappIconBuilderProps>(({ iconSize, theme }) => ({
14
- color: theme.vars?.palette.text.primary,
15
- height: iconSize,
16
- width: iconSize,
17
- }))
@@ -1 +0,0 @@
1
- export * from './useLaunchPoint.js'
@@ -1,31 +0,0 @@
1
- import type { RefObject } from 'react'
2
- import { useLayoutEffect, useState } from 'react'
3
-
4
- import { useOnWindowResize } from '../../../../utils/index.ts'
5
-
6
- /**
7
- * For a given element, determine the left and top distance from the edge of the viewport
8
- * to the element's center
9
- **/
10
- export const useLaunchPoint = (spanRef: RefObject<HTMLSpanElement | null>) => {
11
- const [coordinates, setCoordinates] = useState<{
12
- left: number
13
- top: number
14
- }>({ left: 0, top: 0 })
15
- const resized = useOnWindowResize()
16
-
17
- useLayoutEffect(() => {
18
- const rect = spanRef.current?.getBoundingClientRect() ?? null
19
- if (rect) {
20
- const {
21
- width, height, left, top,
22
- } = rect
23
- setCoordinates({
24
- left: left + width / 2,
25
- top: top + height / 2,
26
- })
27
- }
28
- }, [spanRef, resized])
29
-
30
- return coordinates
31
- }
@@ -1,4 +0,0 @@
1
- export * from './hooks/index.ts'
2
- export * from './IconEx.js'
3
- export * from './lib/index.ts'
4
- export * from './StyledComponents.tsx'
@@ -1,15 +0,0 @@
1
- import type { ButtonExProps } from '@xylabs/react-button'
2
- import type { DappIcon } from '@xyo-network/os-model'
3
-
4
- import { DEFAULT_ICON_SIZE } from '../../lib/index.ts'
5
-
6
- export const decomposeProps = (dappIcon?: DappIcon, props?: ButtonExProps) => {
7
- // Decompose the Payload into various properties
8
- const { color, windowId: id } = dappIcon ?? {}
9
- const DappIconSize = DEFAULT_ICON_SIZE * 0.8
10
- const { sx, ...nonSxProps } = props ?? {}
11
-
12
- return {
13
- DappIconSize, color, id, nonSxProps, sx,
14
- }
15
- }
@@ -1 +0,0 @@
1
- export * from './decomposeProps.js'
@@ -1,63 +0,0 @@
1
- import type { DappIntent } from '@xyo-network/os-model'
2
- import type { RegisteredReactDappSet } from '@xyo-network/os-react-model'
3
- import React, { memo, useMemo } from 'react'
4
-
5
- import { useDappContextCreator } from '../os/index.ts'
6
- import { DappIconButton } from './Button/index.ts'
7
- import { deriveDappState } from './lib/index.ts'
8
- import {
9
- DappRendered, DappWindow, useDappMenu,
10
- } from './modules/index.ts'
11
-
12
- export interface DappContainerProps {
13
- currentIntent?: DappIntent
14
- dappSet: RegisteredReactDappSet
15
- xnsNetwork: string | undefined
16
- xnsNodeUrl: string | undefined
17
- }
18
-
19
- export const DappContainer: React.FC<DappContainerProps> = ({
20
- currentIntent, dappSet, xnsNodeUrl, xnsNetwork,
21
- }) => {
22
- const { dapp, dappIcon } = dappSet
23
-
24
- const {
25
- dappWallet, context, nodeCreateError,
26
- } = useDappContextCreator(xnsNodeUrl, xnsNetwork, dapp, currentIntent)
27
-
28
- const dappState = useMemo(() => {
29
- if (currentIntent?.targetDappId === dapp.config.name) {
30
- return deriveDappState(currentIntent)
31
- }
32
- }, [currentIntent, dapp])
33
-
34
- const { error: menuError, ...dappMenuProperties } = useDappMenu(context, dapp?.config.name)
35
-
36
- const errors = useMemo(() => [nodeCreateError, menuError].filter(Boolean), [nodeCreateError])
37
-
38
- const dappWindowProps = useMemo(() => ({
39
- context,
40
- dapp,
41
- dappMenuProperties,
42
- dappState,
43
- dappWallet,
44
- errors,
45
- }), [context, dapp, dappMenuProperties, dappState, dappWallet, errors])
46
-
47
- return (
48
- <DappIconButton
49
- dappIcon={dappIcon}
50
- dappIconSvg={dapp.params.iconSvg}
51
- dappName={dapp?.config.name}
52
- dappState={dappState}
53
- >
54
- <DappWindow {...dappWindowProps}>
55
- <DappRendered
56
- {...dappWindowProps}
57
- />
58
- </DappWindow>
59
- </DappIconButton>
60
- )
61
- }
62
-
63
- export const DappContainerMemo = memo(DappContainer)