@ebubekirylmaz/link-test 1.2.44 → 1.2.45

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.
Files changed (73) hide show
  1. package/package.json +9 -6
  2. package/src/Platform.jsx +14 -15
  3. package/src/config/schemas.js +1 -0
  4. package/src/context/Context.js +98 -0
  5. package/src/context/reducer.js +590 -10
  6. package/src/hooks/index.js +2 -1
  7. package/src/hooks/use-beta.js +8 -0
  8. package/src/layouts/auth/modern.jsx +4 -2
  9. package/src/layouts/common/account-popover.jsx +1 -2
  10. package/src/lib/APIDialogAction/APIDialogAction.jsx +109 -0
  11. package/src/lib/APIDialogAction/index.js +1 -0
  12. package/src/lib/APIDialogAction/styles.js +6 -0
  13. package/src/lib/APIParams/APIParams.jsx +57 -0
  14. package/src/lib/APIParams/index.js +1 -0
  15. package/src/lib/APIPath/APIPath.jsx +82 -0
  16. package/src/lib/APIPath/index.js +1 -0
  17. package/src/lib/APIPath/styles.js +19 -0
  18. package/src/lib/APITree/APITree.jsx +409 -0
  19. package/src/lib/APITree/Arrow.jsx +21 -0
  20. package/src/lib/APITree/DeleteMethodDialog.jsx +41 -0
  21. package/src/lib/APITree/index.js +1 -0
  22. package/src/lib/APITree/styles.js +19 -0
  23. package/src/lib/APITypes/APITypes.jsx +141 -0
  24. package/src/lib/APITypes/TypeEditor.jsx +46 -0
  25. package/src/lib/APITypes/TypeList.jsx +180 -0
  26. package/src/lib/APITypes/index.js +1 -0
  27. package/src/lib/BlankTreeMessage/BlankTreeMessage.jsx +39 -0
  28. package/src/lib/BlankTreeMessage/index.js +1 -0
  29. package/src/lib/DialogTootip/DialogTooltip.jsx +67 -0
  30. package/src/lib/DialogTootip/index.js +1 -0
  31. package/src/lib/DialogTootip/styles.js +9 -0
  32. package/src/lib/Flow/connectors/DynamicConnector.jsx +179 -107
  33. package/src/lib/Flow/core/Flow.jsx +2 -0
  34. package/src/lib/Flow/core/FlowNode.jsx +2 -0
  35. package/src/lib/Flow/core/FlowViewport.jsx +41 -9
  36. package/src/lib/Flow/hooks/useNodeStyle.js +14 -0
  37. package/src/lib/Flow/nodes/FlowNodeView.jsx +105 -21
  38. package/src/lib/Flow/styles.js +4 -0
  39. package/src/lib/NewApiBody/NewAPIBody.jsx +97 -0
  40. package/src/lib/NewApiBody/ParamView.jsx +38 -0
  41. package/src/lib/NucDialog/NucDialog.jsx +108 -0
  42. package/src/lib/NucDialog/index.js +1 -0
  43. package/src/lib/ParamTable/ParamTable.jsx +133 -0
  44. package/src/lib/ParamTable/TypeMenu.jsx +102 -0
  45. package/src/lib/ParamTable/defaults.js +47 -0
  46. package/src/lib/ParamTable/index.js +1 -0
  47. package/src/lib/ParamTable/styles.js +12 -0
  48. package/src/lib/ResourceMenu/AlertMassage.jsx +28 -0
  49. package/src/lib/ResourceMenu/DeleteResourceDialog.jsx +60 -0
  50. package/src/lib/ResourceMenu/ResourceMenu.jsx +156 -0
  51. package/src/lib/ResourceMenu/index.js +1 -0
  52. package/src/lib/ResourceMenu/styles.js +5 -0
  53. package/src/lib/Schema/Schema.jsx +204 -0
  54. package/src/lib/Schema/index.js +1 -0
  55. package/src/lib/SchemaEditor/SchemaEditor.jsx +258 -0
  56. package/src/lib/SchemaEditor/SchemaEditor.test.js +193 -0
  57. package/src/lib/SchemaEditor/SchemaPropertyEditor.jsx +135 -0
  58. package/src/lib/SchemaEditor/SchemaUtils.js +152 -0
  59. package/src/lib/SchemaEditor/index.js +1 -0
  60. package/src/lib/ToggleableMenu/ToggleableMenu.jsx +35 -0
  61. package/src/lib/ToggleableMenu/index.js +1 -0
  62. package/src/lib/index.js +14 -0
  63. package/src/pages/Callback.jsx +6 -8
  64. package/src/pages/LoginPage.jsx +3 -12
  65. package/src/stories/APITree.stories.jsx +429 -0
  66. package/src/stories/FlowChart.stories.jsx +1 -1
  67. package/src/templates/ActionTemplate.js +24 -0
  68. package/src/widgets/Login/CognitoLogin.jsx +163 -179
  69. package/src/widgets/Login/DemoLogin.jsx +9 -7
  70. package/src/widgets/Login/amplifyAuth.js +6 -6
  71. package/src/widgets/Login/amplifyConfig.js +3 -0
  72. package/src/widgets/LoginForm/LoginForm.jsx +8 -3
  73. package/src/widgets/SettingsDialog.jsx +171 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebubekirylmaz/link-test",
