@xyo-network/os-react-runtime 4.2.0-rc.3 → 4.2.0-rc.4
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 +12 -10
- package/dist/browser/index.mjs.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/modules/Window/DappWindow.tsx +9 -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 +1 @@
|
|
|
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,UAAU,CAAA;IACnB,eAAe,CAAC,EAAE,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,CAkHhD,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.4",
|
|
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.4",
|
|
52
|
+
"@xyo-network/bios-model": "^4.2.0-rc.4",
|
|
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.4",
|
|
59
|
+
"@xyo-network/kernel-model": "^4.2.0-rc.4",
|
|
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.4",
|
|
65
|
+
"@xyo-network/os-react-debug": "^4.2.0-rc.4",
|
|
66
|
+
"@xyo-network/os-react-model": "^4.2.0-rc.4",
|
|
67
|
+
"@xyo-network/os-runtime": "^4.2.0-rc.4",
|
|
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",
|
|
@@ -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, 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,14 @@ 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)
|
|
50
49
|
|
|
51
50
|
const {
|
|
52
51
|
activePath, error: menuError, menuConfig, menuItemsVisible, onPathChange,
|
|
53
52
|
} = useDappMenu(context, name)
|
|
54
53
|
|
|
55
|
-
const
|
|
54
|
+
const resolvedErrors = [nodeCreateError, menuError, ...(errors ?? [])].filter(Boolean)
|
|
55
|
+
const hasErrors = resolvedErrors.length > 0
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<>
|
|
@@ -100,16 +100,13 @@ export const DappWindow: React.FC<DappWindowProps> = ({
|
|
|
100
100
|
/>
|
|
101
101
|
)}
|
|
102
102
|
/* Ensure that loading goes away when error occurs */
|
|
103
|
-
splashScreen={
|
|
103
|
+
splashScreen={hasErrors ? null : <DappLoadingFlexbox minimize={!!minimized} name={name} open={!!active} />}
|
|
104
104
|
>
|
|
105
|
-
{
|
|
105
|
+
{hasErrors
|
|
106
106
|
? (
|
|
107
107
|
<FlexCol padding={2}>
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
: null}
|
|
111
|
-
{errors.map((error, index) => (
|
|
112
|
-
<ErrorRender key={index} error={error} scope="DappWindowErrors" />
|
|
108
|
+
{resolvedErrors?.map((error, index) => (
|
|
109
|
+
<ErrorRender key={index} error={error} scope="DappWindow" />
|
|
113
110
|
))}
|
|
114
111
|
</FlexCol>
|
|
115
112
|
)
|
|
@@ -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
|