@xyo-network/os-react-runtime 7.2.1 → 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 (295) hide show
  1. package/dist/browser/helpers/BridgeActivityHelper.d.ts +1 -1
  2. package/dist/browser/helpers/BrowserLocator.d.ts +1 -1
  3. package/dist/browser/helpers/BrowserLocator.d.ts.map +1 -1
  4. package/dist/browser/helpers/widget/Caller.d.ts.map +1 -1
  5. package/dist/browser/img/backgrounds/index.d.ts +18 -18
  6. package/dist/browser/img/backgrounds/index.d.ts.map +1 -1
  7. package/dist/browser/index.mjs +208 -178
  8. package/dist/browser/index.mjs.map +1 -1
  9. package/dist/browser/modules/Dapp/Alert/RenderErrorWithSupportLink.d.ts.map +1 -1
  10. package/dist/browser/modules/Dapp/Button/StyledDappIconBuilder.d.ts +1 -1
  11. package/dist/browser/modules/Dapp/Button/lib/decomposeProps.d.ts +9 -1098
  12. package/dist/browser/modules/Dapp/Button/lib/decomposeProps.d.ts.map +1 -1
  13. package/dist/browser/modules/Dapp/Page/DappPathSwitcher.d.ts.map +1 -1
  14. package/dist/browser/modules/Dapp/modules/Window/LoadingFlexbox.d.ts.map +1 -1
  15. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts +1 -1
  16. package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts.map +1 -1
  17. package/dist/browser/modules/Dapp/modules/Window/components/menu/BottomNavigation.d.ts.map +1 -1
  18. package/dist/browser/modules/Dapp/modules/Window/components/menu/Drawer.d.ts.map +1 -1
  19. package/dist/browser/modules/Dapp/modules/Window/components/menu/StyledListItems.d.ts +1 -1
  20. package/dist/browser/modules/Dapp/modules/Window/components/menu/img/index.d.ts +2 -2
  21. package/dist/browser/modules/Dapp/modules/Window/components/menu/img/index.d.ts.map +1 -1
  22. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenu.d.ts.map +1 -1
  23. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.d.ts +2 -2
  24. package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.d.ts.map +1 -1
  25. package/dist/browser/modules/Dapp/modules/access-interface/components/Dialog.d.ts.map +1 -1
  26. package/dist/browser/modules/LoadingOsLogo/img/index.d.ts +1 -1
  27. package/dist/browser/modules/LoadingOsLogo/img/index.d.ts.map +1 -1
  28. package/dist/browser/modules/XyOsUi/lib/XyOsUi.d.ts.map +1 -1
  29. package/dist/browser/modules/bios/hooks/useKernel.d.ts +1 -1
  30. package/dist/browser/modules/bios/hooks/useKernel.d.ts.map +1 -1
  31. package/dist/browser/modules/dapps/accounts/components/AccountCard.d.ts +1 -1
  32. package/dist/browser/modules/dapps/accounts/components/AccountCard.d.ts.map +1 -1
  33. package/dist/browser/modules/dapps/accounts/models/CreditCardInput.d.ts +2 -2
  34. package/dist/browser/modules/dapps/accounts/models/CreditCardInput.d.ts.map +1 -1
  35. package/dist/browser/modules/dapps/table/head/components/StyledTableRowHeader.d.ts +1 -1
  36. package/dist/browser/modules/intent/useDappIntentListener2.d.ts.map +1 -1
  37. package/dist/browser/modules/intent/useNavigateIntent.d.ts +2 -2
  38. package/dist/browser/modules/intent/useNavigateIntent.d.ts.map +1 -1
  39. package/dist/browser/modules/network/components/LoadingIndicator.d.ts.map +1 -1
  40. package/dist/browser/modules/os/hooks/useDappRegistrationResults.d.ts.map +1 -1
  41. package/dist/browser/modules/os/hooks/useDappRegistry.d.ts.map +1 -1
  42. package/dist/browser/modules/os/hooks/useDappSeedPhraseRepository.d.ts +1 -1
  43. package/dist/browser/modules/os/hooks/useDappSeedPhraseRepository.d.ts.map +1 -1
  44. package/dist/browser/modules/resource/ResourceHooks.d.ts.map +1 -1
  45. package/dist/browser/modules/resource/useSyncExternalPayloadStore.d.ts.map +1 -1
  46. package/dist/browser/modules/stack/useStackReady.d.ts.map +1 -1
  47. package/dist/browser/modules/widgets/Types/Stat/Subtitle.d.ts +1 -1
  48. package/dist/browser/modules/widgets/Types/Stat/Unit.d.ts +1 -1
  49. package/dist/browser/modules/widgets/Types/Stat/Value.d.ts +1 -1
  50. package/dist/browser/modules/widgets/Types/Tables/BooleanTable.d.ts +4 -4
  51. package/package.json +324 -69
  52. package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/DefaultData.d.ts +0 -10
  53. package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/DefaultData.d.ts.map +0 -1
  54. package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.d.ts +0 -6
  55. package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.d.ts.map +0 -1
  56. package/src/helpers/BridgeActivityHelper.ts +0 -39
  57. package/src/helpers/BrowserLocator.ts +0 -19
  58. package/src/helpers/NodePalettes.ts +0 -84
  59. package/src/helpers/index.ts +0 -5
  60. package/src/helpers/monitor/XyOsBrowserMonitor.ts +0 -14
  61. package/src/helpers/monitor/index.ts +0 -1
  62. package/src/helpers/widget/Caller.tsx +0 -125
  63. package/src/helpers/widget/index.ts +0 -1
  64. package/src/img/backgrounds/candy-dark@3x.webp +0 -0
  65. package/src/img/backgrounds/candy-light@3x.webp +0 -0
  66. package/src/img/backgrounds/candyApple-dark@3x.webp +0 -0
  67. package/src/img/backgrounds/candyApple-light@3x.webp +0 -0
  68. package/src/img/backgrounds/images.d.ts +0 -5
  69. package/src/img/backgrounds/index.ts +0 -18
  70. package/src/img/backgrounds/moss-dark@3x.webp +0 -0
  71. package/src/img/backgrounds/moss-light@3x.webp +0 -0
  72. package/src/img/backgrounds/ocean-dark@3x.webp +0 -0
  73. package/src/img/backgrounds/ocean-light@3x.webp +0 -0
  74. package/src/img/backgrounds/peachYogurt-dark@3x.webp +0 -0
  75. package/src/img/backgrounds/peachYogurt-light@3x.webp +0 -0
  76. package/src/img/backgrounds/sherbet-dark@3x.webp +0 -0
  77. package/src/img/backgrounds/sherbet-light@3x.webp +0 -0
  78. package/src/img/backgrounds/spring-dark@3x.webp +0 -0
  79. package/src/img/backgrounds/spring-light@3x.webp +0 -0
  80. package/src/img/backgrounds/sunset-dark@3x.webp +0 -0
  81. package/src/img/backgrounds/sunset-light@3x.webp +0 -0
  82. package/src/img/backgrounds/xyo-dark@3x.webp +0 -0
  83. package/src/img/backgrounds/xyo-light@3x.webp +0 -0
  84. package/src/img/index.ts +0 -1
  85. package/src/index.ts +0 -5
  86. package/src/interfaces/StackReady.ts +0 -6
  87. package/src/interfaces/index.ts +0 -1
  88. package/src/modules/Dapp/Alert/RenderErrorWithSupportLink.tsx +0 -50
  89. package/src/modules/Dapp/Alert/index.ts +0 -1
  90. package/src/modules/Dapp/Button/IconEx.tsx +0 -96
  91. package/src/modules/Dapp/Button/LaunchFrame.tsx +0 -77
  92. package/src/modules/Dapp/Button/StyledComponents.tsx +0 -55
  93. package/src/modules/Dapp/Button/StyledDappIconBuilder.tsx +0 -17
  94. package/src/modules/Dapp/Button/hooks/index.ts +0 -1
  95. package/src/modules/Dapp/Button/hooks/useLaunchPoint.tsx +0 -31
  96. package/src/modules/Dapp/Button/index.ts +0 -4
  97. package/src/modules/Dapp/Button/lib/decomposeProps.tsx +0 -15
  98. package/src/modules/Dapp/Button/lib/index.ts +0 -1
  99. package/src/modules/Dapp/Container.tsx +0 -63
  100. package/src/modules/Dapp/ContainerFlexbox.tsx +0 -30
  101. package/src/modules/Dapp/Debug/Dialog.tsx +0 -54
  102. package/src/modules/Dapp/Debug/index.ts +0 -1
  103. package/src/modules/Dapp/EnterAnimation.tsx +0 -54
  104. package/src/modules/Dapp/Page/DappPage.tsx +0 -115
  105. package/src/modules/Dapp/Page/DappPathSwitcher.tsx +0 -58
  106. package/src/modules/Dapp/Page/DividerChip.tsx +0 -31
  107. package/src/modules/Dapp/Page/Row.tsx +0 -69
  108. package/src/modules/Dapp/Page/index.ts +0 -3
  109. package/src/modules/Dapp/RenderHtml.tsx +0 -12
  110. package/src/modules/Dapp/index.ts +0 -8
  111. package/src/modules/Dapp/lib/DappState.ts +0 -5
  112. package/src/modules/Dapp/lib/DefaultIconSize.ts +0 -1
  113. package/src/modules/Dapp/lib/deriveDappState.ts +0 -16
  114. package/src/modules/Dapp/lib/index.ts +0 -3
  115. package/src/modules/Dapp/modules/Window/AppBar.tsx +0 -115
  116. package/src/modules/Dapp/modules/Window/Chrome.tsx +0 -79
  117. package/src/modules/Dapp/modules/Window/DappWindow.tsx +0 -39
  118. package/src/modules/Dapp/modules/Window/LoadingFlexbox.tsx +0 -99
  119. package/src/modules/Dapp/modules/Window/MetaTags.tsx +0 -27
  120. package/src/modules/Dapp/modules/Window/NodeManifest.tsx +0 -16
  121. package/src/modules/Dapp/modules/Window/Rendered.tsx +0 -101
  122. package/src/modules/Dapp/modules/Window/Trail.tsx +0 -33
  123. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.tsx +0 -82
  124. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/DeveloperLinkSection.tsx +0 -27
  125. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/InstallButtonSection.tsx +0 -34
  126. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/SummarySection.tsx +0 -73
  127. package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/index.ts +0 -1
  128. package/src/modules/Dapp/modules/Window/components/index.ts +0 -2
  129. package/src/modules/Dapp/modules/Window/components/menu/BottomMenuArea.tsx +0 -130
  130. package/src/modules/Dapp/modules/Window/components/menu/BottomNavigation.tsx +0 -66
  131. package/src/modules/Dapp/modules/Window/components/menu/Drawer.tsx +0 -160
  132. package/src/modules/Dapp/modules/Window/components/menu/SocialData.tsx +0 -68
  133. package/src/modules/Dapp/modules/Window/components/menu/StyledListItems.tsx +0 -36
  134. package/src/modules/Dapp/modules/Window/components/menu/img/index.ts +0 -2
  135. package/src/modules/Dapp/modules/Window/components/menu/img/xyoOS-Icon-Black.svg +0 -1
  136. package/src/modules/Dapp/modules/Window/components/menu/img/xyoOS-Icon-White.svg +0 -1
  137. package/src/modules/Dapp/modules/Window/components/menu/index.ts +0 -3
  138. package/src/modules/Dapp/modules/Window/components/menu/stories/DefaultData.tsx +0 -118
  139. package/src/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.tsx +0 -36
  140. package/src/modules/Dapp/modules/Window/components/menu/stories/default.manifest.json +0 -20
  141. package/src/modules/Dapp/modules/Window/hooks/index.ts +0 -8
  142. package/src/modules/Dapp/modules/Window/hooks/lib/DappPathHelpers.ts +0 -34
  143. package/src/modules/Dapp/modules/Window/hooks/lib/detectCustomer.ts +0 -21
  144. package/src/modules/Dapp/modules/Window/hooks/lib/index.ts +0 -2
  145. package/src/modules/Dapp/modules/Window/hooks/menu/index.ts +0 -5
  146. package/src/modules/Dapp/modules/Window/hooks/menu/useAddDappMenuItems.ts +0 -25
  147. package/src/modules/Dapp/modules/Window/hooks/menu/useBuildDappMenuResource.ts +0 -39
  148. package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenu.ts +0 -71
  149. package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.ts +0 -22
  150. package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenuDependencies.ts +0 -16
  151. package/src/modules/Dapp/modules/Window/hooks/route/helpers/RoutingNodes.md +0 -7
  152. package/src/modules/Dapp/modules/Window/hooks/route/helpers/index.ts +0 -4
  153. package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.tsx +0 -55
  154. package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappIntentRequest.tsx +0 -68
  155. package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.tsx +0 -75
  156. package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.tsx +0 -51
  157. package/src/modules/Dapp/modules/Window/hooks/route/index.ts +0 -1
  158. package/src/modules/Dapp/modules/Window/hooks/useDebugClick.ts +0 -61
  159. package/src/modules/Dapp/modules/Window/hooks/useDecomposeDapp.tsx +0 -21
  160. package/src/modules/Dapp/modules/Window/hooks/useExposedNode.ts +0 -6
  161. package/src/modules/Dapp/modules/Window/hooks/useSkipLoadingScreen.tsx +0 -17
  162. package/src/modules/Dapp/modules/Window/hooks/useSyncOsRegisteredAccessInterfaces.tsx +0 -36
  163. package/src/modules/Dapp/modules/Window/index.ts +0 -7
  164. package/src/modules/Dapp/modules/Window/types/DappMenuProperties.ts +0 -9
  165. package/src/modules/Dapp/modules/Window/types/DappWindowProps.ts +0 -14
  166. package/src/modules/Dapp/modules/Window/types/index.ts +0 -2
  167. package/src/modules/Dapp/modules/access-interface/components/Dialog.tsx +0 -132
  168. package/src/modules/Dapp/modules/access-interface/components/Flexbox.tsx +0 -29
  169. package/src/modules/Dapp/modules/access-interface/components/index.ts +0 -2
  170. package/src/modules/Dapp/modules/access-interface/hooks/index.ts +0 -1
  171. package/src/modules/Dapp/modules/access-interface/hooks/useDialogState.tsx +0 -28
  172. package/src/modules/Dapp/modules/access-interface/index.ts +0 -2
  173. package/src/modules/Dapp/modules/index.ts +0 -2
  174. package/src/modules/Dapp/useDappCaller.ts +0 -16
  175. package/src/modules/LoadingOsLogo/LoadingOsLogo.tsx +0 -54
  176. package/src/modules/LoadingOsLogo/img/index.ts +0 -1
  177. package/src/modules/LoadingOsLogo/img/xyoOS-Icon.svg +0 -1
  178. package/src/modules/LoadingOsLogo/index.ts +0 -1
  179. package/src/modules/XyOsUi/contexts/XyOsUiContext.ts +0 -10
  180. package/src/modules/XyOsUi/contexts/index.ts +0 -1
  181. package/src/modules/XyOsUi/index.ts +0 -2
  182. package/src/modules/XyOsUi/lib/XyOsUi.ts +0 -51
  183. package/src/modules/XyOsUi/lib/index.ts +0 -1
  184. package/src/modules/access-requests/NameServiceRegistrationHooks.ts +0 -36
  185. package/src/modules/access-requests/index.ts +0 -2
  186. package/src/modules/access-requests/useBuildDappAccessRequestResource.ts +0 -38
  187. package/src/modules/bios/hooks/index.ts +0 -2
  188. package/src/modules/bios/hooks/useBios.ts +0 -25
  189. package/src/modules/bios/hooks/useKernel.ts +0 -36
  190. package/src/modules/bios/index.ts +0 -1
  191. package/src/modules/dapps/accounts/components/AccountCard.tsx +0 -57
  192. package/src/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/ShiftAnimation.tsx +0 -116
  193. package/src/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/index.ts +0 -1
  194. package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPoint.tsx +0 -23
  195. package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPointList.tsx +0 -24
  196. package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/index.ts +0 -2
  197. package/src/modules/dapps/accounts/components/AnimatedComponents/index.ts +0 -2
  198. package/src/modules/dapps/accounts/components/InputFields/CoinbaseEmail.tsx +0 -41
  199. package/src/modules/dapps/accounts/components/InputFields/PrimaryCryptowallet.tsx +0 -42
  200. package/src/modules/dapps/accounts/components/InputFields/SecondaryCryptowallet.tsx +0 -42
  201. package/src/modules/dapps/accounts/components/InputFields/index.ts +0 -3
  202. package/src/modules/dapps/accounts/components/PaymentMethods.tsx +0 -51
  203. package/src/modules/dapps/accounts/components/index.ts +0 -3
  204. package/src/modules/dapps/accounts/hooks/index.ts +0 -1
  205. package/src/modules/dapps/accounts/hooks/useAccountArchivist.ts +0 -5
  206. package/src/modules/dapps/accounts/icon/Icon.tsx +0 -49
  207. package/src/modules/dapps/accounts/icon/custom-accounts-icon.svg +0 -1
  208. package/src/modules/dapps/accounts/icon/index.ts +0 -1
  209. package/src/modules/dapps/accounts/index.ts +0 -3
  210. package/src/modules/dapps/accounts/models/CreditCardInput.ts +0 -20
  211. package/src/modules/dapps/accounts/models/index.ts +0 -1
  212. package/src/modules/dapps/index.ts +0 -3
  213. package/src/modules/dapps/name-service/DomainIcon.tsx +0 -12
  214. package/src/modules/dapps/name-service/index.ts +0 -1
  215. package/src/modules/dapps/table/NextIteratorFlexbox.tsx +0 -33
  216. package/src/modules/dapps/table/head/Payload.ts +0 -11
  217. package/src/modules/dapps/table/head/Schema.ts +0 -4
  218. package/src/modules/dapps/table/head/components/Head.tsx +0 -47
  219. package/src/modules/dapps/table/head/components/StyledTableRowHeader.tsx +0 -6
  220. package/src/modules/dapps/table/head/components/index.ts +0 -1
  221. package/src/modules/dapps/table/head/hooks/index.ts +0 -1
  222. package/src/modules/dapps/table/head/hooks/useVisibleColumns.tsx +0 -15
  223. package/src/modules/dapps/table/head/index.ts +0 -4
  224. package/src/modules/dapps/table/index.ts +0 -2
  225. package/src/modules/index.ts +0 -12
  226. package/src/modules/intent/DappIntentResourceHooks.ts +0 -35
  227. package/src/modules/intent/index.ts +0 -7
  228. package/src/modules/intent/useClearIntents.ts +0 -14
  229. package/src/modules/intent/useDappIntentCaller.ts +0 -17
  230. package/src/modules/intent/useDappIntentListener.ts +0 -53
  231. package/src/modules/intent/useDappIntentListener2.ts +0 -48
  232. package/src/modules/intent/useNavigateIntent.ts +0 -51
  233. package/src/modules/intent/useSendDappIntent.ts +0 -38
  234. package/src/modules/network/components/LoadingIndicator.tsx +0 -51
  235. package/src/modules/network/components/NetworkButton.tsx +0 -27
  236. package/src/modules/network/components/NetworkReady.tsx +0 -31
  237. package/src/modules/network/components/StyledLoadingIndicator.tsx +0 -49
  238. package/src/modules/network/components/index.ts +0 -3
  239. package/src/modules/network/hooks/index.ts +0 -2
  240. package/src/modules/network/hooks/lib/NetworkState.ts +0 -8
  241. package/src/modules/network/hooks/lib/createNetworkState.ts +0 -20
  242. package/src/modules/network/hooks/lib/index.ts +0 -2
  243. package/src/modules/network/hooks/useOsNetwork.tsx +0 -17
  244. package/src/modules/network/hooks/useXyoPublicNetwork.tsx +0 -17
  245. package/src/modules/network/index.ts +0 -2
  246. package/src/modules/os/hooks/index.ts +0 -8
  247. package/src/modules/os/hooks/useDappContextCreator.ts +0 -89
  248. package/src/modules/os/hooks/useDappRegistrationResults.ts +0 -30
  249. package/src/modules/os/hooks/useDappRegistry.ts +0 -19
  250. package/src/modules/os/hooks/useDappSeedPhraseRepository.ts +0 -19
  251. package/src/modules/os/hooks/useOsSettingsCaller.ts +0 -19
  252. package/src/modules/os/hooks/usePhraseFile.ts +0 -33
  253. package/src/modules/os/hooks/useTabs.ts +0 -14
  254. package/src/modules/os/hooks/useWidgetDapps.ts +0 -23
  255. package/src/modules/os/index.ts +0 -1
  256. package/src/modules/resource/ResourceHooks.ts +0 -45
  257. package/src/modules/resource/index.ts +0 -3
  258. package/src/modules/resource/useCleanup.ts +0 -10
  259. package/src/modules/resource/useSyncExternalPayloadStore.ts +0 -37
  260. package/src/modules/stack/index.ts +0 -1
  261. package/src/modules/stack/useStackReady.ts +0 -48
  262. package/src/modules/widgets/StackOfWidgets.tsx +0 -149
  263. package/src/modules/widgets/Types/BarGraph/HorizontalBarGraph.tsx +0 -58
  264. package/src/modules/widgets/Types/BarGraph/StyledLinearProgress.tsx +0 -12
  265. package/src/modules/widgets/Types/BarGraph/index.ts +0 -2
  266. package/src/modules/widgets/Types/DataColumns/TwoColFourStat.tsx +0 -34
  267. package/src/modules/widgets/Types/DataColumns/TwoColTwoStat.tsx +0 -39
  268. package/src/modules/widgets/Types/DataColumns/index.ts +0 -1
  269. package/src/modules/widgets/Types/Examples/BarGraph.tsx +0 -10
  270. package/src/modules/widgets/Types/Examples/BooleanTable.tsx +0 -27
  271. package/src/modules/widgets/Types/Examples/TwoColTwoStat.tsx +0 -27
  272. package/src/modules/widgets/Types/Examples/index.ts +0 -3
  273. package/src/modules/widgets/Types/Stat/Insight.ts +0 -9
  274. package/src/modules/widgets/Types/Stat/InsightStatProps.ts +0 -7
  275. package/src/modules/widgets/Types/Stat/Stat.tsx +0 -41
  276. package/src/modules/widgets/Types/Stat/Subtitle.tsx +0 -14
  277. package/src/modules/widgets/Types/Stat/Unit.tsx +0 -13
  278. package/src/modules/widgets/Types/Stat/Value.tsx +0 -16
  279. package/src/modules/widgets/Types/Stat/index.ts +0 -3
  280. package/src/modules/widgets/Types/Tables/BooleanTable.tsx +0 -88
  281. package/src/modules/widgets/Types/Tables/index.ts +0 -1
  282. package/src/modules/widgets/Types/index.ts +0 -4
  283. package/src/modules/widgets/WidgetCard.tsx +0 -111
  284. package/src/modules/widgets/WidgetCardExamples.tsx +0 -31
  285. package/src/modules/widgets/index.ts +0 -2
  286. package/src/settings/Theme/ThemeCssVars.ts +0 -228
  287. package/src/settings/Theme/ThemeProvider.tsx +0 -20
  288. package/src/settings/Theme/index.ts +0 -1
  289. package/src/settings/index.ts +0 -1
  290. package/src/types/global.d.ts +0 -11
  291. package/src/types/images.d.ts +0 -4
  292. package/src/utils/DappInstallTypeFilters.ts +0 -27
  293. package/src/utils/getApiDomain.ts +0 -14
  294. package/src/utils/index.ts +0 -3
  295. package/src/utils/useOnWindowResize.tsx +0 -18
