@darajs/core 1.20.3 → 1.21.0
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/actions/navigate-to.d.ts.map +1 -1
- package/dist/actions/navigate-to.js +5 -1
- package/dist/actions/navigate-to.js.map +1 -1
- package/dist/api/core.d.ts +0 -19
- package/dist/api/core.d.ts.map +1 -1
- package/dist/api/core.js +1 -69
- package/dist/api/core.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/auth/auth.d.ts +0 -20
- package/dist/auth/auth.d.ts.map +1 -1
- package/dist/auth/auth.js +0 -11
- package/dist/auth/auth.js.map +1 -1
- package/dist/auth/basic/basic-auth-login.js +4 -4
- package/dist/auth/basic/basic-auth-login.js.map +1 -1
- package/dist/auth/default/default-auth-login.js +4 -4
- package/dist/auth/default/default-auth-login.js.map +1 -1
- package/dist/auth/index.d.ts +0 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +0 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/components/fallback/default.d.ts +1 -0
- package/dist/components/fallback/default.d.ts.map +1 -1
- package/dist/components/fallback/default.js +3 -0
- package/dist/components/fallback/default.js.map +1 -1
- package/dist/components/index.d.ts +8 -5
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/link.d.ts +18 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/link.js +45 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/menu-link.d.ts +4 -0
- package/dist/components/menu-link.d.ts.map +1 -0
- package/dist/components/menu-link.js +45 -0
- package/dist/components/menu-link.js.map +1 -0
- package/dist/components/{menu/menu.d.ts → menu.d.ts} +1 -1
- package/dist/components/menu.d.ts.map +1 -0
- package/dist/components/{menu/menu.js → menu.js} +6 -6
- package/dist/components/menu.js.map +1 -0
- package/dist/components/outlet.d.ts +3 -0
- package/dist/components/outlet.d.ts.map +1 -0
- package/dist/components/outlet.js +3 -0
- package/dist/components/outlet.js.map +1 -0
- package/dist/components/powered-by-causalens.d.ts +3 -0
- package/dist/components/powered-by-causalens.d.ts.map +1 -0
- package/dist/components/powered-by-causalens.js +25 -0
- package/dist/components/powered-by-causalens.js.map +1 -0
- package/dist/components/progress-tracker.d.ts.map +1 -0
- package/dist/components/{progress-tracker/progress-tracker.js → progress-tracker.js} +4 -4
- package/dist/components/progress-tracker.js.map +1 -0
- package/dist/components/{side-bar-frame/side-bar-frame.d.ts → side-bar-frame.d.ts} +2 -1
- package/dist/components/side-bar-frame.d.ts.map +1 -0
- package/dist/components/{side-bar-frame/side-bar-frame.js → side-bar-frame.js} +10 -13
- package/dist/components/side-bar-frame.js.map +1 -0
- package/dist/components/{top-bar-frame/top-bar-frame.d.ts → top-bar-frame.d.ts} +1 -1
- package/dist/components/top-bar-frame.d.ts.map +1 -0
- package/dist/components/{top-bar-frame/top-bar-frame.js → top-bar-frame.js} +6 -7
- package/dist/components/top-bar-frame.js.map +1 -0
- package/dist/dara_core-1.21.0-py3-none-any.whl +0 -0
- package/dist/index.css +42 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pages/error-page.d.ts +12 -2
- package/dist/pages/error-page.d.ts.map +1 -1
- package/dist/pages/error-page.js +18 -10
- package/dist/pages/error-page.js.map +1 -1
- package/dist/pages/error-status-code-page.d.ts +13 -0
- package/dist/pages/error-status-code-page.d.ts.map +1 -0
- package/dist/pages/error-status-code-page.js +40 -0
- package/dist/pages/error-status-code-page.js.map +1 -0
- package/dist/pages/root-error-page.d.ts +3 -0
- package/dist/pages/root-error-page.d.ts.map +1 -0
- package/dist/pages/root-error-page.js +31 -0
- package/dist/pages/root-error-page.js.map +1 -0
- package/dist/pages/route-error-boundary.d.ts +3 -0
- package/dist/pages/route-error-boundary.d.ts.map +1 -0
- package/dist/pages/route-error-boundary.js +85 -0
- package/dist/pages/route-error-boundary.js.map +1 -0
- package/dist/run.d.ts +3 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +49 -25
- package/dist/run.js.map +1 -1
- package/dist/shared/context/config-context.d.ts +7 -0
- package/dist/shared/context/config-context.d.ts.map +1 -0
- package/dist/shared/context/config-context.js +15 -0
- package/dist/shared/context/config-context.js.map +1 -0
- package/dist/shared/context/global-task-context.d.ts +2 -1
- package/dist/shared/context/global-task-context.d.ts.map +1 -1
- package/dist/shared/context/index.d.ts +2 -1
- package/dist/shared/context/index.d.ts.map +1 -1
- package/dist/shared/context/index.js +2 -1
- package/dist/shared/context/index.js.map +1 -1
- package/dist/shared/context/registries-context.d.ts +10 -7
- package/dist/shared/context/registries-context.d.ts.map +1 -1
- package/dist/shared/context/registries-context.js +49 -9
- package/dist/shared/context/registries-context.js.map +1 -1
- package/dist/shared/dynamic-component/dynamic-auth-component.d.ts +12 -0
- package/dist/shared/dynamic-component/dynamic-auth-component.d.ts.map +1 -0
- package/dist/shared/dynamic-component/dynamic-auth-component.js +53 -0
- package/dist/shared/dynamic-component/dynamic-auth-component.js.map +1 -0
- package/dist/shared/dynamic-component/dynamic-component.d.ts +10 -1
- package/dist/shared/dynamic-component/dynamic-component.d.ts.map +1 -1
- package/dist/shared/dynamic-component/dynamic-component.js +67 -7
- package/dist/shared/dynamic-component/dynamic-component.js.map +1 -1
- package/dist/shared/error-handling/error-display.js +2 -2
- package/dist/shared/index.d.ts +1 -2
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -2
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/interactivity/persistence.d.ts +5 -1
- package/dist/shared/interactivity/persistence.d.ts.map +1 -1
- package/dist/shared/interactivity/persistence.js +81 -3
- package/dist/shared/interactivity/persistence.js.map +1 -1
- package/dist/shared/interactivity/plain-variable.d.ts +2 -1
- package/dist/shared/interactivity/plain-variable.d.ts.map +1 -1
- package/dist/shared/interactivity/plain-variable.js +12 -0
- package/dist/shared/interactivity/plain-variable.js.map +1 -1
- package/dist/shared/interactivity/resolve-variable.d.ts +7 -1
- package/dist/shared/interactivity/resolve-variable.d.ts.map +1 -1
- package/dist/shared/interactivity/resolve-variable.js +56 -2
- package/dist/shared/interactivity/resolve-variable.js.map +1 -1
- package/dist/shared/interactivity/server-variable.d.ts +2 -1
- package/dist/shared/interactivity/server-variable.d.ts.map +1 -1
- package/dist/shared/interactivity/server-variable.js +18 -0
- package/dist/shared/interactivity/server-variable.js.map +1 -1
- package/dist/shared/interactivity/use-action.d.ts +6 -1
- package/dist/shared/interactivity/use-action.d.ts.map +1 -1
- package/dist/shared/interactivity/use-action.js +106 -44
- package/dist/shared/interactivity/use-action.js.map +1 -1
- package/dist/shared/{template-root/template-root.d.ts → root/authenticated-root.d.ts} +4 -5
- package/dist/shared/root/authenticated-root.d.ts.map +1 -0
- package/dist/shared/root/authenticated-root.js +86 -0
- package/dist/shared/root/authenticated-root.js.map +1 -0
- package/dist/shared/root/dynamic-context.d.ts.map +1 -0
- package/dist/shared/root/dynamic-context.js.map +1 -0
- package/dist/shared/root/route-content.d.ts +21 -0
- package/dist/shared/root/route-content.d.ts.map +1 -0
- package/dist/shared/root/route-content.js +164 -0
- package/dist/shared/root/route-content.js.map +1 -0
- package/dist/shared/root/unauthenticated-root.d.ts +7 -0
- package/dist/shared/root/unauthenticated-root.d.ts.map +1 -0
- package/dist/shared/root/unauthenticated-root.js +38 -0
- package/dist/shared/root/unauthenticated-root.js.map +1 -0
- package/dist/shared/router.d.ts +14 -0
- package/dist/shared/router.d.ts.map +1 -0
- package/dist/shared/router.js +199 -0
- package/dist/shared/router.js.map +1 -0
- package/dist/shared/utils/index.d.ts +0 -1
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/index.js +0 -1
- package/dist/shared/utils/index.js.map +1 -1
- package/dist/shared/utils/use-component-styles.d.ts +1 -1
- package/dist/shared/utils/use-component-styles.d.ts.map +1 -1
- package/dist/shared/utils/use-component-styles.js +2 -2
- package/dist/shared/utils/use-component-styles.js.map +1 -1
- package/dist/shared/utils/use-url-sync.d.ts +1 -13
- package/dist/shared/utils/use-url-sync.d.ts.map +1 -1
- package/dist/shared/utils/use-url-sync.js +18 -22
- package/dist/shared/utils/use-url-sync.js.map +1 -1
- package/dist/shared/utils/use-window-title.d.ts +1 -1
- package/dist/shared/utils/use-window-title.d.ts.map +1 -1
- package/dist/shared/utils/use-window-title.js +5 -5
- package/dist/shared/utils/use-window-title.js.map +1 -1
- package/dist/types/core.d.ts +73 -5
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/core.js +11 -1
- package/dist/types/core.js.map +1 -1
- package/dist/umd/{dara.core.umd.js → dara.core.umd.cjs} +30052 -17828
- package/dist/umd/style.css +52 -9
- package/package.json +13 -15
- package/dist/auth/auth-wrapper.d.ts +0 -15
- package/dist/auth/auth-wrapper.d.ts.map +0 -1
- package/dist/auth/auth-wrapper.js +0 -76
- package/dist/auth/auth-wrapper.js.map +0 -1
- package/dist/components/menu/menu.d.ts.map +0 -1
- package/dist/components/menu/menu.js.map +0 -1
- package/dist/components/progress-tracker/progress-tracker.d.ts.map +0 -1
- package/dist/components/progress-tracker/progress-tracker.js.map +0 -1
- package/dist/components/router-content/router-content.d.ts +0 -14
- package/dist/components/router-content/router-content.d.ts.map +0 -1
- package/dist/components/router-content/router-content.js +0 -18
- package/dist/components/router-content/router-content.js.map +0 -1
- package/dist/components/side-bar-frame/side-bar-frame.d.ts.map +0 -1
- package/dist/components/side-bar-frame/side-bar-frame.js.map +0 -1
- package/dist/components/top-bar-frame/top-bar-frame.d.ts.map +0 -1
- package/dist/components/top-bar-frame/top-bar-frame.js.map +0 -1
- package/dist/dara_core-1.20.3-py3-none-any.whl +0 -0
- package/dist/shared/private-route/private-route.d.ts +0 -19
- package/dist/shared/private-route/private-route.d.ts.map +0 -1
- package/dist/shared/private-route/private-route.js +0 -37
- package/dist/shared/private-route/private-route.js.map +0 -1
- package/dist/shared/template-root/dynamic-context.d.ts.map +0 -1
- package/dist/shared/template-root/dynamic-context.js.map +0 -1
- package/dist/shared/template-root/template-root.d.ts.map +0 -1
- package/dist/shared/template-root/template-root.js +0 -100
- package/dist/shared/template-root/template-root.js.map +0 -1
- package/dist/shared/utils/use-action-registry.d.ts +0 -11
- package/dist/shared/utils/use-action-registry.d.ts.map +0 -1
- package/dist/shared/utils/use-action-registry.js +0 -19
- package/dist/shared/utils/use-action-registry.js.map +0 -1
- package/dist/shared/utils/use-component-registry.d.ts +0 -11
- package/dist/shared/utils/use-component-registry.d.ts.map +0 -1
- package/dist/shared/utils/use-component-registry.js +0 -58
- package/dist/shared/utils/use-component-registry.js.map +0 -1
- /package/dist/components/{progress-tracker/progress-tracker.d.ts → progress-tracker.d.ts} +0 -0
- /package/dist/shared/{template-root → root}/dynamic-context.d.ts +0 -0
- /package/dist/shared/{template-root → root}/dynamic-context.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-link.js","sourceRoot":"","sources":["../../js/components/menu-link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,OAAO,IAAI,EAAE,EAAkB,MAAM,QAAQ,CAAC;AAE9C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;;;;;;;;aAalB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS;;;;;;sBAM9B,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;;;;sBAI5D,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;;;;;iBAKjE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;iBAInC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;4BACxB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS;;CAElE,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAgB;IAC7C,OAAO,KAAC,UAAU,oBAAK,KAAK,cAAG,KAAK,CAAC,QAAQ,IAAc,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../js/components/menu.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AA2CzC,UAAU,SAAS;IACf,8CAA8C;IAC9C,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC5B;AAED;;;;;GAKG;AACH,iBAAS,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAgB3C;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { transparentize } from 'polished';
|
|
3
3
|
import { useContext } from 'react';
|
|
4
|
-
import { NavLink } from 'react-router
|
|
4
|
+
import { NavLink } from 'react-router';
|
|
5
5
|
import styled from '@darajs/styled-components';
|
|
6
|
-
import { DirectionCtx } from '
|
|
7
|
-
import { getIcon } from '
|
|
8
|
-
import {} from '
|
|
6
|
+
import { DirectionCtx } from '../shared/context';
|
|
7
|
+
import { getIcon } from '../shared/utils';
|
|
8
|
+
import {} from '../types';
|
|
9
9
|
const MenuItem = styled(NavLink) `
|
|
10
10
|
cursor: pointer;
|
|
11
11
|
|
|
@@ -37,7 +37,7 @@ const MenuItem = styled(NavLink) `
|
|
|
37
37
|
color: ${(props) => props.theme.colors.blue1};
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
&[aria-current] {
|
|
41
41
|
color: ${(props) => props.theme.colors.blue1};
|
|
42
42
|
background-color: ${(props) => props.theme.colors.secondary};
|
|
43
43
|
}
|
|
@@ -52,7 +52,7 @@ function Menu(props) {
|
|
|
52
52
|
const directionCtx = useContext(DirectionCtx);
|
|
53
53
|
return (_jsx(_Fragment, { children: props.routes.map(({ icon, name, route }) => {
|
|
54
54
|
const Icon = icon ? getIcon(icon) : null;
|
|
55
|
-
return (_jsxs(MenuItem, {
|
|
55
|
+
return (_jsxs(MenuItem, { direction: directionCtx.direction, to: route, children: [Icon && _jsx(Icon, { style: { marginRight: '0.5rem' } }), name] }, name));
|
|
56
56
|
}) }));
|
|
57
57
|
}
|
|
58
58
|
export default Menu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../js/components/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAkB,MAAM,SAAS,CAAC;AAMzC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAe;;;;;uBAKxB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,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EAClD,IAAI,KAFyC,IAAI,CAG3C,CACd,CAAC;QACN,CAAC,CAAC,GACH,CACN,CAAC;AACN,CAAC;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlet.d.ts","sourceRoot":"","sources":["../../js/components/outlet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAErD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlet.js","sourceRoot":"","sources":["../../js/components/outlet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAErD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powered-by-causalens.d.ts","sourceRoot":"","sources":["../../js/components/powered-by-causalens.tsx"],"names":[],"mappings":"AAmBA,iBAAS,kBAAkB,IAAI,GAAG,CAAC,OAAO,CAczC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled, { useTheme } from '@darajs/styled-components';
|
|
3
|
+
import CausalensDark from '../assets/causalens-dark.svg';
|
|
4
|
+
import CausalensLight from '../assets/causalens-light.svg';
|
|
5
|
+
const BuiltWithLink = styled.a `
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 0.2rem;
|
|
8
|
+
align-items: center;
|
|
9
|
+
|
|
10
|
+
font-size: 0.75rem;
|
|
11
|
+
color: inherit;
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
|
|
14
|
+
:hover {
|
|
15
|
+
text-decoration: underline;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
function PoweredByCausalens() {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const causalensLogoSrc = theme.themeType === 'dark' ? CausalensDark : CausalensLight;
|
|
21
|
+
const causalensLogo = _jsx("img", { alt: "causaLens Logo", src: causalensLogoSrc });
|
|
22
|
+
return (_jsxs(BuiltWithLink, { href: "https://causalens.com/?utm_source=dara&utm_medium=direct&utm_campaign=dara_platform", target: "_blank", rel: "noopener", children: [_jsx("span", { style: { marginTop: '0.4375rem' }, children: "Powered by" }), " ", causalensLogo] }));
|
|
23
|
+
}
|
|
24
|
+
export default PoweredByCausalens;
|
|
25
|
+
//# sourceMappingURL=powered-by-causalens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powered-by-causalens.js","sourceRoot":"","sources":["../../js/components/powered-by-causalens.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAA;;;;;;;;;;;;CAY7B,CAAC;AAEF,SAAS,kBAAkB;IACvB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,gBAAgB,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC;IACrF,MAAM,aAAa,GAAG,cAAK,GAAG,EAAC,gBAAgB,EAAC,GAAG,EAAE,gBAAgB,GAAI,CAAC;IAE1E,OAAO,CACH,MAAC,aAAa,IACV,IAAI,EAAC,qFAAqF,EAC1F,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,UAAU,aAEd,eAAM,KAAK,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,2BAAmB,OAAE,aAAa,IAC7D,CACnB,CAAC;AACN,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-tracker.d.ts","sourceRoot":"","sources":["../../js/components/progress-tracker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAC;AA6HvE,UAAU,oBAAoB;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACtD;AAUD;;;GAGG;AACH,iBAAS,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,KAAK,CAAC,SAAS,CAkJrE;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -4,10 +4,10 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
|
4
4
|
import { Subscription } from 'rxjs';
|
|
5
5
|
import styled from '@darajs/styled-components';
|
|
6
6
|
import { ProgressBar } from '@darajs/ui-components';
|
|
7
|
-
import {} from '
|
|
8
|
-
import { useTaskContext } from '
|
|
9
|
-
import websocketCtx from '
|
|
10
|
-
import {} from '
|
|
7
|
+
import {} from '../api/websocket';
|
|
8
|
+
import { useTaskContext } from '../shared/context/global-task-context';
|
|
9
|
+
import websocketCtx from '../shared/context/websocket-context';
|
|
10
|
+
import {} from '../types/core';
|
|
11
11
|
const POLLING_INTERVAL = 100;
|
|
12
12
|
const FAKE_PROGRESS_INTERVAL = 100;
|
|
13
13
|
const ESTIMATE_RATIO = 0.85;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-tracker.js","sourceRoot":"","sources":["../../js/components/progress-tracker.tsx"],"names":[],"mappings":";AAAA,gDAAgD;AAChD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,M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AAC;QACF,YAAY,CAAC,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;YACpC,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,EAAE,CAAC,KAAe,CAAC;YAE3D,WAAW,CAAC;gBACR,OAAO,EAAE,OAAQ;gBACjB,QAAQ,EAAE,SAAS;aACtB,CAAC,CAAC;QACP,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAC/B,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAE3B,0DAA0D;IAC1D,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC,QAAQ,CAAC;IAC1B,CAAC;IAED,OAAO,CACH,MAAC,eAAe,eACZ,KAAC,cAAc,mCAAkC,EAChD,QAAQ,IAAI,CACT,8BACI,KAAC,eAAe,cAAE,QAAQ,CAAC,OAAO,GAAmB,EACrD,KAAC,WAAW,IAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAI,IACpE,CACN,IACa,CACrB,CAAC;AACN,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentInstance } from '
|
|
1
|
+
import { type ComponentInstance } from '../types';
|
|
2
2
|
interface SideBarFrameProps {
|
|
3
3
|
content: ComponentInstance;
|
|
4
4
|
hide_logo?: boolean;
|
|
@@ -9,6 +9,7 @@ interface SideBarFrameProps {
|
|
|
9
9
|
side_bar_padding?: string;
|
|
10
10
|
side_bar_position?: 'left' | 'right';
|
|
11
11
|
side_bar_width?: string;
|
|
12
|
+
powered_by_causalens?: boolean;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* The SideBarFrame component is designed as a root component for an app built using the Dara core framework. It adds
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-bar-frame.d.ts","sourceRoot":"","sources":["../../js/components/side-bar-frame.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAyFjD,UAAU,iBAAiB;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,KAAK,GAAG,QAAQ,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAID;;;;;GAKG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA0C3D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -2,14 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { transparentize } from 'polished';
|
|
3
3
|
import styled, { ThemeContext, useTheme } from '@darajs/styled-components';
|
|
4
4
|
import { Button } from '@darajs/ui-components';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {} from '../../types';
|
|
12
|
-
import { prependBaseUrl } from '../../utils';
|
|
5
|
+
import DaraDark from '../assets/dara-dark.svg';
|
|
6
|
+
import DaraLight from '../assets/dara-light.svg';
|
|
7
|
+
import { DirectionCtx, DynamicComponent, Wrapper, getIcon, resolveTheme, useConfig } from '../shared';
|
|
8
|
+
import {} from '../types';
|
|
9
|
+
import { prependBaseUrl } from '../utils';
|
|
10
|
+
import PoweredByCausalens from './powered-by-causalens';
|
|
13
11
|
const shouldForwardProp = (prop) => !['width'].includes(prop);
|
|
14
12
|
const SideBar = styled.div.withConfig({ shouldForwardProp }) `
|
|
15
13
|
display: flex;
|
|
@@ -74,15 +72,14 @@ const LogoutArrow = getIcon('fa-solid fa-arrow-right-from-bracket');
|
|
|
74
72
|
* It exposes two slots for registering content: side-bar & content
|
|
75
73
|
*/
|
|
76
74
|
function SideBarFrame(props) {
|
|
77
|
-
var _a, _b;
|
|
75
|
+
var _a, _b, _c;
|
|
78
76
|
const theme = useTheme();
|
|
79
|
-
const
|
|
77
|
+
const config = useConfig();
|
|
80
78
|
const logo = props.logo_path && (_jsx(LogoImage, { alt: "Logo", src: prependBaseUrl(props.logo_path), width: props.logo_width }));
|
|
81
79
|
const logoSrc = theme.themeType === 'dark' ? DaraDark : DaraLight;
|
|
82
|
-
const causalensLogoSrc = theme.themeType === 'dark' ? CausalensDark : CausalensLight;
|
|
83
80
|
const daraLogo = _jsx("img", { alt: "Dara Logo", src: logoSrc });
|
|
84
|
-
const
|
|
85
|
-
return (_jsxs(Wrapper, { backgroundColor: theme.colors.background, children: [props.side_bar_position === 'right' && (_jsx(Wrapper, { children: props.content && _jsx(DynamicComponent, { component: props.content }) })), _jsx(ThemeContext.Provider, { value: resolveTheme((
|
|
81
|
+
const showPoweredBy = (_a = props.powered_by_causalens) !== null && _a !== void 0 ? _a : config.powered_by_causalens;
|
|
82
|
+
return (_jsxs(Wrapper, { backgroundColor: theme.colors.background, children: [props.side_bar_position === 'right' && (_jsx(Wrapper, { children: props.content && _jsx(DynamicComponent, { component: props.content }) })), _jsx(ThemeContext.Provider, { value: resolveTheme((_b = config.theme) === null || _b === void 0 ? void 0 : _b.main, (_c = config.theme) === null || _c === void 0 ? void 0 : _c.base), children: _jsxs(SideBar, { style: { padding: props.side_bar_padding }, width: props.side_bar_width, children: [!props.hide_logo && props.logo_position !== 'bottom' && logo, _jsx(Wrapper, { direction: "column", children: _jsx(DirectionCtx.Provider, { value: { direction: 'column' }, children: props.side_bar && _jsx(DynamicComponent, { component: props.side_bar }) }) }), !props.hide_logo && props.logo_position === 'bottom' && logo, _jsxs(LogoutButton, { href: "/logout", styling: "error", children: [_jsx(LogoutArrow, { style: { marginRight: '0.5rem' } }), "Logout"] }), _jsxs(BuiltWithLink, { href: "https://github.com/causalens/dara", target: "_blank", rel: "noopener noreferrer", children: ["Built with ", daraLogo] }), showPoweredBy && _jsx(PoweredByCausalens, {})] }) }), props.side_bar_position !== 'right' && (_jsx(Wrapper, { style: { padding: '2rem 3rem' }, children: props.content && _jsx(DynamicComponent, { component: props.content }) }))] }));
|
|
86
83
|
}
|
|
87
84
|
export default SideBarFrame;
|
|
88
85
|
//# sourceMappingURL=side-bar-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-bar-frame.js","sourceRoot":"","sources":["../../js/components/side-bar-frame.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrG,OAAO,EAA0B,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,kBAAkB,MAAM,wBAAwB,CAAC;AAMxD,MAAM,iBAAiB,GAAG,CAAC,IAAS,EAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAE5E,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAc;;;;;aAK7D,C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eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID;;GAEG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAoCzD;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -2,12 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { transparentize } from 'polished';
|
|
3
3
|
import styled, { ThemeContext, useTheme } from '@darajs/styled-components';
|
|
4
4
|
import { Button } from '@darajs/ui-components';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {} from '
|
|
10
|
-
import { prependBaseUrl } from '../../utils';
|
|
5
|
+
import DaraDark from '../assets/dara-dark.svg';
|
|
6
|
+
import DaraLight from '../assets/dara-light.svg';
|
|
7
|
+
import { DirectionCtx, DynamicComponent, Wrapper, getIcon, resolveTheme, useConfig } from '../shared';
|
|
8
|
+
import {} from '../types';
|
|
9
|
+
import { prependBaseUrl } from '../utils';
|
|
11
10
|
const shouldForwardProp = (prop) => !['width'].includes(prop);
|
|
12
11
|
const TopBar = styled.div.withConfig({ shouldForwardProp }) `
|
|
13
12
|
display: flex;
|
|
@@ -80,7 +79,7 @@ const LogoutArrow = getIcon('fa-solid fa-arrow-right-from-bracket');
|
|
|
80
79
|
function TopBarFrame(props) {
|
|
81
80
|
var _a, _b;
|
|
82
81
|
const theme = useTheme();
|
|
83
|
-
const
|
|
82
|
+
const config = useConfig();
|
|
84
83
|
const logo = props.logo_path && (_jsx(LogoImage, { alt: "Logo", src: prependBaseUrl(props.logo_path), width: props.logo_width }));
|
|
85
84
|
const logoSrc = theme.themeType === 'dark' ? DaraDark : DaraLight;
|
|
86
85
|
const daraLogo = _jsx("img", { alt: "Dara", src: logoSrc });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-bar-frame.js","sourceRoot":"","sources":["../../js/components/top-bar-frame.tsx"],"names":[],"m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ary file
|
package/dist/index.css
CHANGED
|
@@ -93,3 +93,45 @@ select {
|
|
|
93
93
|
scroll-behavior: auto !important;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
#nprogress {
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
#nprogress .bar {
|
|
102
|
+
background: #3796f6;
|
|
103
|
+
|
|
104
|
+
position: fixed;
|
|
105
|
+
z-index: 1031;
|
|
106
|
+
top: 0;
|
|
107
|
+
left: 0;
|
|
108
|
+
|
|
109
|
+
width: 100%;
|
|
110
|
+
height: 2px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
#nprogress .peg {
|
|
114
|
+
display: block;
|
|
115
|
+
position: absolute;
|
|
116
|
+
right: 0px;
|
|
117
|
+
width: 100px;
|
|
118
|
+
height: 100%;
|
|
119
|
+
box-shadow:
|
|
120
|
+
0 0 10px #3796f6,
|
|
121
|
+
0 0 5px #3796f6;
|
|
122
|
+
opacity: 1;
|
|
123
|
+
|
|
124
|
+
-webkit-transform: rotate(3deg) translate(0px, -4px);
|
|
125
|
+
-ms-transform: rotate(3deg) translate(0px, -4px);
|
|
126
|
+
transform: rotate(3deg) translate(0px, -4px);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.nprogress-custom-parent {
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
position: relative;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.nprogress-custom-parent #nprogress .spinner,
|
|
135
|
+
.nprogress-custom-parent #nprogress .bar {
|
|
136
|
+
position: absolute;
|
|
137
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../js/index.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AAGxB,OAAO,KAAK,WAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../js/index.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AAGxB,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAE1D,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAGxB,eAAe,GAAG,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import run from './run';
|
|
2
2
|
// re-export things which have shared contexts, so UMD builds can access the share contexts
|
|
3
|
-
export * as ReactRouter from 'react-router
|
|
3
|
+
export * as ReactRouter from 'react-router';
|
|
4
4
|
export * as Notifications from '@darajs/ui-notifications';
|
|
5
5
|
export * from './actions';
|
|
6
6
|
export * from './api';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../js/index.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,2FAA2F;AAC3F,OAAO,KAAK,WAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../js/index.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,2FAA2F;AAC3F,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAE1D,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAExB,qBAAqB;AACrB,eAAe,GAAG,CAAC"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { Button } from '@darajs/ui-components';
|
|
3
|
+
interface ErrorConfig {
|
|
4
|
+
description: string;
|
|
5
|
+
styling: ComponentProps<typeof Button>['styling'];
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const errorMessages: Record<string, ErrorConfig>;
|
|
9
|
+
declare function ErrorStatusCodePage(props: {
|
|
10
|
+
code?: string;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
export default ErrorStatusCodePage;
|
|
3
13
|
//# sourceMappingURL=error-page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-page.d.ts","sourceRoot":"","sources":["../../js/pages/error-page.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-page.d.ts","sourceRoot":"","sources":["../../js/pages/error-page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAIrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAU/C,UAAU,WAAW;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IAClD,KAAK,EAAE,MAAM,CAAC;CACjB;AAQD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAcrD,CAAC;AAEF,iBAAS,mBAAmB,CAAC,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAkBlE;AAED,eAAe,mBAAmB,CAAC"}
|
package/dist/pages/error-page.js
CHANGED
|
@@ -1,32 +1,40 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { useLocation } from 'react-router
|
|
3
|
+
import { useLocation } from 'react-router';
|
|
4
4
|
import styled from '@darajs/styled-components';
|
|
5
5
|
import { Button } from '@darajs/ui-components';
|
|
6
6
|
import Center from '../shared/center/center';
|
|
7
7
|
const CenteredDivWithGap = styled(Center) `
|
|
8
|
-
gap:
|
|
8
|
+
gap: 1rem;
|
|
9
9
|
margin: 10px;
|
|
10
10
|
text-align: center;
|
|
11
11
|
`;
|
|
12
|
-
const
|
|
12
|
+
const config401 = {
|
|
13
|
+
description: 'Your login session may have expired. Try again.',
|
|
14
|
+
styling: 'primary',
|
|
15
|
+
title: 'We were not able to authenticate you',
|
|
16
|
+
};
|
|
17
|
+
export const errorMessages = {
|
|
13
18
|
'403': {
|
|
14
19
|
description: 'You are not authorised to access this application. Please contact the application owner to enable access.',
|
|
15
20
|
styling: 'error',
|
|
16
21
|
title: 'We were not able to authenticate you',
|
|
17
22
|
},
|
|
18
|
-
|
|
19
|
-
description: '
|
|
20
|
-
styling: '
|
|
21
|
-
title: '
|
|
23
|
+
'404': {
|
|
24
|
+
description: 'The requested page could not be found.',
|
|
25
|
+
styling: 'error',
|
|
26
|
+
title: 'Page not found',
|
|
22
27
|
},
|
|
28
|
+
'401': config401,
|
|
29
|
+
default: config401,
|
|
23
30
|
};
|
|
24
|
-
function
|
|
31
|
+
function ErrorStatusCodePage(props) {
|
|
32
|
+
var _a;
|
|
25
33
|
const { search } = useLocation();
|
|
26
34
|
const query = useMemo(() => new URLSearchParams(search), [search]);
|
|
27
|
-
const code = query.get('code');
|
|
35
|
+
const code = (_a = props.code) !== null && _a !== void 0 ? _a : query.get('code');
|
|
28
36
|
const errorConfig = (code && errorMessages[code]) || errorMessages.default;
|
|
29
37
|
return (_jsxs(CenteredDivWithGap, { children: [_jsx("h1", { children: errorConfig.title }), _jsx("p", { children: errorConfig.description }), _jsx(Button, { href: "/login", styling: errorConfig.styling, children: "Retry" })] }));
|
|
30
38
|
}
|
|
31
|
-
export default
|
|
39
|
+
export default ErrorStatusCodePage;
|
|
32
40
|
//# sourceMappingURL=error-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-page.js","sourceRoot":"","sources":["../../js/pages/error-page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuB,OAAO,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"error-page.js","sourceRoot":"","sources":["../../js/pages/error-page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuB,OAAO,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;CAIxC,CAAC;AAQF,MAAM,SAAS,GAAG;IACd,WAAW,EAAE,iDAAiD;IAC9D,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,sCAAsC;CAC1B,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAgC;IACtD,KAAK,EAAE;QACH,WAAW,EACP,2GAA2G;QAC/G,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,sCAAsC;KAChD;IACD,KAAK,EAAE;QACH,WAAW,EAAE,wCAAwC;QACrD,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,gBAAgB;KAC1B;IACD,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;CACrB,CAAC;AAEF,SAAS,mBAAmB,CAAC,KAAwB;;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEjC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnE,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,mCAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE7C,MAAM,WAAW,GAAG,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,aAAa,CAAC,OAAQ,CAAC;IAE5E,OAAO,CACH,MAAC,kBAAkB,eACf,uBAAK,WAAW,CAAC,KAAK,GAAM,EAC5B,sBAAI,WAAW,CAAC,WAAW,GAAK,EAChC,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,WAAW,CAAC,OAAO,sBAEzC,IACQ,CACxB,CAAC;AACN,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { Button } from '@darajs/ui-components';
|
|
3
|
+
interface ErrorConfig {
|
|
4
|
+
description: string;
|
|
5
|
+
styling: ComponentProps<typeof Button>['styling'];
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const errorMessages: Record<string, ErrorConfig>;
|
|
9
|
+
declare function ErrorPage(props: {
|
|
10
|
+
code?: string;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
export default ErrorPage;
|
|
13
|
+
//# sourceMappingURL=error-status-code-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-status-code-page.d.ts","sourceRoot":"","sources":["../../js/pages/error-status-code-page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAIrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAU/C,UAAU,WAAW;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IAClD,KAAK,EAAE,MAAM,CAAC;CACjB;AAQD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAcrD,CAAC;AAEF,iBAAS,SAAS,CAAC,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAkBxD;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useLocation } from 'react-router';
|
|
4
|
+
import styled from '@darajs/styled-components';
|
|
5
|
+
import { Button } from '@darajs/ui-components';
|
|
6
|
+
import Center from '../shared/center/center';
|
|
7
|
+
const CenteredDivWithGap = styled(Center) `
|
|
8
|
+
gap: 1rem;
|
|
9
|
+
margin: 10px;
|
|
10
|
+
text-align: center;
|
|
11
|
+
`;
|
|
12
|
+
const config401 = {
|
|
13
|
+
description: 'Your login session may have expired. Try again.',
|
|
14
|
+
styling: 'primary',
|
|
15
|
+
title: 'We were not able to authenticate you',
|
|
16
|
+
};
|
|
17
|
+
export const errorMessages = {
|
|
18
|
+
'403': {
|
|
19
|
+
description: 'You are not authorised to access this application. Please contact the application owner to enable access.',
|
|
20
|
+
styling: 'error',
|
|
21
|
+
title: 'We were not able to authenticate you',
|
|
22
|
+
},
|
|
23
|
+
'404': {
|
|
24
|
+
description: 'The requested page could not be found.',
|
|
25
|
+
styling: 'error',
|
|
26
|
+
title: 'Page not found',
|
|
27
|
+
},
|
|
28
|
+
'401': config401,
|
|
29
|
+
default: config401,
|
|
30
|
+
};
|
|
31
|
+
function ErrorPage(props) {
|
|
32
|
+
var _a;
|
|
33
|
+
const { search } = useLocation();
|
|
34
|
+
const query = useMemo(() => new URLSearchParams(search), [search]);
|
|
35
|
+
const code = (_a = props.code) !== null && _a !== void 0 ? _a : query.get('code');
|
|
36
|
+
const errorConfig = (code && errorMessages[code]) || errorMessages.default;
|
|
37
|
+
return (_jsxs(CenteredDivWithGap, { children: [_jsx("h1", { children: errorConfig.title }), _jsx("p", { children: errorConfig.description }), _jsx(Button, { href: "/login", styling: errorConfig.styling, children: "Retry" })] }));
|
|
38
|
+
}
|
|
39
|
+
export default ErrorPage;
|
|
40
|
+
//# sourceMappingURL=error-status-code-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-status-code-page.js","sourceRoot":"","sources":["../../js/pages/error-status-code-page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuB,OAAO,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;CAIxC,CAAC;AAQF,MAAM,SAAS,GAAG;IACd,WAAW,EAAE,iDAAiD;IAC9D,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,sCAAsC;CAC1B,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAgC;IACtD,KAAK,EAAE;QACH,WAAW,EACP,2GAA2G;QAC/G,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,sCAAsC;KAChD;IACD,KAAK,EAAE;QACH,WAAW,EAAE,wCAAwC;QACrD,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,gBAAgB;KAC1B;IACD,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;CACrB,CAAC;AAEF,SAAS,SAAS,CAAC,KAAwB;;IACvC,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEjC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnE,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,mCAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE7C,MAAM,WAAW,GAAG,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,aAAa,CAAC,OAAQ,CAAC;IAE5E,OAAO,CACH,MAAC,kBAAkB,eACf,uBAAK,WAAW,CAAC,KAAK,GAAM,EAC5B,sBAAI,WAAW,CAAC,WAAW,GAAK,EAChC,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,WAAW,CAAC,OAAO,sBAEzC,IACQ,CACxB,CAAC;AACN,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-error-page.d.ts","sourceRoot":"","sources":["../../js/pages/root-error-page.tsx"],"names":[],"mappings":"AAeA,iBAAS,aAAa,IAAI,KAAK,CAAC,SAAS,CA4CxC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isRouteErrorResponse, useRouteError } from 'react-router';
|
|
3
|
+
import styled from '@darajs/styled-components';
|
|
4
|
+
import { Button } from '@darajs/ui-components';
|
|
5
|
+
import Center from '../shared/center/center';
|
|
6
|
+
import ErrorStatusCodePage, { errorMessages } from './error-status-code-page';
|
|
7
|
+
const CenteredDivWithGap = styled(Center) `
|
|
8
|
+
gap: 1rem;
|
|
9
|
+
margin: 10px;
|
|
10
|
+
text-align: center;
|
|
11
|
+
`;
|
|
12
|
+
function RootErrorPage() {
|
|
13
|
+
const error = useRouteError();
|
|
14
|
+
// errors from loaders - can happen normally
|
|
15
|
+
if (isRouteErrorResponse(error)) {
|
|
16
|
+
// show a regular error page when the error code is known
|
|
17
|
+
if (String(error.status) in errorMessages) {
|
|
18
|
+
return _jsx(ErrorStatusCodePage, { code: String(error.status) });
|
|
19
|
+
}
|
|
20
|
+
_jsxs(CenteredDivWithGap, { children: [_jsxs("h1", { children: [error.status, " ", error.statusText] }), _jsx("p", { children: "Try again or contact the application owner" }), _jsx(Button, { href: "/login", styling: "error", children: "Go to home" })] });
|
|
21
|
+
}
|
|
22
|
+
// eslint-disable-next-line no-console
|
|
23
|
+
console.error(error);
|
|
24
|
+
// some error thrown, show the actual error
|
|
25
|
+
if (error instanceof Error) {
|
|
26
|
+
_jsxs(CenteredDivWithGap, { children: [_jsx("h1", { children: error.message }), _jsx("pre", { children: error.stack }), _jsx(Button, { href: "/login", styling: "error", children: "Go to home" })] });
|
|
27
|
+
}
|
|
28
|
+
return (_jsxs(CenteredDivWithGap, { children: [_jsx("h1", { children: "Unexpected error occurred" }), _jsx("pre", { children: String(error) }), _jsx(Button, { href: "/login", styling: "error", children: "Go to home" })] }));
|
|
29
|
+
}
|
|
30
|
+
export default RootErrorPage;
|
|
31
|
+
//# sourceMappingURL=root-error-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-error-page.js","sourceRoot":"","sources":["../../js/pages/root-error-page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C,OAAO,mBAAmB,EAAE,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9E,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;CAIxC,CAAC;AAEF,SAAS,aAAa;IAClB,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAE9B,4CAA4C;IAC5C,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,yDAAyD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