@xyo-network/react-webapp 2.26.16 → 2.26.19

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.
@@ -1,4 +1,5 @@
1
1
  import { FlexBoxProps } from '@xylabs/react-flexbox';
2
+ import { WebAppNavigationType } from '@xyo-network/react-app-settings';
2
3
  import { ReactNode } from 'react';
3
4
  export interface WebAppChromeProps extends FlexBoxProps {
4
5
  appName: string;
@@ -6,5 +7,7 @@ export interface WebAppChromeProps extends FlexBoxProps {
6
7
  appbar?: ReactNode;
7
8
  errorPage?: ReactNode;
8
9
  footerElevation?: number;
10
+ navigationType?: WebAppNavigationType;
11
+ menuItems?: ReactNode;
9
12
  }
10
13
  export declare const WebAppChrome: React.FC<WebAppChromeProps>;
@@ -11,8 +11,8 @@ const react_shared_1 = require("@xyo-network/react-shared");
11
11
  const react_helmet_1 = require("react-helmet");
12
12
  const ErrorPage_1 = require("./ErrorPage");
13
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 }) }))] })));
14
+ var { menuItems, navigationType = 'menu', footerElevation = 4, errorPage, appbar, footer, children, appName } = _a, props = tslib_1.__rest(_a, ["menuItems", "navigationType", "footerElevation", "errorPage", "appbar", "footer", "children", "appName"]);
15
+ return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexCol, Object.assign({ alignItems: "stretch", overflow: "hidden", 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, { systemToolbar: (0, jsx_runtime_1.jsx)(react_appbar_1.SystemToolbar, { menuItems: navigationType === 'menu' ? menuItems : undefined }) }), (0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowRow, Object.assign({ overflow: "hidden", alignItems: "stretch" }, { children: [navigationType !== 'menu' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [menuItems, (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical" })] })) : null, (0, jsx_runtime_1.jsx)(react_flexbox_1.FlexGrowCol, Object.assign({ 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)(react_flexbox_1.FlexCol, Object.assign({ alignItems: "stretch" }, { 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
16
  };
17
17
  exports.WebAppChrome = WebAppChrome;
18
18
  //# sourceMappingURL=Chrome.js.map
@@ -1 +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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EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,uBAAC,2BAAe,KAAG,gBAAG,QAAQ,IAAiB,IACzE,KACF,EACd,uBAAC,uBAAO,kBAAC,UAAU,EAAC,SAAS,gBAC3B,uBAAC,gBAAK,kBAAC,SAAS,EAAE,eAAe,EAAE,MAAM,sBACtC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,uBAAC,qBAAM,IAAC,aAAa,SAAG,IAC7B,IACA,KACF,CACX,CAAA;AACH,CAAC,CAAA;AAzBY,QAAA,YAAY,gBAyBxB"}
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const WebAppErrorPage: () => JSX.Element;
2
+ import { WebAppPageProps } from './Page';
3
+ export declare const WebAppErrorPage: React.FC<WebAppPageProps>;
3
4
  /** @deprecated use WebAppErrorPage instead */
4
- export declare const ErrorPage: () => JSX.Element;
5
+ export declare const ErrorPage: import("react").FC<WebAppPageProps>;
@@ -4,7 +4,7 @@ exports.ErrorPage = exports.WebAppErrorPage = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_button_1 = require("@xylabs/react-button");
6
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" }))] })));
7
+ const WebAppErrorPage = (props) => ((0, jsx_runtime_1.jsxs)(Page_1.WebAppPage, Object.assign({ title: "Oops! Something went wrong" }, props, { 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
8
  exports.WebAppErrorPage = WebAppErrorPage;
9
9
  /** @deprecated use WebAppErrorPage instead */
10
10
  exports.ErrorPage = exports.WebAppErrorPage;
@@ -1 +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"}
1
+ {"version":3,"file":"ErrorPage.js","sourceRoot":"","sources":["../../../src/components/ErrorPage.tsx"],"names":[],"mappings":";;;;AAAA,uDAA+C;AAE/C,iCAAoD;AAE7C,MAAM,eAAe,GAA8B,CAAC,KAAK,EAAE,EAAE,CAAC,CACnE,wBAAC,iBAAU,kBAAC,KAAK,EAAC,4BAA4B,IAAK,KAAK,eACtD,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"}
@@ -2,9 +2,11 @@ import { ContainerProps } from '@mui/material';
2
2
  import { FlexBoxProps } from '@xylabs/react-flexbox';
3
3
  import { ReactNode } from 'react';
4
4
  export interface WebAppPageProps extends FlexBoxProps {
5
- container?: ContainerProps['maxWidth'];
5
+ container?: ContainerProps['maxWidth'] | 'none';
6
6
  disableGutters?: boolean;
7
7
  breadcrumbs?: ReactNode;
8
+ disableBreadcrumbGutter?: boolean;
9
+ spacing?: string | number;
8
10
  }
9
11
  export declare const WebAppPage: React.FC<WebAppPageProps>;
10
12
  /** @deprecated use WebAppPagePage instead */
@@ -10,7 +10,7 @@ const react_shared_1 = require("@xylabs/react-shared");
10
10
  const react_helmet_1 = require("react-helmet");
11
11
  const react_router_dom_1 = require("react-router-dom");
12
12
  const WebAppPage = (_a) => {
13
- var { disableGutters, title, container, breadcrumbs, children } = _a, props = tslib_1.__rest(_a, ["disableGutters", "title", "container", "breadcrumbs", "children"]);
13
+ var { spacing = 1, disableBreadcrumbGutter, disableGutters, title, container, breadcrumbs, children } = _a, props = tslib_1.__rest(_a, ["spacing", "disableBreadcrumbGutter", "disableGutters", "title", "container", "breadcrumbs", "children"]);
14
14
  const userEvents = (0, react_pixel_1.useUserEvents)();
15
15
  const { pathname } = (0, react_router_dom_1.useLocation)();
16
16
  (0, react_shared_1.useAsyncEffect)(
@@ -18,8 +18,8 @@ const WebAppPage = (_a) => {
18
18
  () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
19
19
  yield (userEvents === null || userEvents === void 0 ? void 0 : userEvents.viewContent({ name: title !== null && title !== void 0 ? title : 'NodeBasePage', path: location.pathname }));
20
20
  }), [pathname, title, userEvents]);
21
- const Body = (props) => ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowCol, Object.assign({ gap: 2, paddingY: 2, justifyContent: "flex-start", alignItems: "stretch" }, props, { 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)))] })));
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, maxWidth: "100vw", overflow: "visible scroll" }, { children: [(0, jsx_runtime_1.jsx)(react_helmet_1.Helmet, { title: title }), container && container !== 'none' ? ((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
23
  };
24
24
  exports.WebAppPage = WebAppPage;
25
25
  /** @deprecated use WebAppPagePage instead */
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAyD;AACzD,yDAAiE;AACjE,qDAAmD;AACnD,uDAAqD;AAErD,+CAAqC;AACrC,uDAA8C;AAOvC,MAAM,UAAU,GAA8B,CAAC,EAAqE,EAAE,EAAE;QAAzE,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAAnE,mEAAqE,CAAF;IACvH,MAAM,UAAU,GAAG,IAAA,2BAAa,GAAE,CAAA;IAClC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,8BAAW,GAAE,CAAA;IAElC,IAAA,6BAAc;IACZ,uDAAuD;IACvD,GAAS,EAAE;QACT,MAAM,CAAA,U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,QAAQ,EAAC,OAAO,EAAC,QAAQ,EAAC,gBAAgB,iBACpH,uBAAC,qBAAM,IAAC,KAAK,EAAE,KAAK,GAAI,EACvB,SAAS,IAAI,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,CACnC,uBAAC,oBAAS,kBACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,EACrH,QAAQ,EAAE,SAAS,gBAEnB,uBAAC,IAAI,oBAAK,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,8 @@
1
+ import { AxiosError } from 'axios';
2
+ import { PropsWithChildren } from 'react';
3
+ export interface HandleItemDetailLoadingProps<T> {
4
+ apiError: AxiosError | undefined;
5
+ notFound: boolean;
6
+ searchResult: T | undefined;
7
+ }
8
+ export declare function ResultLoader<T>(props: PropsWithChildren<HandleItemDetailLoadingProps<T>>): JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResultLoader = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_flexbox_1 = require("@xylabs/react-flexbox");
6
+ const NotFoundPage_1 = require("./NotFoundPage");
7
+ function ResultLoader(props) {
8
+ const { notFound, apiError, searchResult, children } = props;
9
+ if (notFound) {
10
+ return (0, jsx_runtime_1.jsx)(NotFoundPage_1.NotFound, {});
11
+ }
12
+ // Defer error handling to the children
13
+ if (apiError) {
14
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
15
+ }
16
+ if (searchResult === undefined) {
17
+ return (0, jsx_runtime_1.jsx)(react_flexbox_1.FlexGrowRow, { busy: true, minHeight: "50px" });
18
+ }
19
+ else {
20
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
21
+ }
22
+ }
23
+ exports.ResultLoader = ResultLoader;
24
+ //# sourceMappingURL=ResultLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultLoader.js","sourceRoot":"","sources":["../../../src/components/ResultLoader.tsx"],"names":[],"mappings":";;;;AAAA,yDAAmD;AAInD,iDAAyC;AAQzC,SAAgB,YAAY,CAAI,KAAyD;IACvF,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC5D,IAAI,QAAQ,EAAE;QACZ,OAAO,uBAAC,uBAAQ,KAAG,CAAA;KACpB;IACD,uCAAuC;IACvC,IAAI,QAAQ,EAAE;QACZ,OAAO,2DAAG,QAAQ,GAAI,CAAA;KACvB;IACD,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,OAAO,uBAAC,2BAAW,IAAC,IAAI,QAAC,SAAS,EAAC,MAAM,GAAG,CAAA;KAC7C;SAAM;QACL,OAAO,2DAAG,QAAQ,GAAI,CAAA;KACvB;AACH,CAAC;AAdD,oCAcC"}
@@ -2,3 +2,4 @@ export * from './Chrome';
2
2
  export * from './ErrorPage';
3
3
  export * from './NotFoundPage';
4
4
  export * from './Page';
5
+ export * from './ResultLoader';
@@ -5,4 +5,5 @@ tslib_1.__exportStar(require("./Chrome"), exports);
5
5
  tslib_1.__exportStar(require("./ErrorPage"), exports);
6
6
  tslib_1.__exportStar(require("./NotFoundPage"), exports);
7
7
  tslib_1.__exportStar(require("./Page"), exports);
8
+ tslib_1.__exportStar(require("./ResultLoader"), exports);
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB;AACxB,sDAA2B;AAC3B,yDAA8B;AAC9B,iDAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB;AACxB,sDAA2B;AAC3B,yDAA8B;AAC9B,iDAAsB;AACtB,yDAA8B"}
package/package.json CHANGED
@@ -13,22 +13,20 @@
13
13
  "@emotion/react": "^11.9.3",
14
14
  "@emotion/styled": "^11.9.3",
15
15
  "@mui/material": "^5.9.0",
16
- "@xylabs/react-button": "^2.14.6",
17
- "@xylabs/react-flexbox": "^2.14.6",
18
- "@xylabs/react-link": "^2.14.6",
19
- "@xylabs/react-pixel": "^2.14.6",
20
- "@xylabs/react-shared": "^2.14.6",
21
- "@xylabs/sdk-js": "^2.5.9",
22
- "@xyo-network/react-app-settings": "^2.26.16",
23
- "@xyo-network/react-appbar": "^2.26.16",
24
- "@xyo-network/react-footer": "^2.26.16",
25
- "@xyo-network/react-shared": "^2.26.16",
16
+ "@xylabs/react-button": "^2.14.8",
17
+ "@xylabs/react-flexbox": "^2.14.8",
18
+ "@xylabs/react-link": "^2.14.8",
19
+ "@xylabs/react-pixel": "^2.14.8",
20
+ "@xylabs/react-shared": "^2.14.8",
21
+ "@xyo-network/react-app-settings": "^2.26.19",
22
+ "@xyo-network/react-appbar": "^2.26.19",
23
+ "@xyo-network/react-footer": "^2.26.19",
24
+ "@xyo-network/react-shared": "^2.26.19",
26
25
  "axios": "^0.27.2",
27
26
  "react": "^18.2.0",
28
27
  "react-dom": "^18.2.0",
29
28
  "react-helmet": "^6.1.0",
30
- "react-router-dom": "^6.3.0",
31
- "tslib": "^2.4.0"
29
+ "react-router-dom": "^6.3.0"
32
30
  },
33
31
  "description": "Common React library for all XYO projects that use React",
34
32
  "devDependencies": {
@@ -87,6 +85,6 @@
87
85
  },
88
86
  "sideEffects": false,
89
87
  "types": "dist/esm/index.d.ts",
90
- "version": "2.26.16",
88
+ "version": "2.26.19",
91
89
  "packageManager": "yarn@3.1.1"
92
90
  }