@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,39 +0,0 @@
|
|
|
1
|
-
import { usePromise } from '@xylabs/react-promise'
|
|
2
|
-
import type { XyOsContext } from '@xyo-network/os-model'
|
|
3
|
-
import type { DappMenuResourceViews } from '@xyo-network/os-runtime'
|
|
4
|
-
import { DappMenuResource } from '@xyo-network/os-runtime'
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
ResourceHooks, useCleanUpResource, useSyncExternalPayloadStore,
|
|
8
|
-
} from '../../../../../resource/index.ts'
|
|
9
|
-
|
|
10
|
-
export const useBuildDappMenuResource = (xyOsContext?: XyOsContext | null) => {
|
|
11
|
-
const resource = usePromise(async () => {
|
|
12
|
-
if (xyOsContext) {
|
|
13
|
-
const resource = new DappMenuResource(xyOsContext)
|
|
14
|
-
await resource.start()
|
|
15
|
-
return resource
|
|
16
|
-
}
|
|
17
|
-
}, [xyOsContext])
|
|
18
|
-
|
|
19
|
-
useCleanUpResource(resource[0])
|
|
20
|
-
|
|
21
|
-
return resource
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const useMenuResourceViews = (resource?: DappMenuResource) => {
|
|
25
|
-
const menuItemSelections = useSyncExternalPayloadStore('menuItemSelections', resource)
|
|
26
|
-
const menuConfigs = useSyncExternalPayloadStore('menuConfigs', resource)
|
|
27
|
-
const menuItems = useSyncExternalPayloadStore('menuItems', resource)
|
|
28
|
-
const menuItemsVisible = useSyncExternalPayloadStore('menuItemsVisible', resource)
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
menuConfigs,
|
|
32
|
-
menuItemSelections,
|
|
33
|
-
menuItems,
|
|
34
|
-
menuItemsVisible,
|
|
35
|
-
resource,
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const DappMenuResourceHooks = new ResourceHooks<DappMenuResourceViews, DappMenuResource>(useBuildDappMenuResource, useMenuResourceViews)
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { DappName, XyOsContext } from '@xyo-network/os-model'
|
|
2
|
-
import {
|
|
3
|
-
useEffect, useRef, useState,
|
|
4
|
-
} from 'react'
|
|
5
|
-
import { useNavigate, useParams } from 'react-router-dom'
|
|
6
|
-
|
|
7
|
-
import type { DappMenuProperties } from '../../types/index.ts'
|
|
8
|
-
import { DappPathHelpers } from '../lib/index.ts'
|
|
9
|
-
import { useDappMenuDependencies } from './useDappMenuDependencies.ts'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Use the passed in dapp Node to resolve menu related modules and return the menu related items
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export const useDappMenu = (context?: XyOsContext | null, dappName?: DappName): DappMenuProperties => {
|
|
16
|
-
const [error, setError] = useState<Error>()
|
|
17
|
-
const params = useParams()
|
|
18
|
-
const navigate = useNavigate()
|
|
19
|
-
const {
|
|
20
|
-
defaultPath, menuConfigs, menuItemsVisible, menuSelection, resourceError,
|
|
21
|
-
} = useDappMenuDependencies(context)
|
|
22
|
-
const activePath = menuSelection ?? defaultPath
|
|
23
|
-
|
|
24
|
-
// Keep track of the current path
|
|
25
|
-
// If links are clicked within a dapp, the path will change so we need to keep track of it
|
|
26
|
-
const currentPathRef = useRef<string>(undefined)
|
|
27
|
-
|
|
28
|
-
// Initialize the current path
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (params && currentPathRef.current === undefined) {
|
|
31
|
-
currentPathRef.current = params.path ?? ''
|
|
32
|
-
}
|
|
33
|
-
}, [])
|
|
34
|
-
|
|
35
|
-
// Reset the current path when the dappNode goes away (e.g. when the dapp is closed)
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (context === null) {
|
|
38
|
-
currentPathRef.current = undefined
|
|
39
|
-
}
|
|
40
|
-
}, [context])
|
|
41
|
-
|
|
42
|
-
// Update the current path when new menuSelections are made without invoking onPathChange (i.e. clicking link within a dapp)
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (menuSelection) {
|
|
45
|
-
currentPathRef.current = menuSelection
|
|
46
|
-
}
|
|
47
|
-
}, [menuSelection])
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (resourceError) setError(resourceError)
|
|
51
|
-
}, [resourceError])
|
|
52
|
-
|
|
53
|
-
// Callback to invoke when the path changes. Main purpose is the keep the url in sync with the menu selection
|
|
54
|
-
const onPathChange = (path: string) => {
|
|
55
|
-
const pathIsInUnchanged = DappPathHelpers.detectDuplicateSelections(currentPathRef.current, path, defaultPath)
|
|
56
|
-
if (pathIsInUnchanged) return
|
|
57
|
-
|
|
58
|
-
// navigate to the new path so listeners on the route can react
|
|
59
|
-
const destinationPath = DappPathHelpers.deriveDestinationPath(path, defaultPath, dappName)
|
|
60
|
-
void navigate(destinationPath)
|
|
61
|
-
currentPathRef.current = path
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
activePath,
|
|
66
|
-
error,
|
|
67
|
-
menuConfig: menuConfigs?.[0],
|
|
68
|
-
menuItems: menuItemsVisible,
|
|
69
|
-
onPathChange,
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/assert'
|
|
2
|
-
import type { XyOsContext } from '@xyo-network/os-model'
|
|
3
|
-
import { DappMenuCaller } from '@xyo-network/os-runtime'
|
|
4
|
-
import { useMemo } from 'react'
|
|
5
|
-
|
|
6
|
-
import { useXyOsUiContext } from '../../../../../XyOsUi/index.ts'
|
|
7
|
-
|
|
8
|
-
type DappMenuCallerHookOptions = {
|
|
9
|
-
ignoreProvidedNode?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const useDappMenuCaller = (context?: XyOsContext | null, { ignoreProvidedNode }: DappMenuCallerHookOptions = {}) => {
|
|
13
|
-
const xyOs = useXyOsUiContext()
|
|
14
|
-
|
|
15
|
-
return useMemo(() => {
|
|
16
|
-
const resolvedProvidedNode = ignoreProvidedNode ? null : xyOs
|
|
17
|
-
if (context || resolvedProvidedNode) {
|
|
18
|
-
const finalContext = assertEx(context ?? xyOs, () => 'no node was found in context or passed as argument')
|
|
19
|
-
return new DappMenuCaller(finalContext)
|
|
20
|
-
}
|
|
21
|
-
}, [ignoreProvidedNode, context, xyOs])
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { XyOsContext } from '@xyo-network/os-model'
|
|
2
|
-
import { useMemo } from 'react'
|
|
3
|
-
|
|
4
|
-
import { DappMenuResourceHooks } from './useBuildDappMenuResource.ts'
|
|
5
|
-
|
|
6
|
-
export const useDappMenuDependencies = (context?: XyOsContext | null) => {
|
|
7
|
-
const {
|
|
8
|
-
menuConfigs, menuItemSelections, menuItemsVisible, resourceError,
|
|
9
|
-
} = DappMenuResourceHooks.resourceViewsFromContext(context)
|
|
10
|
-
const defaultPath = useMemo(() => menuConfigs?.[0]?.defaultPath, [menuConfigs])
|
|
11
|
-
const menuSelection = menuItemSelections?.[0]?.path
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
defaultPath, menuConfigs, menuItemsVisible, menuSelection, resourceError,
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Manage the dapp based off the route params and intent type
|
|
2
|
-
|
|
3
|
-
This hook centralizes the logic for managing the dapp based off the route. It reacts to changes in the route params and performs the following:
|
|
4
|
-
|
|
5
|
-
1. Launch or close the dapp based off changes to the `dappName` route params
|
|
6
|
-
1. Update the menu archivist based off changes in the the `path` route param
|
|
7
|
-
1. Update the dapp archivist with injectable params based off changes in the query params
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { findAs } from '@xylabs/array'
|
|
2
|
-
import { assertEx } from '@xylabs/assert'
|
|
3
|
-
import { usePromise } from '@xylabs/react-promise'
|
|
4
|
-
import type { ArchivistInstance, ArchivistModuleEventData } from '@xyo-network/archivist-model'
|
|
5
|
-
import { asArchivistInstance } from '@xyo-network/archivist-model'
|
|
6
|
-
import { asOptionalDappInjectableParams, type XyOsContext } from '@xyo-network/os-model'
|
|
7
|
-
import { DappCaller } from '@xyo-network/os-runtime'
|
|
8
|
-
import { useNavigate, useSearchParams } from 'react-router-dom'
|
|
9
|
-
|
|
10
|
-
/** Update the dapp archivist with injectable params based off changes in the query params */
|
|
11
|
-
export const useManageDappInjectableParamsFromRoute = (context?: XyOsContext | null) => {
|
|
12
|
-
const [queryParams] = useSearchParams()
|
|
13
|
-
const navigate = useNavigate()
|
|
14
|
-
|
|
15
|
-
const [, callerError] = usePromise(async () => {
|
|
16
|
-
if (context && queryParams) {
|
|
17
|
-
const dappCaller = new DappCaller(context)
|
|
18
|
-
const pathname = globalThis.location.pathname
|
|
19
|
-
await dappCaller.setDappInjectableRouteParams(queryParams, pathname)
|
|
20
|
-
}
|
|
21
|
-
}, [context, queryParams])
|
|
22
|
-
|
|
23
|
-
// Update the route if the dapp inserts a new injectable params payload and the path is different
|
|
24
|
-
const [, listenerError] = usePromise(async () => {
|
|
25
|
-
let archivist: ArchivistInstance | undefined
|
|
26
|
-
const listener = ({ payloads }: ArchivistModuleEventData['inserted']) => {
|
|
27
|
-
const injectableParams = findAs(payloads, asOptionalDappInjectableParams)
|
|
28
|
-
if (injectableParams && context) {
|
|
29
|
-
const pathname = globalThis.location.pathname
|
|
30
|
-
if (pathname !== injectableParams.path) {
|
|
31
|
-
void navigate(injectableParams.path)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
if (context) {
|
|
38
|
-
const mod = assertEx(await context?.root.resolve('DappArchivist'), () => 'DappArchivist not found')
|
|
39
|
-
archivist = asArchivistInstance(mod, () => 'DappArchivist not is not an Archivist', { required: true })
|
|
40
|
-
|
|
41
|
-
archivist.on('inserted', listener)
|
|
42
|
-
}
|
|
43
|
-
} catch (e) {
|
|
44
|
-
console.error(e)
|
|
45
|
-
throw e
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return () => {
|
|
49
|
-
archivist?.off('inserted', listener)
|
|
50
|
-
}
|
|
51
|
-
// disabling because navigate reference changes unnecessarily for this use case
|
|
52
|
-
// see - https://stackoverflow.com/a/75329664/2803259
|
|
53
|
-
}, [context])
|
|
54
|
-
|
|
55
|
-
return [callerError, listenerError]
|
|
56
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { findAs } from '@xylabs/array'
|
|
2
|
-
import { useAtomicPromise, usePromise } from '@xylabs/react-promise'
|
|
3
|
-
import type { ArchivistInstance, ArchivistModuleEventData } from '@xyo-network/archivist-model'
|
|
4
|
-
import type {
|
|
5
|
-
DappId, DappIntent, XyOsContext,
|
|
6
|
-
} from '@xyo-network/os-model'
|
|
7
|
-
import { asOptionalDappIntent, DappIntentTypes } from '@xyo-network/os-model'
|
|
8
|
-
import { DappIntentCaller } from '@xyo-network/os-runtime'
|
|
9
|
-
import { useEffect, useState } from 'react'
|
|
10
|
-
|
|
11
|
-
import { useSendDappIntent } from '../../../../../../intent/index.ts'
|
|
12
|
-
import { useDappCaller } from '../../../../../useDappCaller.ts'
|
|
13
|
-
|
|
14
|
-
// React to new intents inserted into the dapp archivist
|
|
15
|
-
export const useManageDappIntentRequest = (context?: XyOsContext | null, dappId?: DappId) => {
|
|
16
|
-
const dappCaller = useDappCaller(context)
|
|
17
|
-
const sendIntent = useSendDappIntent()
|
|
18
|
-
const [intentPayload, setIntentPayload] = useState<DappIntent>()
|
|
19
|
-
const [handleIntentError, setHandleIntentError] = useState<Error>()
|
|
20
|
-
const [dappArchivist, setDappArchivist] = useState<ArchivistInstance>()
|
|
21
|
-
|
|
22
|
-
usePromise(async () => {
|
|
23
|
-
if (context && dappCaller) {
|
|
24
|
-
const archivist = await dappCaller.getDappArchivist()
|
|
25
|
-
if (archivist) setDappArchivist(archivist)
|
|
26
|
-
}
|
|
27
|
-
}, [context, dappCaller])
|
|
28
|
-
|
|
29
|
-
useAtomicPromise(
|
|
30
|
-
'manageDappIntent',
|
|
31
|
-
async () => {
|
|
32
|
-
if (context && intentPayload?.targetDappId && dappId && sendIntent) {
|
|
33
|
-
try {
|
|
34
|
-
const minimizeIntent = DappIntentCaller.buildIntent(DappIntentCaller.OsDappName, DappIntentTypes.Minimize, dappId)
|
|
35
|
-
await sendIntent(minimizeIntent)
|
|
36
|
-
await sendIntent(intentPayload)
|
|
37
|
-
} catch (e) {
|
|
38
|
-
console.error(e)
|
|
39
|
-
setHandleIntentError(e as Error)
|
|
40
|
-
}
|
|
41
|
-
setIntentPayload(undefined)
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
[context, dappId, intentPayload, sendIntent],
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
// catch the intent sent by the dapp and mirror it inside the os intent archivist
|
|
49
|
-
const listener = ({ payloads }: ArchivistModuleEventData['inserted']) => {
|
|
50
|
-
// only dapps with an active context should react to the new intents
|
|
51
|
-
if (context) {
|
|
52
|
-
const intentPayload = findAs(payloads, asOptionalDappIntent)
|
|
53
|
-
if (intentPayload) {
|
|
54
|
-
setIntentPayload(intentPayload)
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
dappArchivist?.off('inserted', listener)
|
|
59
|
-
if (dappArchivist && context) {
|
|
60
|
-
dappArchivist.on('inserted', listener)
|
|
61
|
-
}
|
|
62
|
-
return () => {
|
|
63
|
-
dappArchivist?.off('inserted', listener)
|
|
64
|
-
}
|
|
65
|
-
}, [context, dappArchivist])
|
|
66
|
-
|
|
67
|
-
return handleIntentError
|
|
68
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { usePromise } from '@xylabs/react-promise'
|
|
2
|
-
import type { XyOsContext } from '@xyo-network/os-model'
|
|
3
|
-
import {
|
|
4
|
-
useCallback, useEffect, useRef,
|
|
5
|
-
} from 'react'
|
|
6
|
-
import { useNavigate, useParams } from 'react-router-dom'
|
|
7
|
-
|
|
8
|
-
import { DappPathHelpers } from '../../lib/index.ts'
|
|
9
|
-
import { useDappMenuCaller, useDappMenuDependencies } from '../../menu/index.ts'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Update the menu archivist based off changes in the the `path` route param
|
|
13
|
-
*
|
|
14
|
-
* Test Cases:
|
|
15
|
-
*
|
|
16
|
-
* 1. Clicking sidebar menu
|
|
17
|
-
* 2. Clicking sidebar menu twice
|
|
18
|
-
* 3. Navigating directly to a path on dApp load
|
|
19
|
-
* 4. Navigating directly to a path from within the dApp by clicking a link
|
|
20
|
-
* 5. Navigating directly to a path from within the dApp by clicking back
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/** React to changes in the `path` route param */
|
|
24
|
-
export const useManageDappPathFromRoute = (context?: XyOsContext | null, dappName?: string) => {
|
|
25
|
-
const params = useParams()
|
|
26
|
-
const { path: pathParam } = params
|
|
27
|
-
const dappMenuCaller = useDappMenuCaller(context, { ignoreProvidedNode: true })
|
|
28
|
-
const { menuSelection, defaultPath } = useDappMenuDependencies(context)
|
|
29
|
-
const navigate = useNavigate()
|
|
30
|
-
|
|
31
|
-
// keep track of the current path and avoid making pathParam a dependency
|
|
32
|
-
const currentPathRef = useRef<string>(undefined)
|
|
33
|
-
|
|
34
|
-
// Update the menu archivist based off the params
|
|
35
|
-
const updateMenuArchivist = useCallback(
|
|
36
|
-
async (pathParam?: string) => {
|
|
37
|
-
currentPathRef.current = pathParam
|
|
38
|
-
// ensure the dappNode is active before updating the menu
|
|
39
|
-
if (context && dappMenuCaller) {
|
|
40
|
-
const currentPath = await dappMenuCaller?.currentNavSelection()
|
|
41
|
-
const updatedPath = DappPathHelpers.derivePathForNavSelection(pathParam, currentPath?.[0]?.path, defaultPath)
|
|
42
|
-
|
|
43
|
-
if (updatedPath) {
|
|
44
|
-
await dappMenuCaller.makeNavItemSelection(updatedPath)
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
[dappMenuCaller, context, defaultPath],
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
// Sync the route when the menu archivist updates (no pathParam dependency)
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
if (context && menuSelection) {
|
|
54
|
-
const pathIsInUnchanged = DappPathHelpers.detectDuplicateSelections(currentPathRef.current ?? '', menuSelection, defaultPath)
|
|
55
|
-
if (pathIsInUnchanged) return
|
|
56
|
-
|
|
57
|
-
// navigate to the new path so listeners on the route can react
|
|
58
|
-
const destinationPath = DappPathHelpers.deriveDestinationPath(menuSelection, defaultPath, dappName)
|
|
59
|
-
void navigate(destinationPath)
|
|
60
|
-
currentPathRef.current = menuSelection === defaultPath ? undefined : menuSelection
|
|
61
|
-
}
|
|
62
|
-
// disabling because navigate reference changes unnecessarily for this use case
|
|
63
|
-
// see - https://stackoverflow.com/a/75329664/2803259
|
|
64
|
-
}, [dappName, context, defaultPath, menuSelection])
|
|
65
|
-
|
|
66
|
-
// Sync the menu archivist when the route changes (no menuSelection dependency)
|
|
67
|
-
const [, updateErrors] = usePromise(async () => {
|
|
68
|
-
if (context && pathParam !== currentPathRef.current) {
|
|
69
|
-
await updateMenuArchivist(pathParam)
|
|
70
|
-
currentPathRef.current = pathParam
|
|
71
|
-
}
|
|
72
|
-
}, [context, pathParam, updateMenuArchivist])
|
|
73
|
-
|
|
74
|
-
return updateErrors
|
|
75
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { usePromise } from '@xylabs/react-promise'
|
|
2
|
-
import type { DappIntent } from '@xyo-network/os-model'
|
|
3
|
-
import { DappIntentTypes } from '@xyo-network/os-model'
|
|
4
|
-
import { DappIntentCaller, NameTransforms } from '@xyo-network/os-runtime'
|
|
5
|
-
import { useRef } from 'react'
|
|
6
|
-
import { useParams } from 'react-router-dom'
|
|
7
|
-
|
|
8
|
-
import { useDappIntentCaller, useSendDappIntent } from '../../../../../../intent/index.ts'
|
|
9
|
-
|
|
10
|
-
/** Launch or close the dapp based off changes to the `dappName` route param */
|
|
11
|
-
export const useManageDappStateFromRoute = (intentPayload?: DappIntent) => {
|
|
12
|
-
const params = useParams()
|
|
13
|
-
const { dappName: dappNameParam } = params
|
|
14
|
-
const sendIntent = useSendDappIntent()
|
|
15
|
-
const intentCaller = useDappIntentCaller()
|
|
16
|
-
|
|
17
|
-
// refs to track the dappName param and the last intent sent
|
|
18
|
-
const dappNameParamRef = useRef<string>(undefined)
|
|
19
|
-
const intentRef = useRef<DappIntent>(undefined)
|
|
20
|
-
|
|
21
|
-
// auto-close the dapp if it was launched and the route param goes undefined (i.e. back button clicked)
|
|
22
|
-
usePromise(async () => {
|
|
23
|
-
const launched = intentPayload?.intent === DappIntentTypes.Launch
|
|
24
|
-
const dappNameParamRemoved = !!dappNameParamRef.current && dappNameParam === undefined
|
|
25
|
-
// The last intent was Launch and the dappName param was removed
|
|
26
|
-
if (launched && dappNameParamRemoved && sendIntent) {
|
|
27
|
-
const closeIntent = DappIntentCaller.buildIntent(DappIntentCaller.OsDappName, DappIntentTypes.Close)
|
|
28
|
-
await sendIntent(closeIntent)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// sync back the dappNameParamRef for future checks
|
|
32
|
-
dappNameParamRef.current = dappNameParam
|
|
33
|
-
}, [dappNameParam, intentPayload, sendIntent])
|
|
34
|
-
|
|
35
|
-
// auto-launch the dapp if the route param matches the dapp name
|
|
36
|
-
usePromise(async () => {
|
|
37
|
-
if (dappNameParam && sendIntent && intentCaller) {
|
|
38
|
-
const dappNameParamDeSlugged = new NameTransforms(dappNameParam).deSlug()
|
|
39
|
-
// no intents have been sent yet and the dappName param is set so we need to auto launch the dapp
|
|
40
|
-
const autoLaunchNeeded = intentRef.current === undefined && dappNameParam
|
|
41
|
-
|
|
42
|
-
if (autoLaunchNeeded) {
|
|
43
|
-
const launchIntent = DappIntentCaller.buildIntent(DappIntentCaller.OsDappName, DappIntentTypes.Launch, dappNameParamDeSlugged)
|
|
44
|
-
await sendIntent(launchIntent)
|
|
45
|
-
// sync back the intentRef to ensure the auto launch only happens once
|
|
46
|
-
intentRef.current = launchIntent
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}, [dappNameParam, sendIntent, intentCaller, intentPayload?.intent])
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './helpers/index.ts'
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useCallback, useEffect, useRef, useState,
|
|
3
|
-
} from 'react'
|
|
4
|
-
import { useNavigate, useSearchParams } from 'react-router-dom'
|
|
5
|
-
|
|
6
|
-
export const useDebugClick = () => {
|
|
7
|
-
const [params, setParams] = useSearchParams()
|
|
8
|
-
const [debugOpen, setDebugOpen] = useState(false)
|
|
9
|
-
const openFromClick = useRef(false)
|
|
10
|
-
const closeFromClick = useRef(false)
|
|
11
|
-
const initialized = useRef(false)
|
|
12
|
-
const navigate = useNavigate()
|
|
13
|
-
|
|
14
|
-
const openDebug = useCallback(() => {
|
|
15
|
-
openFromClick.current = true
|
|
16
|
-
closeFromClick.current = false
|
|
17
|
-
setParams((params) => {
|
|
18
|
-
params.set('debug', 'true')
|
|
19
|
-
return new URLSearchParams(params)
|
|
20
|
-
})
|
|
21
|
-
setDebugOpen(true)
|
|
22
|
-
}, [setParams])
|
|
23
|
-
|
|
24
|
-
const closeDebug = useCallback(() => {
|
|
25
|
-
openFromClick.current = false
|
|
26
|
-
closeFromClick.current = true
|
|
27
|
-
initialized.current = false
|
|
28
|
-
void navigate(-1)
|
|
29
|
-
setDebugOpen(false)
|
|
30
|
-
}, [navigate])
|
|
31
|
-
|
|
32
|
-
// Auto Open Logic (on forward click) - not working
|
|
33
|
-
// useEffect(() => {
|
|
34
|
-
// // Was closed, open wasn't clicked, and debug is in the query params
|
|
35
|
-
// const openedFromRoute = !openFromClick.current && !closeFromClick.current && params.has('debug')
|
|
36
|
-
// if (openedFromRoute) {
|
|
37
|
-
// // openDebug()
|
|
38
|
-
// }
|
|
39
|
-
// }, [openDebug, params])
|
|
40
|
-
|
|
41
|
-
// Auto Close Logic (on back click)
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
// Was opened, close wasn't clicked, and debug is in the query params
|
|
44
|
-
const initialOpen = openFromClick.current && !closeFromClick.current && params.has('debug')
|
|
45
|
-
// Was opened, close wasn't clicked, and debug is missing in the query params
|
|
46
|
-
const backButtonClicked = openFromClick.current && !closeFromClick.current && !params.has('debug')
|
|
47
|
-
if (initialOpen) {
|
|
48
|
-
// using the ref to avoid setting debugOpen to false on the first render
|
|
49
|
-
if (initialized.current === false) {
|
|
50
|
-
initialized.current = true
|
|
51
|
-
}
|
|
52
|
-
} else if (backButtonClicked) {
|
|
53
|
-
initialized.current = false
|
|
54
|
-
closeDebug()
|
|
55
|
-
}
|
|
56
|
-
}, [params, closeDebug])
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
closeDebug, debugOpen, openDebug,
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { RegisteredReactDapp } from '@xyo-network/os-react-model'
|
|
2
|
-
import { useMemo } from 'react'
|
|
3
|
-
|
|
4
|
-
import { NodeManifest } from '../NodeManifest.tsx'
|
|
5
|
-
|
|
6
|
-
export const useDecomposeDapp = (dapp?: RegisteredReactDapp) => {
|
|
7
|
-
const DappComponent = useMemo(() => dapp?.params.modes?.window?.component ?? NodeManifest, []) as React.FC<{
|
|
8
|
-
name?: string
|
|
9
|
-
}>
|
|
10
|
-
const name = dapp?.config.name
|
|
11
|
-
const version = dapp?.config.version
|
|
12
|
-
const scrollable = dapp?.params.modes?.window?.scrollable ?? true
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
DappComponent,
|
|
16
|
-
dapp,
|
|
17
|
-
name,
|
|
18
|
-
scrollable,
|
|
19
|
-
version,
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react'
|
|
2
|
-
import { useSearchParams } from 'react-router-dom'
|
|
3
|
-
|
|
4
|
-
import { detectCustomer } from './lib/index.ts'
|
|
5
|
-
|
|
6
|
-
const PARAMS_TO_TARGET = ['username', 'utm_source'] as const
|
|
7
|
-
|
|
8
|
-
export const useSkipLoadingScreen = () => {
|
|
9
|
-
const [params] = useSearchParams()
|
|
10
|
-
const customer = detectCustomer()
|
|
11
|
-
return useMemo(() => {
|
|
12
|
-
const hasTargetParams = PARAMS_TO_TARGET.some(param => params.has(param))
|
|
13
|
-
const isCustomer = !!customer
|
|
14
|
-
|
|
15
|
-
return hasTargetParams || isCustomer
|
|
16
|
-
}, [customer, params])
|
|
17
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { usePromise } from '@xylabs/react-promise'
|
|
2
|
-
import type { ArchivistModuleEventData } from '@xyo-network/archivist-model'
|
|
3
|
-
import type { XyOsContext } from '@xyo-network/os-model'
|
|
4
|
-
import { useWeakArchivistFromNode } from '@xyo-network/react-archivist'
|
|
5
|
-
|
|
6
|
-
import { useDappCaller } from '../../../useDappCaller.ts'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Syncs the registered access interfaces from the Os with the DappArchivist
|
|
10
|
-
* @param {NodeInstance | null} dappNode The dapp node
|
|
11
|
-
*/
|
|
12
|
-
export const useSyncOsRegisteredAccessInterfaces = (context?: XyOsContext | null) => {
|
|
13
|
-
const [registeredInterfacesArchivist] = useWeakArchivistFromNode('RegisteredDappInterfacesArchivist')
|
|
14
|
-
const dappCaller = useDappCaller(context)
|
|
15
|
-
|
|
16
|
-
usePromise(async () => {
|
|
17
|
-
const listener = async ({ payloads }: ArchivistModuleEventData['inserted']) => {
|
|
18
|
-
if (context && dappCaller) {
|
|
19
|
-
await dappCaller.addPayloadsToDappArchivist(payloads)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (context && dappCaller) {
|
|
23
|
-
// Add all registered interfaces to the dapp archivist
|
|
24
|
-
const registeredInterfaces = await registeredInterfacesArchivist?.deref()?.all()
|
|
25
|
-
if (registeredInterfaces) {
|
|
26
|
-
await dappCaller.addPayloadsToDappArchivist(registeredInterfaces)
|
|
27
|
-
}
|
|
28
|
-
// Listen for new interfaces and add them to the dapp archivist
|
|
29
|
-
registeredInterfacesArchivist?.deref()?.on('inserted', listener)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return () => {
|
|
33
|
-
registeredInterfacesArchivist?.deref()?.off('inserted', listener)
|
|
34
|
-
}
|
|
35
|
-
}, [dappCaller, context, registeredInterfacesArchivist])
|
|
36
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RegisteredReactDapp, XyOsUiContext } from '@xyo-network/os-react-model'
|
|
2
|
-
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
3
|
-
|
|
4
|
-
import type { DappState } from '../../../lib/index.ts'
|
|
5
|
-
import type { DappMenuProperties } from './DappMenuProperties.ts'
|
|
6
|
-
|
|
7
|
-
export interface DappWindowProps {
|
|
8
|
-
context?: XyOsUiContext | null
|
|
9
|
-
dapp?: RegisteredReactDapp
|
|
10
|
-
dappMenuProperties?: DappMenuProperties
|
|
11
|
-
dappState?: DappState
|
|
12
|
-
dappWallet?: WalletInstance
|
|
13
|
-
errors?: (Error | undefined)[]
|
|
14
|
-
}
|