@@ -1,35 +0,0 @@
1
- import { usePromise } from '@xylabs/react-promise'
2
- import type { XyOsContext } from '@xyo-network/os-model'
3
- import type { DappIntentViews } from '@xyo-network/os-runtime'
4
- import { DappIntentResource } from '@xyo-network/os-runtime'
5
-
6
- import {
7
- ResourceHooks, useCleanUpResource, useSyncExternalPayloadStore,
8
- } from '../resource/index.ts'
9
-
10
- export const useBuildIntentResource = (context?: XyOsContext | null) => {
11
- const resource = usePromise(async () => {
12
- if (context) {
13
- const resource = new DappIntentResource(context)
14
- await resource.start()
15
- return resource
16
- }
17
- }, [context])
18
-
19
- useCleanUpResource(resource[0])
20
-
21
- return resource
22
- }
23
-
24
- export const useIntentResourceViews = (resource?: DappIntentResource) => {
25
- const allDappIntents = useSyncExternalPayloadStore('allDappIntents', resource)
26
- const latestDappIntent = useSyncExternalPayloadStore('latestDappIntent', resource)
27
-
28
- return {
29
- allDappIntents,
30
- latestDappIntent,
31
- resource,
32
- }
33
- }
34
-
35
- export const DappIntentResourceHooks = new ResourceHooks<DappIntentViews, DappIntentResource>(useBuildIntentResource, useIntentResourceViews)
@@ -1,7 +0,0 @@
1
- export * from './DappIntentResourceHooks.ts'
2
- export * from './useClearIntents.ts'
3
- export * from './useDappIntentCaller.ts'
4
- export * from './useDappIntentListener.ts'
5
- export * from './useDappIntentListener2.ts'
6
- export * from './useNavigateIntent.ts'
7
- export * from './useSendDappIntent.ts'
@@ -1,14 +0,0 @@
1
- import { useAsyncEffect } from '@xylabs/react-async-effect'
2
- import { useWeakArchivistFromNode } from '@xyo-network/react-archivist'
3
-
4
- export const useClearIntents = () => {
5
- const [intentArchivist] = useWeakArchivistFromNode('IntentArchivist')
6
- // For now, clear the archivist to avoid bloating
7
- useAsyncEffect(
8
- async () => {
9
- const intentArchivistInstance = intentArchivist?.deref()
10
- if (intentArchivistInstance) await intentArchivistInstance.clear?.()
11
- },
12
- [intentArchivist],
13
- )
14
- }
@@ -1,17 +0,0 @@
1
- import { assertEx } from '@xylabs/sdk-js'
2
- import type { XyOsContext } from '@xyo-network/os-model'
3
- import { DappIntentCaller } from '@xyo-network/os-runtime'
4
- import { useMemo } from 'react'
5
-
6
- import { useXyOsUiContext } from '../XyOsUi/index.ts'
7
-
8
- export const useDappIntentCaller = (xyOsContext?: XyOsContext | null) => {
9
- const xyOs = useXyOsUiContext()
10
-
11
- return useMemo(() => {
12
- if (xyOsContext || xyOs) {
13
- const context = assertEx(xyOsContext ?? xyOs, () => 'no node was found in context or passed as argument')
14
- return new DappIntentCaller(context)
15
- }
16
- }, [xyOsContext, xyOs])
17
- }
@@ -1,53 +0,0 @@
1
- import { filterAs } from '@xylabs/sdk-js'
2
- import type { ArchivistModuleEventData } from '@xyo-network/archivist-model'
3
- import type { DappIntent } from '@xyo-network/os-model'
4
- import {
5
- asOptionalDappIntent,
6
- DappIntentTypes, DappMode,
7
- } from '@xyo-network/os-model'
8
- import { useWeakArchivistFromNode } from '@xyo-network/react-archivist'
9
- import { useEffect, useState } from 'react'
10
-
11
- /** watch payloads going into the intent archivist to figure out what if the current state of the passed in dappId */
12
- export const useDappIntentListener = (dappName?: string | null, targetMode = DappMode.Window) => {
13
- const [dappIntentType, setDappIntentType] = useState<DappIntentTypes>(DappIntentTypes.Close)
14
- const [intentPayload, setIntentPayload] = useState<DappIntent>()
15
- const [intentArchivist] = useWeakArchivistFromNode('IntentArchivist')
16
-
17
- useEffect(() => {
18
- const listener = ({ payloads }: ArchivistModuleEventData['inserted']) => {
19
- const filteredPayloads = filterAs(payloads, asOptionalDappIntent)
20
- for (const payload of filteredPayloads) {
21
- const allDapps = dappName === null && payload.targetMode === targetMode
22
- const targetDapps = dappName === payload.targetDappId && payload.targetMode === targetMode
23
- if (allDapps || targetDapps) {
24
- setIntentPayload(payload)
25
- switch (payload.intent) {
26
- case DappIntentTypes.Close: {
27
- setDappIntentType(DappIntentTypes.Close)
28
- break
29
- }
30
- case DappIntentTypes.Launch: {
31
- setDappIntentType(DappIntentTypes.Launch)
32
- break
33
- }
34
- case DappIntentTypes.Minimize: {
35
- setDappIntentType(DappIntentTypes.Minimize)
36
- break
37
- }
38
- default: {
39
- console.warn('Unrecognized DappIntentType:', payload)
40
- }
41
- }
42
- }
43
- }
44
- }
45
- intentArchivist?.deref()?.on('inserted', listener)
46
-
47
- return () => {
48
- intentArchivist?.deref()?.off('inserted', listener)
49
- }
50
- }, [dappName, intentArchivist, targetMode])
51
-
52
- return { dappIntentType, intentPayload }
53
- }
@@ -1,48 +0,0 @@
1
- import { DappIntentTypes, DappMode } from '@xyo-network/os-model'
2
- import { useEffect, useState } from 'react'
3
-
4
- import { DappIntentResourceHooks } from './DappIntentResourceHooks.ts'
5
-
6
- /**
7
- * Note: This is a modified version of the original useDappIntentListener hook.
8
- * This version uses the DappIntentResourceHooks instead of the useArchivistFromNode hook.
9
- * Sadly, it appears to be much slower than the original version. It might be because the resource
10
- * uses useExternalStoreSync under the hood, which might be the cause :shrug:
11
- */
12
-
13
- /** watch payloads going into the intent archivist to figure out what if the current state of the passed in dappId */
14
- /** @deprecated - use the original version - useDappIntentListener till performance issues are ironed out */
15
- export const useDappIntentListener2 = (dappName?: string | null, sourceMode = DappMode.Window) => {
16
- const { latestDappIntent } = DappIntentResourceHooks.useResourceViewsFromProvidedNode()
17
- const [dappIntentType, setDappIntentType] = useState<DappIntentTypes>(DappIntentTypes.Close)
18
-
19
- useEffect(() => {
20
- if (sourceMode === DappMode.Window) {
21
- for (const payload of latestDappIntent ?? []) {
22
- if (payload.targetDappId === dappName) {
23
- switch (payload.intent) {
24
- case DappIntentTypes.Close: {
25
- setDappIntentType(DappIntentTypes.Close)
26
- break
27
- }
28
- case DappIntentTypes.Launch: {
29
- setDappIntentType(DappIntentTypes.Launch)
30
- break
31
- }
32
- case DappIntentTypes.Minimize: {
33
- setDappIntentType(DappIntentTypes.Minimize)
34
- break
35
- }
36
- default: {
37
- console.warn('Unrecognized DappIntentType:', payload)
38
- }
39
- }
40
- }
41
- }
42
- } else {
43
- console.warn('Intent sent from unrecognized mode', sourceMode)
44
- }
45
- }, [dappName, latestDappIntent, sourceMode])
46
-
47
- return dappIntentType
48
- }
@@ -1,51 +0,0 @@
1
- import type { DappIntent } from '@xyo-network/os-model'
2
- import { DappIntentTypes } from '@xyo-network/os-model'
3
- import { NameTransforms } from '@xyo-network/os-runtime'
4
- import { useCallback } from 'react'
5
- import { useNavigate, useParams } from 'react-router-dom'
6
-
7
- export type UpdateRouteParamOptions = {
8
- // skip the navigate call to allow intents to be processed without updating the route
9
- skipNavigate?: boolean
10
- }
11
-
12
- const rootRoute = '/'
13
-
14
- /** update url based off passed intents */
15
- export const useNavigateIntent = () => {
16
- const navigate = useNavigate()
17
- const { dappName: dappNameParam } = useParams()
18
-
19
- const updateRouteParam = useCallback(
20
- (dappIntent: DappIntent, { skipNavigate }: UpdateRouteParamOptions = {}) => {
21
- if (dappIntent && dappIntent.targetDappId) {
22
- const {
23
- targetDappId: dappName, intent: intentType, params: intentParams,
24
- } = dappIntent
25
- const slug = new NameTransforms(dappName).slug()
26
- switch (intentType) {
27
- case DappIntentTypes.Launch: {
28
- const dappNameDeSlugged = dappNameParam ? new NameTransforms(dappNameParam).deSlug() : null
29
- if (dappNameDeSlugged !== dappName) {
30
- // navigating from the root to allow overwriting duplicate slugs
31
- const slugFromRoot = `${rootRoute}${slug}${intentParams ? `/${intentParams}` : ''}`
32
- if (!skipNavigate) void navigate(slugFromRoot)
33
- }
34
- break
35
- }
36
- case DappIntentTypes.Minimize: {
37
- if (!skipNavigate) void navigate(rootRoute)
38
- break
39
- }
40
- case DappIntentTypes.Close: {
41
- if (!skipNavigate) void navigate(rootRoute)
42
- break
43
- }
44
- }
45
- }
46
- },
47
- [dappNameParam, navigate],
48
- )
49
-
50
- return updateRouteParam
51
- }
@@ -1,38 +0,0 @@
1
- import type { DappIntent } from '@xyo-network/os-model'
2
- import { useWeakArchivistFromNode } from '@xyo-network/react-archivist'
3
- import { useCallback } from 'react'
4
-
5
- import type { UpdateRouteParamOptions } from './useNavigateIntent.js'
6
- import { useNavigateIntent } from './useNavigateIntent.js'
7
-
8
- /** Returns a function that resolves the IntentArchivist and inserts an intent payload */
9
- export const useSendDappIntent = () => {
10
- const [intentArchivist] = useWeakArchivistFromNode('IntentArchivist')
11
- const navigate = useNavigateIntent()
12
-
13
- const sendIntent = useCallback(
14
- async (dappIntent: DappIntent, options: UpdateRouteParamOptions = {}) => {
15
- const intentArchivistInstance = intentArchivist?.deref()
16
- if (!intentArchivistInstance) {
17
- console.error('unable to find IntentArchivist')
18
- return
19
- }
20
- if (dappIntent) {
21
- try {
22
- await intentArchivistInstance.insert([dappIntent])
23
- } catch (e) {
24
- console.error('error sending intent to archivist', e)
25
- }
26
- // sync the route with the intent
27
- navigate(dappIntent, options)
28
- } else {
29
- console.warn('tried to send intent but intent payload')
30
- }
31
- },
32
- // Disabling because navigate changes references and causes additional renders
33
-
34
- [intentArchivist],
35
- )
36
-
37
- return intentArchivist ? sendIntent : null
38
- }
@@ -1,51 +0,0 @@
1
- import { SignalCellularAltOutlined } from '@mui/icons-material'
2
- import { Tooltip, useTheme } from '@mui/material'
3
- import { useIsDark } from '@xylabs/react-theme'
4
- import React, { useMemo } from 'react'
5
-
6
- import { useOsNetwork } from '../hooks/index.ts'
7
- import { StyledNetworkLoadingIndicator } from './StyledLoadingIndicator.js'
8
-
9
- const WaitingForNetwork: React.FC = () => (
10
- <Tooltip title="Waiting for Network initialization">
11
- <StyledNetworkLoadingIndicator />
12
- </Tooltip>
13
- )
14
-
15
- export interface NetworkLoadingIndicatorProps {
16
- // helps with contrast on bright backgrounds for dark mode
17
- highContrast?: boolean
18
- }
19
-
20
- export const NetworkLoadingIndicator: React.FC<NetworkLoadingIndicatorProps> = ({ highContrast }) => {
21
- const darkMode = useIsDark()
22
- const theme = useTheme()
23
- const { networkReady } = useOsNetwork()
24
-
25
- const highContrastSuccessColor = darkMode ? theme.vars?.palette.success.dark : theme.vars?.palette.success.main
26
- const successColor = highContrast ? highContrastSuccessColor : theme.vars?.palette.success.main
27
-
28
- const highContrastErrorColor = darkMode ? theme.vars?.palette.success.dark : theme.vars?.palette.error.main
29
- const errorColor = highContrast ? highContrastErrorColor : theme.vars?.palette.error.main
30
-
31
- const NetworkComponent = useMemo(() => {
32
- if (networkReady) {
33
- const connectionReady = true
34
- return connectionReady
35
- ? () => (
36
- <Tooltip title="Connected to Network">
37
- <SignalCellularAltOutlined sx={{ color: successColor }} />
38
- </Tooltip>
39
- )
40
- : () => (
41
- <Tooltip title="Error Connecting to Network">
42
- <SignalCellularAltOutlined sx={{ color: errorColor }} />
43
- </Tooltip>
44
- )
45
- } else {
46
- return WaitingForNetwork
47
- }
48
- }, [errorColor, networkReady, successColor])
49
-
50
- return <NetworkComponent />
51
- }
@@ -1,27 +0,0 @@
1
- import { NotInterested } from '@mui/icons-material'
2
- import type { ButtonProps } from '@mui/material'
3
- import { Button } from '@mui/material'
4
- import React from 'react'
5
-
6
- import { useOsNetwork } from '../hooks/index.ts'
7
-
8
- export const NetworkButton: React.FC<ButtonProps> = ({
9
- disabled, startIcon, ...props
10
- }) => {
11
- const { networkReady } = useOsNetwork()
12
-
13
- return (
14
- <Button
15
- disabled={disabled || !networkReady}
16
- startIcon={(
17
- <>
18
- {startIcon}
19
- {networkReady === false
20
- ? <NotInterested />
21
- : null}
22
- </>
23
- )}
24
- {...props}
25
- />
26
- )
27
- }
@@ -1,31 +0,0 @@
1
- import { Typography } from '@mui/material'
2
- import type { FlexBoxProps } from '@xylabs/react-flexbox'
3
- import { FlexCol } from '@xylabs/react-flexbox'
4
- import type { PropsWithChildren } from 'react'
5
- import React from 'react'
6
-
7
- import { LoadingOsLogo } from '../../LoadingOsLogo/index.ts'
8
- import { useOsNetwork } from '../hooks/index.ts'
9
-
10
- export interface NetworkReadyFlexBoxProps extends PropsWithChildren, FlexBoxProps {
11
- skipCheck?: boolean
12
- }
13
-
14
- export const NetworkReadyFlexBox: React.FC<NetworkReadyFlexBoxProps> = ({
15
- children, skipCheck, ...props
16
- }) => {
17
- const { networkReady } = useOsNetwork()
18
-
19
- return (
20
- <>
21
- {networkReady || skipCheck
22
- ? children
23
- : (
24
- <FlexCol height="100%" {...props}>
25
- <LoadingOsLogo widthInPixels={100} busy />
26
- <Typography fontFamily="monospace">Loading XYO Name Service...</Typography>
27
- </FlexCol>
28
- )}
29
- </>
30
- )
31
- }
@@ -1,49 +0,0 @@
1
- import { styled } from '@mui/material'
2
-
3
- // Inspired by https://codepen.io/andrewarchi/pen/ExVQmQm
4
- export const StyledNetworkLoadingIndicator = styled('div', { name: 'StyledNetworkLoadingIndicator' })(({ theme }) => ({
5
- '&': {
6
- '--Loader-color': '#fff',
7
- '--Loader-offset': theme.spacing(0.1667),
8
- '--Loader-size': theme.spacing(1.5),
9
- '--Loader-timing': 'ease-in-out',
10
- 'alignItems': 'center',
11
- 'display': 'flex',
12
- 'justifyContent': 'center',
13
- 'marginBottom': 'calc(var(--Loader-size) / 2)',
14
- 'marginTop': 'calc(var(--Loader-size) / 2)',
15
- 'minHeight': 'var(--Loader-size)',
16
- 'minWidth': 'var(--Loader-size)',
17
- 'position': 'relative',
18
- 'width': '100%',
19
- },
20
- '&:after': {
21
- animationName: 'pulsB',
22
- boxShadow: '0 0 0 0 var(--Loader-color)',
23
- paddingBottom: 'calc(100% - var(--Loader-offset) * 2)',
24
- width: 'calc(100% - var(--Loader-offset) * 2)',
25
- },
26
- '&:before': {
27
- animationName: 'pulsA',
28
- boxShadow: 'inset 0 0 0 var(--Loader-offset) var(--Loader-color)',
29
- paddingBottom: '100%',
30
- width: '100%',
31
- },
32
- '&:before, &:after': {
33
- animationDuration: '1.8s',
34
- animationIterationCount: 'infinite',
35
- animationTimingFunction: 'var(--Loader-timing)',
36
- borderRadius: '50%',
37
- content: '""',
38
- filter: 'drop-shadow(0 0 var(--Loader-offset)/2.25 rgba(var(--Loader-color), 0.75))',
39
- position: 'absolute',
40
- },
41
- '@keyframes pulsA': {
42
- '0%': { boxShadow: 'inset 0 0 0 var(--Loader-offset) var(--Loader-color)' },
43
- '50%, 100%': { boxShadow: 'inset 0 0 0 0 var(--Loader-color)' },
44
- },
45
- '@keyframes pulsB': {
46
- '0%, 50%': { boxShadow: '0 0 0 0 var(--Loader-color)' },
47
- '100%': { boxShadow: '0 0 0 var(--Loader-offset) var(--Loader-color)' },
48
- },
49
- }))
@@ -1,3 +0,0 @@
1
- export * from './LoadingIndicator.js'
2
- export * from './NetworkButton.js'
3
- export * from './NetworkReady.js'
@@ -1,2 +0,0 @@
1
- export * from './useOsNetwork.tsx'
2
- export * from './useXyoPublicNetwork.tsx'
@@ -1,8 +0,0 @@
1
- import type { AttachableNodeInstance } from '@xyo-network/node-model'
2
-
3
- export interface NetworkState {
4
- connected: boolean
5
- error: Error | undefined
6
- networkReady: boolean
7
- stack?: AttachableNodeInstance
8
- }
@@ -1,20 +0,0 @@
1
- import { assertEx } from '@xylabs/sdk-js'
2
-
3
- import type { StackReady } from '../../../../interfaces/index.ts'
4
- import type { NetworkState } from './NetworkState.ts'
5
-
6
- const defaultNetworkState: NetworkState = {
7
- connected: false, error: undefined, networkReady: false,
8
- }
9
-
10
- export const createNetworkState = (stackReady?: StackReady) => {
11
- const { ready, stack } = stackReady ?? {}
12
- if (ready) {
13
- const foundStack = assertEx(stack, () => 'stack said it was ready but no stack found')
14
- return {
15
- connected: true, error: undefined, networkReady: true, stack: foundStack,
16
- }
17
- } else {
18
- return defaultNetworkState
19
- }
20
- }
@@ -1,2 +0,0 @@
1
- export * from './createNetworkState.ts'
2
- export * from './NetworkState.ts'
@@ -1,17 +0,0 @@
1
- import { OsPubSubNetworkReadyEvent } from '@xyo-network/os-runtime'
2
- import { useMemo } from 'react'
3
-
4
- import { useStackReady } from '../../stack/index.ts'
5
- import { useXyOsUiContext } from '../../XyOsUi/index.ts'
6
- import { createNetworkState, type NetworkState } from './lib/index.ts'
7
-
8
- export const useOsNetwork = () => {
9
- const context = useXyOsUiContext()
10
- const stackReady = useStackReady(OsPubSubNetworkReadyEvent, 'osPubSubNetworkStack', context)
11
-
12
- const networkState = useMemo<NetworkState>(() => {
13
- return createNetworkState(stackReady)
14
- }, [context, stackReady])
15
-
16
- return networkState
17
- }
@@ -1,17 +0,0 @@
1
- import { OsXyoPublicNetworkReadyEvent } from '@xyo-network/os-runtime'
2
- import { useMemo } from 'react'
3
-
4
- import { useStackReady } from '../../stack/index.ts'
5
- import { useXyOsUiContext } from '../../XyOsUi/index.ts'
6
- import { createNetworkState, type NetworkState } from './lib/index.ts'
7
-
8
- export const useXyoPublicNetwork = () => {
9
- const context = useXyOsUiContext()
10
- const stackReady = useStackReady(OsXyoPublicNetworkReadyEvent, 'xyoPublicNetworkStack', context)
11
-
12
- const networkState = useMemo<NetworkState>(() => {
13
- return createNetworkState(stackReady)
14
- }, [context, stackReady])
15
-
16
- return networkState
17
- }
@@ -1,2 +0,0 @@
1
- export * from './components/index.ts'
2
- export * from './hooks/index.ts'
@@ -1,8 +0,0 @@
1
- export * from './useDappContextCreator.ts'
2
- export * from './useDappRegistrationResults.ts'
3
- export * from './useDappRegistry.ts'
4
- export * from './useDappSeedPhraseRepository.ts'
5
- export * from './useOsSettingsCaller.ts'
6
- export * from './usePhraseFile.ts'
7
- export * from './useTabs.ts'
8
- export * from './useWidgetDapps.ts'
@@ -1,89 +0,0 @@
1
- import { useAsyncEffect } from '@xylabs/react-async-effect'
2
- import type {
3
- DappIntent, RegisteredDapp, WindowDappNodeSet,
4
- } from '@xyo-network/os-model'
5
- import { DappIntentTypes } from '@xyo-network/os-model'
6
- import { DappContextCreator, RunningDappCache } from '@xyo-network/os-runtime'
7
- import {
8
- useCallback, useEffect, useRef, useState,
9
- } from 'react'
10
-
11
- import { useXyOsUiContext } from '../../XyOsUi/index.ts'
12
-
13
- /**
14
- * Creates a dapp node for the provided dapp and name
15
- * @param dapp - The dapp to create the node for
16
- */
17
- export const useDappContextCreator = (
18
- xnsNodeUrl: string | undefined,
19
- xnsNetwork: string | undefined,
20
- dapp?: RegisteredDapp,
21
- currentIntent?: DappIntent,
22
- allowedNames?: string[],
23
- createOnMount = false,
24
- ): WindowDappNodeSet & {
25
- nodeCreateError?: Error
26
- } => {
27
- const context = useXyOsUiContext()
28
- const [windowDappNodeSet, setWindowDappNodeSet] = useState<WindowDappNodeSet>({ context: undefined, dappWallet: undefined })
29
- const [dappWindowNodeError, setDappWindowNodeError] = useState<Error>()
30
- // ensure the dapp is targeted by the current intent
31
- const targetedDapp = !!(dapp && context && currentIntent?.targetDappId === dapp?.config.name)
32
-
33
- // Keep a ref of the windowDappNodeSet to use in effect hooks without needing it as a dependency
34
- const windowDappNodeSetRef = useRef<WindowDappNodeSet>(windowDappNodeSet)
35
- useEffect(() => {
36
- windowDappNodeSetRef.current = windowDappNodeSet
37
- }, [windowDappNodeSet])
38
-
39
- const createNode = useCallback(async () => {
40
- if (targetedDapp) {
41
- try {
42
- const windowDappNodeSet = await RunningDappCache.findOrCreate(dapp, context, allowedNames ?? [], xnsNodeUrl, xnsNetwork)
43
- setWindowDappNodeSet(windowDappNodeSet)
44
- } catch (e) {
45
- setDappWindowNodeError(e as Error)
46
- }
47
- }
48
- }, [dapp, currentIntent, context, allowedNames])
49
-
50
- useEffect(() => {
51
- if (createOnMount) {
52
- void (async () => {
53
- await createNode()
54
- })()
55
- }
56
- }, [createOnMount, createNode])
57
-
58
- // Watch the intents to determine if the dappWindowNode should be built
59
- useAsyncEffect(
60
-
61
- async () => {
62
- // unless the dapp was passed, do nothing
63
- if (targetedDapp) {
64
- switch (currentIntent?.intent) {
65
- case DappIntentTypes.Launch: {
66
- await createNode()
67
- break
68
- }
69
- case DappIntentTypes.Close: {
70
- if (windowDappNodeSetRef.current.context) {
71
- // In case a cached dapp was closed, clear its Dapp Archivist to allow for a fresh start upon next launch
72
- await DappContextCreator.resetDappArchivist(windowDappNodeSetRef.current.context)
73
- setWindowDappNodeSet({ context: null, dappWallet: undefined })
74
- }
75
- break
76
- }
77
- case DappIntentTypes.Minimize:
78
- // do nothing
79
- }
80
- }
81
- },
82
- [createNode, currentIntent],
83
- )
84
-
85
- return {
86
- ...windowDappNodeSet,
87
- nodeCreateError: dappWindowNodeError,
88
- }
89
- }
@@ -1,30 +0,0 @@
1
- import type { EventListener } from '@xylabs/sdk-js'
2
- import type { DappRegistrationResults, EventBusPubSubConnectionRequest } from '@xyo-network/os-model'
3
- import { EventBusPubSubConnection } from '@xyo-network/os-runtime'
4
- import { useEffect, useState } from 'react'
5
-
6
- import { useXyOsUiContext } from '../../XyOsUi/index.ts'
7
-
8
- export const useDappRegistrationResults = () => {
9
- const context = useXyOsUiContext()
10
-
11
- const [registeredDappSetResults, setRegisteredDappSetResults] = useState<DappRegistrationResults | undefined>()
12
-
13
- useEffect(() => {
14
- const listener: EventListener = () => {
15
- setRegisteredDappSetResults(context?.dappRegistrationResults)
16
- }
17
- const dappsReadyConnectionRequest: EventBusPubSubConnectionRequest = {
18
- subscribableEvents: new Map([['dappsReady', listener]]),
19
- type: 'PubSub',
20
- }
21
- const dappsReadyConnection = new EventBusPubSubConnection(dappsReadyConnectionRequest)
22
- if (context) {
23
- context.eventBus.addConnection(dappsReadyConnection)
24
- setRegisteredDappSetResults(context.dappRegistrationResults)
25
- }
26
- return () => (context && dappsReadyConnection.id ? context.eventBus.removeConnection(dappsReadyConnection.id) : undefined)
27
- }, [context])
28
-
29
- return registeredDappSetResults
30
- }
@@ -1,19 +0,0 @@
1
- import { DappRegistry } from '@xyo-network/os-runtime'
2
- import { useMemo } from 'react'
3
-
4
- import { useDappSeedPhraseRepository } from './useDappSeedPhraseRepository.ts'
5
-
6
- let _dappRegistry: DappRegistry
7
-
8
- export const useDappRegistry = (allowedNames: string[]) => {
9
- const dappSeedPhraseRepository = useDappSeedPhraseRepository(allowedNames)
10
-
11
- return useMemo(() => {
12
- if (dappSeedPhraseRepository) {
13
- if (!_dappRegistry) {
14
- _dappRegistry = new DappRegistry(dappSeedPhraseRepository)
15
- }
16
- return _dappRegistry
17
- }
18
- }, [dappSeedPhraseRepository])
19
- }