@xyo-network/react-webapp 2.47.4 → 2.47.6
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/cjs/components/Chrome.js +5 -4
- package/dist/cjs/components/Chrome.js.map +1 -1
- package/dist/docs.json +1172 -1141
- package/dist/esm/components/Chrome.js +5 -3
- package/dist/esm/components/Chrome.js.map +1 -1
- package/dist/types/components/Chrome.d.ts +1 -1
- package/dist/types/components/Chrome.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/Chrome.tsx +36 -42
|
@@ -4,11 +4,13 @@ import { FlexCol, FlexGrowCol, FlexGrowRow } from '@xylabs/react-flexbox';
|
|
|
4
4
|
import { ApplicationAppBar, SystemToolbar } from '@xyo-network/react-appbar';
|
|
5
5
|
import { Footer } from '@xyo-network/react-footer';
|
|
6
6
|
import { ErrorBoundary } from '@xyo-network/react-shared';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
7
8
|
import { Helmet } from 'react-helmet';
|
|
8
9
|
import { WebAppErrorPage } from './ErrorPage';
|
|
9
|
-
export const WebAppChrome = ({ appName, appbar, children, errorPage, footer, footerElevation = 4, menuItems, navigationType = 'menu', ...props }) => {
|
|
10
|
-
return (_jsxs(FlexCol, { id: "web-chrome-flex", alignItems: "stretch", overflow: "hidden", height: "100vh", ...props, children: [_jsx(Helmet, { defaultTitle: appName, titleTemplate: `%s | ${appName}`, children: _jsx("meta", { content: "website", property: "og:type" }) }), appbar ?? _jsx(ApplicationAppBar, { systemToolbar: _jsx(SystemToolbar, { menuItems: navigationType === 'menu' ? menuItems : undefined }) }), _jsxs(FlexGrowRow, { id: "sidebar-nav-flex", overflow: "hidden", alignItems: "stretch", children: [navigationType !== 'menu' ? (_jsxs(_Fragment, { children: [menuItems, _jsx(Divider, { orientation: "vertical" })] })) : null, _jsx(FlexGrowCol, { id: "main-flex", justifyContent: "flex-start", alignItems: "stretch", children: _jsx(ErrorBoundary, { fallbackWithError: (error) => {
|
|
10
|
+
export const WebAppChrome = forwardRef(({ appName, appbar, children, errorPage, footer, footerElevation = 4, menuItems, navigationType = 'menu', ...props }, ref) => {
|
|
11
|
+
return (_jsxs(FlexCol, { id: "web-chrome-flex", alignItems: "stretch", overflow: "hidden", height: "100vh", ref: ref, ...props, children: [_jsx(Helmet, { defaultTitle: appName, titleTemplate: `%s | ${appName}`, children: _jsx("meta", { content: "website", property: "og:type" }) }), appbar ?? _jsx(ApplicationAppBar, { systemToolbar: _jsx(SystemToolbar, { menuItems: navigationType === 'menu' ? menuItems : undefined }) }), _jsxs(FlexGrowRow, { id: "sidebar-nav-flex", overflow: "hidden", alignItems: "stretch", children: [navigationType !== 'menu' ? (_jsxs(_Fragment, { children: [menuItems, _jsx(Divider, { orientation: "vertical" })] })) : null, _jsx(FlexGrowCol, { id: "main-flex", justifyContent: "flex-start", alignItems: "stretch", children: _jsx(ErrorBoundary, { fallbackWithError: (error) => {
|
|
11
12
|
return errorPage ?? _jsx(WebAppErrorPage, { error: error });
|
|
12
13
|
}, children: children }) })] }), _jsx(FlexCol, { id: "footer-flex", alignItems: "stretch", children: _jsx(Paper, { elevation: footerElevation, square: true, children: footer ?? _jsx(Footer, { dynamicHeight: true }) }) })] }));
|
|
13
|
-
};
|
|
14
|
+
});
|
|
15
|
+
WebAppChrome.displayName = 'WebAppChrome';
|
|
14
16
|
//# sourceMappingURL=Chrome.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chrome.js","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAgB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEvF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD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AC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAI,GAAI,EAChI,MAAC,WAAW,IAAC,EAAE,EAAC,kBAAkB,EAAC,QAAQ,EAAC,QAAQ,EAAC,UAAU,EAAC,SAAS,aACtE,cAAc,KAAK,MAAM,CAAC,CAAC,CAAC,CAC3B,8BACG,SAAS,EACV,KAAC,OAAO,IAAC,WAAW,EAAC,UAAU,GAAG,IACjC,CACJ,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,WAAW,IAAC,EAAE,EAAC,WAAW,EAAC,cAAc,EAAC,YAAY,EAAC,UAAU,EAAC,SAAS,YAC1E,KAAC,aAAa,IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;gCAC3B,OAAO,SAAS,IAAI,KAAC,eAAe,IAAC,KAAK,EAAE,KAAK,GAAI,CAAA;4BACvD,CAAC,YAEA,QAAQ,GACK,GACJ,IACF,EACd,KAAC,OAAO,IAAC,EAAE,EAAC,aAAa,EAAC,UAAU,EAAC,SAAS,YAC5C,KAAC,KAAK,IAAC,SAAS,EAAE,eAAe,EAAE,MAAM,kBACtC,MAAM,IAAI,KAAC,MAAM,IAAC,aAAa,SAAG,GAC7B,GACA,IACF,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA"}
|
|
@@ -10,5 +10,5 @@ export interface WebAppChromeProps extends FlexBoxProps {
|
|
|
10
10
|
menuItems?: ReactNode;
|
|
11
11
|
navigationType?: WebAppNavigationType;
|
|
12
12
|
}
|
|
13
|
-
export declare const WebAppChrome:
|
|
13
|
+
export declare const WebAppChrome: import("react").ForwardRefExoticComponent<WebAppChromeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
14
|
//# sourceMappingURL=Chrome.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chrome.d.ts","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,uBAAuB,CAAA;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAItE,OAAO,
|
|
1
|
+
{"version":3,"file":"Chrome.d.ts","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,uBAAuB,CAAA;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAItE,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7C,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,cAAc,CAAC,EAAE,oBAAoB,CAAA;CACtC;AAED,eAAO,MAAM,YAAY,8GAiCxB,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/react-app-settings": "^2.47.
|
|
14
|
-
"@xyo-network/react-appbar": "^2.47.
|
|
15
|
-
"@xyo-network/react-footer": "^2.47.
|
|
16
|
-
"@xyo-network/react-shared": "^2.47.
|
|
13
|
+
"@xyo-network/react-app-settings": "^2.47.6",
|
|
14
|
+
"@xyo-network/react-appbar": "^2.47.6",
|
|
15
|
+
"@xyo-network/react-footer": "^2.47.6",
|
|
16
|
+
"@xyo-network/react-shared": "^2.47.6"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@mui/icons-material": "^5",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
},
|
|
91
91
|
"sideEffects": false,
|
|
92
92
|
"types": "dist/types/index.d.ts",
|
|
93
|
-
"version": "2.47.
|
|
93
|
+
"version": "2.47.6"
|
|
94
94
|
}
|
|
@@ -4,7 +4,7 @@ import { WebAppNavigationType } from '@xyo-network/react-app-settings'
|
|
|
4
4
|
import { ApplicationAppBar, SystemToolbar } from '@xyo-network/react-appbar'
|
|
5
5
|
import { Footer } from '@xyo-network/react-footer'
|
|
6
6
|
import { ErrorBoundary } from '@xyo-network/react-shared'
|
|
7
|
-
import { ReactNode } from 'react'
|
|
7
|
+
import { forwardRef, ReactNode } from 'react'
|
|
8
8
|
import { Helmet } from 'react-helmet'
|
|
9
9
|
|
|
10
10
|
import { WebAppErrorPage } from './ErrorPage'
|
|
@@ -19,45 +19,39 @@ export interface WebAppChromeProps extends FlexBoxProps {
|
|
|
19
19
|
navigationType?: WebAppNavigationType
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export const WebAppChrome
|
|
23
|
-
appName,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{children}
|
|
53
|
-
</ErrorBoundary>
|
|
54
|
-
</FlexGrowCol>
|
|
55
|
-
</FlexGrowRow>
|
|
56
|
-
<FlexCol id="footer-flex" alignItems="stretch">
|
|
57
|
-
<Paper elevation={footerElevation} square>
|
|
58
|
-
{footer ?? <Footer dynamicHeight />}
|
|
59
|
-
</Paper>
|
|
22
|
+
export const WebAppChrome = forwardRef<HTMLDivElement, WebAppChromeProps>(
|
|
23
|
+
({ appName, appbar, children, errorPage, footer, footerElevation = 4, menuItems, navigationType = 'menu', ...props }, ref) => {
|
|
24
|
+
return (
|
|
25
|
+
<FlexCol id="web-chrome-flex" alignItems="stretch" overflow="hidden" height="100vh" ref={ref} {...props}>
|
|
26
|
+
<Helmet defaultTitle={appName} titleTemplate={`%s | ${appName}`}>
|
|
27
|
+
<meta content="website" property="og:type" />
|
|
28
|
+
</Helmet>
|
|
29
|
+
{appbar ?? <ApplicationAppBar systemToolbar={<SystemToolbar menuItems={navigationType === 'menu' ? menuItems : undefined} />} />}
|
|
30
|
+
<FlexGrowRow id="sidebar-nav-flex" overflow="hidden" alignItems="stretch">
|
|
31
|
+
{navigationType !== 'menu' ? (
|
|
32
|
+
<>
|
|
33
|
+
{menuItems}
|
|
34
|
+
<Divider orientation="vertical" />
|
|
35
|
+
</>
|
|
36
|
+
) : null}
|
|
37
|
+
<FlexGrowCol id="main-flex" justifyContent="flex-start" alignItems="stretch">
|
|
38
|
+
<ErrorBoundary
|
|
39
|
+
fallbackWithError={(error) => {
|
|
40
|
+
return errorPage ?? <WebAppErrorPage error={error} />
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</ErrorBoundary>
|
|
45
|
+
</FlexGrowCol>
|
|
46
|
+
</FlexGrowRow>
|
|
47
|
+
<FlexCol id="footer-flex" alignItems="stretch">
|
|
48
|
+
<Paper elevation={footerElevation} square>
|
|
49
|
+
{footer ?? <Footer dynamicHeight />}
|
|
50
|
+
</Paper>
|
|
51
|
+
</FlexCol>
|
|
60
52
|
</FlexCol>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
)
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
WebAppChrome.displayName = 'WebAppChrome'
|