3
- "version": "1.2.44",
3
+ "version": "1.2.45",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -26,11 +26,14 @@
26
26
  "@emoji-mart/data": "^1.1.2",
27
27
  "@emoji-mart/react": "^1.1.1",
28
28
  "@emotion/react": "^11.13.3",
29
+ "@emotion/styled": "^11.11.5",
29
30
  "@iconify/react": "^5.0.1",
30
- "@mui/icons-material": "^5.16.4",
31
- "@mui/lab": "^5.0.0-alpha.172",
32
- "@mui/material": "^5.16.4",
33
- "@mui/x-date-pickers": "^7.10.0",
31
+ "@mui/icons-material": "^7.3.9",
32
+ "@mui/lab": "^7.0.0-beta.17",
33
+ "@mui/material": "^7.3.9",
34
+ "@mui/x-data-grid": "^8.28.2",
35
+ "@mui/x-date-pickers": "^8.27.2",
36
+ "@mui/x-tree-view": "^8.27.2",
34
37
  "@nucleoidai/react-event": "^1.1.9",
35
38
  "@nucleoidjs/webstorage": "^1.0.5",
36
39
  "autosuggest-highlight": "^3.3.4",
@@ -45,7 +48,7 @@
45
48
  "joi": "^17.13.3",
46
49
  "jwt-decode": "^4.0.0",
47
50
  "mapbox-gl": "^2.15.0",
48
- "mui-one-time-password-input": "^2.0.3",
51
+ "mui-one-time-password-input": "^5.0.0",
49
52
  "notistack": "^3.0.1",
50
53
  "nprogress": "^0.2.0",
51
54
  "numeral": "^2.0.6",
package/src/Platform.jsx CHANGED
@@ -1,7 +1,6 @@
1
1
  import "./global.css";
2
2
  import "./widgets/Login/amplifyAuth";
3
3
 
4
- import ContextProvider from "./ContextProvider/ContextProvider";
5
4
  import GlobalSnackMessage from "./GlobalSnackMessage/GlobalSnackMessage";
6
5
  import React from "react";
7
6
  import RouteManager from "./RouteManager/RouteManager";
@@ -16,12 +15,13 @@ import { init } from "./config/config";
16
15
  import oauth from "./http/oauth";
17
16
 
18
17
  import { BrowserRouter, Navigate } from "react-router-dom";
19
- import { initialState, reducer } from "./context/reducer";
20
18
  import { publish, subscribe, useEvent } from "@nucleoidai/react-event";
21
19
 
22
20
  init();
23
21
 
24
- configureAmplify();
22
+ if (config().credentials?.provider === "COGNITO") {
23
+ configureAmplify();
24
+ }
25
25
 
26
26
  window["@nucleoidai"] = {
27
27
  Event: { publish, subscribe, useEvent },
@@ -51,6 +51,7 @@ const Platform = ({ routes }) => {
51
51
  themeLayout: "vertical",
52
52
  themeColorPresets: template.theme.colorPresets || "default",
53
53
  themeStretch: false,
54
+ beta: false,
54
55
  }}
