@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.
- package/dist/browser/helpers/BridgeActivityHelper.d.ts +3 -5
- package/dist/browser/helpers/BridgeActivityHelper.d.ts.map +1 -1
- package/dist/browser/helpers/BrowserLocator.d.ts +1 -1
- package/dist/browser/helpers/BrowserLocator.d.ts.map +1 -1
- package/dist/browser/helpers/widget/Caller.d.ts.map +1 -1
- package/dist/browser/img/backgrounds/index.d.ts +18 -18
- package/dist/browser/img/backgrounds/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +2664 -2504
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/modules/Dapp/Alert/RenderErrorWithSupportLink.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/Button/StyledComponents.d.ts +3 -3
- package/dist/browser/modules/Dapp/Button/StyledComponents.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/Button/StyledDappIconBuilder.d.ts +1 -1
- package/dist/browser/modules/Dapp/Button/StyledDappIconBuilder.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/Button/hooks/useLaunchPoint.d.ts +1 -1
- package/dist/browser/modules/Dapp/Button/hooks/useLaunchPoint.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/Button/lib/decomposeProps.d.ts +9 -1098
- package/dist/browser/modules/Dapp/Button/lib/decomposeProps.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/Page/DappPathSwitcher.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/Page/Row.d.ts +1 -1
- package/dist/browser/modules/Dapp/Page/Row.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/LoadingFlexbox.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts +1 -1
- package/dist/browser/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/components/menu/BottomNavigation.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/components/menu/Drawer.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/components/menu/SocialData.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/components/menu/StyledListItems.d.ts +2 -2
- package/dist/browser/modules/Dapp/modules/Window/components/menu/StyledListItems.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/components/menu/img/index.d.ts +2 -2
- package/dist/browser/modules/Dapp/modules/Window/components/menu/img/index.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenu.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.d.ts +2 -2
- package/dist/browser/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/useSyncOsRegisteredAccessInterfaces.d.ts +1 -1
- package/dist/browser/modules/Dapp/modules/access-interface/components/Dialog.d.ts.map +1 -1
- package/dist/browser/modules/LoadingOsLogo/img/index.d.ts +1 -1
- package/dist/browser/modules/LoadingOsLogo/img/index.d.ts.map +1 -1
- package/dist/browser/modules/XyOsUi/lib/XyOsUi.d.ts.map +1 -1
- package/dist/browser/modules/bios/hooks/useKernel.d.ts +1 -1
- package/dist/browser/modules/bios/hooks/useKernel.d.ts.map +1 -1
- package/dist/browser/modules/dapps/accounts/components/AccountCard.d.ts +1 -1
- package/dist/browser/modules/dapps/accounts/components/AccountCard.d.ts.map +1 -1
- package/dist/browser/modules/dapps/accounts/models/CreditCardInput.d.ts +5 -3
- package/dist/browser/modules/dapps/accounts/models/CreditCardInput.d.ts.map +1 -1
- package/dist/browser/modules/dapps/table/head/Schema.d.ts +3 -1
- package/dist/browser/modules/dapps/table/head/Schema.d.ts.map +1 -1
- package/dist/browser/modules/dapps/table/head/components/StyledTableRowHeader.d.ts +1 -1
- package/dist/browser/modules/dapps/table/head/components/StyledTableRowHeader.d.ts.map +1 -1
- package/dist/browser/modules/intent/useDappIntentListener2.d.ts.map +1 -1
- package/dist/browser/modules/intent/useNavigateIntent.d.ts +2 -2
- package/dist/browser/modules/intent/useNavigateIntent.d.ts.map +1 -1
- package/dist/browser/modules/network/components/LoadingIndicator.d.ts.map +1 -1
- package/dist/browser/modules/network/components/StyledLoadingIndicator.d.ts +1 -1
- package/dist/browser/modules/network/components/StyledLoadingIndicator.d.ts.map +1 -1
- package/dist/browser/modules/os/hooks/useDappContextCreator.d.ts +0 -1
- package/dist/browser/modules/os/hooks/useDappContextCreator.d.ts.map +1 -1
- package/dist/browser/modules/os/hooks/useDappRegistrationResults.d.ts.map +1 -1
- package/dist/browser/modules/os/hooks/useDappRegistry.d.ts.map +1 -1
- package/dist/browser/modules/os/hooks/useDappSeedPhraseRepository.d.ts +1 -1
- package/dist/browser/modules/os/hooks/useDappSeedPhraseRepository.d.ts.map +1 -1
- package/dist/browser/modules/resource/ResourceHooks.d.ts.map +1 -1
- package/dist/browser/modules/resource/useSyncExternalPayloadStore.d.ts.map +1 -1
- package/dist/browser/modules/stack/useStackReady.d.ts.map +1 -1
- package/dist/browser/modules/widgets/Types/BarGraph/StyledLinearProgress.d.ts +1 -1
- package/dist/browser/modules/widgets/Types/BarGraph/StyledLinearProgress.d.ts.map +1 -1
- package/dist/browser/modules/widgets/Types/Stat/Subtitle.d.ts +1 -1
- package/dist/browser/modules/widgets/Types/Stat/Subtitle.d.ts.map +1 -1
- package/dist/browser/modules/widgets/Types/Stat/Unit.d.ts +1 -1
- package/dist/browser/modules/widgets/Types/Stat/Unit.d.ts.map +1 -1
- package/dist/browser/modules/widgets/Types/Stat/Value.d.ts +1 -1
- package/dist/browser/modules/widgets/Types/Stat/Value.d.ts.map +1 -1
- package/dist/browser/modules/widgets/Types/Tables/BooleanTable.d.ts +4 -4
- package/dist/browser/modules/widgets/Types/Tables/BooleanTable.d.ts.map +1 -1
- package/dist/browser/settings/Theme/ThemeCssVars.d.ts +1 -1
- package/dist/browser/settings/Theme/ThemeCssVars.d.ts.map +1 -1
- package/package.json +323 -75
- package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/DefaultData.d.ts +0 -10
- package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/DefaultData.d.ts.map +0 -1
- package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.d.ts +0 -6
- package/dist/browser/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.d.ts.map +0 -1
- package/src/helpers/BridgeActivityHelper.ts +0 -40
- package/src/helpers/BrowserLocator.ts +0 -18
- package/src/helpers/NodePalettes.ts +0 -84
- package/src/helpers/index.ts +0 -5
- package/src/helpers/monitor/XyOsBrowserMonitor.ts +0 -14
- package/src/helpers/monitor/index.ts +0 -1
- package/src/helpers/widget/Caller.tsx +0 -124
- package/src/helpers/widget/index.ts +0 -1
- package/src/img/backgrounds/candy-dark@3x.webp +0 -0
- package/src/img/backgrounds/candy-light@3x.webp +0 -0
- package/src/img/backgrounds/candyApple-dark@3x.webp +0 -0
- package/src/img/backgrounds/candyApple-light@3x.webp +0 -0
- package/src/img/backgrounds/images.d.ts +0 -5
- package/src/img/backgrounds/index.ts +0 -18
- package/src/img/backgrounds/moss-dark@3x.webp +0 -0
- package/src/img/backgrounds/moss-light@3x.webp +0 -0
- package/src/img/backgrounds/ocean-dark@3x.webp +0 -0
- package/src/img/backgrounds/ocean-light@3x.webp +0 -0
- package/src/img/backgrounds/peachYogurt-dark@3x.webp +0 -0
- package/src/img/backgrounds/peachYogurt-light@3x.webp +0 -0
- package/src/img/backgrounds/sherbet-dark@3x.webp +0 -0
- package/src/img/backgrounds/sherbet-light@3x.webp +0 -0
- package/src/img/backgrounds/spring-dark@3x.webp +0 -0
- package/src/img/backgrounds/spring-light@3x.webp +0 -0
- package/src/img/backgrounds/sunset-dark@3x.webp +0 -0
- package/src/img/backgrounds/sunset-light@3x.webp +0 -0
- package/src/img/backgrounds/xyo-dark@3x.webp +0 -0
- package/src/img/backgrounds/xyo-light@3x.webp +0 -0
- package/src/img/index.ts +0 -1
- package/src/index.ts +0 -5
- package/src/interfaces/StackReady.ts +0 -6
- package/src/interfaces/index.ts +0 -1
- package/src/modules/Dapp/Alert/RenderErrorWithSupportLink.tsx +0 -50
- package/src/modules/Dapp/Alert/index.ts +0 -1
- package/src/modules/Dapp/Button/IconEx.tsx +0 -96
- package/src/modules/Dapp/Button/LaunchFrame.tsx +0 -77
- package/src/modules/Dapp/Button/StyledComponents.tsx +0 -55
- package/src/modules/Dapp/Button/StyledDappIconBuilder.tsx +0 -17
- package/src/modules/Dapp/Button/hooks/index.ts +0 -1
- package/src/modules/Dapp/Button/hooks/useLaunchPoint.tsx +0 -31
- package/src/modules/Dapp/Button/index.ts +0 -4
- package/src/modules/Dapp/Button/lib/decomposeProps.tsx +0 -15
- package/src/modules/Dapp/Button/lib/index.ts +0 -1
- package/src/modules/Dapp/Container.tsx +0 -63
- package/src/modules/Dapp/ContainerFlexbox.tsx +0 -30
- package/src/modules/Dapp/Debug/Dialog.tsx +0 -54
- package/src/modules/Dapp/Debug/index.ts +0 -1
- package/src/modules/Dapp/EnterAnimation.tsx +0 -54
- package/src/modules/Dapp/Page/DappPage.tsx +0 -115
- package/src/modules/Dapp/Page/DappPathSwitcher.tsx +0 -58
- package/src/modules/Dapp/Page/DividerChip.tsx +0 -31
- package/src/modules/Dapp/Page/Row.tsx +0 -69
- package/src/modules/Dapp/Page/index.ts +0 -3
- package/src/modules/Dapp/RenderHtml.tsx +0 -12
- package/src/modules/Dapp/index.ts +0 -8
- package/src/modules/Dapp/lib/DappState.ts +0 -5
- package/src/modules/Dapp/lib/DefaultIconSize.ts +0 -1
- package/src/modules/Dapp/lib/deriveDappState.ts +0 -16
- package/src/modules/Dapp/lib/index.ts +0 -3
- package/src/modules/Dapp/modules/Window/AppBar.tsx +0 -115
- package/src/modules/Dapp/modules/Window/Chrome.tsx +0 -79
- package/src/modules/Dapp/modules/Window/DappWindow.tsx +0 -39
- package/src/modules/Dapp/modules/Window/LoadingFlexbox.tsx +0 -99
- package/src/modules/Dapp/modules/Window/MetaTags.tsx +0 -27
- package/src/modules/Dapp/modules/Window/NodeManifest.tsx +0 -16
- package/src/modules/Dapp/modules/Window/Rendered.tsx +0 -101
- package/src/modules/Dapp/modules/Window/Trail.tsx +0 -33
- package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/DefaultComingSoon.tsx +0 -82
- package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/DeveloperLinkSection.tsx +0 -27
- package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/InstallButtonSection.tsx +0 -34
- package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/SummarySection.tsx +0 -73
- package/src/modules/Dapp/modules/Window/components/DefaultComingSoon/index.ts +0 -1
- package/src/modules/Dapp/modules/Window/components/index.ts +0 -2
- package/src/modules/Dapp/modules/Window/components/menu/BottomMenuArea.tsx +0 -130
- package/src/modules/Dapp/modules/Window/components/menu/BottomNavigation.tsx +0 -66
- package/src/modules/Dapp/modules/Window/components/menu/Drawer.tsx +0 -160
- package/src/modules/Dapp/modules/Window/components/menu/SocialData.tsx +0 -71
- package/src/modules/Dapp/modules/Window/components/menu/StyledListItems.tsx +0 -36
- package/src/modules/Dapp/modules/Window/components/menu/img/index.ts +0 -2
- package/src/modules/Dapp/modules/Window/components/menu/img/xyoOS-Icon-Black.svg +0 -1
- package/src/modules/Dapp/modules/Window/components/menu/img/xyoOS-Icon-White.svg +0 -1
- package/src/modules/Dapp/modules/Window/components/menu/index.ts +0 -3
- package/src/modules/Dapp/modules/Window/components/menu/stories/DefaultData.tsx +0 -118
- package/src/modules/Dapp/modules/Window/components/menu/stories/Drawer.stories.tsx +0 -36
- package/src/modules/Dapp/modules/Window/components/menu/stories/default.manifest.json +0 -20
- package/src/modules/Dapp/modules/Window/hooks/index.ts +0 -8
- package/src/modules/Dapp/modules/Window/hooks/lib/DappPathHelpers.ts +0 -34
- package/src/modules/Dapp/modules/Window/hooks/lib/detectCustomer.ts +0 -21
- package/src/modules/Dapp/modules/Window/hooks/lib/index.ts +0 -2
- package/src/modules/Dapp/modules/Window/hooks/menu/index.ts +0 -5
- package/src/modules/Dapp/modules/Window/hooks/menu/useAddDappMenuItems.ts +0 -25
- package/src/modules/Dapp/modules/Window/hooks/menu/useBuildDappMenuResource.ts +0 -39
- package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenu.ts +0 -71
- package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenuCaller.ts +0 -22
- package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenuDependencies.ts +0 -16
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/RoutingNodes.md +0 -7
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/index.ts +0 -4
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.tsx +0 -56
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappIntentRequest.tsx +0 -68
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.tsx +0 -75
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.tsx +0 -51
- package/src/modules/Dapp/modules/Window/hooks/route/index.ts +0 -1
- package/src/modules/Dapp/modules/Window/hooks/useDebugClick.ts +0 -61
- package/src/modules/Dapp/modules/Window/hooks/useDecomposeDapp.tsx +0 -21
- package/src/modules/Dapp/modules/Window/hooks/useExposedNode.ts +0 -6
- package/src/modules/Dapp/modules/Window/hooks/useSkipLoadingScreen.tsx +0 -17
- package/src/modules/Dapp/modules/Window/hooks/useSyncOsRegisteredAccessInterfaces.tsx +0 -36
- package/src/modules/Dapp/modules/Window/index.ts +0 -7
- package/src/modules/Dapp/modules/Window/types/DappMenuProperties.ts +0 -9
- package/src/modules/Dapp/modules/Window/types/DappWindowProps.ts +0 -14
- package/src/modules/Dapp/modules/Window/types/index.ts +0 -2
- package/src/modules/Dapp/modules/access-interface/components/Dialog.tsx +0 -132
- package/src/modules/Dapp/modules/access-interface/components/Flexbox.tsx +0 -29
- package/src/modules/Dapp/modules/access-interface/components/index.ts +0 -2
- package/src/modules/Dapp/modules/access-interface/hooks/index.ts +0 -1
- package/src/modules/Dapp/modules/access-interface/hooks/useDialogState.tsx +0 -28
- package/src/modules/Dapp/modules/access-interface/index.ts +0 -2
- package/src/modules/Dapp/modules/index.ts +0 -2
- package/src/modules/Dapp/useDappCaller.ts +0 -16
- package/src/modules/LoadingOsLogo/LoadingOsLogo.tsx +0 -54
- package/src/modules/LoadingOsLogo/img/index.ts +0 -1
- package/src/modules/LoadingOsLogo/img/xyoOS-Icon.svg +0 -1
- package/src/modules/LoadingOsLogo/index.ts +0 -1
- package/src/modules/XyOsUi/contexts/XyOsUiContext.ts +0 -10
- package/src/modules/XyOsUi/contexts/index.ts +0 -1
- package/src/modules/XyOsUi/index.ts +0 -2
- package/src/modules/XyOsUi/lib/XyOsUi.ts +0 -51
- package/src/modules/XyOsUi/lib/index.ts +0 -1
- package/src/modules/access-requests/NameServiceRegistrationHooks.ts +0 -36
- package/src/modules/access-requests/index.ts +0 -2
- package/src/modules/access-requests/useBuildDappAccessRequestResource.ts +0 -38
- package/src/modules/bios/hooks/index.ts +0 -2
- package/src/modules/bios/hooks/useBios.ts +0 -25
- package/src/modules/bios/hooks/useKernel.ts +0 -36
- package/src/modules/bios/index.ts +0 -1
- package/src/modules/dapps/accounts/components/AccountCard.tsx +0 -57
- package/src/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/ShiftAnimation.tsx +0 -116
- package/src/modules/dapps/accounts/components/AnimatedComponents/GenericAnimations/index.ts +0 -1
- package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPoint.tsx +0 -23
- package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/TwoToneBulletPointList.tsx +0 -24
- package/src/modules/dapps/accounts/components/AnimatedComponents/IconAnimations/index.ts +0 -2
- package/src/modules/dapps/accounts/components/AnimatedComponents/index.ts +0 -2
- package/src/modules/dapps/accounts/components/InputFields/CoinbaseEmail.tsx +0 -41
- package/src/modules/dapps/accounts/components/InputFields/PrimaryCryptowallet.tsx +0 -42
- package/src/modules/dapps/accounts/components/InputFields/SecondaryCryptowallet.tsx +0 -42
- package/src/modules/dapps/accounts/components/InputFields/index.ts +0 -3
- package/src/modules/dapps/accounts/components/PaymentMethods.tsx +0 -51
- package/src/modules/dapps/accounts/components/index.ts +0 -3
- package/src/modules/dapps/accounts/hooks/index.ts +0 -1
- package/src/modules/dapps/accounts/hooks/useAccountArchivist.ts +0 -5
- package/src/modules/dapps/accounts/icon/Icon.tsx +0 -49
- package/src/modules/dapps/accounts/icon/custom-accounts-icon.svg +0 -1
- package/src/modules/dapps/accounts/icon/index.ts +0 -1
- package/src/modules/dapps/accounts/index.ts +0 -3
- package/src/modules/dapps/accounts/models/CreditCardInput.ts +0 -20
- package/src/modules/dapps/accounts/models/index.ts +0 -1
- package/src/modules/dapps/index.ts +0 -3
- package/src/modules/dapps/name-service/DomainIcon.tsx +0 -12
- package/src/modules/dapps/name-service/index.ts +0 -1
- package/src/modules/dapps/table/NextIteratorFlexbox.tsx +0 -33
- package/src/modules/dapps/table/head/Payload.ts +0 -11
- package/src/modules/dapps/table/head/Schema.ts +0 -2
- package/src/modules/dapps/table/head/components/Head.tsx +0 -47
- package/src/modules/dapps/table/head/components/StyledTableRowHeader.tsx +0 -6
- package/src/modules/dapps/table/head/components/index.ts +0 -1
- package/src/modules/dapps/table/head/hooks/index.ts +0 -1
- package/src/modules/dapps/table/head/hooks/useVisibleColumns.tsx +0 -15
- package/src/modules/dapps/table/head/index.ts +0 -4
- package/src/modules/dapps/table/index.ts +0 -2
- package/src/modules/index.ts +0 -12
- package/src/modules/intent/DappIntentResourceHooks.ts +0 -35
- package/src/modules/intent/index.ts +0 -7
- package/src/modules/intent/useClearIntents.ts +0 -14
- package/src/modules/intent/useDappIntentCaller.ts +0 -17
- package/src/modules/intent/useDappIntentListener.ts +0 -53
- package/src/modules/intent/useDappIntentListener2.ts +0 -48
- package/src/modules/intent/useNavigateIntent.ts +0 -51
- package/src/modules/intent/useSendDappIntent.ts +0 -38
- package/src/modules/network/components/LoadingIndicator.tsx +0 -51
- package/src/modules/network/components/NetworkButton.tsx +0 -27
- package/src/modules/network/components/NetworkReady.tsx +0 -31
- package/src/modules/network/components/StyledLoadingIndicator.tsx +0 -49
- package/src/modules/network/components/index.ts +0 -3
- package/src/modules/network/hooks/index.ts +0 -2
- package/src/modules/network/hooks/lib/NetworkState.ts +0 -8
- package/src/modules/network/hooks/lib/createNetworkState.ts +0 -20
- package/src/modules/network/hooks/lib/index.ts +0 -2
- package/src/modules/network/hooks/useOsNetwork.tsx +0 -17
- package/src/modules/network/hooks/useXyoPublicNetwork.tsx +0 -17
- package/src/modules/network/index.ts +0 -2
- package/src/modules/os/hooks/index.ts +0 -8
- package/src/modules/os/hooks/useDappContextCreator.ts +0 -90
- package/src/modules/os/hooks/useDappRegistrationResults.ts +0 -30
- package/src/modules/os/hooks/useDappRegistry.ts +0 -19
- package/src/modules/os/hooks/useDappSeedPhraseRepository.ts +0 -19
- package/src/modules/os/hooks/useOsSettingsCaller.ts +0 -19
- package/src/modules/os/hooks/usePhraseFile.ts +0 -33
- package/src/modules/os/hooks/useTabs.ts +0 -14
- package/src/modules/os/hooks/useWidgetDapps.ts +0 -23
- package/src/modules/os/index.ts +0 -1
- package/src/modules/resource/ResourceHooks.ts +0 -45
- package/src/modules/resource/index.ts +0 -3
- package/src/modules/resource/useCleanup.ts +0 -10
- package/src/modules/resource/useSyncExternalPayloadStore.ts +0 -37
- package/src/modules/stack/index.ts +0 -1
- package/src/modules/stack/useStackReady.ts +0 -48
- package/src/modules/widgets/StackOfWidgets.tsx +0 -149
- package/src/modules/widgets/Types/BarGraph/HorizontalBarGraph.tsx +0 -58
- package/src/modules/widgets/Types/BarGraph/StyledLinearProgress.tsx +0 -12
- package/src/modules/widgets/Types/BarGraph/index.ts +0 -2
- package/src/modules/widgets/Types/DataColumns/TwoColFourStat.tsx +0 -34
- package/src/modules/widgets/Types/DataColumns/TwoColTwoStat.tsx +0 -39
- package/src/modules/widgets/Types/DataColumns/index.ts +0 -1
- package/src/modules/widgets/Types/Examples/BarGraph.tsx +0 -10
- package/src/modules/widgets/Types/Examples/BooleanTable.tsx +0 -27
- package/src/modules/widgets/Types/Examples/TwoColTwoStat.tsx +0 -27
- package/src/modules/widgets/Types/Examples/index.ts +0 -3
- package/src/modules/widgets/Types/Stat/Insight.ts +0 -9
- package/src/modules/widgets/Types/Stat/InsightStatProps.ts +0 -7
- package/src/modules/widgets/Types/Stat/Stat.tsx +0 -41
- package/src/modules/widgets/Types/Stat/Subtitle.tsx +0 -14
- package/src/modules/widgets/Types/Stat/Unit.tsx +0 -13
- package/src/modules/widgets/Types/Stat/Value.tsx +0 -16
- package/src/modules/widgets/Types/Stat/index.ts +0 -3
- package/src/modules/widgets/Types/Tables/BooleanTable.tsx +0 -88
- package/src/modules/widgets/Types/Tables/index.ts +0 -1
- package/src/modules/widgets/Types/index.ts +0 -4
- package/src/modules/widgets/WidgetCard.tsx +0 -111
- package/src/modules/widgets/WidgetCardExamples.tsx +0 -31
- package/src/modules/widgets/index.ts +0 -2
- package/src/settings/Theme/ThemeCssVars.ts +0 -228
- package/src/settings/Theme/ThemeProvider.tsx +0 -20
- package/src/settings/Theme/index.ts +0 -1
- package/src/settings/index.ts +0 -1
- package/src/types/global.d.ts +0 -11
- package/src/types/images.d.ts +0 -4
- package/src/utils/DappInstallTypeFilters.ts +0 -27
- package/src/utils/getApiDomain.ts +0 -14
- package/src/utils/index.ts +0 -3
- 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/assert'
|
|
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/array'
|
|
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,20 +0,0 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/assert'
|
|
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,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,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,90 +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
|
-
*
|
|
16
|
-
* @param dapp - The dapp to create the node for
|
|
17
|
-
*/
|
|
18
|
-
export const useDappContextCreator = (
|
|
19
|
-
xnsNodeUrl: string | undefined,
|
|
20
|
-
xnsNetwork: string | undefined,
|
|
21
|
-
dapp?: RegisteredDapp,
|
|
22
|
-
currentIntent?: DappIntent,
|
|
23
|
-
allowedNames?: string[],
|
|
24
|
-
createOnMount = false,
|
|
25
|
-
): WindowDappNodeSet & {
|
|
26
|
-
nodeCreateError?: Error
|
|
27
|
-
} => {
|
|
28
|
-
const context = useXyOsUiContext()
|
|
29
|
-
const [windowDappNodeSet, setWindowDappNodeSet] = useState<WindowDappNodeSet>({ context: undefined, dappWallet: undefined })
|
|
30
|
-
const [dappWindowNodeError, setDappWindowNodeError] = useState<Error>()
|
|
31
|
-
// ensure the dapp is targeted by the current intent
|
|
32
|
-
const targetedDapp = !!(dapp && context && currentIntent?.targetDappId === dapp?.config.name)
|
|
33
|
-
|
|
34
|
-
// Keep a ref of the windowDappNodeSet to use in effect hooks without needing it as a dependency
|
|
35
|
-
const windowDappNodeSetRef = useRef<WindowDappNodeSet>(windowDappNodeSet)
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
windowDappNodeSetRef.current = windowDappNodeSet
|
|
38
|
-
}, [windowDappNodeSet])
|
|
39
|
-
|
|
40
|
-
const createNode = useCallback(async () => {
|
|
41
|
-
if (targetedDapp) {
|
|
42
|
-
try {
|
|
43
|
-
const windowDappNodeSet = await RunningDappCache.findOrCreate(dapp, context, allowedNames ?? [], xnsNodeUrl, xnsNetwork)
|
|
44
|
-
setWindowDappNodeSet(windowDappNodeSet)
|
|
45
|
-
} catch (e) {
|
|
46
|
-
setDappWindowNodeError(e as Error)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}, [dapp, currentIntent, context, allowedNames])
|
|
50
|
-
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (createOnMount) {
|
|
53
|
-
void (async () => {
|
|
54
|
-
await createNode()
|
|
55
|
-
})()
|
|
56
|
-
}
|
|
57
|
-
}, [createOnMount, createNode])
|
|
58
|
-
|
|
59
|
-
// Watch the intents to determine if the dappWindowNode should be built
|
|
60
|
-
useAsyncEffect(
|
|
61
|
-
|
|
62
|
-
async () => {
|
|
63
|
-
// unless the dapp was passed, do nothing
|
|
64
|
-
if (targetedDapp) {
|
|
65
|
-
switch (currentIntent?.intent) {
|
|
66
|
-
case DappIntentTypes.Launch: {
|
|
67
|
-
await createNode()
|
|
68
|
-
break
|
|
69
|
-
}
|
|
70
|
-
case DappIntentTypes.Close: {
|
|
71
|
-
if (windowDappNodeSetRef.current.context) {
|
|
72
|
-
// In case a cached dapp was closed, clear its Dapp Archivist to allow for a fresh start upon next launch
|
|
73
|
-
await DappContextCreator.resetDappArchivist(windowDappNodeSetRef.current.context)
|
|
74
|
-
setWindowDappNodeSet({ context: null, dappWallet: undefined })
|
|
75
|
-
}
|
|
76
|
-
break
|
|
77
|
-
}
|
|
78
|
-
case DappIntentTypes.Minimize:
|
|
79
|
-
// do nothing
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
[createNode, currentIntent],
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
...windowDappNodeSet,
|
|
88
|
-
nodeCreateError: dappWindowNodeError,
|
|
89
|
-
}
|
|
90
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { EventListener } from '@xylabs/events'
|
|
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
|
-
}
|