@xyo-network/os-react-runtime 4.2.0-rc.3 → 4.2.0-rc.5
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/index.mjs +16 -13
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/modules/Dapp/Page/Row.d.ts +2 -1
- package/dist/browser/modules/Dapp/Page/Row.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts +1 -0
- package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/index.d.ts +1 -0
- package/dist/browser/modules/Dapp/modules/Window/hooks/index.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/modules/Dapp/Page/Row.tsx +4 -5
- package/src/modules/Dapp/modules/Window/DappWindow.tsx +11 -12
- package/src/modules/Dapp/modules/Window/hooks/index.ts +1 -0
- package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenu.tsx +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { InstallationType } from '@xyo-network/os-model';
|
|
1
|
+
import type { DappIntent, InstallationType } from '@xyo-network/os-model';
|
|
2
2
|
import type { RegisteredReactDappSet } from '@xyo-network/os-react-model';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
export interface DappsRowProps {
|
|
5
5
|
chipLabel: string;
|
|
6
|
+
currentIntent?: DappIntent;
|
|
6
7
|
installType: InstallationType;
|
|
7
8
|
registeredDappsSet?: RegisteredReactDappSet[];
|
|
8
9
|
xnsNetwork: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../../../src/modules/Dapp/Page/Row.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../../../src/modules/Dapp/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AAE,KAAK,CAAA;CACxB;AAED,gIAAgI;AAChI,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"DappWindow.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/Dapp/modules/Window/DappWindow.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAIzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAkB,MAAM,OAAO,CAAA;AAOtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAOjD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAC5B,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,eAAe,CAAC,EAAE,KAAK,CAAA;CACxB;AAED,gIAAgI;AAChI,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoHhD,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './lib/index.ts';
|
|
2
2
|
export * from './menu/index.ts';
|
|
3
3
|
export * from './route/index.ts';
|
|
4
|
+
export * from './useDappMenuResourceValues.tsx';
|
|
4
5
|
export * from './useDecomposeDappSet.js';
|
|
5
6
|
export * from './useSkipLoadingScreen.js';
|
|
6
7
|
export * from './useSyncOsRegisteredAccessInterfaces.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/Dapp/modules/Window/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0CAA0C,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/Dapp/modules/Window/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0CAA0C,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/os-react-runtime",
|
|
3
|
-
"version": "4.2.0-rc.
|
|
3
|
+
"version": "4.2.0-rc.5",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -48,23 +48,23 @@
|
|
|
48
48
|
"@xylabs/react-shared": "^5.3.14",
|
|
49
49
|
"@xyo-network/archivist-indexeddb": "^3.6.6",
|
|
50
50
|
"@xyo-network/archivist-model": "^3.6.6",
|
|
51
|
-
"@xyo-network/bios-browser": "^4.2.0-rc.
|
|
52
|
-
"@xyo-network/bios-model": "^4.2.0-rc.
|
|
51
|
+
"@xyo-network/bios-browser": "^4.2.0-rc.5",
|
|
52
|
+
"@xyo-network/bios-model": "^4.2.0-rc.5",
|
|
53
53
|
"@xyo-network/diviner-boundwitness-indexeddb": "^3.6.6",
|
|
54
54
|
"@xyo-network/diviner-model": "^3.6.6",
|
|
55
55
|
"@xyo-network/diviner-payload-generic": "^3.6.6",
|
|
56
56
|
"@xyo-network/diviner-payload-indexeddb": "^3.6.6",
|
|
57
57
|
"@xyo-network/diviner-payload-model": "^3.6.6",
|
|
58
|
-
"@xyo-network/kernel": "^4.2.0-rc.
|
|
59
|
-
"@xyo-network/kernel-model": "^4.2.0-rc.
|
|
58
|
+
"@xyo-network/kernel": "^4.2.0-rc.5",
|
|
59
|
+
"@xyo-network/kernel-model": "^4.2.0-rc.5",
|
|
60
60
|
"@xyo-network/module-event-emitter": "^3.6.6",
|
|
61
61
|
"@xyo-network/module-events": "^3.6.6",
|
|
62
62
|
"@xyo-network/module-factory-locator": "^3.6.6",
|
|
63
63
|
"@xyo-network/node-model": "^3.6.6",
|
|
64
|
-
"@xyo-network/os-model": "^4.2.0-rc.
|
|
65
|
-
"@xyo-network/os-react-debug": "^4.2.0-rc.
|
|
66
|
-
"@xyo-network/os-react-model": "^4.2.0-rc.
|
|
67
|
-
"@xyo-network/os-runtime": "^4.2.0-rc.
|
|
64
|
+
"@xyo-network/os-model": "^4.2.0-rc.5",
|
|
65
|
+
"@xyo-network/os-react-debug": "^4.2.0-rc.5",
|
|
66
|
+
"@xyo-network/os-react-model": "^4.2.0-rc.5",
|
|
67
|
+
"@xyo-network/os-runtime": "^4.2.0-rc.5",
|
|
68
68
|
"@xyo-network/payload-model": "^3.6.6",
|
|
69
69
|
"@xyo-network/react-archivist": "^4.3.1",
|
|
70
70
|
"@xyo-network/react-card": "^4.3.1",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Divider, Fade, styled,
|
|
3
3
|
} from '@mui/material'
|
|
4
|
-
import type { InstallationType } from '@xyo-network/os-model'
|
|
4
|
+
import type { DappIntent, InstallationType } from '@xyo-network/os-model'
|
|
5
5
|
import type { RegisteredReactDappSet } from '@xyo-network/os-react-model'
|
|
6
6
|
import React, { useMemo } from 'react'
|
|
7
7
|
|
|
8
|
-
import { useDappIntentListener } from '../../../hooks/index.ts'
|
|
9
8
|
import { DappInstallTypeFilters } from '../../../utils/index.ts'
|
|
10
9
|
import { DappContainerMemo } from '../Container.tsx'
|
|
11
10
|
import { DividerChip } from './DividerChip.js'
|
|
12
11
|
|
|
13
12
|
export interface DappsRowProps {
|
|
14
13
|
chipLabel: string
|
|
14
|
+
currentIntent?: DappIntent
|
|
15
15
|
installType: InstallationType
|
|
16
16
|
registeredDappsSet?: RegisteredReactDappSet[]
|
|
17
17
|
xnsNetwork: string | undefined
|
|
@@ -19,10 +19,9 @@ export interface DappsRowProps {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const DappsRow: React.FC<DappsRowProps> = ({
|
|
22
|
-
chipLabel, installType, registeredDappsSet, xnsNetwork, xnsNodeUrl,
|
|
22
|
+
chipLabel, currentIntent, installType, registeredDappsSet, xnsNetwork, xnsNodeUrl,
|
|
23
23
|
}) => {
|
|
24
24
|
const filteredRegisteredDappSets = useMemo(() => DappInstallTypeFilters[installType](registeredDappsSet), [installType, registeredDappsSet])
|
|
25
|
-
const { intentPayload } = useDappIntentListener(null)
|
|
26
25
|
|
|
27
26
|
return (
|
|
28
27
|
<>
|
|
@@ -43,7 +42,7 @@ export const DappsRow: React.FC<DappsRowProps> = ({
|
|
|
43
42
|
{filteredRegisteredDappSets?.map(
|
|
44
43
|
dappSet => (
|
|
45
44
|
<DappContainerMemo
|
|
46
|
-
currentIntent={
|
|
45
|
+
currentIntent={currentIntent}
|
|
47
46
|
key={dappSet.dapp.config.name}
|
|
48
47
|
dappSet={dappSet as RegisteredReactDappSet}
|
|
49
48
|
xnsNodeUrl={xnsNodeUrl}
|
|
@@ -16,7 +16,7 @@ import { DappBar } from './AppBar.js'
|
|
|
16
16
|
import { DappChrome } from './Chrome.js'
|
|
17
17
|
import type { DappState } from './hooks/index.ts'
|
|
18
18
|
import {
|
|
19
|
-
decomposeDappSet, useDappMenu,
|
|
19
|
+
decomposeDappSet, useDappMenu, useManageDappInjectableParamsFromRoute, useManageDappPathFromRoute, useSyncOsRegisteredAccessInterfaces,
|
|
20
20
|
} from './hooks/index.ts'
|
|
21
21
|
import { DappLoadingFlexbox } from './LoadingFlexbox.js'
|
|
22
22
|
import { DappBottomNavigation, DappMenuDrawer } from './menu/index.ts'
|
|
@@ -26,13 +26,14 @@ export interface DappWindowProps {
|
|
|
26
26
|
dappSet?: RegisteredReactDappSet
|
|
27
27
|
dappState?: DappState
|
|
28
28
|
dappWallet?: WalletInstance
|
|
29
|
+
errors?: Error[]
|
|
29
30
|
intent?: DappIntent
|
|
30
31
|
nodeCreateError?: Error
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/** A component that can load immediately, but delays node loading and dapp mounting till corresponding launch intent arrives */
|
|
34
35
|
export const DappWindow: React.FC<DappWindowProps> = ({
|
|
35
|
-
context, dappSet, dappState, dappWallet,
|
|
36
|
+
context, dappSet, dappState, dappWallet, errors, nodeCreateError,
|
|
36
37
|
}) => {
|
|
37
38
|
const {
|
|
38
39
|
DappComponent, name, scrollable = true, version,
|
|
@@ -44,15 +45,16 @@ export const DappWindow: React.FC<DappWindowProps> = ({
|
|
|
44
45
|
name?: string
|
|
45
46
|
}>, [])
|
|
46
47
|
|
|
47
|
-
// TODO - see if we can move this outside of the DappWindow component
|
|
48
|
-
const errors = useManageDappBasedOffRoute(intent, name, context)
|
|
49
48
|
useSyncOsRegisteredAccessInterfaces(context)
|
|
49
|
+
useManageDappPathFromRoute(context, name)
|
|
50
|
+
useManageDappInjectableParamsFromRoute(context)
|
|
50
51
|
|
|
51
52
|
const {
|
|
52
53
|
activePath, error: menuError, menuConfig, menuItemsVisible, onPathChange,
|
|
53
54
|
} = useDappMenu(context, name)
|
|
54
55
|
|
|
55
|
-
const
|
|
56
|
+
const resolvedErrors = [nodeCreateError, menuError, ...(errors ?? [])].filter(Boolean)
|
|
57
|
+
const hasErrors = resolvedErrors.length > 0
|
|
56
58
|
|
|
57
59
|
return (
|
|
58
60
|
<>
|
|
@@ -100,16 +102,13 @@ export const DappWindow: React.FC<DappWindowProps> = ({
|
|
|
100
102
|
/>
|
|
101
103
|
)}
|
|
102
104
|
/* Ensure that loading goes away when error occurs */
|
|
103
|
-
splashScreen={
|
|
105
|
+
splashScreen={hasErrors ? null : <DappLoadingFlexbox minimize={!!minimized} name={name} open={!!active} />}
|
|
104
106
|
>
|
|
105
|
-
{
|
|
107
|
+
{hasErrors
|
|
106
108
|
? (
|
|
107
109
|
<FlexCol padding={2}>
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
: null}
|
|
111
|
-
{errors.map((error, index) => (
|
|
112
|
-
<ErrorRender key={index} error={error} scope="DappWindowErrors" />
|
|
110
|
+
{resolvedErrors?.map((error, index) => (
|
|
111
|
+
<ErrorRender key={index} error={error} scope="DappWindow" />
|
|
113
112
|
))}
|
|
114
113
|
</FlexCol>
|
|
115
114
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './lib/index.ts'
|
|
2
2
|
export * from './menu/index.ts'
|
|
3
3
|
export * from './route/index.ts'
|
|
4
|
+
export * from './useDappMenuResourceValues.tsx'
|
|
4
5
|
export * from './useDecomposeDappSet.js'
|
|
5
6
|
export * from './useSkipLoadingScreen.js'
|
|
6
7
|
export * from './useSyncOsRegisteredAccessInterfaces.js'
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import { useNavigate, useParams } from 'react-router-dom'
|
|
7
7
|
|
|
8
8
|
import { DappPathHelpers } from '../lib/index.ts'
|
|
9
|
-
import { useDappMenuDependencies } from '../useDappMenuResourceValues.
|
|
9
|
+
import { useDappMenuDependencies } from '../useDappMenuResourceValues.tsx'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Use the passed in dapp Node to resolve menu related modules and return the menu related items
|