55
56
  >
56
57
  <ThemeProvider>
@@ -58,18 +59,16 @@ const Platform = ({ routes }) => {
58
59
  {configInitError.error !== "" && (
59
60
  <Navigate to="/config-error" state={configInitError} />
60
61
  )}
61
- <ContextProvider reducer={reducer} state={initialState}>
62
- <SnackbarProvider
63
- anchorOrigin={{
64
- vertical: "top",
65
- horizontal: "right",
66
- }}
67
- >
68
- <SettingsDrawer />
69
- <GlobalSnackMessage />
70
- <RouteManager routes={routes} />
71
- </SnackbarProvider>
72
- </ContextProvider>
62
+ <SnackbarProvider
63
+ anchorOrigin={{
64
+ vertical: "top",
65
+ horizontal: "right",
66
+ }}
67
+ >
68
+ <SettingsDrawer />
69
+ <GlobalSnackMessage />
70
+ <RouteManager routes={routes} />
71
+ </SnackbarProvider>
73
72
  </BrowserRouter>
74
73
  </ThemeProvider>
75
74
  </SettingsProvider>
@@ -15,6 +15,7 @@ export const ConfigSchema = Joi.object({
15
15
  region: Joi.string().optional(),
16
16
  userPoolId: Joi.string().optional(),
17
17
  clientId: Joi.string().optional(),
18
+ requestUrl: Joi.string().uri().optional(),
18
19
  }).optional(),
19
20
  project: Joi.object({
20
21
  nucleoid: Joi.object().optional(),
@@ -0,0 +1,98 @@
1
+ class Context {
2
+ constructor(data = {}) {
3
+ this.login = data.login !== undefined ? data.login : false;
4
+ this.itemId = data.itemId || null;
5
+
6
+ this.specification = {
7
+ api: [],
8
+ functions: [],
9
+ types: [],
10
+ declarations: [],
11
+ ...(data.specification || {}),
12
+ };
13
+
14
+ this.pages = {
15
+ api: {
16
+ selected: { path: "/", method: "get" },
17
+ dialog: {
18
+ type: null,
19
+ action: null,
20
+ open: false,
21
+ view: null,
22
+ map: {},
23
+ params: {},
24
+ },
25
+ resourceMenu: {
26
+ open: false,
27
+ anchor: null,
28
+ path: null,
29
+ },
30
+ ...(data.pages?.api || {}),
31
+ },
32
+ functions: {
33
+ selected: null,
34
+ dialog: {
35
+ type: null,
36
+ open: false,
37
+ },
38
+ AIDialog: {
39
+ open: false,
40
+ },
41
+ ...(data.pages?.functions || {}),
42
+ },
43
+ logic: {
44
+ selected: null,
45
+ AIDialog: {
46
+ open: false,
47
+ },
48
+ ...(data.pages?.logic || {}),
49
+ },
50
+ query: {
51
+ results: null,
52
+ ...(data.pages?.query || {}),
53
+ },
54
+ ...(data.pages || {}),
55
+ };
56
+ }
57
+
58
+ static copy(context) {
59
+ const copied = new Context();
60
+
61
+ copied.login = context.login;
62
+ copied.itemId = context.itemId;
63
+
64
+ copied.specification = {
65
+ api: context.specification?.api ? [...context.specification.api] : [],
66
+ functions: context.specification?.functions
67
+ ? [...context.specification.functions]
68
+ : [],
69
+ types: context.specification?.types
70
+ ? [...context.specification.types]
71
+ : [],
72
+ declarations: context.specification?.declarations
73
+ ? [...context.specification.declarations]
74
+ : [],
75
+ };
76
+
77
+ copied.pages = JSON.parse(JSON.stringify(context.pages || {}));
78
+
79
+ return copied;
80
+ }
81
+
82
+ get(path) {
83
+ const keys = path.split(".");
84
+ let result = this;
85
+
86
+ for (const key of keys) {
87
+ if (result && typeof result === "object" && key in result) {
88
+ result = result[key];
89
+ } else {
90
+ return undefined;
91
+ }
92
+ }
93
+
94
+ return result;
95
+ }
96
+ }
97
+
98
+ export default Context;