@darajs/core 1.20.2 → 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.2-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,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { isRouteErrorResponse, useRouteError } from 'react-router';
|
|
4
|
+
import styled from '@darajs/styled-components';
|
|
5
|
+
import { Button } from '@darajs/ui-components';
|
|
6
|
+
import { useConfig } from '../shared';
|
|
7
|
+
import { LoaderError } from '../types';
|
|
8
|
+
import ErrorStatusCodePage, { errorMessages } from './error-status-code-page';
|
|
9
|
+
const CenteredDivWithGap = styled.div `
|
|
10
|
+
display: flex;
|
|
11
|
+
flex: 1;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: 2rem;
|
|
14
|
+
|
|
15
|
+
min-width: 0;
|
|
16
|
+
margin: auto;
|
|
17
|
+
padding: 0.5rem;
|
|
18
|
+
|
|
19
|
+
text-align: center;
|
|
20
|
+
|
|
21
|
+
code {
|
|
22
|
+
padding: 0.2rem;
|
|
23
|
+
background-color: ${(props) => props.theme.colors.grey2};
|
|
24
|
+
border-radius: 0.5rem;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
const Title = styled.h1 `
|
|
28
|
+
margin: 0;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
`;
|
|
31
|
+
const ErrorMessage = styled.p `
|
|
32
|
+
font-size: 0.875rem;
|
|
33
|
+
line-height: 1.5;
|
|
34
|
+
`;
|
|
35
|
+
const ErrorStack = styled.pre `
|
|
36
|
+
overflow-x: auto;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-shrink: 1;
|
|
39
|
+
|
|
40
|
+
min-width: 0;
|
|
41
|
+
|
|
42
|
+
font-size: 0.825rem;
|
|
43
|
+
text-align: left;
|
|
44
|
+
`;
|
|
45
|
+
const ButtonBar = styled.div `
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
|
|
49
|
+
button {
|
|
50
|
+
width: fit-content;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
function isProductionBuild(config) {
|
|
54
|
+
return config.build_mode === 'PRODUCTION' && !config.build_dev;
|
|
55
|
+
}
|
|
56
|
+
function RouteErrorBoundary() {
|
|
57
|
+
const error = useRouteError();
|
|
58
|
+
const config = useConfig();
|
|
59
|
+
const firstRender = useRef(true);
|
|
60
|
+
if (firstRender.current) {
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
console.error(error);
|
|
63
|
+
firstRender.current = false;
|
|
64
|
+
}
|
|
65
|
+
// explicit errors from loaders
|
|
66
|
+
if (isRouteErrorResponse(error)) {
|
|
67
|
+
// show a regular error page when the error code is known
|
|
68
|
+
if (String(error.status) in errorMessages) {
|
|
69
|
+
return _jsx(ErrorStatusCodePage, { code: String(error.status) });
|
|
70
|
+
}
|
|
71
|
+
return (_jsxs(CenteredDivWithGap, { children: [_jsxs(Title, { children: [error.status, " ", error.statusText] }), _jsx(ErrorMessage, { children: "Try again or contact the application owner" }), _jsx(ButtonBar, { children: _jsx(Button, { href: "/login", styling: "error", children: "Go to home" }) })] }));
|
|
72
|
+
}
|
|
73
|
+
// in prod, always show the error page
|
|
74
|
+
if (isProductionBuild(config)) {
|
|
75
|
+
return (_jsxs(CenteredDivWithGap, { children: [_jsx(Title, { children: "Unexpected error occurred" }), _jsx(ErrorMessage, { children: "Try again or contact the application owner" }), _jsx(ButtonBar, { children: _jsx(Button, { href: "/login", styling: "error", children: "Go to home" }) })] }));
|
|
76
|
+
}
|
|
77
|
+
// Otherwise, show the actual error to the user (developer mode)
|
|
78
|
+
if (error instanceof LoaderError) {
|
|
79
|
+
// Explicitly handle loader errors
|
|
80
|
+
return (_jsxs(CenteredDivWithGap, { children: [_jsxs(Title, { children: ["Error loading page ", _jsx("code", { children: error.payload.path })] }), _jsxs(ErrorMessage, { children: ["Error was thrown by action ", _jsx("code", { children: error.payload.action_name }), ". ", _jsx("br", {}), "To ensure security and integrity of the page content, errors raised within ", _jsx("code", { children: "on_load" }), ' ', "actions trigger this error boundary page rather than only showing a notification. For best user experience, gracefully handle any exceptions raised within those actions."] }), _jsx(ErrorStack, { children: error.payload.stacktrace }), _jsx(ButtonBar, { children: _jsx(Button, { href: "/login", styling: "error", children: "Go to home" }) })] }));
|
|
81
|
+
}
|
|
82
|
+
return (_jsxs(CenteredDivWithGap, { children: [_jsx(Title, { children: "Unknown error occurred" }), _jsx(ErrorStack, { children: String(error) }), _jsx(ButtonBar, { children: _jsx(Button, { href: "/login", styling: "error", children: "Go to home" }) })] }));
|
|
83
|
+
}
|
|
84
|
+
export default RouteErrorBoundary;
|
|
85
|
+
//# sourceMappingURL=route-error-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-error-boundary.js","sourceRoot":"","sources":["../../js/pages/route-error-boundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE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C,KAAC,UAAU,cAAE,MAAM,CAAC,KAAK,CAAC,GAAc,EACxC,KAAC,SAAS,cACN,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,2BAE5B,GACD,IACK,CACxB,CAAC;AACN,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
package/dist/run.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WebSocketClientInterface } from './api';
|
|
1
2
|
import './index.css';
|
|
2
3
|
declare global {
|
|
3
4
|
interface Window {
|
|
@@ -6,6 +7,7 @@ declare global {
|
|
|
6
7
|
}
|
|
7
8
|
interface DaraGlobals {
|
|
8
9
|
base_url: string;
|
|
10
|
+
ws?: WebSocketClientInterface;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* The main run function for the JS half of the application creates a div and binds the react app onto the tree. It sets
|
|
@@ -17,6 +19,6 @@ interface DaraGlobals {
|
|
|
17
19
|
*/
|
|
18
20
|
declare function run(importers: {
|
|
19
21
|
[k: string]: () => Promise<any>;
|
|
20
|
-
}): void
|
|
22
|
+
}): Promise<void>;
|
|
21
23
|
export default run;
|
|
22
24
|
//# sourceMappingURL=run.d.ts.map
|
package/dist/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../js/run.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../js/run.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,aAAa,CAAC;AAQrB,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,IAAI,EAAE,WAAW,CAAC;KACrB;CACJ;AAED,UAAU,WAAW;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,wBAAwB,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,iBAAe,GAAG,CAAC,SAAS,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDhF;AAED,eAAe,GAAG,CAAC"}
|
package/dist/run.js
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
11
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
3
|
-
import
|
|
12
|
+
import NProgress from 'nprogress';
|
|
13
|
+
import { useState } from 'react';
|
|
4
14
|
import { createRoot } from 'react-dom/client';
|
|
5
|
-
import {
|
|
6
|
-
import { RecoilRoot } from 'recoil';
|
|
7
|
-
import {
|
|
8
|
-
import { ThemeProvider, theme } from '@darajs/styled-components';
|
|
15
|
+
import { RouterProvider } from 'react-router/dom';
|
|
16
|
+
import { RecoilRoot, useRecoilSnapshot } from 'recoil';
|
|
17
|
+
import { ThemeProvider } from '@darajs/styled-components';
|
|
9
18
|
import { ErrorBoundary } from '@darajs/ui-components';
|
|
10
|
-
import {
|
|
11
|
-
import { GlobalTaskProvider } from './shared/context';
|
|
12
|
-
import { useUrlSync } from './shared/utils';
|
|
13
|
-
import AuthWrapper from './auth/auth-wrapper';
|
|
19
|
+
import { useLatestRef } from '@darajs/ui-utils';
|
|
20
|
+
import { ConfigContextProvider, GlobalTaskProvider } from './shared/context';
|
|
14
21
|
import './index.css';
|
|
15
|
-
import { DirectionCtx, ImportersCtx,
|
|
22
|
+
import { DirectionCtx, ImportersCtx, resolveTheme } from './shared';
|
|
23
|
+
import { preloadAuthComponent } from './shared/dynamic-component/dynamic-auth-component';
|
|
24
|
+
import { preloadComponents } from './shared/dynamic-component/dynamic-component';
|
|
25
|
+
import { preloadActions } from './shared/interactivity/use-action';
|
|
26
|
+
import { createRouter } from './shared/router';
|
|
16
27
|
/**
|
|
17
28
|
* The main run function for the JS half of the application creates a div and binds the react app onto the tree. It sets
|
|
18
29
|
* up a lot of context providers for the rest of the application. It accepts an object of importers as an argument. An
|
|
@@ -22,20 +33,33 @@ import { DirectionCtx, ImportersCtx, TemplateRoot } from './shared';
|
|
|
22
33
|
* @param importers - the importers object.
|
|
23
34
|
*/
|
|
24
35
|
function run(importers) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
const queryClient = new QueryClient();
|
|
39
|
+
const daraData = JSON.parse(document.getElementById('__DARA_DATA__').textContent);
|
|
40
|
+
document.title = daraData.title;
|
|
41
|
+
NProgress.configure({ showSpinner: false });
|
|
42
|
+
yield Promise.all([
|
|
43
|
+
// preload auth components to prevent flashing of extra spinners
|
|
44
|
+
...Object.values(daraData.auth_components).map((component) => preloadAuthComponent(importers, component)),
|
|
45
|
+
// preload components and actions for the entire loaded registry
|
|
46
|
+
preloadComponents(importers, Object.values(daraData.components)),
|
|
47
|
+
preloadActions(importers, Object.values(daraData.actions)),
|
|
48
|
+
]);
|
|
49
|
+
function RouterRoot() {
|
|
50
|
+
const snapshot = useRecoilSnapshot();
|
|
51
|
+
const snapshotRef = useLatestRef(snapshot);
|
|
52
|
+
const [router] = useState(() => createRouter(daraData, queryClient, snapshotRef));
|
|
53
|
+
return _jsx(RouterProvider, { router: router });
|
|
54
|
+
}
|
|
55
|
+
const theme = resolveTheme((_a = daraData.theme) === null || _a === void 0 ? void 0 : _a.main, (_b = daraData.theme) === null || _b === void 0 ? void 0 : _b.base);
|
|
56
|
+
function Root() {
|
|
57
|
+
return (_jsx(ConfigContextProvider, { initialConfig: daraData, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemeProvider, { theme: theme, children: _jsx(ErrorBoundary, { children: _jsx(ImportersCtx.Provider, { value: importers, children: _jsx(DirectionCtx.Provider, { value: { direction: 'row' }, children: _jsx(RecoilRoot, { children: _jsx(GlobalTaskProvider, { children: _jsx(RouterRoot, {}) }) }) }) }) }) }) }) }));
|
|
58
|
+
}
|
|
59
|
+
const container = document.getElementById('dara_root');
|
|
60
|
+
const root = createRoot(container);
|
|
61
|
+
root.render(_jsx(Root, {}));
|
|
62
|
+
});
|
|
39
63
|
}
|
|
40
64
|
export default run;
|
|
41
65
|
//# sourceMappingURL=run.js.map
|
package/dist/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../js/run.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../js/run.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU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@
|
|
|
1
|
+
import type { Config } from '../../types';
|
|
2
|
+
export declare function ConfigContextProvider(props: {
|
|
3
|
+
initialConfig: Config;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}): React.ReactNode;
|
|
6
|
+
export declare function useConfig(): Config;
|
|
7
|
+
//# sourceMappingURL=config-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-context.d.ts","sourceRoot":"","sources":["../../../js/shared/context/config-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAQtC,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAGlH;AAED,wBAAgB,SAAS,IAAI,MAAM,CAQlC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
3
|
+
const configContext = createContext(null);
|
|
4
|
+
export function ConfigContextProvider(props) {
|
|
5
|
+
const contextValue = useMemo(() => ({ config: props.initialConfig }), [props.initialConfig]);
|
|
6
|
+
return _jsx(configContext.Provider, { value: contextValue, children: props.children });
|
|
7
|
+
}
|
|
8
|
+
export function useConfig() {
|
|
9
|
+
const context = useContext(configContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error('useConfigContext must be used within a ConfigContextProvider');
|
|
12
|
+
}
|
|
13
|
+
return context.config;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=config-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-context.js","sourceRoot":"","sources":["../../../js/shared/context/config-context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQ3D,MAAM,aAAa,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC;AAEhE,MAAM,UAAU,qBAAqB,CAAC,KAA2D;IAC7F,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAC7F,OAAO,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAAG,KAAK,CAAC,QAAQ,GAA0B,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,SAAS;IACrB,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IACpF,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { type GlobalTaskContext } from '../../types/core';
|
|
2
3
|
/**
|
|
3
4
|
* Represents a task run
|
|
@@ -9,7 +10,7 @@ export interface VariableTaskEntry {
|
|
|
9
10
|
triggerKey?: string;
|
|
10
11
|
}
|
|
11
12
|
interface GlobalTaskProviderProps {
|
|
12
|
-
children:
|
|
13
|
+
children: React.ReactNode;
|
|
13
14
|
tasks?: Set<string>;
|
|
14
15
|
variableTaskMap?: Map<string, Array<VariableTaskEntry>>;
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-task-context.d.ts","sourceRoot":"","sources":["../../../js/shared/context/global-task-context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"global-task-context.d.ts","sourceRoot":"","sources":["../../../js/shared/context/global-task-context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMtD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,uBAAuB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;CAC3D;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CA4FrH;AAED,wBAAgB,cAAc,IAAI,iBAAiB,CAQlD"}
|
|
@@ -3,8 +3,9 @@ export { default as ImportersCtx } from './importers-context';
|
|
|
3
3
|
export { default as GlobalTaskProvider, useTaskContext } from './global-task-context';
|
|
4
4
|
export { default as VariableCtx } from './variable-context';
|
|
5
5
|
export { default as WebSocketCtx } from './websocket-context';
|
|
6
|
-
export {
|
|
6
|
+
export { RegistriesCtxProvider, useRegistriesCtx } from './registries-context';
|
|
7
7
|
export { default as DisplayCtx } from './display-context';
|
|
8
8
|
export { default as FallbackCtx } from './fallback-context';
|
|
9
9
|
export { default as RequestExtrasCtx, useRequestExtras, RequestExtrasProvider, PartialRequestExtrasProvider, } from './request-extras-context';
|
|
10
|
+
export { useConfig, ConfigContextProvider } from './config-context';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../js/shared/context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../js/shared/context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACH,OAAO,IAAI,gBAAgB,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -3,8 +3,9 @@ export { default as ImportersCtx } from './importers-context';
|
|
|
3
3
|
export { default as GlobalTaskProvider, useTaskContext } from './global-task-context';
|
|
4
4
|
export { default as VariableCtx } from './variable-context';
|
|
5
5
|
export { default as WebSocketCtx } from './websocket-context';
|
|
6
|
-
export {
|
|
6
|
+
export { RegistriesCtxProvider, useRegistriesCtx } from './registries-context';
|
|
7
7
|
export { default as DisplayCtx } from './display-context';
|
|
8
8
|
export { default as FallbackCtx } from './fallback-context';
|
|
9
9
|
export { default as RequestExtrasCtx, useRequestExtras, RequestExtrasProvider, PartialRequestExtrasProvider, } from './request-extras-context';
|
|
10
|
+
export { useConfig, ConfigContextProvider } from './config-context';
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../js/shared/context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../js/shared/context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACH,OAAO,IAAI,gBAAgB,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { RequestError } from '@darajs/ui-utils';
|
|
3
|
-
import { type ActionDef, type Component } from '../../types';
|
|
1
|
+
import { type ActionDef, type Component, type ComponentInstance } from '../../types';
|
|
4
2
|
type RegistriesCtx = {
|
|
5
3
|
/**
|
|
6
4
|
* Action registry
|
|
@@ -11,10 +9,15 @@ type RegistriesCtx = {
|
|
|
11
9
|
*/
|
|
12
10
|
componentRegistry: Record<string, Component>;
|
|
13
11
|
/**
|
|
14
|
-
* Callback to
|
|
12
|
+
* Callback to get a component from the components registry
|
|
15
13
|
*/
|
|
16
|
-
|
|
14
|
+
getComponent: (instance: ComponentInstance) => Promise<Component>;
|
|
17
15
|
};
|
|
18
|
-
declare
|
|
19
|
-
|
|
16
|
+
export declare function RegistriesCtxProvider(props: {
|
|
17
|
+
componentRegistry: Record<string, Component>;
|
|
18
|
+
actionRegistry: Record<string, ActionDef>;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}): React.ReactNode;
|
|
21
|
+
export declare function useRegistriesCtx(): RegistriesCtx;
|
|
22
|
+
export {};
|
|
20
23
|
//# sourceMappingURL=registries-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registries-context.d.ts","sourceRoot":"","sources":["../../../js/shared/context/registries-context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registries-context.d.ts","sourceRoot":"","sources":["../../../js/shared/context/registries-context.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjF,KAAK,aAAa,GAAG;IACjB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1C;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC7C;;OAEG;IACH,YAAY,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;CACrE,CAAC;AAIF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IACzC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC7C,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,GAAG,KAAK,CAAC,SAAS,CA0ClB;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CAQhD"}
|
|
@@ -1,11 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { useMutation } from '@tanstack/react-query';
|
|
12
|
+
import { createContext, useCallback, useContext, useMemo, useState } from 'react';
|
|
13
|
+
import { HTTP_METHOD, validateResponse } from '@darajs/ui-utils';
|
|
14
|
+
import { request } from '../../api/http';
|
|
15
|
+
import { handleAuthErrors } from '../../auth/auth';
|
|
4
16
|
import {} from '../../types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
import { useRequestExtras } from './request-extras-context';
|
|
18
|
+
const registriesCtx = createContext(null);
|
|
19
|
+
export function RegistriesCtxProvider(props) {
|
|
20
|
+
const [actionRegistry] = useState(props.actionRegistry);
|
|
21
|
+
const [componentRegistry, setComponentRegistry] = useState(props.componentRegistry);
|
|
22
|
+
const extras = useRequestExtras();
|
|
23
|
+
const refetchComponentMutation = useMutation({
|
|
24
|
+
mutationKey: ['component-definition'],
|
|
25
|
+
mutationFn: (_a) => __awaiter(this, [_a], void 0, function* ({ name }) {
|
|
26
|
+
const response = yield request(`/api/core/components/${name}/definition`, { method: HTTP_METHOD.GET }, extras);
|
|
27
|
+
yield handleAuthErrors(response, true);
|
|
28
|
+
yield validateResponse(response, `Failed to fetch the component definition for ${name}, was it registered in the app?`);
|
|
29
|
+
return response.json();
|
|
30
|
+
}),
|
|
31
|
+
retry: 3,
|
|
32
|
+
});
|
|
33
|
+
const getComponent = useCallback((instance) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (componentRegistry[instance.name]) {
|
|
35
|
+
return componentRegistry[instance.name];
|
|
36
|
+
}
|
|
37
|
+
const component = yield refetchComponentMutation.mutateAsync({ name: instance.name });
|
|
38
|
+
setComponentRegistry((prev) => (Object.assign(Object.assign({}, prev), { [instance.name]: component })));
|
|
39
|
+
return component;
|
|
40
|
+
}), [componentRegistry, refetchComponentMutation]);
|
|
41
|
+
const contextValue = useMemo(() => ({ actionRegistry, componentRegistry, getComponent }), [actionRegistry, componentRegistry, getComponent]);
|
|
42
|
+
return _jsx(registriesCtx.Provider, { value: contextValue, children: props.children });
|
|
43
|
+
}
|
|
44
|
+
export function useRegistriesCtx() {
|
|
45
|
+
const context = useContext(registriesCtx);
|
|
46
|
+
if (!context) {
|
|
47
|
+
throw new Error('useRegistriesCtx must be used within a RegistriesCtxProvider');
|
|
48
|
+
}
|
|
49
|
+
return context;
|
|
50
|
+
}
|
|
11
51
|
//# sourceMappingURL=registries-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registries-context.js","sourceRoot":"","sources":["../../../js/shared/context/registries-context.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"registries-context.js","sourceRoot":"","sources":["../../../js/shared/context/registries-context.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAA0D,MAAM,SAAS,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAiB5D,MAAM,aAAa,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC;AAEhE,MAAM,UAAU,qBAAqB,CAAC,KAIrC;IACG,MAAM,CAAC,cAAc,CAAC,GAAG,QAAQ,CAA4B,KAAK,CAAC,cAAc,CAAC,CAAC;IACnF,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAA4B,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC/G,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAElC,MAAM,wBAAwB,GAAG,WAAW,CAAqC;QAC7E,WAAW,EAAE,CAAC,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AQ,GAA0B,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC5B,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IACpF,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthComponent, ModuleContent } from '../../types/core';
|
|
2
|
+
export declare function preloadAuthComponent(importers: Record<string, () => Promise<ModuleContent>>, component: AuthComponent): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Simplified version of DynamicComponent, just for the auth components.
|
|
5
|
+
* This is because we can't use the component registry for auth components, since the component registry operates
|
|
6
|
+
* in an authenticated context, and we need to be able to render the login page without being authenticated.
|
|
7
|
+
*/
|
|
8
|
+
declare function DynamicAuthComponent(props: {
|
|
9
|
+
component: AuthComponent;
|
|
10
|
+
}): React.ReactNode;
|
|
11
|
+
export default DynamicAuthComponent;
|
|
12
|
+
//# sourceMappingURL=dynamic-auth-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-auth-component.d.ts","sourceRoot":"","sources":["../../../js/shared/dynamic-component/dynamic-auth-component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQjE,wBAAsB,oBAAoB,CACtC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC,EACvD,SAAS,EAAE,aAAa,GACzB,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;;;;GAIG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE;IAAE,SAAS,EAAE,aAAa,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAOlF;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import {} from 'react';
|
|
12
|
+
const PRELOADED_COMPONENTS = {};
|
|
13
|
+
function getIdentifier(component) {
|
|
14
|
+
return `${component.py_module}.${component.js_name}`;
|
|
15
|
+
}
|
|
16
|
+
export function preloadAuthComponent(importers, component) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const importer = importers[component.py_module];
|
|
19
|
+
if (!importer) {
|
|
20
|
+
throw new Error(`Missing importer for module ${component.py_module}`);
|
|
21
|
+
}
|
|
22
|
+
let moduleContent = null;
|
|
23
|
+
try {
|
|
24
|
+
moduleContent = yield importer();
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
throw new Error(`Failed to import module ${component.py_module}`, err);
|
|
28
|
+
}
|
|
29
|
+
if (!moduleContent) {
|
|
30
|
+
throw new Error(`Failed to import module ${component.py_module}`);
|
|
31
|
+
}
|
|
32
|
+
const Component = moduleContent[component.js_name];
|
|
33
|
+
if (!Component) {
|
|
34
|
+
throw new Error(`Failed to import component ${component.js_name} from module ${component.py_module}`);
|
|
35
|
+
}
|
|
36
|
+
PRELOADED_COMPONENTS[getIdentifier(component)] = _jsx(Component, {});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Simplified version of DynamicComponent, just for the auth components.
|
|
41
|
+
* This is because we can't use the component registry for auth components, since the component registry operates
|
|
42
|
+
* in an authenticated context, and we need to be able to render the login page without being authenticated.
|
|
43
|
+
*/
|
|
44
|
+
function DynamicAuthComponent(props) {
|
|
45
|
+
const identifier = getIdentifier(props.component);
|
|
46
|
+
// should not happen
|
|
47
|
+
if (!(identifier in PRELOADED_COMPONENTS)) {
|
|
48
|
+
throw new Error(`Component ${identifier} not found`);
|
|
49
|
+
}
|
|
50
|
+
return PRELOADED_COMPONENTS[identifier];
|
|
51
|
+
}
|
|
52
|
+
export default DynamicAuthComponent;
|
|
53
|
+
//# sourceMappingURL=dynamic-auth-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-auth-component.js","sourceRoot":"","sources":["../../../js/shared/dynamic-component/dynamic-auth-component.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAsC,MAAM,OAAO,CAAC;AAI3D,MAAM,oBAAoB,GAA8B,EAAE,CAAC;AAE3D,SAAS,aAAa,CAAC,SAAwB;IAC3C,OAAO,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC;AAED,MAAM,UAAgB,oBAAoB,CACtC,SAAuD,EACvD,SAAwB;;QAExB,MAAM,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,+BAA+B,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1E,CAAC;QAED,IAAI,aAAa,GAAQ,IAAI,CAAC;QAE9B,IAAI,CAAC;YACD,aAAa,GAAG,MAAM,QAAQ,EAAE,CAAC;QACrC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,2BAA2B,SAAS,CAAC,SAAS,EAAE,EAAE,GAAY,CAAC,CAAC;QACpF,CAAC;QACD,IAAI,CAAC,aAAa,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,2BAA2B,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;QACtE,CAAC;QAED,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,CAA8B,CAAC;QAEhF,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,8BAA8B,SAAS,CAAC,OAAO,gBAAgB,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1G,CAAC;QAED,oBAAoB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,GAAG,KAAC,SAAS,KAAG,CAAC;IACnE,CAAC;CAAA;AAED;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,KAAmC;IAC7D,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAClD,oBAAoB;IACpB,IAAI,CAAC,CAAC,UAAU,IAAI,oBAAoB,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,aAAa,UAAU,YAAY,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,oBAAoB,CAAC,UAAU,CAAE,CAAC;AAC7C,CAAC;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import { type ComponentInstance } from '../../types';
|
|
1
|
+
import { type Component, type ComponentInstance } from '../../types';
|
|
2
|
+
import { type ModuleContent } from '../../types/core';
|
|
2
3
|
/**
|
|
3
4
|
* Clear the caches for testing.
|
|
4
5
|
* In prod we don't want to clear ever
|
|
5
6
|
*/
|
|
6
7
|
export declare function clearCaches_TEST(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Pre-warm the caches for the given components.
|
|
10
|
+
* This is useful to pre-warm the core components on startup to avoid spinners
|
|
11
|
+
*
|
|
12
|
+
* @param importers - the importers object.
|
|
13
|
+
* @param components - the components to pre-warm
|
|
14
|
+
*/
|
|
15
|
+
export declare function preloadComponents(importers: Record<string, () => Promise<ModuleContent>>, components: Component[]): Promise<void>;
|
|
7
16
|
interface DynamicComponentProps {
|
|
8
17
|
/** The component instance to inject */
|
|
9
18
|
component: ComponentInstance | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-component.d.ts","sourceRoot":"","sources":["../../../js/shared/dynamic-component/dynamic-component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic-component.d.ts","sourceRoot":"","sources":["../../../js/shared/dynamic-component/dynamic-component.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA2C,MAAM,SAAS,CAAC;AAC1G,OAAO,EAAoB,KAAK,aAAa,EAA8C,MAAM,cAAc,CAAC;AA6DhH;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC,EACvD,UAAU,EAAE,SAAS,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC,CA6Cf;AA4ID,UAAU,qBAAqB;IAC3B,uCAAuC;IACvC,SAAS,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;CACnD;AA8BD;;;;;;;GAOG;AACH,iBAAS,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,KAAK,CAAC,SAAS,CA0IvE;;AAkED,wBAAsC"}
|