test-nucleoid 1.0.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/.babelrc +3 -0
- package/.browserslistrc +1 -0
- package/.env +2 -0
- package/.eslintignore +3 -0
- package/.eslintrc.json +58 -0
- package/.gitattributes +1 -0
- package/.github/workflows/publish.yml +66 -0
- package/.prettierignore +1 -0
- package/.prettierrc +10 -0
- package/.storybook/main.js +15 -0
- package/.storybook/preview.js +17 -0
- package/.storybook/vitest.setup.js +6 -0
- package/README.md +1 -0
- package/cypress.config.js +11 -0
- package/index.js +1 -0
- package/package.json +795 -0
- package/project/.eslintrc.cjs +22 -0
- package/project/config.js +18 -0
- package/project/config.menu.js +39 -0
- package/project/config.template.js +31 -0
- package/project/cypress/e2e/layouts.cy.js +170 -0
- package/project/cypress/e2e/login.cy.js +35 -0
- package/project/cypress/e2e/selectbar.cy.js +80 -0
- package/project/cypress/fixtures/CONFIG/MENU_CONFIG.js +39 -0
- package/project/cypress/fixtures/EMPEROR/EMPERORS_GET.json +51 -0
- package/project/cypress/fixtures/EMPEROR/EMPERORS_POST.json +9 -0
- package/project/cypress/fixtures/OAUTH/GITHUB/user.json +46 -0
- package/project/cypress/fixtures/example.json +5 -0
- package/project/cypress/support/commands.js +104 -0
- package/project/cypress/support/e2e.js +1 -0
- package/project/cypress.config.js +10 -0
- package/project/index.html +12 -0
- package/project/media/ProjectIcons/3d.png +0 -0
- package/project/media/ProjectIcons/box.png +0 -0
- package/project/media/ProjectIcons/cafe.png +0 -0
- package/project/media/ProjectIcons/cargo.png +0 -0
- package/project/media/ProjectIcons/cloud.png +0 -0
- package/project/media/ProjectIcons/code.png +0 -0
- package/project/media/ProjectIcons/company.png +0 -0
- package/project/media/ProjectIcons/conversation.png +0 -0
- package/project/media/ProjectIcons/distributed.png +0 -0
- package/project/media/ProjectIcons/fingerprint.png +0 -0
- package/project/media/ProjectIcons/forest.png +0 -0
- package/project/media/ProjectIcons/headphones.png +0 -0
- package/project/media/ProjectIcons/office.png +0 -0
- package/project/media/ProjectIcons/path.png +0 -0
- package/project/media/ProjectIcons/printer.png +0 -0
- package/project/media/ProjectIcons/project.png +0 -0
- package/project/media/ProjectIcons/resume.png +0 -0
- package/project/media/ProjectIcons/rocket.png +0 -0
- package/project/media/ProjectIcons/rtruck.png +0 -0
- package/project/media/ProjectIcons/sign.png +0 -0
- package/project/media/ProjectIcons/site.png +0 -0
- package/project/media/ProjectIcons/truck.png +0 -0
- package/project/media/logo.png +0 -0
- package/project/package-lock.json +22434 -0
- package/project/package.json +42 -0
- package/project/public/assets/background/overlay_2.jpg +0 -0
- package/project/public/assets/illustrations/illustration_dashboard.png +0 -0
- package/project/public/media/largeLogo.png +0 -0
- package/project/public/media/logo.png +0 -0
- package/project/public/vite.svg +1 -0
- package/project/routes.jsx +47 -0
- package/project/server/mock.json +110 -0
- package/project/server/oauthMock.js +27 -0
- package/project/server/package-lock.json +1505 -0
- package/project/server/package.json +20 -0
- package/project/server/server.js +127 -0
- package/project/src/Container.jsx +7 -0
- package/project/src/components/ActionButton.jsx +18 -0
- package/project/src/hooks/useEmperor.jsx +21 -0
- package/project/src/http/index.js +39 -0
- package/project/src/main.jsx +10 -0
- package/project/src/pages/Battles.jsx +16 -0
- package/project/src/pages/Emperor.jsx +50 -0
- package/project/src/pages/index.jsx +33 -0
- package/project/src/theme.js +151 -0
- package/project/src/widgets/ActionButton.jsx +68 -0
- package/project/src/widgets/AddNewEmperor.jsx +120 -0
- package/project/src/widgets/ProjectContainer.jsx +27 -0
- package/project/vite.config.js +6 -0
- package/project/vite.config.js.timestamp-1709564450418-45fdd27900806.mjs +341 -0
- package/public/assets/background/overlay_2.jpg +0 -0
- package/public/assets/illustrations/illustration_dashboard.png +0 -0
- package/public/vite.svg +1 -0
- package/src/ContextProvider/ContextProvider.jsx +19 -0
- package/src/GlobalSnackMessage/GlobalSnackMessage.jsx +45 -0
- package/src/GlobalSnackMessage/index.js +1 -0
- package/src/GlobalSnackMessage/styles.js +3 -0
- package/src/Platform.jsx +76 -0
- package/src/RouteManager/RouteManager.jsx +56 -0
- package/src/RouteManager/index.js +1 -0
- package/src/assets/illustrations/avatar-shape.jsx +31 -0
- package/src/assets/illustrations/background-shape.jsx +37 -0
- package/src/assets/illustrations/booking-illustration.jsx +335 -0
- package/src/assets/illustrations/check-in-illustration.jsx +96 -0
- package/src/assets/illustrations/check-out-illustration.jsx +69 -0
- package/src/assets/illustrations/coming-soon-illustration.jsx +125 -0
- package/src/assets/illustrations/forbidden-illustration.jsx +95 -0
- package/src/assets/illustrations/index.js +2 -0
- package/src/assets/illustrations/maintenance-illustration.jsx +228 -0
- package/src/assets/illustrations/motivation-illustration.jsx +74 -0
- package/src/assets/illustrations/order-complete-illustration.jsx +126 -0
- package/src/assets/illustrations/page-not-found-illustration.jsx +81 -0
- package/src/assets/illustrations/seo-illustration.jsx +244 -0
- package/src/assets/illustrations/sever-error-illustration.jsx +152 -0
- package/src/assets/illustrations/upgrade-storage-illustration.jsx +161 -0
- package/src/assets/illustrations/upload-illustration.jsx +622 -0
- package/src/components/Iconify/Iconify.jsx +18 -0
- package/src/components/Iconify/index.js +1 -0
- package/src/components/MiniTopBar/MiniTopBar.jsx +25 -0
- package/src/components/MiniTopBar/index.js +1 -0
- package/src/components/MiniTopBar/styles.js +6 -0
- package/src/components/NucleoidLoginForm/NucleoidLoginForm.jsx +69 -0
- package/src/components/NucleoidLoginForm/index.js +1 -0
- package/src/components/NucleoidLoginForm/styles.js +3 -0
- package/src/components/Sidebar/Sidebar.jsx +76 -0
- package/src/components/Sidebar/index.js +1 -0
- package/src/components/Sidebar/styles.js +25 -0
- package/src/components/SocialLoginButtons/SocialLoginButtons.jsx +55 -0
- package/src/components/SocialLoginButtons/index.js +1 -0
- package/src/components/SocialLoginButtons/styles.js +3 -0
- package/src/components/TopNavBar/TopNavBar.jsx +186 -0
- package/src/components/TopNavBar/index.js +1 -0
- package/src/components/TopNavBar/styles.js +7 -0
- package/src/components/animate/index.js +4 -0
- package/src/components/animate/motion-container.jsx +38 -0
- package/src/components/animate/motion-lazy.jsx +11 -0
- package/src/components/animate/motion-viewport.jsx +30 -0
- package/src/components/animate/variants/actions.js +4 -0
- package/src/components/animate/variants/background.js +97 -0
- package/src/components/animate/variants/bounce.js +107 -0
- package/src/components/animate/variants/container.js +20 -0
- package/src/components/animate/variants/fade.js +127 -0
- package/src/components/animate/variants/flip.js +54 -0
- package/src/components/animate/variants/index.js +12 -0
- package/src/components/animate/variants/path.js +12 -0
- package/src/components/animate/variants/rotate.js +33 -0
- package/src/components/animate/variants/scale.js +54 -0
- package/src/components/animate/variants/slide.js +65 -0
- package/src/components/animate/variants/transition.js +20 -0
- package/src/components/animate/variants/zoom.js +130 -0
- package/src/components/chart/chart.js +69 -0
- package/src/components/chart/index.js +5 -0
- package/src/components/chart/use-chart.js +215 -0
- package/src/components/custom-popover/custom-popover.jsx +46 -0
- package/src/components/custom-popover/index.js +3 -0
- package/src/components/custom-popover/styles.js +84 -0
- package/src/components/custom-popover/use-popover.js +22 -0
- package/src/components/custom-popover/utils.js +100 -0
- package/src/components/file-thumbnail/download-button.jsx +39 -0
- package/src/components/file-thumbnail/file-thumbnail.jsx +72 -0
- package/src/components/file-thumbnail/index.js +5 -0
- package/src/components/file-thumbnail/utils.js +148 -0
- package/src/components/image/image.jsx +119 -0
- package/src/components/image/index.js +1 -0
- package/src/components/image/utils.js +15 -0
- package/src/components/label/index.js +1 -0
- package/src/components/label/label.jsx +51 -0
- package/src/components/label/styles.js +78 -0
- package/src/components/loading-screen/index.js +2 -0
- package/src/components/loading-screen/loading-screen.jsx +23 -0
- package/src/components/loading-screen/splash-screen.jsx +95 -0
- package/src/components/logo/index.js +1 -0
- package/src/components/logo/logo.jsx +61 -0
- package/src/components/logo/styles.js +17 -0
- package/src/components/nav-section/horizontal/index.js +1 -0
- package/src/components/nav-section/horizontal/nav-item.jsx +224 -0
- package/src/components/nav-section/horizontal/nav-list.jsx +113 -0
- package/src/components/nav-section/horizontal/nav-section-horizontal.jsx +41 -0
- package/src/components/nav-section/index.js +3 -0
- package/src/components/nav-section/mini/index.js +1 -0
- package/src/components/nav-section/mini/nav-item.jsx +242 -0
- package/src/components/nav-section/mini/nav-list.jsx +107 -0
- package/src/components/nav-section/mini/nav-section-mini.jsx +35 -0
- package/src/components/nav-section/vertical/index.js +1 -0
- package/src/components/nav-section/vertical/nav-item.jsx +294 -0
- package/src/components/nav-section/vertical/nav-list.jsx +66 -0
- package/src/components/nav-section/vertical/nav-section-vertical.jsx +74 -0
- package/src/components/scrollbar/index.js +1 -0
- package/src/components/scrollbar/scrollbar.jsx +39 -0
- package/src/components/scrollbar/styles.js +27 -0
- package/src/components/search-not-found/index.js +1 -0
- package/src/components/search-not-found/search-not-found.jsx +29 -0
- package/src/components/settings/context/index.js +2 -0
- package/src/components/settings/context/settings-context.js +14 -0
- package/src/components/settings/context/settings-provider.jsx +46 -0
- package/src/components/settings/drawer/base-option.jsx +52 -0
- package/src/components/settings/drawer/fullscreen-option.jsx +58 -0
- package/src/components/settings/drawer/index.js +1 -0
- package/src/components/settings/drawer/layout-options.jsx +144 -0
- package/src/components/settings/drawer/presets-options.jsx +53 -0
- package/src/components/settings/drawer/settings-drawer.jsx +189 -0
- package/src/components/settings/drawer/stretch-options.jsx +67 -0
- package/src/components/settings/index.js +3 -0
- package/src/components/svg-color/index.js +1 -0
- package/src/components/svg-color/svg-color.jsx +23 -0
- package/src/config/config.js +47 -0
- package/src/config/schemas.js +148 -0
- package/src/context/Context.js +98 -0
- package/src/context/reducer.js +632 -0
- package/src/global.css +2 -0
- package/src/hooks/index.js +2 -0
- package/src/hooks/use-boolean.js +27 -0
- package/src/hooks/use-event-listener.js +34 -0
- package/src/hooks/use-local-storage.js +89 -0
- package/src/hooks/use-off-set-top.js +37 -0
- package/src/hooks/use-responsive.js +47 -0
- package/src/hooks/use-scroll-to-top.js +14 -0
- package/src/hooks/use-user.js +58 -0
- package/src/hooks/useApi.js +25 -0
- package/src/hooks/useItemsState.js +23 -0
- package/src/hooks/useProjects.js +24 -0
- package/src/hooks/useSettings.jsx +51 -0
- package/src/http/index.js +166 -0
- package/src/http/oauth.js +27 -0
- package/src/http/user.js +110 -0
- package/src/layouts/AppLayout.jsx +113 -0
- package/src/layouts/CompactLayout/CompactLayout.jsx +32 -0
- package/src/layouts/CompactLayout/index.js +1 -0
- package/src/layouts/DashboardLayout/DashboardLayout.jsx +87 -0
- package/src/layouts/DashboardLayout/config-navigation.jsx +0 -0
- package/src/layouts/DashboardLayout/header.jsx +104 -0
- package/src/layouts/DashboardLayout/index.js +2 -0
- package/src/layouts/DashboardLayout/main.jsx +64 -0
- package/src/layouts/DashboardLayout/nav-horizontal.jsx +62 -0
- package/src/layouts/DashboardLayout/nav-mini.jsx +99 -0
- package/src/layouts/DashboardLayout/nav-vertical.jsx +201 -0
- package/src/layouts/FullScreenLayout/FullScreenLayout.jsx +101 -0
- package/src/layouts/FullScreenLayout/index.js +1 -0
- package/src/layouts/FullScreenLayout/nav-horizontal.jsx +50 -0
- package/src/layouts/FullScreenLayout/nav-vertical.jsx +136 -0
- package/src/layouts/MainLayout/MainLayout.jsx +21 -0
- package/src/layouts/MainLayout/footer.jsx +153 -0
- package/src/layouts/MainLayout/header.jsx +81 -0
- package/src/layouts/MainLayout/index.js +1 -0
- package/src/layouts/MainLayout/nav/desktop/index.jsx +20 -0
- package/src/layouts/MainLayout/nav/desktop/nav-item.jsx +186 -0
- package/src/layouts/MainLayout/nav/desktop/nav-list.jsx +145 -0
- package/src/layouts/MainLayout/nav/mobile/index.jsx +60 -0
- package/src/layouts/MainLayout/nav/mobile/nav-item.jsx +90 -0
- package/src/layouts/MainLayout/nav/mobile/nav-list.jsx +72 -0
- package/src/layouts/Page.jsx +16 -0
- package/src/layouts/SimpleLayout/SimpleLayout.jsx +8 -0
- package/src/layouts/SimpleLayout/index.js +1 -0
- package/src/layouts/TwoSideLayout/TwoSideLayout.jsx +31 -0
- package/src/layouts/TwoSideLayout/index.js +1 -0
- package/src/layouts/auth/classic.jsx +95 -0
- package/src/layouts/auth/modern-compact.jsx +51 -0
- package/src/layouts/auth/modern.jsx +110 -0
- package/src/layouts/common/ProjectBar/index.jsx +338 -0
- package/src/layouts/common/ProjectBar/result-item.jsx +90 -0
- package/src/layouts/common/ProjectBar/utils.js +86 -0
- package/src/layouts/common/account-popover.jsx +119 -0
- package/src/layouts/common/header-shadow.jsx +26 -0
- package/src/layouts/common/header-sim.jsx +52 -0
- package/src/layouts/common/header-simple.jsx +76 -0
- package/src/layouts/common/nav-toggle-button.jsx +57 -0
- package/src/layouts/common/notifications-popover/index.jsx +177 -0
- package/src/layouts/common/notifications-popover/notification-item.jsx +252 -0
- package/src/layouts/common/settings-button.jsx +48 -0
- package/src/layouts/config-layout.js +12 -0
- package/src/layouts/index.js +7 -0
- package/src/lib/APIDialogAction/APIDialogAction.jsx +109 -0
- package/src/lib/APIDialogAction/index.js +1 -0
- package/src/lib/APIDialogAction/styles.js +6 -0
- package/src/lib/APIParams/APIParams.jsx +57 -0
- package/src/lib/APIParams/index.js +1 -0
- package/src/lib/APIPath/APIPath.jsx +82 -0
- package/src/lib/APIPath/index.js +1 -0
- package/src/lib/APIPath/styles.js +19 -0
- package/src/lib/APITree/APITree.jsx +418 -0
- package/src/lib/APITree/Arrow.jsx +21 -0
- package/src/lib/APITree/DeleteMethodDialog.jsx +41 -0
- package/src/lib/APITree/index.js +1 -0
- package/src/lib/APITree/styles.js +19 -0
- package/src/lib/APITypes/APITypes.jsx +151 -0
- package/src/lib/APITypes/TypeEditor.jsx +46 -0
- package/src/lib/APITypes/TypeList.jsx +178 -0
- package/src/lib/APITypes/index.js +1 -0
- package/src/lib/AddItemWizard/AddItemWizard.jsx +211 -0
- package/src/lib/AddItemWizard/index.js +1 -0
- package/src/lib/BlankTreeMessage/BlankTreeMessage.jsx +39 -0
- package/src/lib/BlankTreeMessage/index.js +1 -0
- package/src/lib/CustomBreadcrumbs/CustomBreadcrumbs.jsx +88 -0
- package/src/lib/CustomBreadcrumbs/index.js +1 -0
- package/src/lib/CustomBreadcrumbs/link-item.jsx +58 -0
- package/src/lib/CustomPopover/CustomPopover.jsx +46 -0
- package/src/lib/CustomPopover/index.js +3 -0
- package/src/lib/CustomPopover/styles.js +82 -0
- package/src/lib/CustomPopover/usePopover.js +20 -0
- package/src/lib/CustomPopover/utils.js +100 -0
- package/src/lib/DialogTootip/DialogTooltip.jsx +67 -0
- package/src/lib/DialogTootip/index.js +1 -0
- package/src/lib/DialogTootip/styles.js +9 -0
- package/src/lib/Flow/connectors/DynamicConnector.jsx +319 -0
- package/src/lib/Flow/core/Flow.jsx +79 -0
- package/src/lib/Flow/core/FlowNode.jsx +68 -0
- package/src/lib/Flow/core/FlowViewport.jsx +259 -0
- package/src/lib/Flow/graph/FloatingGraph.jsx +44 -0
- package/src/lib/Flow/hooks/useGraphOperations.js +362 -0
- package/src/lib/Flow/hooks/useNodeStyle.js +70 -0
- package/src/lib/Flow/index.js +1 -0
- package/src/lib/Flow/layouts/ActionNode.jsx +78 -0
- package/src/lib/Flow/layouts/AnimatedNode.jsx +22 -0
- package/src/lib/Flow/layouts/CardLayout.jsx +397 -0
- package/src/lib/Flow/layouts/InfoNode.jsx +255 -0
- package/src/lib/Flow/layouts/LoadingNode.jsx +37 -0
- package/src/lib/Flow/nodes/DefaultCard.jsx +107 -0
- package/src/lib/Flow/nodes/DraggableNode.jsx +162 -0
- package/src/lib/Flow/nodes/FlowNodeView.jsx +298 -0
- package/src/lib/Flow/selection/SelectionContext.jsx +259 -0
- package/src/lib/Flow/selection/SelectionOverlay.jsx +31 -0
- package/src/lib/Flow/styles.js +158 -0
- package/src/lib/Flow/utils/flowUtils.js +268 -0
- package/src/lib/FormProvider/FormProvider.jsx +16 -0
- package/src/lib/FormProvider/index.js +1 -0
- package/src/lib/IconSelector/IconSelector.jsx +89 -0
- package/src/lib/Iconify/Iconify.jsx +17 -0
- package/src/lib/Iconify/index.js +1 -0
- package/src/lib/Image/Image.jsx +116 -0
- package/src/lib/Image/index.js +1 -0
- package/src/lib/Image/utils.js +15 -0
- package/src/lib/ItemSummary/ItemSummary.jsx +78 -0
- package/src/lib/ItemSummary/ItemsSummary.jsx +164 -0
- package/src/lib/Label/Label.jsx +51 -0
- package/src/lib/Label/index.js +1 -0
- package/src/lib/Label/styles.js +76 -0
- package/src/lib/NewApiBody/NewAPIBody.jsx +97 -0
- package/src/lib/NewApiBody/ParamView.jsx +38 -0
- package/src/lib/NucDialog/NucDialog.jsx +108 -0
- package/src/lib/NucDialog/index.js +1 -0
- package/src/lib/ParamTable/ParamTable.jsx +133 -0
- package/src/lib/ParamTable/TypeMenu.jsx +102 -0
- package/src/lib/ParamTable/defaults.js +47 -0
- package/src/lib/ParamTable/index.js +1 -0
- package/src/lib/ParamTable/styles.js +12 -0
- package/src/lib/ProjectWizard.jsx +137 -0
- package/src/lib/RHFTextfield/RHFTextfield.jsx +40 -0
- package/src/lib/RHFTextfield/index.js +1 -0
- package/src/lib/ResourceMenu/AlertMassage.jsx +28 -0
- package/src/lib/ResourceMenu/DeleteResourceDialog.jsx +60 -0
- package/src/lib/ResourceMenu/ResourceMenu.jsx +165 -0
- package/src/lib/ResourceMenu/index.js +1 -0
- package/src/lib/ResourceMenu/styles.js +5 -0
- package/src/lib/Schema/Schema.jsx +204 -0
- package/src/lib/Schema/index.js +1 -0
- package/src/lib/SchemaEditor/SchemaEditor.jsx +258 -0
- package/src/lib/SchemaEditor/SchemaEditor.test.js +193 -0
- package/src/lib/SchemaEditor/SchemaPropertyEditor.jsx +135 -0
- package/src/lib/SchemaEditor/SchemaUtils.js +152 -0
- package/src/lib/SchemaEditor/index.js +1 -0
- package/src/lib/Scrollbar/Scrollbar.jsx +39 -0
- package/src/lib/Scrollbar/index.js +1 -0
- package/src/lib/Scrollbar/styles.js +27 -0
- package/src/lib/SearchNotFound/SearchNotFound.jsx +29 -0
- package/src/lib/SearchNotFound/index.js +1 -0
- package/src/lib/SparkleInput/SparkleInput.jsx +51 -0
- package/src/lib/StepComponent/StepComponent.jsx +98 -0
- package/src/lib/SvgColor/SvgColor.jsx +29 -0
- package/src/lib/SvgColor/index.js +1 -0
- package/src/lib/TableHeadCustom/TableHeadCustom.jsx +87 -0
- package/src/lib/TableHeadCustom/index.js +1 -0
- package/src/lib/TableSelectedAction/TableSelectedAction.jsx +72 -0
- package/src/lib/TableSelectedAction/index.js +1 -0
- package/src/lib/ToggleableMenu/ToggleableMenu.jsx +35 -0
- package/src/lib/ToggleableMenu/index.js +1 -0
- package/src/lib/index.js +50 -0
- package/src/lib/lib/Icons.js +40 -0
- package/src/lib/lib/context.json +272 -0
- package/src/lib/useChart/useChart.js +180 -0
- package/src/lib/useTable/useTable.js +121 -0
- package/src/pages/404.jsx +17 -0
- package/src/pages/Callback.jsx +126 -0
- package/src/pages/ConfigError.jsx +49 -0
- package/src/pages/LoginPage.jsx +52 -0
- package/src/routes/components/index.js +1 -0
- package/src/routes/components/router-link.jsx +11 -0
- package/src/routes/hooks/index.js +4 -0
- package/src/routes/hooks/use-active-link.js +15 -0
- package/src/routes/hooks/use-pathname.js +10 -0
- package/src/routes/hooks/use-router.js +21 -0
- package/src/stories/APITree.stories.jsx +332 -0
- package/src/stories/FlowChart.stories.jsx +333 -0
- package/src/stories/Iconify.stories.jsx +183 -0
- package/src/stories/Label.stories.jsx +447 -0
- package/src/stories/Navbar.stories.jsx +588 -0
- package/src/templates/ActionTemplate.js +24 -0
- package/src/theme/css.js +152 -0
- package/src/theme/custom-shadows.js +47 -0
- package/src/theme/index.jsx +100 -0
- package/src/theme/options/contrast.js +34 -0
- package/src/theme/options/presets.js +89 -0
- package/src/theme/options/right-to-left.jsx +26 -0
- package/src/theme/overrides/components/accordion.js +43 -0
- package/src/theme/overrides/components/alert.js +69 -0
- package/src/theme/overrides/components/appbar.js +13 -0
- package/src/theme/overrides/components/autocomplete.js +44 -0
- package/src/theme/overrides/components/avatar.js +111 -0
- package/src/theme/overrides/components/backdrop.js +18 -0
- package/src/theme/overrides/components/badge.js +90 -0
- package/src/theme/overrides/components/breadcrumbs.js +21 -0
- package/src/theme/overrides/components/button-group.js +90 -0
- package/src/theme/overrides/components/button.js +145 -0
- package/src/theme/overrides/components/card.js +30 -0
- package/src/theme/overrides/components/checkbox.js +13 -0
- package/src/theme/overrides/components/chip.js +129 -0
- package/src/theme/overrides/components/css-baseline.js +48 -0
- package/src/theme/overrides/components/data-grid.js +94 -0
- package/src/theme/overrides/components/date-picker.jsx +94 -0
- package/src/theme/overrides/components/dialog.js +49 -0
- package/src/theme/overrides/components/drawer.js +39 -0
- package/src/theme/overrides/components/fab.js +165 -0
- package/src/theme/overrides/components/list.js +33 -0
- package/src/theme/overrides/components/loading-button.js +30 -0
- package/src/theme/overrides/components/menu.js +15 -0
- package/src/theme/overrides/components/pagination.js +81 -0
- package/src/theme/overrides/components/paper.js +18 -0
- package/src/theme/overrides/components/popover.js +20 -0
- package/src/theme/overrides/components/progress.js +40 -0
- package/src/theme/overrides/components/radio.js +22 -0
- package/src/theme/overrides/components/rating.js +40 -0
- package/src/theme/overrides/components/select.js +26 -0
- package/src/theme/overrides/components/skeleton.js +16 -0
- package/src/theme/overrides/components/slider.js +30 -0
- package/src/theme/overrides/components/stepper.js +13 -0
- package/src/theme/overrides/components/svg-icon.js +15 -0
- package/src/theme/overrides/components/switch.js +66 -0
- package/src/theme/overrides/components/table.js +79 -0
- package/src/theme/overrides/components/tabs.js +39 -0
- package/src/theme/overrides/components/textfield.js +146 -0
- package/src/theme/overrides/components/timeline.js +20 -0
- package/src/theme/overrides/components/toggle-button.js +70 -0
- package/src/theme/overrides/components/tooltip.js +18 -0
- package/src/theme/overrides/components/tree-view.js +16 -0
- package/src/theme/overrides/components/typography.js +16 -0
- package/src/theme/overrides/default-props.jsx +238 -0
- package/src/theme/overrides/index.js +100 -0
- package/src/theme/palette.js +144 -0
- package/src/theme/shadows.js +41 -0
- package/src/theme/typography.js +107 -0
- package/src/utils/flatten-array.js +16 -0
- package/src/utils/format-number.js +37 -0
- package/src/utils/format-time.js +27 -0
- package/src/utils/storage-available.js +24 -0
- package/src/widgets/Login/CognitoLogin.jsx +45 -0
- package/src/widgets/Login/DemoLogin.jsx +178 -0
- package/src/widgets/Login/Login.jsx +58 -0
- package/src/widgets/Login/cognitoAuth.jsx +44 -0
- package/src/widgets/LoginForm/LoginForm.jsx +87 -0
- package/src/widgets/LoginForm/LoginFormStyles.js +43 -0
- package/src/widgets/LoginForm/index.js +1 -0
- package/src/widgets/SettingsDialog.jsx +433 -0
- package/src/widgets/error/index.js +1 -0
- package/src/widgets/error/not-found-view.jsx +42 -0
- package/vite/vite.js +86 -0
- package/vite.config.js +7 -0
- package/vitest.config.js +32 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import ParamView from "./ParamView";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import SchemaEditor from "../SchemaEditor";
|
|
4
|
+
|
|
5
|
+
import { Box, Divider, Paper, Typography } from "@mui/material";
|
|
6
|
+
|
|
7
|
+
const NewAPIBody = ({ types, api, requestSchemaRef, responseSchemaRef }) => {
|
|
8
|
+
return (
|
|
9
|
+
<Box
|
|
10
|
+
sx={{
|
|
11
|
+
display: "flex",
|
|
12
|
+
flexDirection: "row",
|
|
13
|
+
height: "85%",
|
|
14
|
+
p: 2,
|
|
15
|
+
}}
|
|
16
|
+
data-cy="api-body"
|
|
17
|
+
>
|
|
18
|
+
<Box
|
|
19
|
+
sx={{
|
|
20
|
+
flex: 1,
|
|
21
|
+
display: "flex",
|
|
22
|
+
flexDirection: "column",
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<Paper
|
|
26
|
+
elevation={3}
|
|
27
|
+
sx={{
|
|
28
|
+
width: "100%",
|
|
29
|
+
p: 2,
|
|
30
|
+
bgcolor: "background.paper",
|
|
31
|
+
borderRadius: 2,
|
|
32
|
+
height: "100%",
|
|
33
|
+
boxSizing: "border-box",
|
|
34
|
+
display: "flex",
|
|
35
|
+
flexDirection: "column",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
}}
|
|
39
|
+
data-cy="request-schema-editor"
|
|
40
|
+
>
|
|
41
|
+
{api.method === "GET" ? (
|
|
42
|
+
<Box sx={{ width: "100%", height: "100%" }}>
|
|
43
|
+
<ParamView params={api.params} />
|
|
44
|
+
</Box>
|
|
45
|
+
) : (
|
|
46
|
+
<SchemaEditor
|
|
47
|
+
ref={requestSchemaRef}
|
|
48
|
+
initialData={api.request ? api.request.schema : ""}
|
|
49
|
+
customTypes={types}
|
|
50
|
+
/>
|
|
51
|
+
)}
|
|
52
|
+
<Typography variant="h6" gutterBottom>
|
|
53
|
+
Request
|
|
54
|
+
</Typography>
|
|
55
|
+
</Paper>
|
|
56
|
+
</Box>
|
|
57
|
+
|
|
58
|
+
<Divider orientation="vertical" flexItem sx={{ width: "1rem" }} />
|
|
59
|
+
|
|
60
|
+
<Box
|
|
61
|
+
sx={{
|
|
62
|
+
flex: 1,
|
|
63
|
+
display: "flex",
|
|
64
|
+
flexDirection: "column",
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
<Paper
|
|
68
|
+
elevation={3}
|
|
69
|
+
sx={{
|
|
70
|
+
width: "100%",
|
|
71
|
+
p: 2,
|
|
72
|
+
bgcolor: "background.paper",
|
|
73
|
+
borderRadius: 2,
|
|
74
|
+
height: "100%",
|
|
75
|
+
boxSizing: "border-box",
|
|
76
|
+
display: "flex",
|
|
77
|
+
flexDirection: "column",
|
|
78
|
+
justifyContent: "center",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
}}
|
|
81
|
+
data-cy="response-schema-editor"
|
|
82
|
+
>
|
|
83
|
+
<SchemaEditor
|
|
84
|
+
ref={responseSchemaRef}
|
|
85
|
+
customTypes={types}
|
|
86
|
+
initialData={api.response ? api.response.schema : ""}
|
|
87
|
+
/>
|
|
88
|
+
<Typography variant="h6" gutterBottom>
|
|
89
|
+
Response
|
|
90
|
+
</Typography>
|
|
91
|
+
</Paper>
|
|
92
|
+
</Box>
|
|
93
|
+
</Box>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default NewAPIBody;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { v4 as uuid } from "uuid";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Table,
|
|
5
|
+
TableBody,
|
|
6
|
+
TableCell,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableRow,
|
|
9
|
+
} from "@mui/material";
|
|
10
|
+
|
|
11
|
+
function ParamView({ params }) {
|
|
12
|
+
params = params || [];
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Table size={"small"} data-cy="param-view">
|
|
16
|
+
<colgroup>
|
|
17
|
+
<col style={{ width: "50%" }} />
|
|
18
|
+
<col style={{ width: "50%" }} />
|
|
19
|
+
</colgroup>
|
|
20
|
+
<TableHead>
|
|
21
|
+
<TableRow>
|
|
22
|
+
<TableCell>Parameter</TableCell>
|
|
23
|
+
<TableCell>Data Type</TableCell>
|
|
24
|
+
</TableRow>
|
|
25
|
+
</TableHead>
|
|
26
|
+
<TableBody>
|
|
27
|
+
{params.map((param) => (
|
|
28
|
+
<TableRow key={uuid()}>
|
|
29
|
+
<TableCell>{param.name}</TableCell>
|
|
30
|
+
<TableCell>{param.type}</TableCell>
|
|
31
|
+
</TableRow>
|
|
32
|
+
))}
|
|
33
|
+
</TableBody>
|
|
34
|
+
</Table>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default ParamView;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Close } from "@mui/icons-material";
|
|
2
|
+
import Fullscreen from "@mui/icons-material/Fullscreen";
|
|
3
|
+
import FullscreenExit from "@mui/icons-material/FullscreenExit";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogActions,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
IconButton,
|
|
12
|
+
} from "@mui/material";
|
|
13
|
+
import { storage, useStorage } from "@nucleoidjs/webstorage";
|
|
14
|
+
|
|
15
|
+
export default function NucDialog({
|
|
16
|
+
title,
|
|
17
|
+
minWidth = 600,
|
|
18
|
+
children,
|
|
19
|
+
action,
|
|
20
|
+
open,
|
|
21
|
+
handleClose,
|
|
22
|
+
maximizedDimensions = { width: "65rem", height: "50rem" },
|
|
23
|
+
minimizedDimensions = { width: "55rem", height: "40rem" },
|
|
24
|
+
}) {
|
|
25
|
+
const [maximized] = useStorage("platform", title, "maximized", false);
|
|
26
|
+
const currentDimensions = maximized
|
|
27
|
+
? maximizedDimensions
|
|
28
|
+
: minimizedDimensions;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Dialog
|
|
32
|
+
open={open}
|
|
33
|
+
maxWidth={false}
|
|
34
|
+
onClose={handleClose}
|
|
35
|
+
sx={{
|
|
36
|
+
"& .MuiDialog-paper": {
|
|
37
|
+
width: currentDimensions.width,
|
|
38
|
+
height: currentDimensions.height,
|
|
39
|
+
transition: "width 0.3s ease-in-out, height 0.3s ease-in-out",
|
|
40
|
+
},
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<DialogTitle
|
|
44
|
+
sx={{
|
|
45
|
+
m: 0,
|
|
46
|
+
p: 2,
|
|
47
|
+
backgroundColor: (theme) => theme.palette.background.default,
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{title}
|
|
51
|
+
</DialogTitle>
|
|
52
|
+
<IconButton
|
|
53
|
+
aria-label="close"
|
|
54
|
+
onClick={handleClose}
|
|
55
|
+
sx={{
|
|
56
|
+
position: "absolute",
|
|
57
|
+
right: 8,
|
|
58
|
+
top: 8,
|
|
59
|
+
color: (theme) => theme.palette.grey[500],
|
|
60
|
+
}}
|
|
61
|
+
data-cy="close-dialog-button"
|
|
62
|
+
>
|
|
63
|
+
<Close />
|
|
64
|
+
</IconButton>
|
|
65
|
+
{maximized ? (
|
|
66
|
+
<IconButton
|
|
67
|
+
aria-label="collapse"
|
|
68
|
+
onClick={() => storage.set("platform", title, "maximized", false)}
|
|
69
|
+
sx={{
|
|
70
|
+
position: "absolute",
|
|
71
|
+
right: 48,
|
|
72
|
+
top: 8,
|
|
73
|
+
color: (theme) => theme.palette.grey[500],
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<FullscreenExit />
|
|
77
|
+
</IconButton>
|
|
78
|
+
) : (
|
|
79
|
+
<IconButton
|
|
80
|
+
aria-label="expand"
|
|
81
|
+
onClick={() => storage.set("platform", title, "maximized", true)}
|
|
82
|
+
sx={{
|
|
83
|
+
position: "absolute",
|
|
84
|
+
right: 48,
|
|
85
|
+
top: 8,
|
|
86
|
+
color: (theme) => theme.palette.grey[500],
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<Fullscreen />
|
|
90
|
+
</IconButton>
|
|
91
|
+
)}
|
|
92
|
+
|
|
93
|
+
<DialogContent
|
|
94
|
+
sx={{
|
|
95
|
+
minWidth,
|
|
96
|
+
backgroundColor: (theme) => theme.palette.background.default,
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{children}
|
|
100
|
+
</DialogContent>
|
|
101
|
+
<DialogActions
|
|
102
|
+
sx={{ backgroundColor: (theme) => theme.palette.background.default }}
|
|
103
|
+
>
|
|
104
|
+
{action}
|
|
105
|
+
</DialogActions>
|
|
106
|
+
</Dialog>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./NucDialog";
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { DataGrid } from "@mui/x-data-grid";
|
|
2
|
+
import HighlightOffIcon from "@mui/icons-material/HighlightOff";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import TypeMenu from "./TypeMenu";
|
|
5
|
+
import styles from "./styles";
|
|
6
|
+
|
|
7
|
+
import { Checkbox, IconButton, InputBase } from "@mui/material";
|
|
8
|
+
|
|
9
|
+
const ParamTable = ({ types, params, setParams }) => {
|
|
10
|
+
const columns = [
|
|
11
|
+
{
|
|
12
|
+
field: "name",
|
|
13
|
+
headerName: "Name",
|
|
14
|
+
renderCell: (param) => {
|
|
15
|
+
const { id } = param.row;
|
|
16
|
+
return (
|
|
17
|
+
<InputBase
|
|
18
|
+
disabled={param.row.in === "path"}
|
|
19
|
+
value={param.value || ""}
|
|
20
|
+
onChange={(event) => updateParam(id, "name", event.target.value)}
|
|
21
|
+
fullWidth
|
|
22
|
+
placeholder="Enter name"
|
|
23
|
+
data-cy={`param-name-field-${id}`}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
flex: 1,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
field: "type",
|
|
31
|
+
headerName: "Type",
|
|
32
|
+
renderCell: (param) => {
|
|
33
|
+
const { id } = param.row;
|
|
34
|
+
return (
|
|
35
|
+
<TypeMenu
|
|
36
|
+
disabled={param.row.in === "path"}
|
|
37
|
+
primitive
|
|
38
|
+
types={types}
|
|
39
|
+
id={id}
|
|
40
|
+
type={param.value}
|
|
41
|
+
onChange={(type) => updateParam(id, "type", type)}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
flex: 1,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
field: "in",
|
|
49
|
+
headerName: "Param",
|
|
50
|
+
flex: 1,
|
|
51
|
+
valueGetter: (param) => param.value || "query",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
field: "required",
|
|
55
|
+
headerName: "Required",
|
|
56
|
+
renderCell: (param) => {
|
|
57
|
+
const { id } = param.row;
|
|
58
|
+
return (
|
|
59
|
+
<Checkbox
|
|
60
|
+
disabled={param.row.in === "path"}
|
|
61
|
+
checked={param.value}
|
|
62
|
+
onChange={(event) =>
|
|
63
|
+
updateParam(id, "required", event.target.checked)
|
|
64
|
+
}
|
|
65
|
+
data-cy={`param-required-checkbox-${id}`}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
flex: 1,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
field: "description",
|
|
73
|
+
headerName: "Description",
|
|
74
|
+
renderCell: (param) => {
|
|
75
|
+
const { id } = param.row;
|
|
76
|
+
return (
|
|
77
|
+
<InputBase
|
|
78
|
+
disabled={param.row.in === "path"}
|
|
79
|
+
value={param.value || ""}
|
|
80
|
+
onChange={(event) =>
|
|
81
|
+
updateParam(id, "description", event.target.value)
|
|
82
|
+
}
|
|
83
|
+
fullWidth
|
|
84
|
+
placeholder="Enter description"
|
|
85
|
+
data-cy={`param-description-field-${id}`}
|
|
86
|
+
/>
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
flex: 2,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
field: "action",
|
|
93
|
+
headerName: " ",
|
|
94
|
+
sortable: false,
|
|
95
|
+
renderCell: (param) => {
|
|
96
|
+
const { id } = param.row;
|
|
97
|
+
return (
|
|
98
|
+
<IconButton
|
|
99
|
+
disabled={param.row.in === "path"}
|
|
100
|
+
onClick={() => removeParam(id)}
|
|
101
|
+
size="large"
|
|
102
|
+
>
|
|
103
|
+
<HighlightOffIcon />
|
|
104
|
+
</IconButton>
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
const removeParam = (id) => {
|
|
111
|
+
setParams((prevParams) => prevParams.filter((param) => param.id !== id));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const updateParam = (id, field, value) => {
|
|
115
|
+
setParams((prevParams) =>
|
|
116
|
+
prevParams.map((param) =>
|
|
117
|
+
param.id === id ? { ...param, [field]: value } : param
|
|
118
|
+
)
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<DataGrid
|
|
124
|
+
sx={styles.dataGrid}
|
|
125
|
+
columns={columns}
|
|
126
|
+
rows={params}
|
|
127
|
+
hideFooter
|
|
128
|
+
disableSelectionOnClick
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export default ParamTable;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import Defaults from "./defaults";
|
|
2
|
+
import { v4 as uuid } from "uuid";
|
|
3
|
+
|
|
4
|
+
import { Divider, MenuItem, Select } from "@mui/material";
|
|
5
|
+
import { forwardRef, useState } from "react";
|
|
6
|
+
|
|
7
|
+
const TypeMenu = forwardRef(
|
|
8
|
+
(
|
|
9
|
+
{
|
|
10
|
+
id,
|
|
11
|
+
type,
|
|
12
|
+
types,
|
|
13
|
+
map,
|
|
14
|
+
edit,
|
|
15
|
+
setKey,
|
|
16
|
+
primitive,
|
|
17
|
+
objAndArr,
|
|
18
|
+
globalTypes,
|
|
19
|
+
disabled,
|
|
20
|
+
},
|
|
21
|
+
ref
|
|
22
|
+
) => {
|
|
23
|
+
const [selectedType, setSelectedType] = useState(type);
|
|
24
|
+
|
|
25
|
+
function updateType(id, value) {
|
|
26
|
+
if (ref) {
|
|
27
|
+
ref[id].type = value;
|
|
28
|
+
} else {
|
|
29
|
+
switch (value) {
|
|
30
|
+
case "array":
|
|
31
|
+
if (map.type === "object") delete map["properties"];
|
|
32
|
+
map.type = "array";
|
|
33
|
+
map["items"] = Defaults.compiledObject(uuid(), uuid());
|
|
34
|
+
|
|
35
|
+
break;
|
|
36
|
+
case "object":
|
|
37
|
+
if (map.type === "array") delete map["items"];
|
|
38
|
+
map.type = "object";
|
|
39
|
+
map["properties"] = Defaults.compiledProperty(uuid());
|
|
40
|
+
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
if (map["properties"]) delete map["properties"];
|
|
44
|
+
if (map["items"]) delete map["items"];
|
|
45
|
+
map.type = value;
|
|
46
|
+
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
setKey && setKey(uuid());
|
|
51
|
+
setSelectedType(value);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
{edit && (
|
|
57
|
+
<Select
|
|
58
|
+
disabled={disabled}
|
|
59
|
+
value={selectedType}
|
|
60
|
+
onChange={(event) => {
|
|
61
|
+
updateType(id, event.target.value);
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{primitive && [
|
|
65
|
+
<MenuItem key={uuid()} value={"integer"}>
|
|
66
|
+
integer
|
|
67
|
+
</MenuItem>,
|
|
68
|
+
<MenuItem key={uuid()} value={"string"}>
|
|
69
|
+
string
|
|
70
|
+
</MenuItem>,
|
|
71
|
+
<MenuItem key={uuid()} value={"boolean"}>
|
|
72
|
+
boolean
|
|
73
|
+
</MenuItem>,
|
|
74
|
+
<Divider key={uuid()} id={uuid()} />,
|
|
75
|
+
]}
|
|
76
|
+
|
|
77
|
+
{objAndArr && [
|
|
78
|
+
<MenuItem key={uuid()} id={uuid()} value={"object"}>
|
|
79
|
+
object
|
|
80
|
+
</MenuItem>,
|
|
81
|
+
<MenuItem key={uuid()} id={uuid()} value={"array"}>
|
|
82
|
+
array
|
|
83
|
+
</MenuItem>,
|
|
84
|
+
]}
|
|
85
|
+
{globalTypes && <Divider />}
|
|
86
|
+
{globalTypes &&
|
|
87
|
+
types.map((item) => {
|
|
88
|
+
return (
|
|
89
|
+
<MenuItem key={uuid()} id={uuid()} value={item.name}>
|
|
90
|
+
{item.name}
|
|
91
|
+
</MenuItem>
|
|
92
|
+
);
|
|
93
|
+
})}
|
|
94
|
+
</Select>
|
|
95
|
+
)}
|
|
96
|
+
{!edit && <>{type}</>}
|
|
97
|
+
</>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export default TypeMenu;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const Defaults = {
|
|
2
|
+
compiledObject: (objID, objPropID) => {
|
|
3
|
+
return {
|
|
4
|
+
[objID]: {
|
|
5
|
+
type: "object",
|
|
6
|
+
id: objID,
|
|
7
|
+
properties: {
|
|
8
|
+
[objPropID]: {
|
|
9
|
+
id: objPropID,
|
|
10
|
+
name: "id",
|
|
11
|
+
type: "string",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
compiledProperty: (id) => {
|
|
18
|
+
return {
|
|
19
|
+
[id]: {
|
|
20
|
+
id: id,
|
|
21
|
+
name: "id",
|
|
22
|
+
type: "string",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
object: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
id: {
|
|
30
|
+
type: "string",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
array: {
|
|
35
|
+
type: "array",
|
|
36
|
+
items: {
|
|
37
|
+
id: {
|
|
38
|
+
type: "string",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
action: `function action(req) {\n\treturn req.body.name;\n}\n`,
|
|
43
|
+
summary: "Summary",
|
|
44
|
+
description: "Description",
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default Defaults;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ParamTable";
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import Dialog from "@mui/material/Dialog";
|
|
4
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
5
|
+
import DialogTitle from "@mui/material/DialogTitle";
|
|
6
|
+
import ItemSummary from "./ItemSummary/ItemSummary";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import SelectAvatar from "./IconSelector/IconSelector";
|
|
9
|
+
import SparkleInput from "./SparkleInput/SparkleInput";
|
|
10
|
+
import StepComponent from "./StepComponent/StepComponent";
|
|
11
|
+
|
|
12
|
+
function ProjectWizard({
|
|
13
|
+
itemProperties,
|
|
14
|
+
onSubmit,
|
|
15
|
+
open,
|
|
16
|
+
onClose,
|
|
17
|
+
itemToEdit,
|
|
18
|
+
steps,
|
|
19
|
+
stepExp,
|
|
20
|
+
}) {
|
|
21
|
+
const [activeStep, setActiveStep] = React.useState(0);
|
|
22
|
+
|
|
23
|
+
const handleNext = () => {
|
|
24
|
+
setActiveStep((prevActiveStep) => prevActiveStep + 1);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const handleBack = () => {
|
|
28
|
+
setActiveStep((prevActiveStep) => prevActiveStep - 1);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const [newItem, setNewItem] = useState(
|
|
32
|
+
itemProperties.reduce((obj, property) => ({ ...obj, [property]: "" }), {})
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (itemToEdit) {
|
|
37
|
+
setNewItem(itemToEdit);
|
|
38
|
+
} else if (!open) {
|
|
39
|
+
setNewItem(
|
|
40
|
+
itemProperties.reduce(
|
|
41
|
+
(obj, property) => ({ ...obj, [property]: "" }),
|
|
42
|
+
{}
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}, [open, itemProperties, itemToEdit]);
|
|
47
|
+
|
|
48
|
+
const handleSave = () => {
|
|
49
|
+
if (newItem.id) {
|
|
50
|
+
const { id, ...rest } = newItem;
|
|
51
|
+
onSubmit(id, rest);
|
|
52
|
+
} else {
|
|
53
|
+
onSubmit(newItem);
|
|
54
|
+
}
|
|
55
|
+
onClose();
|
|
56
|
+
setActiveStep(0);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const handleEmojiSelect = (emoji) => {
|
|
60
|
+
setNewItem((prevItem) => {
|
|
61
|
+
return {
|
|
62
|
+
...prevItem,
|
|
63
|
+
icon: emoji.shortcodes,
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const handleInputChange = (property) => (event) => {
|
|
68
|
+
setNewItem({ ...newItem, [property]: event.target.value });
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const Name = () => {
|
|
72
|
+
return (
|
|
73
|
+
<SparkleInput
|
|
74
|
+
prop="name"
|
|
75
|
+
value={newItem["name"]}
|
|
76
|
+
onChange={handleInputChange("name")}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const StepPages = () => {
|
|
82
|
+
switch (activeStep) {
|
|
83
|
+
case 0:
|
|
84
|
+
return Name();
|
|
85
|
+
case 1:
|
|
86
|
+
return (
|
|
87
|
+
<SelectAvatar
|
|
88
|
+
handleEmojiSelect={handleEmojiSelect}
|
|
89
|
+
iconCategories={"project_icons"}
|
|
90
|
+
avatar={newItem?.icon?.replace(/:/g, "").replace("/", ":")}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
case 2:
|
|
94
|
+
return <ItemSummary newItem={newItem} />;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return (
|
|
98
|
+
<Dialog
|
|
99
|
+
fullWidth={true}
|
|
100
|
+
maxWidth="sm"
|
|
101
|
+
open={open}
|
|
102
|
+
onClose={() => {
|
|
103
|
+
onClose();
|
|
104
|
+
setActiveStep(0);
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<>
|
|
108
|
+
<DialogTitle
|
|
109
|
+
sx={{
|
|
110
|
+
backgroundColor: (theme) => theme.palette.background.default,
|
|
111
|
+
}}
|
|
112
|
+
></DialogTitle>
|
|
113
|
+
<StepComponent
|
|
114
|
+
activeStep={activeStep}
|
|
115
|
+
steps={steps}
|
|
116
|
+
stepExp={stepExp}
|
|
117
|
+
handleNext={handleNext}
|
|
118
|
+
handleBack={handleBack}
|
|
119
|
+
handleSave={handleSave}
|
|
120
|
+
>
|
|
121
|
+
<DialogContent
|
|
122
|
+
sx={{
|
|
123
|
+
height: "100%",
|
|
124
|
+
alignContent: "center",
|
|
125
|
+
justifyContent: "center",
|
|
126
|
+
backgroundColor: (theme) => theme.palette.background.default,
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
{StepPages()}
|
|
130
|
+
</DialogContent>
|
|
131
|
+
</StepComponent>
|
|
132
|
+
</>
|
|
133
|
+
</Dialog>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export default ProjectWizard;
|