@xyo-network/react-app-settings 2.25.67 → 2.25.70
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/WebAppNavigationType.d.ts +1 -0
- package/dist/cjs/WebAppNavigationType.js +3 -0
- package/dist/cjs/WebAppNavigationType.js.map +1 -0
- package/dist/cjs/components/Chrome.d.ts +10 -0
- package/dist/cjs/components/Chrome.js +18 -0
- package/dist/cjs/components/Chrome.js.map +1 -0
- package/dist/cjs/components/DarkModeIconButton.d.ts +3 -0
- package/dist/cjs/components/DarkModeIconButton.js +18 -0
- package/dist/cjs/components/DarkModeIconButton.js.map +1 -0
- package/dist/cjs/components/ErrorPage.d.ts +4 -0
- package/dist/cjs/components/ErrorPage.js +11 -0
- package/dist/cjs/components/ErrorPage.js.map +1 -0
- package/dist/cjs/components/NotFoundPage/NotFound.d.ts +4 -0
- package/dist/cjs/components/NotFoundPage/NotFound.js +11 -0
- package/dist/cjs/components/NotFoundPage/NotFound.js.map +1 -0
- package/dist/cjs/components/NotFoundPage/Page.d.ts +5 -0
- package/dist/cjs/components/NotFoundPage/Page.js +15 -0
- package/dist/cjs/components/NotFoundPage/Page.js.map +1 -0
- package/dist/cjs/components/NotFoundPage/index.d.ts +2 -0
- package/dist/cjs/components/NotFoundPage/index.js +6 -0
- package/dist/cjs/components/NotFoundPage/index.js.map +1 -0
- package/dist/cjs/components/Page.d.ts +13 -0
- package/dist/cjs/components/Page.js +27 -0
- package/dist/cjs/components/Page.js.map +1 -0
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +5 -0
- package/dist/cjs/components/index.js.map +1 -0
- package/dist/cjs/contexts/AppSettings/Context.d.ts +11 -0
- package/dist/cjs/contexts/AppSettings/Context.js +7 -0
- package/dist/cjs/contexts/AppSettings/Context.js.map +1 -0
- package/dist/cjs/contexts/AppSettings/Provider.d.ts +8 -0
- package/dist/cjs/contexts/AppSettings/Provider.js +34 -0
- package/dist/cjs/contexts/AppSettings/Provider.js.map +1 -0
- package/dist/cjs/contexts/AppSettings/Slug.d.ts +5 -0
- package/dist/cjs/contexts/AppSettings/Slug.js +10 -0
- package/dist/cjs/contexts/AppSettings/Slug.js.map +1 -0
- package/dist/cjs/contexts/AppSettings/Storage.d.ts +11 -0
- package/dist/cjs/contexts/AppSettings/Storage.js +31 -0
- package/dist/cjs/contexts/AppSettings/Storage.js.map +1 -0
- package/dist/cjs/contexts/AppSettings/StorageBase.d.ts +15 -0
- package/dist/cjs/contexts/AppSettings/StorageBase.js +78 -0
- package/dist/cjs/contexts/AppSettings/StorageBase.js.map +1 -0
- package/dist/cjs/contexts/AppSettings/appSettingDefault.d.ts +1 -0
- package/dist/cjs/contexts/AppSettings/appSettingDefault.js +13 -0
- package/dist/cjs/contexts/AppSettings/appSettingDefault.js.map +1 -0
- package/dist/cjs/contexts/AppSettings/index.d.ts +6 -0
- package/dist/cjs/contexts/AppSettings/index.js +10 -0
- package/dist/cjs/contexts/AppSettings/index.js.map +1 -0
- package/dist/cjs/contexts/AppSettings/useAppSettings.d.ts +1 -0
- package/dist/cjs/contexts/AppSettings/useAppSettings.js +10 -0
- package/dist/cjs/contexts/AppSettings/useAppSettings.js.map +1 -0
- package/dist/cjs/contexts/index.d.ts +1 -0
- package/dist/cjs/contexts/index.js +5 -0
- package/dist/cjs/contexts/index.js.map +1 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/components/Chrome.d.ts +10 -0
- package/dist/esm/components/Chrome.js +12 -0
- package/dist/esm/components/Chrome.js.map +1 -0
- package/dist/esm/components/ErrorPage.d.ts +4 -0
- package/dist/esm/components/ErrorPage.js +7 -0
- package/dist/esm/components/ErrorPage.js.map +1 -0
- package/dist/esm/components/NotFoundPage/NotFound.d.ts +4 -0
- package/dist/esm/components/NotFoundPage/NotFound.js +8 -0
- package/dist/esm/components/NotFoundPage/NotFound.js.map +1 -0
- package/dist/esm/components/NotFoundPage/Page.d.ts +5 -0
- package/dist/esm/components/NotFoundPage/Page.js +7 -0
- package/dist/esm/components/NotFoundPage/Page.js.map +1 -0
- package/dist/esm/components/NotFoundPage/index.d.ts +2 -0
- package/dist/esm/components/NotFoundPage/index.js +3 -0
- package/dist/esm/components/NotFoundPage/index.js.map +1 -0
- package/dist/esm/components/Page.d.ts +13 -0
- package/dist/esm/components/Page.js +21 -0
- package/dist/esm/components/Page.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type WebAppNavigationType = 'menu' | 'sidebar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebAppNavigationType.js","sourceRoot":"","sources":["../../src/WebAppNavigationType.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface WebAppChromeProps extends FlexBoxProps {
|
|
4
|
+
appName: string;
|
|
5
|
+
footer?: ReactNode;
|
|
6
|
+
appbar?: ReactNode;
|
|
7
|
+
errorPage?: ReactNode;
|
|
8
|
+
footerElevation?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const WebAppChrome: React.FC<WebAppChromeProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebAppChrome = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_flexbox_1 = require("@xylabs/react-flexbox");
|
|
8
|
+
const react_appbar_1 = require("@xyo-network/react-appbar");
|
|
9
|
+
const react_footer_1 = require("@xyo-network/react-footer");
|
|
10
|
+
const react_shared_1 = require("@xyo-network/react-shared");
|
|
11
|
+
const react_helmet_1 = require("react-helmet");
|
|
12
|
+
const ErrorPage_1 = require("./ErrorPage");
|
|
13
|
+
const WebAppChrome = (_a) => {
|
|
14
|
+
var { footerElevation = 4, errorPage, appbar, footer, children, appName } = _a, props = tslib_1.__rest(_a, ["footerElevation", "errorPage", "appbar", "footer", "children", "appName"]);
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexCol, Object.assign({ alignItems: "stretch", height: "100vh" }, props, { children: [(0, jsx_runtime_1.jsx)(react_helmet_1.Helmet, Object.assign({ defaultTitle: appName, titleTemplate: `%s | ${appName}` }, { children: (0, jsx_runtime_1.jsx)("meta", { content: "website", property: "og:type" }) })), appbar !== null && appbar !== void 0 ? appbar : (0, jsx_runtime_1.jsx)(react_appbar_1.ApplicationAppBar, {}), (0, jsx_runtime_1.jsx)(react_flexbox_1.FlexGrowCol, Object.assign({ overflow: "hidden", justifyContent: "flex-start", alignItems: "stretch" }, { children: (0, jsx_runtime_1.jsx)(react_shared_1.ErrorBoundary, Object.assign({ fallback: errorPage !== null && errorPage !== void 0 ? errorPage : (0, jsx_runtime_1.jsx)(ErrorPage_1.WebAppErrorPage, {}) }, { children: children })) })), (0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ elevation: footerElevation, square: true }, { children: footer !== null && footer !== void 0 ? footer : (0, jsx_runtime_1.jsx)(react_footer_1.Footer, { dynamicHeight: true }) }))] })));
|
|
16
|
+
};
|
|
17
|
+
exports.WebAppChrome = WebAppChrome;
|
|
18
|
+
//# sourceMappingURL=Chrome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chrome.js","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAqC;AACrC,yDAA0E;AAC1E,4DAA6D;AAC7D,4DAAkD;AAClD,4DAAyD;AAEzD,+CAAqC;AAErC,2CAA6C;AAUtC,MAAM,YAAY,GAAgC,CAAC,EAA+E,EAAE,EAAE;QAAnF,EAAE,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,OAAY,EAAP,KAAK,sBAA7E,2EAA+E,CAAF;IACrI,OAAO,CACL,wBAAC,uBAAO,kBAAC,UAAU,EAAC,SAAS,EAAC,MAAM,EAAC,OAAO,IAAK,KAAK,eACpD,uBAAC,qBAAM,kBAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,OAAO,EAAE,gBAC7D,iCAAM,OAAO,EAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,GAAG,IACtC,EACR,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,uBAAC,gCAAiB,KAAG,EAChC,uBAAC,2BAAW,kBAAC,QAAQ,EAAC,QAAQ,EAAC,cAAc,EAAC,YAAY,EAAC,UAAU,EAAC,SAAS,gBAC7E,uBAAC,4BAAa,kBAAC,QAAQ,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,uBAAC,2BAAe,KAAG,gBAAG,QAAQ,IAAiB,IACzE,EACd,uBAAC,gBAAK,kBAAC,SAAS,EAAE,eAAe,EAAE,MAAM,sBACtC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,uBAAC,qBAAM,IAAC,aAAa,SAAG,IAC7B,KACA,CACX,CAAA;AACH,CAAC,CAAA;AAfY,QAAA,YAAY,gBAexB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DarkModeIconButton = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const DarkModeRounded_1 = tslib_1.__importDefault(require("@mui/icons-material/DarkModeRounded"));
|
|
7
|
+
const LightModeRounded_1 = tslib_1.__importDefault(require("@mui/icons-material/LightModeRounded"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const contexts_1 = require("../contexts");
|
|
10
|
+
const DarkModeIconButton = (props) => {
|
|
11
|
+
const { darkMode, enableDarkMode } = (0, contexts_1.useAppSettings)();
|
|
12
|
+
const handleDarkModeChange = () => {
|
|
13
|
+
enableDarkMode === null || enableDarkMode === void 0 ? void 0 : enableDarkMode(!darkMode);
|
|
14
|
+
};
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleDarkModeChange }, props, { children: darkMode ? (0, jsx_runtime_1.jsx)(DarkModeRounded_1.default, {}) : (0, jsx_runtime_1.jsx)(LightModeRounded_1.default, {}) })));
|
|
16
|
+
};
|
|
17
|
+
exports.DarkModeIconButton = DarkModeIconButton;
|
|
18
|
+
//# sourceMappingURL=DarkModeIconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DarkModeIconButton.js","sourceRoot":"","sources":["../../../src/components/DarkModeIconButton.tsx"],"names":[],"mappings":";;;;;AAAA,kGAAqE;AACrE,oGAAuE;AACvE,4CAA2D;AAE3D,0CAA4C;AAErC,MAAM,kBAAkB,GAA8B,CAAC,KAAK,EAAE,EAAE;IACrE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAA,yBAAc,GAAE,CAAA;IAErD,MAAM,oBAAoB,GAAG,GAAG,EAAE;QAChC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,QAAQ,CAAC,CAAA;IAC7B,CAAC,CAAA;IAED,OAAO,CACL,uBAAC,qBAAU,kBAAC,OAAO,EAAE,oBAAoB,IAAM,KAAK,cACjD,QAAQ,CAAC,CAAC,CAAC,uBAAC,yBAAmB,KAAG,CAAC,CAAC,CAAC,uBAAC,0BAAoB,KAAG,IACnD,CACd,CAAA;AACH,CAAC,CAAA;AAZY,QAAA,kBAAkB,sBAY9B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorPage = exports.WebAppErrorPage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_button_1 = require("@xylabs/react-button");
|
|
6
|
+
const Page_1 = require("./Page");
|
|
7
|
+
const WebAppErrorPage = () => ((0, jsx_runtime_1.jsxs)(Page_1.WebAppPage, Object.assign({ title: "Oops! Something went wrong" }, { children: [(0, jsx_runtime_1.jsx)("h1", { children: "Oops! Something went wrong!" }), (0, jsx_runtime_1.jsx)(react_button_1.ButtonEx, Object.assign({ href: "/", variant: "contained" }, { children: "Homepage" }))] })));
|
|
8
|
+
exports.WebAppErrorPage = WebAppErrorPage;
|
|
9
|
+
/** @deprecated use WebAppErrorPage instead */
|
|
10
|
+
exports.ErrorPage = exports.WebAppErrorPage;
|
|
11
|
+
//# sourceMappingURL=ErrorPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorPage.js","sourceRoot":"","sources":["../../../src/components/ErrorPage.tsx"],"names":[],"mappings":";;;;AAAA,uDAA+C;AAE/C,iCAAmC;AAE5B,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,CACnC,wBAAC,iBAAU,kBAAC,KAAK,EAAC,4BAA4B,iBAC5C,yEAAoC,EACpC,uBAAC,uBAAQ,kBAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAC,WAAW,8BAE3B,KACA,CACd,CAAA;AAPY,QAAA,eAAe,mBAO3B;AAED,8CAA8C;AACjC,QAAA,SAAS,GAAG,uBAAe,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotFound = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_flexbox_1 = require("@xylabs/react-flexbox");
|
|
7
|
+
const NotFound = (props) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowCol, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h2" }, { children: "Sorry!" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ marginY: 3, variant: "body2" }, { children: "Can't find anything here" }))] })));
|
|
9
|
+
};
|
|
10
|
+
exports.NotFound = NotFound;
|
|
11
|
+
//# sourceMappingURL=NotFound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotFound.js","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/NotFound.tsx"],"names":[],"mappings":";;;;AAAA,4CAA0C;AAC1C,yDAAiE;AAEjE,MAAM,QAAQ,GAA2B,CAAC,KAAK,EAAE,EAAE;IACjD,OAAO,CACL,wBAAC,2BAAW,oBAAK,KAAK,eACpB,uBAAC,qBAAU,kBAAC,OAAO,EAAC,IAAI,4BAAoB,EAC5C,uBAAC,qBAAU,kBAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAC,OAAO,gBACpC,0BAA0B,IAChB,KACD,CACf,CAAA;AACH,CAAC,CAAA;AAEQ,4BAAQ"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebAppPageProps } from '../Page';
|
|
3
|
+
export declare const WebAppNotFoundPage: React.FC<WebAppPageProps>;
|
|
4
|
+
/** @deprecated use WebAppNotFoundPage instead */
|
|
5
|
+
export declare const NotFoundPage: import("react").FC<WebAppPageProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotFoundPage = exports.WebAppNotFoundPage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const Page_1 = require("../Page");
|
|
7
|
+
const NotFound_1 = require("./NotFound");
|
|
8
|
+
const WebAppNotFoundPage = (_a) => {
|
|
9
|
+
var { title } = _a, props = tslib_1.__rest(_a, ["title"]);
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(Page_1.WebAppPage, Object.assign({ title: title !== null && title !== void 0 ? title : 'Sorry! Page Not Found' }, props, { children: (0, jsx_runtime_1.jsx)(NotFound_1.NotFound, {}) })));
|
|
11
|
+
};
|
|
12
|
+
exports.WebAppNotFoundPage = WebAppNotFoundPage;
|
|
13
|
+
/** @deprecated use WebAppNotFoundPage instead */
|
|
14
|
+
exports.NotFoundPage = exports.WebAppNotFoundPage;
|
|
15
|
+
//# sourceMappingURL=Page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/Page.tsx"],"names":[],"mappings":";;;;;AAAA,kCAAqD;AACrD,yCAAqC;AAE9B,MAAM,kBAAkB,GAA8B,CAAC,EAAmB,EAAE,EAAE;QAAvB,EAAE,KAAK,OAAY,EAAP,KAAK,sBAAjB,SAAmB,CAAF;IAAO,OAAA,CACpF,uBAAC,iBAAU,kBAAC,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,uBAAuB,IAAM,KAAK,cAC5D,uBAAC,mBAAQ,KAAG,IACD,CACd,CAAA;CAAA,CAAA;AAJY,QAAA,kBAAkB,sBAI9B;AAED,kDAAkD;AACrC,QAAA,YAAY,GAAG,0BAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,iDAAsB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContainerProps } from '@mui/material';
|
|
2
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export interface WebAppPageProps extends FlexBoxProps {
|
|
5
|
+
container?: ContainerProps['maxWidth'];
|
|
6
|
+
disableGutters?: boolean;
|
|
7
|
+
breadcrumbs?: ReactNode;
|
|
8
|
+
disableBreadcrumbGutter?: boolean;
|
|
9
|
+
spacing?: string | number;
|
|
10
|
+
}
|
|
11
|
+
export declare const WebAppPage: React.FC<WebAppPageProps>;
|
|
12
|
+
/** @deprecated use WebAppPagePage instead */
|
|
13
|
+
export declare const FlexPage: import("react").FC<WebAppPageProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlexPage = exports.WebAppPage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_flexbox_1 = require("@xylabs/react-flexbox");
|
|
8
|
+
const react_pixel_1 = require("@xylabs/react-pixel");
|
|
9
|
+
const react_shared_1 = require("@xylabs/react-shared");
|
|
10
|
+
const react_helmet_1 = require("react-helmet");
|
|
11
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
12
|
+
const WebAppPage = (_a) => {
|
|
13
|
+
var { spacing = 1, disableBreadcrumbGutter, disableGutters, title, container, breadcrumbs, children } = _a, props = tslib_1.__rest(_a, ["spacing", "disableBreadcrumbGutter", "disableGutters", "title", "container", "breadcrumbs", "children"]);
|
|
14
|
+
const userEvents = (0, react_pixel_1.useUserEvents)();
|
|
15
|
+
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
16
|
+
(0, react_shared_1.useAsyncEffect)(
|
|
17
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
+
() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
yield (userEvents === null || userEvents === void 0 ? void 0 : userEvents.viewContent({ name: title !== null && title !== void 0 ? title : 'NodeBasePage', path: location.pathname }));
|
|
20
|
+
}), [pathname, title, userEvents]);
|
|
21
|
+
const Body = (props) => ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowCol, Object.assign({ gap: 1, paddingY: spacing, justifyContent: "flex-start", alignItems: "stretch" }, props, { children: [(0, jsx_runtime_1.jsx)(react_flexbox_1.FlexRow, Object.assign({ justifyContent: "flex-start", marginX: disableBreadcrumbGutter ? 0 : spacing }, { children: breadcrumbs })), children] })));
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowCol, Object.assign({ alignItems: "stretch", justifyContent: "flex-start", minHeight: 0, overflow: "visible scroll" }, { children: [(0, jsx_runtime_1.jsx)(react_helmet_1.Helmet, { title: title }), container ? ((0, jsx_runtime_1.jsx)(material_1.Container, Object.assign({ disableGutters: disableGutters, style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start' }, maxWidth: container }, { children: (0, jsx_runtime_1.jsx)(Body, Object.assign({}, props)) }))) : ((0, jsx_runtime_1.jsx)(Body, Object.assign({ paddingX: disableGutters ? 0 : 1 }, props)))] })));
|
|
23
|
+
};
|
|
24
|
+
exports.WebAppPage = WebAppPage;
|
|
25
|
+
/** @deprecated use WebAppPagePage instead */
|
|
26
|
+
exports.FlexPage = exports.WebAppPage;
|
|
27
|
+
//# sourceMappingURL=Page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAyD;AACzD,yDAA0E;AAC1E,qDAAmD;AACnD,uDAAqD;AAErD,+CAAqC;AACrC,uDAA8C;AASvC,MAAM,UAAU,GAA8B,CAAC,EAA2G,EAAE,EAAE;QAA/G,EAAE,OAAO,GAAG,CAAC,EAAE,uBAAuB,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAAzG,yGAA2G,CAAF;IAC7J,MAA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AK,KAAK,EAAI,IACT,CACb,CAAC,CAAC,CAAC,CACF,uBAAC,IAAI,kBAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAM,KAAK,EAAI,CACtD,KACW,CACf,CAAA;AACH,CAAC,CAAA;AArCY,QAAA,UAAU,cAqCtB;AAED,6CAA6C;AAChC,QAAA,QAAQ,GAAG,kBAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DarkModeIconButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,+DAAoC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebAppNavigationType } from '../../WebAppNavigationType';
|
|
3
|
+
export interface AppSettingsContextProps {
|
|
4
|
+
darkMode?: boolean;
|
|
5
|
+
developerMode?: boolean;
|
|
6
|
+
enableDarkMode?: (value: boolean) => void;
|
|
7
|
+
enableDeveloperMode?: (value: boolean) => void;
|
|
8
|
+
changeNavigationType?: (value: WebAppNavigationType) => void;
|
|
9
|
+
navigationType?: WebAppNavigationType;
|
|
10
|
+
}
|
|
11
|
+
export declare const AppSettingsContext: import("react").Context<AppSettingsContextProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppSettingsContext = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const appSettingDefault_1 = require("./appSettingDefault");
|
|
6
|
+
exports.AppSettingsContext = (0, react_1.createContext)((0, appSettingDefault_1.appSettingDefault)());
|
|
7
|
+
//# sourceMappingURL=Context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../../src/contexts/AppSettings/Context.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AAGrC,2DAAuD;AAW1C,QAAA,kBAAkB,GAAG,IAAA,qBAAa,EAA0B,IAAA,qCAAiB,GAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WithChildren } from '@xylabs/react-shared';
|
|
2
|
+
import { ProviderProps } from 'react';
|
|
3
|
+
import { AppSettingsContextProps } from './Context';
|
|
4
|
+
import { AppSettingsStorage } from './Storage';
|
|
5
|
+
export interface AppSettingsProviderProps<T extends AppSettingsContextProps = AppSettingsContextProps> extends ProviderProps<T> {
|
|
6
|
+
storage?: AppSettingsStorage;
|
|
7
|
+
}
|
|
8
|
+
export declare const AppSettingsProvider: React.FC<WithChildren<AppSettingsProviderProps>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppSettingsProvider = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const Context_1 = require("./Context");
|
|
8
|
+
const Storage_1 = require("./Storage");
|
|
9
|
+
const AppSettingsProvider = (_a) => {
|
|
10
|
+
var { storage = new Storage_1.AppSettingsStorage(), value, children } = _a, props = tslib_1.__rest(_a, ["storage", "value", "children"]);
|
|
11
|
+
const [developerMode, setDeveloperMode] = (0, react_1.useState)(storage.developerMode);
|
|
12
|
+
const [darkMode, setDarkMode] = (0, react_1.useState)(storage.darkMode);
|
|
13
|
+
const [navigationType, setNaviagtionType] = (0, react_1.useState)(storage.navigationType);
|
|
14
|
+
const enableDeveloperMode = (value) => {
|
|
15
|
+
storage.developerMode = value;
|
|
16
|
+
setDeveloperMode(storage.developerMode);
|
|
17
|
+
};
|
|
18
|
+
const enableDarkMode = (value) => {
|
|
19
|
+
storage.darkMode = value;
|
|
20
|
+
setDarkMode(storage.darkMode);
|
|
21
|
+
};
|
|
22
|
+
const changeNavigationType = (value) => {
|
|
23
|
+
storage.navigationType = value;
|
|
24
|
+
setNaviagtionType(value);
|
|
25
|
+
};
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(Context_1.AppSettingsContext.Provider, Object.assign({ value: Object.assign({ changeNavigationType,
|
|
27
|
+
darkMode,
|
|
28
|
+
developerMode,
|
|
29
|
+
enableDarkMode,
|
|
30
|
+
enableDeveloperMode,
|
|
31
|
+
navigationType }, value) }, props, { children: children })));
|
|
32
|
+
};
|
|
33
|
+
exports.AppSettingsProvider = AppSettingsProvider;
|
|
34
|
+
//# sourceMappingURL=Provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../src/contexts/AppSettings/Provider.tsx"],"names":[],"mappings":";;;;;AACA,iCAA+C;AAG/C,uCAAuE;AACvE,uCAA8C;AAMvC,MAAM,mBAAmB,GAAqD,CAAC,EAAiE,EAAE,EAAE;QAArE,EAAE,OAAO,GAAG,IAAI,4BAAkB,EAAE,EAAE,KAAK,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAA/D,gCAAiE,CAAF;IACnJ,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,aAAa,CAAC,CAAA;IACzE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC1D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IAE5E,MAAM,mBAAmB,GAAG,CAAC,KAAc,EAAE,EAAE;QAC7C,OAAO,CAAC,aAAa,GAAG,KAAK,CAAA;QAC7B,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;IACzC,CAAC,CAAA;IAED,MAAM,cAAc,GAAG,CAAC,KAAc,EAAE,EAAE;QACxC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAA;QACxB,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC/B,CAAC,CAAA;IAED,MAAM,oBAAoB,GAAG,CAAC,KAA2B,EAAE,EAAE;QAC3D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAA;QAC9B,iBAAiB,CAAC,KAAK,CAAC,CAAA;IAC1B,CAAC,CAAA;IAED,OAAO,CACL,uBAAC,4BAAkB,CAAC,QAAQ,kBAC1B,KAAK,kBACH,oBAAoB;YACpB,QAAQ;YACR,aAAa;YACb,cAAc;YACd,mBAAmB;YACnB,cAAc,IAEX,KAAK,KAEN,KAAK,cAER,QAAQ,IACmB,CAC/B,CAAA;AACH,CAAC,CAAA;AArCY,QAAA,mBAAmB,uBAqC/B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppSettingSlug = void 0;
|
|
4
|
+
var AppSettingSlug;
|
|
5
|
+
(function (AppSettingSlug) {
|
|
6
|
+
AppSettingSlug["DarkMode"] = "darkmode";
|
|
7
|
+
AppSettingSlug["Developer"] = "developer";
|
|
8
|
+
AppSettingSlug["NavigationType"] = "navgiationType";
|
|
9
|
+
})(AppSettingSlug = exports.AppSettingSlug || (exports.AppSettingSlug = {}));
|
|
10
|
+
//# sourceMappingURL=Slug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slug.js","sourceRoot":"","sources":["../../../../src/contexts/AppSettings/Slug.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,yCAAuB,CAAA;IACvB,mDAAiC,CAAA;AACnC,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WebAppNavigationType } from '../../WebAppNavigationType';
|
|
2
|
+
import { AppSettingsStorageBase } from './StorageBase';
|
|
3
|
+
export declare class AppSettingsStorage extends AppSettingsStorageBase {
|
|
4
|
+
constructor(prefix?: string, defaults?: Record<string, unknown>);
|
|
5
|
+
get darkMode(): boolean;
|
|
6
|
+
set darkMode(value: boolean);
|
|
7
|
+
get developerMode(): boolean;
|
|
8
|
+
set developerMode(value: boolean);
|
|
9
|
+
get navigationType(): WebAppNavigationType;
|
|
10
|
+
set navigationType(value: WebAppNavigationType);
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppSettingsStorage = void 0;
|
|
4
|
+
const appSettingDefault_1 = require("./appSettingDefault");
|
|
5
|
+
const Slug_1 = require("./Slug");
|
|
6
|
+
const StorageBase_1 = require("./StorageBase");
|
|
7
|
+
class AppSettingsStorage extends StorageBase_1.AppSettingsStorageBase {
|
|
8
|
+
constructor(prefix = 'AppSettings', defaults) {
|
|
9
|
+
super(prefix, Object.assign(Object.assign({}, (0, appSettingDefault_1.appSettingDefault)()), defaults));
|
|
10
|
+
}
|
|
11
|
+
get darkMode() {
|
|
12
|
+
return this.getBoolean(Slug_1.AppSettingSlug.DarkMode);
|
|
13
|
+
}
|
|
14
|
+
set darkMode(value) {
|
|
15
|
+
this.setBoolean(Slug_1.AppSettingSlug.DarkMode, value);
|
|
16
|
+
}
|
|
17
|
+
get developerMode() {
|
|
18
|
+
return this.getBoolean(Slug_1.AppSettingSlug.Developer);
|
|
19
|
+
}
|
|
20
|
+
set developerMode(value) {
|
|
21
|
+
this.setBoolean(Slug_1.AppSettingSlug.Developer, value);
|
|
22
|
+
}
|
|
23
|
+
get navigationType() {
|
|
24
|
+
return this.getString(Slug_1.AppSettingSlug.NavigationType);
|
|
25
|
+
}
|
|
26
|
+
set navigationType(value) {
|
|
27
|
+
this.setString(Slug_1.AppSettingSlug.NavigationType, value);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.AppSettingsStorage = AppSettingsStorage;
|
|
31
|
+
//# sourceMappingURL=Storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Storage.js","sourceRoot":"","sources":["../../../../src/contexts/AppSettings/Storage.ts"],"names":[],"mappings":";;;AACA,2DAAuD;AACvD,iCAAuC;AACvC,+CAAsD;AAEtD,MAAa,kBAAmB,SAAQ,oCAAsB;IAC5D,YAAY,MAAM,GAAG,aAAa,EAAE,QAAkC;QACpE,KAAK,CAAC,MAAM,kCAAO,IAAA,qCAAiB,GAAE,GAAK,QAAQ,EAAG,CAAA;IACxD,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,qBAAc,CAAC,QAAQ,CAAC,CAAA;IACjD,CAAC;IAED,IAAI,QAAQ,CAAC,KAAc;QACzB,IAAI,CAAC,UAAU,CAAC,qBAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IACjD,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,qBAAc,CAAC,SAAS,CAAC,CAAA;IAClD,CAAC;IAED,IAAI,aAAa,CAAC,KAAc;QAC9B,IAAI,CAAC,UAAU,CAAC,qBAAc,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;IAClD,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,qBAAc,CAAC,cAAc,CAAyB,CAAA;IAC9E,CAAC;IAED,IAAI,cAAc,CAAC,KAA2B;QAC5C,IAAI,CAAC,SAAS,CAAC,qBAAc,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;CACF;AA5BD,gDA4BC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class AppSettingsStorageBase {
|
|
2
|
+
private prefix;
|
|
3
|
+
private defaults;
|
|
4
|
+
constructor(prefix?: string, defaults?: Record<string, unknown>);
|
|
5
|
+
getBoolean(name: string): boolean;
|
|
6
|
+
setBoolean(name: string, value: boolean): void;
|
|
7
|
+
setNumber(name: string, value: number): void;
|
|
8
|
+
getNumber(name: string): number;
|
|
9
|
+
getString(name: string): string;
|
|
10
|
+
setString(name: string, value: string): void;
|
|
11
|
+
getStringArray(name: string): string[];
|
|
12
|
+
setStringArray(name: string, value: string[]): void;
|
|
13
|
+
getObject<T>(name: string): T;
|
|
14
|
+
setObject<T>(name: string, value: T): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppSettingsStorageBase = void 0;
|
|
4
|
+
const sdk_js_1 = require("@xylabs/sdk-js");
|
|
5
|
+
const react_shared_1 = require("@xyo-network/react-shared");
|
|
6
|
+
class AppSettingsStorageBase {
|
|
7
|
+
constructor(prefix = 'AppSettings', defaults) {
|
|
8
|
+
this.prefix = prefix;
|
|
9
|
+
this.defaults = defaults !== null && defaults !== void 0 ? defaults : {};
|
|
10
|
+
}
|
|
11
|
+
getBoolean(name) {
|
|
12
|
+
const storedValue = localStorage.getItem(`${this.prefix}|${name}`);
|
|
13
|
+
if (!storedValue) {
|
|
14
|
+
(0, sdk_js_1.assertEx)(typeof this.defaults[name] === 'boolean', 'Default value is not boolean');
|
|
15
|
+
const defaultValue = this.defaults[name];
|
|
16
|
+
(0, sdk_js_1.assertEx)(defaultValue !== undefined, `Missing Default for ${name}`);
|
|
17
|
+
return defaultValue;
|
|
18
|
+
}
|
|
19
|
+
return storedValue !== 'false';
|
|
20
|
+
}
|
|
21
|
+
setBoolean(name, value) {
|
|
22
|
+
localStorage.setItem(`${this.prefix}|${name}`, JSON.stringify(value));
|
|
23
|
+
}
|
|
24
|
+
setNumber(name, value) {
|
|
25
|
+
localStorage.setItem(`${this.prefix}|${name}`, JSON.stringify(value));
|
|
26
|
+
}
|
|
27
|
+
getNumber(name) {
|
|
28
|
+
const storedValue = localStorage.getItem(`${this.prefix}|${name}`);
|
|
29
|
+
if (!storedValue) {
|
|
30
|
+
(0, sdk_js_1.assertEx)(typeof this.defaults[name] === 'boolean', 'Default value is not boolean');
|
|
31
|
+
const defaultValue = this.defaults[name];
|
|
32
|
+
(0, sdk_js_1.assertEx)(defaultValue !== undefined, `Missing Default for ${name}`);
|
|
33
|
+
return defaultValue;
|
|
34
|
+
}
|
|
35
|
+
return parseFloat(storedValue);
|
|
36
|
+
}
|
|
37
|
+
getString(name) {
|
|
38
|
+
const storedValue = localStorage.getItem(`${this.prefix}|${name}`);
|
|
39
|
+
if (!storedValue) {
|
|
40
|
+
(0, react_shared_1.assertDefinedEx)(typeof this.defaults[name] === 'string', 'Default value is not string');
|
|
41
|
+
const defaultValue = this.defaults[name];
|
|
42
|
+
(0, sdk_js_1.assertEx)(defaultValue !== undefined, `Missing Default for ${name}`);
|
|
43
|
+
return defaultValue;
|
|
44
|
+
}
|
|
45
|
+
return storedValue;
|
|
46
|
+
}
|
|
47
|
+
setString(name, value) {
|
|
48
|
+
localStorage.setItem(`${this.prefix}|${name}`, value);
|
|
49
|
+
}
|
|
50
|
+
getStringArray(name) {
|
|
51
|
+
var _a;
|
|
52
|
+
const storedValue = (_a = localStorage.getItem(`${this.prefix}|${name}`)) === null || _a === void 0 ? void 0 : _a.split(',');
|
|
53
|
+
if (!storedValue) {
|
|
54
|
+
(0, react_shared_1.assertDefinedEx)(Array.isArray(this.defaults[name]), 'Default value is not array');
|
|
55
|
+
const defaultValue = this.defaults[name];
|
|
56
|
+
(0, sdk_js_1.assertEx)(defaultValue !== undefined, `Missing Default for ${name}`);
|
|
57
|
+
return defaultValue;
|
|
58
|
+
}
|
|
59
|
+
return storedValue;
|
|
60
|
+
}
|
|
61
|
+
setStringArray(name, value) {
|
|
62
|
+
localStorage.setItem(`${this.prefix}|${name}`, value.join(','));
|
|
63
|
+
}
|
|
64
|
+
getObject(name) {
|
|
65
|
+
const storedValue = localStorage.getItem(`${this.prefix}|${name}`);
|
|
66
|
+
const parsedStoredValue = storedValue ? JSON.parse(storedValue) : null;
|
|
67
|
+
if (!parsedStoredValue) {
|
|
68
|
+
(0, sdk_js_1.assertEx)(typeof this.defaults[name] === 'object', 'Default value is not object');
|
|
69
|
+
return (0, sdk_js_1.assertEx)(this.defaults[name], `Missing Default for ${name}`);
|
|
70
|
+
}
|
|
71
|
+
return parsedStoredValue;
|
|
72
|
+
}
|
|
73
|
+
setObject(name, value) {
|
|
74
|
+
localStorage.setItem(`${this.prefix}|${name}`, JSON.stringify(value));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.AppSettingsStorageBase = AppSettingsStorageBase;
|
|
78
|
+
//# sourceMappingURL=StorageBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageBase.js","sourceRoot":"","sources":["../../../../src/contexts/AppSettings/StorageBase.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AACzC,4DAA2D;AAE3D,MAAa,sBAAsB;IAGjC,YAAY,MAAM,GAAG,aAAa,EAAE,QAAkC;QACpE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAA;IAChC,CAAC;IAEM,UAAU,CAAC,IAAY;QAC5B,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAA;QAClE,IAAI,CAAC,WAAW,EAAE;YAChB,IAAA,iBAAQ,EAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,8BAA8B,CAAC,CAAA;YAClF,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAY,CAAA;YACnD,IAAA,iBAAQ,EAAC,YAAY,KAAK,SAAS,EAAE,uBAAuB,IAAI,EAAE,CAA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CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACtE,IAAI,CAAC,iBAAiB,EAAE;YACtB,IAAA,iBAAQ,EAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE,6BAA6B,CAAC,CAAA;YAChF,OAAO,IAAA,iBAAQ,EAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAM,EAAE,uBAAuB,IAAI,EAAE,CAAC,CAAA;SACzE;QACD,OAAO,iBAAsB,CAAA;IAC/B,CAAC;IAEM,SAAS,CAAI,IAAY,EAAE,KAAQ;QACxC,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;IACvE,CAAC;CACF;AAjFD,wDAiFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const appSettingDefault: () => Record<string, unknown>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appSettingDefault = void 0;
|
|
4
|
+
const Slug_1 = require("./Slug");
|
|
5
|
+
const appSettingDefault = () => {
|
|
6
|
+
return {
|
|
7
|
+
[Slug_1.AppSettingSlug.DarkMode]: false,
|
|
8
|
+
[Slug_1.AppSettingSlug.Developer]: false,
|
|
9
|
+
[Slug_1.AppSettingSlug.NavigationType]: 'menu',
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
exports.appSettingDefault = appSettingDefault;
|
|
13
|
+
//# sourceMappingURL=appSettingDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appSettingDefault.js","sourceRoot":"","sources":["../../../../src/contexts/AppSettings/appSettingDefault.ts"],"names":[],"mappings":";;;AAAA,iCAAuC;AAEhC,MAAM,iBAAiB,GAAG,GAA4B,EAAE;IAC7D,OAAO;QACL,CAAC,qBAAc,CAAC,QAAQ,CAAC,EAAE,KAAK;QAChC,CAAC,qBAAc,CAAC,SAAS,CAAC,EAAE,KAAK;QACjC,CAAC,qBAAc,CAAC,cAAc,CAAC,EAAE,MAAM;KACxC,CAAA;AACH,CAAC,CAAA;AANY,QAAA,iBAAiB,qBAM7B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./Context"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./Provider"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./Slug"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./Storage"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./StorageBase"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./useAppSettings"), exports);
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/contexts/AppSettings/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB;AACzB,qDAA0B;AAC1B,iDAAsB;AACtB,oDAAyB;AACzB,wDAA6B;AAC7B,2DAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useAppSettings: () => import("./Context").AppSettingsContextProps;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAppSettings = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const Context_1 = require("./Context");
|
|
6
|
+
const useAppSettings = () => {
|
|
7
|
+
return (0, react_1.useContext)(Context_1.AppSettingsContext);
|
|
8
|
+
};
|
|
9
|
+
exports.useAppSettings = useAppSettings;
|
|
10
|
+
//# sourceMappingURL=useAppSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppSettings.js","sourceRoot":"","sources":["../../../../src/contexts/AppSettings/useAppSettings.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAElC,uCAA8C;AAEvC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,IAAA,kBAAU,EAAC,4BAAkB,CAAC,CAAA;AACvC,CAAC,CAAA;AAFY,QAAA,cAAc,kBAE1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AppSettings';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":";;;AAAA,wDAA6B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./components"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./contexts"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./WebAppNavigationType"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,qDAA0B;AAC1B,iEAAsC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface WebAppChromeProps extends FlexBoxProps {
|
|
4
|
+
appName: string;
|
|
5
|
+
footer?: ReactNode;
|
|
6
|
+
appbar?: ReactNode;
|
|
7
|
+
errorPage?: ReactNode;
|
|
8
|
+
footerElevation?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const WebAppChrome: React.FC<WebAppChromeProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Paper } from '@mui/material';
|
|
3
|
+
import { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox';
|
|
4
|
+
import { ApplicationAppBar } from '@xyo-network/react-appbar';
|
|
5
|
+
import { Footer } from '@xyo-network/react-footer';
|
|
6
|
+
import { ErrorBoundary } from '@xyo-network/react-shared';
|
|
7
|
+
import { Helmet } from 'react-helmet';
|
|
8
|
+
import { WebAppErrorPage } from './ErrorPage';
|
|
9
|
+
export const WebAppChrome = ({ footerElevation = 4, errorPage, appbar, footer, children, appName, ...props }) => {
|
|
10
|
+
return (_jsxs(FlexCol, { alignItems: "stretch", height: "100vh", ...props, children: [_jsx(Helmet, { defaultTitle: appName, titleTemplate: `%s | ${appName}`, children: _jsx("meta", { content: "website", property: "og:type" }) }), appbar ?? _jsx(ApplicationAppBar, {}), _jsx(FlexGrowCol, { overflow: "hidden", justifyContent: "flex-start", alignItems: "stretch", children: _jsx(ErrorBoundary, { fallback: errorPage ?? _jsx(WebAppErrorPage, {}), children: children }) }), _jsx(Paper, { elevation: footerElevation, square: true, children: footer ?? _jsx(Footer, { dynamicHeight: true }) })] }));
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=Chrome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chrome.js","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAgB,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAU7C,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC3I,OAAO,CACL,MAAC,OAAO,IAAC,UAAU,EAAC,SAAS,EAAC,MAAM,EAAC,OAAO,KAAK,KAAK,aACpD,KAAC,MAAM,IAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,OAAO,EAAE,YAC7D,eAAM,OAAO,EAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,GAAG,GACtC,EACR,MAAM,IAAI,KAAC,iBAAiB,KAAG,EAChC,KAAC,WAAW,IAAC,QAAQ,EAAC,QAAQ,EAAC,cAAc,EAAC,YAAY,EAAC,UAAU,EAAC,SAAS,YAC7E,KAAC,aAAa,IAAC,QAAQ,EAAE,SAAS,IAAI,KAAC,eAAe,KAAG,YAAG,QAAQ,GAAiB,GACzE,EACd,KAAC,KAAK,IAAC,SAAS,EAAE,eAAe,EAAE,MAAM,kBACtC,MAAM,IAAI,KAAC,MAAM,IAAC,aAAa,SAAG,GAC7B,IACA,CACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonEx } from '@xylabs/react-button';
|
|
3
|
+
import { WebAppPage } from './Page';
|
|
4
|
+
export const WebAppErrorPage = () => (_jsxs(WebAppPage, { title: "Oops! Something went wrong", children: [_jsx("h1", { children: "Oops! Something went wrong!" }), _jsx(ButtonEx, { href: "/", variant: "contained", children: "Homepage" })] }));
|
|
5
|
+
/** @deprecated use WebAppErrorPage instead */
|
|
6
|
+
export const ErrorPage = WebAppErrorPage;
|
|
7
|
+
//# sourceMappingURL=ErrorPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorPage.js","sourceRoot":"","sources":["../../../src/components/ErrorPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAEnC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,CACnC,MAAC,UAAU,IAAC,KAAK,EAAC,4BAA4B,aAC5C,uDAAoC,EACpC,KAAC,QAAQ,IAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAC,WAAW,yBAE3B,IACA,CACd,CAAA;AAED,8CAA8C;AAC9C,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from '@mui/material';
|
|
3
|
+
import { FlexGrowCol } from '@xylabs/react-flexbox';
|
|
4
|
+
const NotFound = (props) => {
|
|
5
|
+
return (_jsxs(FlexGrowCol, { ...props, children: [_jsx(Typography, { variant: "h2", children: "Sorry!" }), _jsx(Typography, { marginY: 3, variant: "body2", children: "Can't find anything here" })] }));
|
|
6
|
+
};
|
|
7
|
+
export { NotFound };
|
|
8
|
+
//# sourceMappingURL=NotFound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotFound.js","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/NotFound.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEjE,MAAM,QAAQ,GAA2B,CAAC,KAAK,EAAE,EAAE;IACjD,OAAO,CACL,MAAC,WAAW,OAAK,KAAK,aACpB,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,uBAAoB,EAC5C,KAAC,UAAU,IAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAC,OAAO,YACpC,0BAA0B,GAChB,IACD,CACf,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebAppPageProps } from '../Page';
|
|
3
|
+
export declare const WebAppNotFoundPage: React.FC<WebAppPageProps>;
|
|
4
|
+
/** @deprecated use WebAppNotFoundPage instead */
|
|
5
|
+
export declare const NotFoundPage: import("react").FC<WebAppPageProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { WebAppPage } from '../Page';
|
|
3
|
+
import { NotFound } from './NotFound';
|
|
4
|
+
export const WebAppNotFoundPage = ({ title, ...props }) => (_jsx(WebAppPage, { title: title ?? 'Sorry! Page Not Found', ...props, children: _jsx(NotFound, {}) }));
|
|
5
|
+
/** @deprecated use WebAppNotFoundPage instead */
|
|
6
|
+
export const NotFoundPage = WebAppNotFoundPage;
|
|
7
|
+
//# sourceMappingURL=Page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/Page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,CAAC,MAAM,kBAAkB,GAA8B,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CACpF,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,IAAI,uBAAuB,KAAM,KAAK,YAC5D,KAAC,QAAQ,KAAG,GACD,CACd,CAAA;AAED,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContainerProps } from '@mui/material';
|
|
2
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export interface WebAppPageProps extends FlexBoxProps {
|
|
5
|
+
container?: ContainerProps['maxWidth'];
|
|
6
|
+
disableGutters?: boolean;
|
|
7
|
+
breadcrumbs?: ReactNode;
|
|
8
|
+
disableBreadcrumbGutter?: boolean;
|
|
9
|
+
spacing?: string | number;
|
|
10
|
+
}
|
|
11
|
+
export declare const WebAppPage: React.FC<WebAppPageProps>;
|
|
12
|
+
/** @deprecated use WebAppPagePage instead */
|
|
13
|
+
export declare const FlexPage: import("react").FC<WebAppPageProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Container } from '@mui/material';
|
|
3
|
+
import { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox';
|
|
4
|
+
import { useUserEvents } from '@xylabs/react-pixel';
|
|
5
|
+
import { useAsyncEffect } from '@xylabs/react-shared';
|
|
6
|
+
import { Helmet } from 'react-helmet';
|
|
7
|
+
import { useLocation } from 'react-router-dom';
|
|
8
|
+
export const WebAppPage = ({ spacing = 1, disableBreadcrumbGutter, disableGutters, title, container, breadcrumbs, children, ...props }) => {
|
|
9
|
+
const userEvents = useUserEvents();
|
|
10
|
+
const { pathname } = useLocation();
|
|
11
|
+
useAsyncEffect(
|
|
12
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
+
async () => {
|
|
14
|
+
await userEvents?.viewContent({ name: title ?? 'NodeBasePage', path: location.pathname });
|
|
15
|
+
}, [pathname, title, userEvents]);
|
|
16
|
+
const Body = (props) => (_jsxs(FlexGrowCol, { gap: 1, paddingY: spacing, justifyContent: "flex-start", alignItems: "stretch", ...props, children: [_jsx(FlexRow, { justifyContent: "flex-start", marginX: disableBreadcrumbGutter ? 0 : spacing, children: breadcrumbs }), children] }));
|
|
17
|
+
return (_jsxs(FlexGrowCol, { alignItems: "stretch", justifyContent: "flex-start", minHeight: 0, overflow: "visible scroll", children: [_jsx(Helmet, { title: title }), container ? (_jsx(Container, { disableGutters: disableGutters, style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start' }, maxWidth: container, children: _jsx(Body, { ...props }) })) : (_jsx(Body, { paddingX: disableGutters ? 0 : 1, ...props }))] }));
|
|
18
|
+
};
|
|
19
|
+
/** @deprecated use WebAppPagePage instead */
|
|
20
|
+
export const FlexPage = WebAppPage;
|
|
21
|
+
//# sourceMappingURL=Page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,eAAe,CAAA;AACzD,OAAO,EAAgB,WAAW,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAS9C,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,uBAAuB,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACnK,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAA;I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6CAA6C;AAC7C,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAA"}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@xylabs/react-flexbox": "^2.14.4",
|
|
18
18
|
"@xylabs/react-pixel": "^2.14.4",
|
|
19
19
|
"@xylabs/react-shared": "^2.14.4",
|
|
20
|
-
"@xyo-network/react-shared": "^2.25.
|
|
20
|
+
"@xyo-network/react-shared": "^2.25.71",
|
|
21
21
|
"react": "^18.2.0",
|
|
22
22
|
"react-dom": "^18.2.0",
|
|
23
23
|
"react-helmet": "^6.1.0",
|
|
@@ -82,6 +82,6 @@
|
|
|
82
82
|
},
|
|
83
83
|
"sideEffects": false,
|
|
84
84
|
"types": "dist/esm/index.d.ts",
|
|
85
|
-
"version": "2.25.
|
|
85
|
+
"version": "2.25.70",
|
|
86
86
|
"packageManager": "yarn@3.1.1"
|
|
87
87
|
}
|