@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,132 +0,0 @@
1
- import { ArrowForward } from '@mui/icons-material'
2
- import type { DialogProps } from '@mui/material'
3
- import {
4
- Alert,
5
- Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography,
6
- } from '@mui/material'
7
- import { ErrorRender } from '@xylabs/react-error'
8
- import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
9
- import type {
10
- DappAccessRequest, RegisteredDappAccess, XyOsContext,
11
- } from '@xyo-network/os-model'
12
- import { RegisteredNames } from '@xyo-network/os-model'
13
- import { AccessNodeQueries } from '@xyo-network/os-runtime'
14
- import React, { useState } from 'react'
15
-
16
- export interface AccessDialogProps extends DialogProps {
17
- accessRequest?: DappAccessRequest
18
- dappNode?: XyOsContext | null
19
- registeredDappAccess?: RegisteredDappAccess
20
- }
21
-
22
- export const DappAccessDialog: React.FC<AccessDialogProps> = ({
23
- accessRequest, children, dappNode, registeredDappAccess, ...props
24
- }) => {
25
- const [error, setError] = useState<Error>()
26
- const [noPayloadsInserted, setNoPayloadsInserted] = useState(false)
27
-
28
- const onClose = () => {
29
- setNoPayloadsInserted(false)
30
- props.onClose?.({}, 'escapeKeyDown')
31
- }
32
-
33
- const handleAllow = () => {
34
- if (accessRequest && registeredDappAccess && dappNode) {
35
- try {
36
- switch (registeredDappAccess.name) {
37
- case RegisteredNames: {
38
- const accessNodeQueries = new AccessNodeQueries(dappNode, accessRequest, registeredDappAccess)
39
- accessNodeQueries.run().then((payloads) => {
40
- if (payloads.length === 0) {
41
- setNoPayloadsInserted(true)
42
- } else {
43
- onClose()
44
- }
45
- return
46
- }).catch((e) => {
47
- setError(e as Error)
48
- })
49
- }
50
- default: {
51
- const message = `no helper for interface ${registeredDappAccess.name} found`
52
- console.error(message)
53
- setError(new Error(message))
54
- }
55
- }
56
- } catch (e) {
57
- console.error(e)
58
- setError(e as Error)
59
- }
60
- } else {
61
- setError(new Error('No registered dapp access or dappNode found'))
62
- }
63
- }
64
-
65
- return (
66
- <Dialog {...props}>
67
- <DialogTitle>Message from XYO OS</DialogTitle>
68
- <DialogContent
69
- dividers
70
- sx={{
71
- display: 'flex', flexDirection: 'column', gap: 3,
72
- }}
73
- >
74
- <ErrorRender error={error} scope="DappAccessDialog" />
75
- <FlexCol gap={1}>
76
- <Typography variant="subtitle2">dApp to dApp Access Request</Typography>
77
- <FlexRow gap={1}>
78
- <Typography fontSize={16}>
79
- <strong>{accessRequest?.requestingDappId}</strong>
80
- &nbsp;
81
- </Typography>
82
- <ArrowForward />
83
- <Typography fontSize={16}>
84
- <strong>{registeredDappAccess?.registeringDappId}</strong>
85
- </Typography>
86
- </FlexRow>
87
- </FlexCol>
88
- </DialogContent>
89
- <DialogContent
90
- dividers
91
- sx={{
92
- display: 'flex', flexDirection: 'column', gap: 3,
93
- }}
94
- >
95
- <FlexCol gap={1}>
96
- <Typography>
97
- <strong>{accessRequest?.requestingDappId}</strong>
98
- {' '}
99
- dApp would like to access your
100
- <strong>{registeredDappAccess?.name}</strong>
101
- {' '}
102
- from
103
- {' '}
104
- <strong>{registeredDappAccess?.registeringDappId}</strong>
105
- {' '}
106
- dApp
107
- </Typography>
108
- </FlexCol>
109
- {noPayloadsInserted
110
- ? (
111
- <Alert severity="warning">
112
- {registeredDappAccess?.name}
113
- {' '}
114
- Access Request did not find payloads to insert
115
- </Alert>
116
- )
117
- : null}
118
- </DialogContent>
119
- {children
120
- ? <DialogContent dividers>{children}</DialogContent>
121
- : null}
122
- <DialogActions>
123
- <Button variant="outlined" onClick={onClose}>
124
- Cancel
125
- </Button>
126
- <Button variant="contained" onClick={handleAllow}>
127
- Allow
128
- </Button>
129
- </DialogActions>
130
- </Dialog>
131
- )
132
- }
@@ -1,29 +0,0 @@
1
- import { ErrorRender } from '@xylabs/react-error'
2
- import type { XyOsContext } from '@xyo-network/os-model'
3
- import React from 'react'
4
-
5
- import { useDialogState } from '../hooks/index.ts'
6
- import { DappAccessDialog } from './Dialog.js'
7
-
8
- export interface DappAccessFlexboxProps {
9
- context?: XyOsContext | null
10
- }
11
-
12
- export const DappAccessFlexbox: React.FC<DappAccessFlexboxProps> = ({ context }) => {
13
- const {
14
- accessRequests, allowAccessDialogError, openAccessDialog, registeredInterface, setOpenAccessDialog,
15
- } = useDialogState(context)
16
- return (
17
- <DappAccessDialog
18
- accessRequest={accessRequests?.[0]}
19
- dappNode={context}
20
- open={openAccessDialog}
21
- onClose={() => setOpenAccessDialog(false)}
22
- registeredDappAccess={registeredInterface}
23
- >
24
- {allowAccessDialogError
25
- ? <ErrorRender error={allowAccessDialogError} scope="DappAccessFlexbox" />
26
- : null}
27
- </DappAccessDialog>
28
- )
29
- }
@@ -1,2 +0,0 @@
1
- export * from './Dialog.js'
2
- export * from './Flexbox.js'
@@ -1 +0,0 @@
1
- export * from './useDialogState.js'
@@ -1,28 +0,0 @@
1
- import { usePromise } from '@xylabs/react-promise'
2
- import type { RegisteredDappAccess, XyOsContext } from '@xyo-network/os-model'
3
- import { isRegisteredDappAccess, RegisteredNames } from '@xyo-network/os-model'
4
- import { useState } from 'react'
5
-
6
- import { DappAccessRequestResourceHooks } from '../../../../access-requests/index.ts'
7
- import { useDappCaller } from '../../../useDappCaller.ts'
8
-
9
- export const useDialogState = (context?: XyOsContext | null) => {
10
- const dappCaller = useDappCaller()
11
- const { accessRequests } = DappAccessRequestResourceHooks.resourceViewsFromContext(context)
12
- const [openAccessDialog, setOpenAccessDialog] = useState(false)
13
- const [registeredInterface, setRegisteredInterface] = useState<RegisteredDappAccess>()
14
-
15
- const [, allowAccessDialogError] = usePromise(async () => {
16
- const accessRequest = accessRequests?.[0]
17
- if (accessRequest && context && dappCaller) {
18
- setOpenAccessDialog(true)
19
- const payload = await dappCaller.getRegisteredDappAccessByName(RegisteredNames)
20
-
21
- setRegisteredInterface(isRegisteredDappAccess(payload) ? payload : undefined)
22
- }
23
- }, [accessRequests, dappCaller, context])
24
-
25
- return {
26
- accessRequests, allowAccessDialogError, openAccessDialog, registeredInterface, setOpenAccessDialog,
27
- }
28
- }
@@ -1,2 +0,0 @@
1
- export * from './components/index.ts'
2
- export * from './hooks/index.ts'
@@ -1,2 +0,0 @@
1
- export * from './access-interface/index.ts'
2
- export * from './Window/index.ts'
@@ -1,16 +0,0 @@
1
- import type { XyOsContext } from '@xyo-network/os-model'
2
- import { DappCaller } from '@xyo-network/os-runtime'
3
- import { useMemo } from 'react'
4
-
5
- import { useXyOsUiContext } from '../XyOsUi/index.ts'
6
-
7
- export const useDappCaller = (context?: XyOsContext | null) => {
8
- const xyOs = useXyOsUiContext()
9
-
10
- return useMemo(() => {
11
- const resolvedContext = context ?? xyOs
12
- if (resolvedContext) {
13
- return new DappCaller(resolvedContext)
14
- }
15
- }, [context, xyOs])
16
- }
@@ -1,54 +0,0 @@
1
- import type { FlexBoxProps } from '@xylabs/react-flexbox'
2
- import { FlexCol } from '@xylabs/react-flexbox'
3
- import React, { useState } from 'react'
4
-
5
- import { XyoOSIcon } from './img/index.ts'
6
-
7
- export type LoadingOsLogoProps = Omit<FlexBoxProps, 'children'> & {
8
- busy?: boolean
9
- spinsPerSecond?: number
10
- widthInPixels?: number
11
- }
12
-
13
- export const LoadingOsLogo: React.FC<LoadingOsLogoProps> = ({
14
- widthInPixels, busy, spinsPerSecond = 0.5, ...props
15
- }) => {
16
- // preloading image to prevent shifting
17
- const [imageLoaded, setImageLoaded] = useState(false)
18
- if (!imageLoaded) {
19
- const img = new Image()
20
- img.addEventListener('load', () => setImageLoaded(true))
21
- img.src = XyoOSIcon
22
- }
23
- return imageLoaded
24
- ? (
25
- <FlexCol
26
- sx={{
27
- '@keyframes fadeOut': {
28
- '0%': { opacity: 1 },
29
- '100%': { opacity: 0.1 },
30
- '35%': { opacity: 1 },
31
- },
32
- 'animation': busy ? 'fadeOut linear' : undefined,
33
- 'animationDuration': '1500ms',
34
- 'animationFillMode': 'both',
35
- }}
36
- {...props}
37
- >
38
- <FlexCol
39
- sx={{
40
- '@keyframes spin': {
41
- '0%': { transform: 'rotate(360deg)' },
42
- '100%': { transform: 'rotate(0deg)' },
43
- },
44
- 'animation': busy ? `spin ${1 / spinsPerSecond}s linear infinite` : undefined,
45
- 'animationDirection': 'reverse',
46
- }}
47
- {...props}
48
- >
49
- <img src={XyoOSIcon} height={widthInPixels ?? 22} />
50
- </FlexCol>
51
- </FlexCol>
52
- )
53
- : null
54
- }
@@ -1 +0,0 @@
1
- export { default as XyoOSIcon } from './xyoOS-Icon.svg'
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 900 900"><defs><style>.cls-1{fill:url(#linear-gradient);}.cls-1,.cls-2{stroke-width:0px;}.cls-2{fill:#a8a8a8;opacity:.21;}</style><linearGradient id="linear-gradient" x1="34.7" y1="450.98" x2="865.07" y2="450.98" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#579fd6"/><stop offset=".52" stop-color="#eb407a"/><stop offset="1" stop-color="#f27046"/></linearGradient></defs><path class="cls-2" d="M864.29,297.43c-2.44-6.58-9.76-9.94-16.34-7.5l-143.74,53.26L533.2,21.88c-1.85-3.48-5.21-5.9-9.09-6.56-3.89-.66-7.85.51-10.75,3.18l-267.76,246.55-118-97.86c-5.4-4.48-13.42-3.73-17.9,1.67-4.48,5.4-3.73,13.42,1.67,17.9l118,97.86L36.62,593.37c-2.09,3.34-2.5,7.46-1.14,11.15s4.37,6.54,8.13,7.72l347.4,108.61-25.75,151.12c-1.18,6.92,3.48,13.49,10.4,14.67.24.04.47.07.7.1,6.66.76,12.82-3.81,13.96-10.5l25.75-151.12,363.77,12.56c3.94.14,7.71-1.56,10.22-4.59,2.51-3.03,3.48-7.06,2.62-10.9l-79.64-355.16,143.75-53.26c6.58-2.44,9.94-9.75,7.5-16.34ZM518.49,48.34l156.33,293.75-401.12-68.35,244.79-225.4ZM674.37,367.8l-264.69,319.16-144.06-388.81,408.75,69.65ZM66.9,592.88l176.22-282.26,141.37,381.56-317.59-99.29ZM431.72,700.22l259.75-313.21,72.81,324.69-332.56-11.48Z"/><path class="cls-1" d="M865.04,302.64c.01-.2.02-.4.03-.6,0-.33,0-.66-.03-.99-.01-.2-.02-.39-.04-.58-.04-.35-.1-.71-.17-1.06-.03-.16-.05-.32-.09-.48-.12-.5-.26-1.01-.45-1.5-.18-.49-.4-.97-.64-1.43-.08-.15-.17-.29-.25-.43-.17-.31-.35-.61-.55-.9-.12-.17-.24-.33-.37-.49-.19-.25-.39-.5-.6-.74-.14-.16-.29-.32-.45-.47-.22-.22-.45-.44-.68-.65-.1-.08-.18-.18-.27-.26L530.1,18.07c-.34-.28-.7-.53-1.07-.77-.09-.06-.17-.13-.26-.19-.62-.39-1.26-.7-1.92-.98-.18-.07-.36-.14-.54-.21-.71-.26-1.43-.47-2.16-.6,0,0-.01,0-.02,0,0,0,0,0-.01,0-.67-.11-1.35-.15-2.03-.16-.37,0-.73,0-1.09.03-.23.02-.46.06-.7.09-.86.11-1.69.31-2.5.59-.07.03-.15.04-.23.07l-.32.12c-.2.08-.4.13-.59.22L115.08,165.06c-.11.04-.22.1-.33.15-.3.12-.59.25-.88.39-.19.1-.38.19-.57.3-.27.15-.54.32-.81.5-.17.12-.35.22-.52.35-.27.2-.53.42-.79.64-.14.12-.28.23-.41.35-.35.33-.68.68-1,1.05-.04.05-.08.1-.12.14-.32.38-.6.78-.87,1.2-.09.14-.16.29-.25.43-.18.31-.36.62-.51.94-.08.17-.15.35-.23.53-.13.31-.25.62-.36.93-.06.19-.12.38-.17.57-.09.33-.17.65-.23.98-.02.11-.06.22-.08.33l-72.09,423.12c-.07.43-.11.87-.13,1.3,0,.11-.03.22-.03.33-.03.73.02,1.44.12,2.16.02.19.06.38.09.57.13.74.31,1.48.57,2.19,0,0,0,0,0,0,0,.02.01.03.02.04.2.53.43,1.04.7,1.53.12.22.26.42.38.63.17.28.33.56.52.82.17.23.35.44.54.66.18.22.36.44.56.65.2.21.42.4.63.6.16.14.29.3.46.43l330.39,274c.08.07.17.12.25.18.32.25.65.49.99.71.15.09.29.19.44.28.44.26.9.5,1.37.7.04.02.08.04.12.06.51.21,1.03.39,1.56.53.17.05.35.08.53.12.24.06.47.12.71.16.23.04.46.07.69.1.47.05.95.08,1.42.08.15,0,.3-.02.45-.02.32-.01.65-.02.97-.06.18-.02.36-.06.54-.08.29-.04.58-.09.86-.15.19-.04.38-.1.56-.15.28-.08.55-.16.82-.25.08-.03.15-.04.23-.07l402.48-149.13s.06-.03.09-.04c.39-.15.76-.32,1.13-.51.12-.06.24-.1.35-.16.44-.24.88-.51,1.29-.8.03-.02.06-.04.09-.06.55-.39,1.07-.85,1.56-1.34.83-.82,1.54-1.76,2.11-2.78.09-.17.19-.33.27-.5.32-.64.61-1.3.82-2,.03-.11.05-.22.08-.33.12-.42.23-.84.3-1.27l72.09-423.12c.02-.11.02-.22.03-.33.05-.34.08-.67.1-1.01ZM771.44,701.13l-101.05-83.8,158.61-254.06-57.56,337.86ZM121.2,242.67l65.53,292.26-123.1,45.61,57.57-337.87ZM656.65,591.33l-141.37-381.56,317.59,99.3-176.22,282.26ZM508.76,181.1l22.05-129.41,263.81,218.79-285.86-89.37ZM483.7,176.83l-299.33-10.33L505.75,47.42l-22.05,129.41ZM208.31,514.94l-72.81-324.69,332.56,11.48-259.75,313.21ZM490.1,214.98l144.06,388.81-382.98-65.25-25.77-4.39L490.1,214.98ZM246.9,563.6l379.17,64.6-244.79,225.4-156.33-293.74,21.95,3.74ZM654.16,636.9l101.05,83.8-321.38,119.08,220.33-202.88ZM72.47,604.37l123.1-45.61,140.72,264.4-84.17-69.81-179.65-148.98Z"/></svg>
@@ -1 +0,0 @@
1
- export * from './LoadingOsLogo.js'
@@ -1,10 +0,0 @@
1
- import type { XyOsUiContext as XyOsUiContextImport } from '@xyo-network/os-react-model'
2
- import { createContext, use } from 'react'
3
-
4
- export const XyOsUiContext = createContext<XyOsUiContextImport | undefined>(undefined)
5
-
6
- export const useXyOsUiContext = () => {
7
- return use(XyOsUiContext)
8
- }
9
-
10
- export const XyOsUiContextProvider = XyOsUiContext.Provider
@@ -1 +0,0 @@
1
- export * from './XyOsUiContext.js'
@@ -1,2 +0,0 @@
1
- export * from './contexts/index.ts'
2
- export * from './lib/index.ts'
@@ -1,51 +0,0 @@
1
- import { forget } from '@xylabs/sdk-js'
2
- import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
3
- import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model'
4
- import type { SplashScreenLoadingMessages, XyOsUiGlobal } from '@xyo-network/os-model'
5
- import type { ReactDappRegistrationResults, XyOsUiContext } from '@xyo-network/os-react-model'
6
- import type { XyOsMonitor, XyOsParams } from '@xyo-network/os-runtime'
7
- import { dappsReadyConnection, XyOs } from '@xyo-network/os-runtime'
8
- import type { WalletInstance } from '@xyo-network/wallet-model'
9
-
10
- import { XyOsBrowserMonitor } from '../../../helpers/index.ts'
11
-
12
- export class XyOsUi extends XyOs implements XyOsUiContext {
13
- dappRegistrationResults: ReactDappRegistrationResults = { failed: [], succeeded: [] }
14
-
15
- private dappsReadyConnection = dappsReadyConnection()
16
-
17
- constructor(params: XyOsParams) {
18
- super(params)
19
-
20
- this.eventBus.addConnection(this.dappsReadyConnection)
21
- }
22
-
23
- static override get monitoring(): XyOsMonitor | undefined {
24
- return new XyOsBrowserMonitor()
25
- }
26
-
27
- static get xyOsUiGlobal(): XyOsUiGlobal {
28
- return XyOs.xyOsGlobal as XyOsUiGlobal
29
- }
30
-
31
- static hideSplash() {
32
- this.xyOsUiGlobal.splashScreen.hideSplash()
33
- this.xyOsUiGlobal.splashScreen.onComplete()
34
- this.setSplashStatus('complete')
35
- }
36
-
37
- static setSplashStatus(status: SplashScreenLoadingMessages) {
38
- const statusText = this.xyOsUiGlobal.splashScreen._LOADING_MESSAGES[status]
39
- this.xyOsUiGlobal.splashScreen.setStatusText(statusText)
40
- }
41
-
42
- override async boot(wallet: WalletInstance, locator: ModuleFactoryLocatorInstance = new ModuleFactoryLocator()): Promise<this> {
43
- await super.boot(wallet, locator)
44
- const registerLazy = async () => {
45
- this.dappRegistrationResults = (await this.dappRegistrationService.start()) as ReactDappRegistrationResults
46
- await this.dappsReadyConnection.emit('dappsReady', {})
47
- }
48
- forget(registerLazy())
49
- return this
50
- }
51
- }
@@ -1 +0,0 @@
1
- export * from './XyOsUi.js'
@@ -1,36 +0,0 @@
1
- import { usePromise } from '@xylabs/react-promise'
2
- import type { XyOsContext } from '@xyo-network/os-model'
3
- import type { XnsRegistrationsViews } from '@xyo-network/os-runtime'
4
- import { XnsRegistrationsResource } from '@xyo-network/os-runtime'
5
-
6
- import {
7
- ResourceHooks, useCleanUpResource, useSyncExternalPayloadStore,
8
- } from '../resource/index.ts'
9
-
10
- export const useBuildNameServiceRegistrationsResource = (context?: XyOsContext | null, pathPrefix?: string) => {
11
- const result = usePromise(async () => {
12
- if (context) {
13
- const xnsRegistrationsResource = new XnsRegistrationsResource(context, pathPrefix)
14
- await xnsRegistrationsResource.start()
15
- return xnsRegistrationsResource
16
- }
17
- }, [context, pathPrefix])
18
-
19
- useCleanUpResource(result[0])
20
-
21
- return result
22
- }
23
-
24
- export const useBuildNameServiceRegistrationsResourceViews = (resource?: XnsRegistrationsResource) => {
25
- const allRegistrations = useSyncExternalPayloadStore<XnsRegistrationsResource, XnsRegistrationsViews>('allRegistrations', resource)
26
-
27
- return {
28
- allRegistrations,
29
- resource,
30
- }
31
- }
32
-
33
- export const NameServiceRegistrationHooks = new ResourceHooks<XnsRegistrationsViews, XnsRegistrationsResource>(
34
- useBuildNameServiceRegistrationsResource,
35
- useBuildNameServiceRegistrationsResourceViews,
36
- )
@@ -1,2 +0,0 @@
1
- export * from './NameServiceRegistrationHooks.ts'
2
- export * from './useBuildDappAccessRequestResource.ts'
@@ -1,38 +0,0 @@
1
- import { usePromise } from '@xylabs/react-promise'
2
- import type { XyOsContext } from '@xyo-network/os-model'
3
- import type { DappAccessRequestViews } from '@xyo-network/os-runtime'
4
- import { DappAccessRequestResource } from '@xyo-network/os-runtime'
5
-
6
- import {
7
- ResourceHooks, useCleanUpResource, useSyncExternalPayloadStore,
8
- } from '../resource/index.ts'
9
-
10
- export const useBuildDappAccessRequestResource = (context?: XyOsContext | null) => {
11
- const resource = usePromise(async () => {
12
- if (context) {
13
- const resource = new DappAccessRequestResource(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 useDappAccessRequestResourceViews = (resource?: DappAccessRequestResource) => {
25
- const accessRequests = useSyncExternalPayloadStore('accessRequests', resource)
26
- const registeredInterfaces = useSyncExternalPayloadStore('registeredInterfaces', resource)
27
-
28
- return {
29
- accessRequests,
30
- registeredInterfaces,
31
- resource,
32
- }
33
- }
34
-
35
- export const DappAccessRequestResourceHooks = new ResourceHooks<DappAccessRequestViews, DappAccessRequestResource>(
36
- useBuildDappAccessRequestResource,
37
- useDappAccessRequestResourceViews,
38
- )
@@ -1,2 +0,0 @@
1
- export * from './useBios.js'
2
- export * from './useKernel.js'
@@ -1,25 +0,0 @@
1
- import { usePromise } from '@xylabs/react-promise'
2
- import { boot } from '@xyo-network/bios-browser'
3
- import type { BiosExternalInterface } from '@xyo-network/bios-model'
4
- import { useEffect } from 'react'
5
-
6
- let biosBoot: Promise<BiosExternalInterface>
7
-
8
- export const useBios = () => {
9
- const [biosExternalInterface, biosError] = usePromise(async () => {
10
- // If we've already booted the bios, await it's boot
11
- if (biosBoot !== undefined) return await biosBoot
12
- // Otherwise, boot the bios
13
- biosBoot = boot()
14
- // and await it's boot
15
- return await biosBoot
16
- }, [])
17
-
18
- // Bring any async BIOS errors from usePromise back
19
- // within react error boundaries
20
- useEffect(() => {
21
- if (biosError) throw biosError
22
- }, [biosError])
23
-
24
- return biosExternalInterface
25
- }
@@ -1,36 +0,0 @@
1
- import { usePromise } from '@xylabs/react-promise'
2
- import { Kernel } from '@xyo-network/kernel'
3
- import type { KernelBootParams, KernelExternal } from '@xyo-network/kernel-model'
4
- import type { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
5
- import { useEffect } from 'react'
6
-
7
- import { useBios } from './useBios.js'
8
-
9
- let kernelBoot: Promise<KernelExternal>
10
-
11
- export const useKernel = (locator: ModuleFactoryLocator, params: KernelBootParams) => {
12
- const bios = useBios()
13
- const [kernelExternalInterface, kernelError] = usePromise(async () => {
14
- // If we've already booted the kernel, await it's boot
15
- if (kernelBoot !== undefined) return await kernelBoot
16
- if (bios) {
17
- // Otherwise, boot the kernel
18
- kernelBoot = (async function () {
19
- const kernel = new Kernel()
20
-
21
- await kernel.boot(bios, { locator, ...params })
22
- return kernel
23
- })()
24
- // and await it's boot
25
- return await kernelBoot
26
- }
27
- }, [bios])
28
-
29
- // Bring any async BIOS errors from usePromise back
30
- // within react error boundaries
31
- useEffect(() => {
32
- if (kernelError) throw kernelError
33
- }, [kernelError])
34
-
35
- return kernelExternalInterface
36
- }
@@ -1 +0,0 @@
1
- export * from './hooks/index.ts'
@@ -1,57 +0,0 @@
1
- import type { CardProps } from '@mui/material'
2
- import {
3
- Card, CardContent, Divider, Typography,
4
- } from '@mui/material'
5
- import { FlexGrowCol, FlexGrowRow } from '@xylabs/react-flexbox'
6
- import type { ReactNode } from 'react'
7
- import React from 'react'
8
-
9
- interface AccountSectionProps {
10
- component?: ReactNode
11
- desc: string
12
- title: string
13
- }
14
-
15
- interface AccountCardProps extends CardProps {
16
- items: Array<AccountSectionProps>
17
- }
18
-
19
- export const AccountCard: React.FC<AccountCardProps> = ({ items, ...props }) => {
20
- return (
21
- <Card {...props}>
22
- <CardContent>
23
- <FlexGrowCol width="100%" gap={2}>
24
- {items.map((item, index) => {
25
- return (
26
- <FlexGrowCol gap={2} key={index} width="100%" alignItems="stretch">
27
- <FlexGrowRow
28
- sx={{
29
- alignItems: 'stretch',
30
- flexDirection: { md: 'row', xs: 'column' },
31
- justifyContent: 'space-between',
32
- }}
33
- gap={2}
34
- >
35
- <FlexGrowCol
36
- alignItems="flex-start"
37
- width="100%"
38
- sx={{ maxWidth: { md: '40%', xs: '100%' } }}
39
- >
40
- <Typography variant="h5" gutterBottom>
41
- {item.title}
42
- </Typography>
43
- <Typography variant="body1" gutterBottom>
44
- {item.desc}
45
- </Typography>
46
- </FlexGrowCol>
47
- {item?.component}
48
- </FlexGrowRow>
49
- {items.length === 1 || index === items.length - 1 ? null : <Divider flexItem />}
50
- </FlexGrowCol>
51
- )
52
- })}
53
- </FlexGrowCol>
54
- </CardContent>
55
- </Card>
56
- )
57
- }