@env-hopper/frontend-core 2.0.1-alpha
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/LICENSE +21 -0
- package/dist/apple-touch-180x180.png +0 -0
- package/dist/disable.well-known/appspecific/com.chrome.devtools.json +6 -0
- package/dist/env-hopper-16x16.png +0 -0
- package/dist/env-hopper-192x192.png +0 -0
- package/dist/env-hopper-32x32.png +0 -0
- package/dist/env-hopper-48x48.png +0 -0
- package/dist/env-hopper-512x512.png +0 -0
- package/dist/env-hopper-square.svg +114 -0
- package/dist/esm/App.d.ts +12 -0
- package/dist/esm/App.js +12 -0
- package/dist/esm/App.js.map +1 -0
- package/dist/esm/__tests__/modules/fuzzyMatchLogic/autoCompleteFilter.test.d.ts +1 -0
- package/dist/esm/__tests__/modules/fuzzyMatchLogic/features/prefixFracTokenMiddles.test.d.ts +1 -0
- package/dist/esm/__tests__/modules/fuzzyMatchLogic/fixLayout.test.d.ts +1 -0
- package/dist/esm/__tests__/modules/fuzzyMatchLogic/postFiltration.test.d.ts +1 -0
- package/dist/esm/__tests__/modules/fuzzyMatchLogic/testUtils.d.ts +2 -0
- package/dist/esm/__tests__/modules/fuzzyMatchLogic/tokenize.test.d.ts +1 -0
- package/dist/esm/__tests__/modules/resouceJump/findBestMatchByUrl.test.d.ts +1 -0
- package/dist/esm/__tests__/setupTests.d.ts +0 -0
- package/dist/esm/__tests__/util/availabilityMatrixUtils.test.d.ts +1 -0
- package/dist/esm/api/ApiQueryMagazine.d.ts +12 -0
- package/dist/esm/api/ApiQueryMagazine.js +16 -0
- package/dist/esm/api/ApiQueryMagazine.js.map +1 -0
- package/dist/esm/api/data/useQueryBootstrapConfig.d.ts +3 -0
- package/dist/esm/api/data/useQueryBootstrapConfig.js +14 -0
- package/dist/esm/api/data/useQueryBootstrapConfig.js.map +1 -0
- package/dist/esm/api/infra/createQueryClient.d.ts +7 -0
- package/dist/esm/api/infra/createQueryClient.js +23 -0
- package/dist/esm/api/infra/createQueryClient.js.map +1 -0
- package/dist/esm/api/infra/trpc.d.ts +93 -0
- package/dist/esm/api/infra/trpc.js +8 -0
- package/dist/esm/api/infra/trpc.js.map +1 -0
- package/dist/esm/api/unsorted/indexDataFetcher.d.ts +11 -0
- package/dist/esm/api/unsorted/indexDataFetcher.js +35 -0
- package/dist/esm/api/unsorted/indexDataFetcher.js.map +1 -0
- package/dist/esm/appPropsFactory.d.ts +2 -0
- package/dist/esm/appPropsFactory.js +32 -0
- package/dist/esm/appPropsFactory.js.map +1 -0
- package/dist/esm/assets/env-hopper-logo.svg.js +16 -0
- package/dist/esm/assets/env-hopper-logo.svg.js.map +1 -0
- package/dist/esm/components/ThemeSwitcher.d.ts +1 -0
- package/dist/esm/components/ThemeSwitcher.js +25 -0
- package/dist/esm/components/ThemeSwitcher.js.map +1 -0
- package/dist/esm/components/theme-provider.d.ts +2 -0
- package/dist/esm/components/theme-provider.js +10 -0
- package/dist/esm/components/theme-provider.js.map +1 -0
- package/dist/esm/components/ui/badge.d.ts +9 -0
- package/dist/esm/components/ui/breadcrumb.d.ts +46 -0
- package/dist/esm/components/ui/button.d.ts +16 -0
- package/dist/esm/components/ui/button.js +52 -0
- package/dist/esm/components/ui/button.js.map +1 -0
- package/dist/esm/components/ui/card.d.ts +38 -0
- package/dist/esm/components/ui/collapsible.d.ts +5 -0
- package/dist/esm/components/ui/dialog.d.ts +21 -0
- package/dist/esm/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/esm/components/ui/input.d.ts +10 -0
- package/dist/esm/components/ui/popover.d.ts +7 -0
- package/dist/esm/components/ui/popover.js +14 -0
- package/dist/esm/components/ui/popover.js.map +1 -0
- package/dist/esm/components/ui/scroll-area.d.ts +5 -0
- package/dist/esm/components/ui/separator.d.ts +4 -0
- package/dist/esm/components/ui/separator.js +27 -0
- package/dist/esm/components/ui/separator.js.map +1 -0
- package/dist/esm/components/ui/tabs.d.ts +7 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/utils.d.ts +2 -0
- package/dist/esm/lib/utils.js +9 -0
- package/dist/esm/lib/utils.js.map +1 -0
- package/dist/esm/main.d.ts +0 -0
- package/dist/esm/modules/config/BootstrapConfigContext.d.ts +9 -0
- package/dist/esm/modules/config/BootstrapConfigContext.js +25 -0
- package/dist/esm/modules/config/BootstrapConfigContext.js.map +1 -0
- package/dist/esm/modules/config/GlobalConfigContext.d.ts +14 -0
- package/dist/esm/modules/config/GlobalConfigContext.js +21 -0
- package/dist/esm/modules/config/GlobalConfigContext.js.map +1 -0
- package/dist/esm/modules/environment/ApiQueryMagazineEnvironment.d.ts +12 -0
- package/dist/esm/modules/environment/ApiQueryMagazineEnvironment.js +13 -0
- package/dist/esm/modules/environment/ApiQueryMagazineEnvironment.js.map +1 -0
- package/dist/esm/modules/environment/EnvironmentContext.d.ts +15 -0
- package/dist/esm/modules/environment/EnvironmentContext.js +67 -0
- package/dist/esm/modules/environment/EnvironmentContext.js.map +1 -0
- package/dist/esm/modules/environment/types.d.ts +4 -0
- package/dist/esm/modules/environment/ui/EhEnvSelector.d.ts +9 -0
- package/dist/esm/modules/environment/ui/EhEnvSelector.js +167 -0
- package/dist/esm/modules/environment/ui/EhEnvSelector.js.map +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/autoCompleteFilter.d.ts +3 -0
- package/dist/esm/modules/fuzzyMatchLogic/autoCompleteFilter.js +43 -0
- package/dist/esm/modules/fuzzyMatchLogic/autoCompleteFilter.js.map +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/features/prefixFrac.d.ts +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/features/prefixFrac.js +12 -0
- package/dist/esm/modules/fuzzyMatchLogic/features/prefixFrac.js.map +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/features/prefixFracTokenMiddles.d.ts +2 -0
- package/dist/esm/modules/fuzzyMatchLogic/fixLayout.d.ts +2 -0
- package/dist/esm/modules/fuzzyMatchLogic/postFiltration.d.ts +2 -0
- package/dist/esm/modules/fuzzyMatchLogic/scoring.d.ts +2 -0
- package/dist/esm/modules/fuzzyMatchLogic/scoring.js +23 -0
- package/dist/esm/modules/fuzzyMatchLogic/scoring.js.map +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/tokenize.d.ts +3 -0
- package/dist/esm/modules/fuzzyMatchLogic/types.d.ts +25 -0
- package/dist/esm/modules/fuzzyMatchLogic/utils.d.ts +2 -0
- package/dist/esm/modules/fuzzyMatchLogic/utils.js +12 -0
- package/dist/esm/modules/fuzzyMatchLogic/utils.js.map +1 -0
- package/dist/esm/modules/pluginCore/PluginManagerContext.d.ts +24 -0
- package/dist/esm/modules/pluginCore/PluginManagerContext.js +62 -0
- package/dist/esm/modules/pluginCore/PluginManagerContext.js.map +1 -0
- package/dist/esm/modules/pluginCore/makePluginManagerContext.d.ts +7 -0
- package/dist/esm/modules/pluginCore/makePluginManagerContext.js +27 -0
- package/dist/esm/modules/pluginCore/makePluginManagerContext.js.map +1 -0
- package/dist/esm/modules/pluginCore/types.d.ts +36 -0
- package/dist/esm/modules/pluginCore/types.js +7 -0
- package/dist/esm/modules/pluginCore/types.js.map +1 -0
- package/dist/esm/modules/resourceJump/ApiQueryMagazineResourceJump.d.ts +27 -0
- package/dist/esm/modules/resourceJump/ApiQueryMagazineResourceJump.js +26 -0
- package/dist/esm/modules/resourceJump/ApiQueryMagazineResourceJump.js.map +1 -0
- package/dist/esm/modules/resourceJump/ResourceJumpContext.d.ts +17 -0
- package/dist/esm/modules/resourceJump/ResourceJumpContext.js +88 -0
- package/dist/esm/modules/resourceJump/ResourceJumpContext.js.map +1 -0
- package/dist/esm/modules/resourceJump/buildJumpUrl.d.ts +2 -0
- package/dist/esm/modules/resourceJump/buildJumpUrl.js +32 -0
- package/dist/esm/modules/resourceJump/buildJumpUrl.js.map +1 -0
- package/dist/esm/modules/resourceJump/findBestMatchByUrl.d.ts +17 -0
- package/dist/esm/modules/resourceJump/findBestMatchByUrl.js +85 -0
- package/dist/esm/modules/resourceJump/findBestMatchByUrl.js.map +1 -0
- package/dist/esm/modules/resourceJump/helpers.d.ts +28 -0
- package/dist/esm/modules/resourceJump/helpers.js +19 -0
- package/dist/esm/modules/resourceJump/helpers.js.map +1 -0
- package/dist/esm/modules/resourceJump/routeLoader.d.ts +11 -0
- package/dist/esm/modules/resourceJump/routeLoader.js +43 -0
- package/dist/esm/modules/resourceJump/routeLoader.js.map +1 -0
- package/dist/esm/modules/resourceJump/types.d.ts +18 -0
- package/dist/esm/modules/resourceJump/ui/EhJumpResourceSelector.d.ts +20 -0
- package/dist/esm/modules/resourceJump/ui/EhJumpResourceSelector.js +209 -0
- package/dist/esm/modules/resourceJump/ui/EhJumpResourceSelector.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/JumpALink.d.ts +14 -0
- package/dist/esm/modules/resourceJump/ui/JumpALink.js +38 -0
- package/dist/esm/modules/resourceJump/ui/JumpALink.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/JumpMainButton.d.ts +5 -0
- package/dist/esm/modules/resourceJump/ui/JumpMainButton.js +66 -0
- package/dist/esm/modules/resourceJump/ui/JumpMainButton.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/ResouceJumpLayout.d.ts +5 -0
- package/dist/esm/modules/resourceJump/ui/ResouceJumpLayout.js +42 -0
- package/dist/esm/modules/resourceJump/ui/ResouceJumpLayout.js.map +1 -0
- package/dist/esm/plugins/builtin/pageUrl/PageUrlPluginContext.d.ts +9 -0
- package/dist/esm/plugins/builtin/pageUrl/PageUrlPluginContext.js +36 -0
- package/dist/esm/plugins/builtin/pageUrl/PageUrlPluginContext.js.map +1 -0
- package/dist/esm/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.d.ts +11 -0
- package/dist/esm/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.js +44 -0
- package/dist/esm/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.js.map +1 -0
- package/dist/esm/plugins/builtin/pageUrl/pageUrlJumpPlugin.d.ts +7 -0
- package/dist/esm/plugins/builtin/pageUrl/pageUrlJumpPlugin.js +29 -0
- package/dist/esm/plugins/builtin/pageUrl/pageUrlJumpPlugin.js.map +1 -0
- package/dist/esm/plugins/builtin/pageUrl/pageUrlTypes.d.ts +11 -0
- package/dist/esm/routeTree.gen.d.ts +142 -0
- package/dist/esm/routeTree.gen.js +77 -0
- package/dist/esm/routeTree.gen.js.map +1 -0
- package/dist/esm/routes/__root.d.ts +2 -0
- package/dist/esm/routes/__root.js +22 -0
- package/dist/esm/routes/__root.js.map +1 -0
- package/dist/esm/routes/_layout/app/$appSlug/sub/$subValue.d.ts +1 -0
- package/dist/esm/routes/_layout/app/$appSlug.d.ts +1 -0
- package/dist/esm/routes/_layout/app/_appSlug/sub/_subValue.js +18 -0
- package/dist/esm/routes/_layout/app/_appSlug/sub/_subValue.js.map +1 -0
- package/dist/esm/routes/_layout/app/_appSlug.js +18 -0
- package/dist/esm/routes/_layout/app/_appSlug.js.map +1 -0
- package/dist/esm/routes/_layout/env/$envSlug/app/$appSlug/sub/$subValue.d.ts +1 -0
- package/dist/esm/routes/_layout/env/$envSlug/app/$appSlug.d.ts +1 -0
- package/dist/esm/routes/_layout/env/$envSlug/sub/$subValue.d.ts +1 -0
- package/dist/esm/routes/_layout/env/$envSlug.d.ts +1 -0
- package/dist/esm/routes/_layout/env/_envSlug/app/_appSlug/sub/_subValue.js +20 -0
- package/dist/esm/routes/_layout/env/_envSlug/app/_appSlug/sub/_subValue.js.map +1 -0
- package/dist/esm/routes/_layout/env/_envSlug/app/_appSlug.js +18 -0
- package/dist/esm/routes/_layout/env/_envSlug/app/_appSlug.js.map +1 -0
- package/dist/esm/routes/_layout/env/_envSlug/sub/_subValue.js +18 -0
- package/dist/esm/routes/_layout/env/_envSlug/sub/_subValue.js.map +1 -0
- package/dist/esm/routes/_layout/env/_envSlug.js +18 -0
- package/dist/esm/routes/_layout/env/_envSlug.js.map +1 -0
- package/dist/esm/routes/_layout/index.d.ts +1 -0
- package/dist/esm/routes/_layout/index.js +18 -0
- package/dist/esm/routes/_layout/index.js.map +1 -0
- package/dist/esm/routes/_layout.d.ts +1 -0
- package/dist/esm/routes/_layout.js +12 -0
- package/dist/esm/routes/_layout.js.map +1 -0
- package/dist/esm/types/ehTypes.d.ts +31 -0
- package/dist/esm/types/slateTypes.d.ts +28 -0
- package/dist/esm/types/tanstackQuery.d.ts +11 -0
- package/dist/esm/types/types.d.ts +16 -0
- package/dist/esm/types/userBehaviourTypes.d.ts +76 -0
- package/dist/esm/types/utilityTypes.d.ts +1 -0
- package/dist/esm/ui/components/ActionCard.d.ts +9 -0
- package/dist/esm/ui/components/AppIcon.d.ts +7 -0
- package/dist/esm/ui/components/commandInput/EhBaseSelector.d.ts +6 -0
- package/dist/esm/ui/components/commandInput/EhBaseSelector.js +22 -0
- package/dist/esm/ui/components/commandInput/EhBaseSelector.js.map +1 -0
- package/dist/esm/ui/components/commandInput/types.d.ts +13 -0
- package/dist/esm/ui/components/contextDebug.d.ts +2 -0
- package/dist/esm/ui/components/contextDebug.js +12 -0
- package/dist/esm/ui/components/contextDebug.js.map +1 -0
- package/dist/esm/ui/components/controlPanel/BaseDropdownSelector.d.ts +11 -0
- package/dist/esm/ui/components/controlPanel/env/EnvDropdownContent.d.ts +5 -0
- package/dist/esm/ui/components/controlPanel/env/EnvDropdownSelector.d.ts +1 -0
- package/dist/esm/ui/components/error/DefaultErrorComponent.d.ts +2 -0
- package/dist/esm/ui/components/error/DefaultErrorComponent.js +13 -0
- package/dist/esm/ui/components/error/DefaultErrorComponent.js.map +1 -0
- package/dist/esm/ui/components/error/RooutErrorPage.d.ts +2 -0
- package/dist/esm/ui/components/error/RooutErrorPage.js +12 -0
- package/dist/esm/ui/components/error/RooutErrorPage.js.map +1 -0
- package/dist/esm/ui/components/footer/Footer.d.ts +1 -0
- package/dist/esm/ui/components/footer/Footer.js +38 -0
- package/dist/esm/ui/components/footer/Footer.js.map +1 -0
- package/dist/esm/ui/components/header/PlaygroundHeader.d.ts +1 -0
- package/dist/esm/ui/components/header/PlaygroundHeader.js +23 -0
- package/dist/esm/ui/components/header/PlaygroundHeader.js.map +1 -0
- package/dist/esm/ui/components/leftPanel/LeftPanel.d.ts +5 -0
- package/dist/esm/ui/components/quickBar/EnvQuickJumpBar.d.ts +5 -0
- package/dist/esm/ui/components/quickBar/EnvQuickJumpBar.js +52 -0
- package/dist/esm/ui/components/quickBar/EnvQuickJumpBar.js.map +1 -0
- package/dist/esm/ui/components/quickBar/QuickJumpBar.d.ts +5 -0
- package/dist/esm/ui/components/widgetPanel/AddWidgetCard.d.ts +5 -0
- package/dist/esm/ui/components/widgetPanel/WidgetGrid.d.ts +6 -0
- package/dist/esm/ui/components/widgets/CredentialsWidget.d.ts +11 -0
- package/dist/esm/ui/components/widgets/VersionWidget.d.ts +7 -0
- package/dist/esm/ui/error/NotFoundError.d.ts +1 -0
- package/dist/esm/ui/error/NotFoundError.js +16 -0
- package/dist/esm/ui/error/NotFoundError.js.map +1 -0
- package/dist/esm/ui/layout/Footer.d.ts +1 -0
- package/dist/esm/ui/layout/Header.d.ts +1 -0
- package/dist/esm/ui/layout/LoadingScreen.d.ts +4 -0
- package/dist/esm/ui/layout/LoadingScreen.js +14 -0
- package/dist/esm/ui/layout/LoadingScreen.js.map +1 -0
- package/dist/esm/ui/layout/MainLayout.d.ts +5 -0
- package/dist/esm/ui/layout/MainLayout.js +18 -0
- package/dist/esm/ui/layout/MainLayout.js.map +1 -0
- package/dist/esm/ui/layout/SideColumn.d.ts +1 -0
- package/dist/esm/ui/layout/TopLevelProviders.d.ts +5 -0
- package/dist/esm/ui/layout/TopLevelProviders.js +42 -0
- package/dist/esm/ui/layout/TopLevelProviders.js.map +1 -0
- package/dist/esm/ui/main/JumpTabContent.d.ts +1 -0
- package/dist/esm/ui/main/Tabs.d.ts +4 -0
- package/dist/esm/userDb/DbContext.d.ts +9 -0
- package/dist/esm/userDb/DbContext.js +18 -0
- package/dist/esm/userDb/DbContext.js.map +1 -0
- package/dist/esm/userDb/EhDb.d.ts +12 -0
- package/dist/esm/userDb/EhDb.js +20 -0
- package/dist/esm/userDb/EhDb.js.map +1 -0
- package/dist/esm/util/availabilityMatrixUtils.d.ts +12 -0
- package/dist/esm/util/availabilityMatrixUtils.js +57 -0
- package/dist/esm/util/availabilityMatrixUtils.js.map +1 -0
- package/dist/esm/util/createEhRouter.d.ts +7 -0
- package/dist/esm/util/createEhRouter.js +16 -0
- package/dist/esm/util/createEhRouter.js.map +1 -0
- package/dist/esm/util/highlightMatches.d.ts +2 -0
- package/dist/esm/util/highlightMatches.js +19 -0
- package/dist/esm/util/highlightMatches.js.map +1 -0
- package/dist/esm/util/reactQueryUtils.d.ts +6 -0
- package/dist/esm/util/reactQueryUtils.js +10 -0
- package/dist/esm/util/reactQueryUtils.js.map +1 -0
- package/dist/esm/util/route-utils.d.ts +6 -0
- package/dist/esm/util/route-utils.js +72 -0
- package/dist/esm/util/route-utils.js.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/robots.txt +2 -0
- package/package.json +110 -0
- package/src/App.tsx +28 -0
- package/src/__tests__/modules/fuzzyMatchLogic/autoCompleteFilter.test.ts +185 -0
- package/src/__tests__/modules/fuzzyMatchLogic/features/prefixFracTokenMiddles.test.ts +23 -0
- package/src/__tests__/modules/fuzzyMatchLogic/fixLayout.test.ts +11 -0
- package/src/__tests__/modules/fuzzyMatchLogic/postFiltration.test.ts +15 -0
- package/src/__tests__/modules/fuzzyMatchLogic/testUtils.ts +8 -0
- package/src/__tests__/modules/fuzzyMatchLogic/tokenize.test.ts +65 -0
- package/src/__tests__/modules/resouceJump/findBestMatchByUrl.test.ts +234 -0
- package/src/__tests__/setupTests.tsx +0 -0
- package/src/__tests__/util/availabilityMatrixUtils.test.ts +61 -0
- package/src/api/ApiQueryMagazine.ts +15 -0
- package/src/api/data/useQueryBootstrapConfig.ts +17 -0
- package/src/api/infra/createQueryClient.ts +25 -0
- package/src/api/infra/trpc.ts +6 -0
- package/src/api/unsorted/indexDataFetcher.ts +46 -0
- package/src/appPropsFactory.ts +35 -0
- package/src/assets/env-hopper-logo.svg +114 -0
- package/src/components/ThemeSwitcher.tsx +22 -0
- package/src/components/theme-provider.tsx +8 -0
- package/src/components/ui/badge.tsx +37 -0
- package/src/components/ui/breadcrumb.tsx +128 -0
- package/src/components/ui/button.tsx +60 -0
- package/src/components/ui/card.tsx +95 -0
- package/src/components/ui/collapsible.tsx +31 -0
- package/src/components/ui/dialog.tsx +182 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/input.tsx +28 -0
- package/src/components/ui/popover.tsx +48 -0
- package/src/components/ui/scroll-area.tsx +58 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/tabs.tsx +65 -0
- package/src/index.css +211 -0
- package/src/index.tsx +3 -0
- package/src/lib/utils.ts +7 -0
- package/src/main.tsx +53 -0
- package/src/modules/config/BootstrapConfigContext.tsx +33 -0
- package/src/modules/config/GlobalConfigContext.tsx +42 -0
- package/src/modules/environment/ApiQueryMagazineEnvironment.ts +12 -0
- package/src/modules/environment/EnvironmentContext.tsx +115 -0
- package/src/modules/environment/types.ts +4 -0
- package/src/modules/environment/ui/EhEnvSelector.tsx +191 -0
- package/src/modules/fuzzyMatchLogic/autoCompleteFilter.ts +186 -0
- package/src/modules/fuzzyMatchLogic/features/prefixFrac.ts +13 -0
- package/src/modules/fuzzyMatchLogic/features/prefixFracTokenMiddles.ts +29 -0
- package/src/modules/fuzzyMatchLogic/fixLayout.ts +24 -0
- package/src/modules/fuzzyMatchLogic/postFiltration.ts +35 -0
- package/src/modules/fuzzyMatchLogic/scoring.ts +42 -0
- package/src/modules/fuzzyMatchLogic/tokenize.ts +32 -0
- package/src/modules/fuzzyMatchLogic/types.ts +33 -0
- package/src/modules/fuzzyMatchLogic/utils.ts +18 -0
- package/src/modules/pluginCore/PluginManagerContext.tsx +107 -0
- package/src/modules/pluginCore/makePluginManagerContext.ts +35 -0
- package/src/modules/pluginCore/types.ts +54 -0
- package/src/modules/resourceJump/ApiQueryMagazineResourceJump.ts +31 -0
- package/src/modules/resourceJump/ResourceJumpContext.tsx +142 -0
- package/src/modules/resourceJump/buildJumpUrl.ts +40 -0
- package/src/modules/resourceJump/findBestMatchByUrl.ts +121 -0
- package/src/modules/resourceJump/helpers.ts +117 -0
- package/src/modules/resourceJump/routeLoader.ts +58 -0
- package/src/modules/resourceJump/types.ts +21 -0
- package/src/modules/resourceJump/ui/EhJumpResourceSelector.tsx +259 -0
- package/src/modules/resourceJump/ui/JumpALink.tsx +54 -0
- package/src/modules/resourceJump/ui/JumpMainButton.tsx +97 -0
- package/src/modules/resourceJump/ui/ResouceJumpLayout.tsx +73 -0
- package/src/plugins/builtin/pageUrl/PageUrlPluginContext.tsx +55 -0
- package/src/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.ts +66 -0
- package/src/plugins/builtin/pageUrl/pageUrlJumpPlugin.ts +36 -0
- package/src/plugins/builtin/pageUrl/pageUrlTypes.ts +17 -0
- package/src/routeTree.gen.ts +249 -0
- package/src/routes/__root.tsx +23 -0
- package/src/routes/_layout/app/$appSlug/sub/$subValue.tsx +15 -0
- package/src/routes/_layout/app/$appSlug.tsx +15 -0
- package/src/routes/_layout/env/$envSlug/app/$appSlug/sub/$subValue.tsx +17 -0
- package/src/routes/_layout/env/$envSlug/app/$appSlug.tsx +15 -0
- package/src/routes/_layout/env/$envSlug/sub/$subValue.tsx +15 -0
- package/src/routes/_layout/env/$envSlug.tsx +15 -0
- package/src/routes/_layout/index.tsx +16 -0
- package/src/routes/_layout.tsx +9 -0
- package/src/types/ehTypes.ts +40 -0
- package/src/types/slateTypes.ts +22 -0
- package/src/types/tanstackQuery.ts +14 -0
- package/src/types/types.ts +20 -0
- package/src/types/userBehaviourTypes.ts +100 -0
- package/src/types/utilityTypes.ts +1 -0
- package/src/types/vite-env.d.ts +1 -0
- package/src/ui/components/ActionCard.tsx +30 -0
- package/src/ui/components/AppIcon.tsx +48 -0
- package/src/ui/components/commandInput/EhBaseSelector.tsx +51 -0
- package/src/ui/components/commandInput/types.ts +22 -0
- package/src/ui/components/contextDebug.tsx +13 -0
- package/src/ui/components/controlPanel/BaseDropdownSelector.tsx +163 -0
- package/src/ui/components/controlPanel/env/EnvDropdownContent.tsx +114 -0
- package/src/ui/components/controlPanel/env/EnvDropdownSelector.tsx +21 -0
- package/src/ui/components/error/DefaultErrorComponent.tsx +38 -0
- package/src/ui/components/error/RooutErrorPage.tsx +10 -0
- package/src/ui/components/footer/Footer.tsx +32 -0
- package/src/ui/components/header/PlaygroundHeader.tsx +26 -0
- package/src/ui/components/leftPanel/LeftPanel.tsx +194 -0
- package/src/ui/components/quickBar/EnvQuickJumpBar.tsx +65 -0
- package/src/ui/components/quickBar/QuickJumpBar.tsx +101 -0
- package/src/ui/components/widgetPanel/AddWidgetCard.tsx +17 -0
- package/src/ui/components/widgetPanel/WidgetGrid.tsx +18 -0
- package/src/ui/components/widgets/CredentialsWidget.tsx +55 -0
- package/src/ui/components/widgets/VersionWidget.tsx +29 -0
- package/src/ui/error/NotFoundError.tsx +13 -0
- package/src/ui/layout/Footer.tsx +16 -0
- package/src/ui/layout/Header.tsx +14 -0
- package/src/ui/layout/LoadingScreen.tsx +17 -0
- package/src/ui/layout/MainLayout.tsx +27 -0
- package/src/ui/layout/SideColumn.tsx +3 -0
- package/src/ui/layout/TopLevelProviders.tsx +52 -0
- package/src/ui/main/JumpTabContent.tsx +12 -0
- package/src/ui/main/Tabs.tsx +29 -0
- package/src/userDb/DbContext.tsx +22 -0
- package/src/userDb/EhDb.ts +22 -0
- package/src/util/availabilityMatrixUtils.ts +80 -0
- package/src/util/createEhRouter.ts +20 -0
- package/src/util/highlightMatches.tsx +29 -0
- package/src/util/reactQueryUtils.ts +12 -0
- package/src/util/route-utils.ts +71 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { Popover, PopoverContent } from '@radix-ui/react-popover'
|
|
2
|
+
import { useCombobox } from 'downshift'
|
|
3
|
+
import { CornerDownRight, Edit3Icon, ExpandIcon, XIcon } from 'lucide-react'
|
|
4
|
+
import { unique } from 'radashi'
|
|
5
|
+
import React, { useEffect, useMemo } from 'react'
|
|
6
|
+
import { EhBaseSelectorRoot } from '../../../ui/components/commandInput/EhBaseSelector'
|
|
7
|
+
import { mapDisplayedItems } from '../helpers'
|
|
8
|
+
import { useResourceJumpContext } from '../ResourceJumpContext'
|
|
9
|
+
import type {
|
|
10
|
+
BaseAutoCompletableItem,
|
|
11
|
+
BaseAutoCompleteItemRender,
|
|
12
|
+
} from '~/modules/pluginCore/types'
|
|
13
|
+
import type {
|
|
14
|
+
AppAutoCompleteAmend,
|
|
15
|
+
AutoCompleteContext,
|
|
16
|
+
} from '../../../ui/components/commandInput/types'
|
|
17
|
+
import { Button } from '~/components/ui/button'
|
|
18
|
+
import { PopoverTrigger } from '~/components/ui/popover'
|
|
19
|
+
import { cn } from '~/lib/utils'
|
|
20
|
+
import {
|
|
21
|
+
autocompleteFilter,
|
|
22
|
+
autocompleteToString,
|
|
23
|
+
isAutocompleteItem,
|
|
24
|
+
} from '~/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin'
|
|
25
|
+
import { highlightMatches } from '~/util/highlightMatches'
|
|
26
|
+
|
|
27
|
+
interface EhJumpResourceSelectorProps {
|
|
28
|
+
className?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function EhJumpResourceSelector({
|
|
32
|
+
className = '',
|
|
33
|
+
}: EhJumpResourceSelectorProps) {
|
|
34
|
+
const { jumpResources, currentResourceJump, setCurrentResourceJumpSlug } =
|
|
35
|
+
useResourceJumpContext()
|
|
36
|
+
|
|
37
|
+
const appFilter = (
|
|
38
|
+
needle: string,
|
|
39
|
+
allItems: Array<BaseAutoCompletableItem>,
|
|
40
|
+
) => {
|
|
41
|
+
return autocompleteFilter(
|
|
42
|
+
allItems.filter((i) => isAutocompleteItem(i)),
|
|
43
|
+
needle,
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const [displayedItems, setDisplayedItems] =
|
|
48
|
+
React.useState<Array<BaseAutoCompletableItem>>(jumpResources)
|
|
49
|
+
|
|
50
|
+
const {
|
|
51
|
+
isOpen: comboIsOpen,
|
|
52
|
+
getLabelProps,
|
|
53
|
+
getMenuProps,
|
|
54
|
+
getInputProps,
|
|
55
|
+
getToggleButtonProps,
|
|
56
|
+
highlightedIndex,
|
|
57
|
+
getItemProps,
|
|
58
|
+
selectItem,
|
|
59
|
+
selectedItem: comboSelectedItem,
|
|
60
|
+
inputValue: comboInputValue,
|
|
61
|
+
setInputValue,
|
|
62
|
+
} = useCombobox<BaseAutoCompletableItem>({
|
|
63
|
+
onInputValueChange({
|
|
64
|
+
inputValue: changedInputValue,
|
|
65
|
+
isOpen: changedIsOpen,
|
|
66
|
+
}) {
|
|
67
|
+
if (changedIsOpen) {
|
|
68
|
+
const matchedIds = unique(appFilter(changedInputValue, jumpResources))
|
|
69
|
+
setDisplayedItems(matchedIds)
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
onSelectedItemChange({ selectedItem: changedSelectedItem }) {
|
|
73
|
+
setCurrentResourceJumpSlug(changedSelectedItem?.slug)
|
|
74
|
+
},
|
|
75
|
+
// selectedItem,
|
|
76
|
+
items: displayedItems,
|
|
77
|
+
itemToString(item) {
|
|
78
|
+
if (isAutocompleteItem(item)) {
|
|
79
|
+
return autocompleteToString(item)
|
|
80
|
+
}
|
|
81
|
+
return 'n/a'
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (currentResourceJump) {
|
|
87
|
+
const f = jumpResources.find((e) => e.slug === currentResourceJump.slug)
|
|
88
|
+
if (f) {
|
|
89
|
+
selectItem(f)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, [currentResourceJump, jumpResources, selectItem])
|
|
93
|
+
|
|
94
|
+
const ctx = useMemo<AutoCompleteContext>(() => {
|
|
95
|
+
return {
|
|
96
|
+
searchString: comboInputValue,
|
|
97
|
+
}
|
|
98
|
+
}, [comboInputValue])
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<EhBaseSelectorRoot className={className}>
|
|
102
|
+
<Popover open={comboIsOpen}>
|
|
103
|
+
<PopoverTrigger asChild>
|
|
104
|
+
<div className="relative group hover:cursor-pointer w-full">
|
|
105
|
+
<input
|
|
106
|
+
className={cn(
|
|
107
|
+
'text-xl h-14 w-full rounded-md border border-input bg-background px-4 py-4 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ',
|
|
108
|
+
'group-hover:border-secondary-foreground/60 group-hover:bg-secondary/30 focus:bg-secondary/30 focus:border-secondary-foreground/60',
|
|
109
|
+
'pr-12 hover:cursor-pointer',
|
|
110
|
+
)}
|
|
111
|
+
{...getInputProps({
|
|
112
|
+
onMouseUp: (e) => {
|
|
113
|
+
const userHasSelectedSomeText =
|
|
114
|
+
e.currentTarget.selectionStart !==
|
|
115
|
+
e.currentTarget.selectionEnd
|
|
116
|
+
if (!userHasSelectedSomeText) {
|
|
117
|
+
// setInputValue('asdads')
|
|
118
|
+
e.currentTarget.select()
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
onKeyUp: (e) => {
|
|
122
|
+
if (e.key !== 'Enter') {
|
|
123
|
+
// console.log(e.target.value)
|
|
124
|
+
// setLastUsersInputText(e.target.value)
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
})}
|
|
128
|
+
/>
|
|
129
|
+
{comboInputValue.length ? (
|
|
130
|
+
<XIcon
|
|
131
|
+
className="absolute right-5 top-1/2 -translate-y-1/2 stroke-secondary-foreground/50 group-hover:stroke-secondary-foreground/60 group-hover:rotate-3 group-hover:scale-95 hover:stroke-secondary-foreground hover:bg-secondary rounded-full"
|
|
132
|
+
onClick={() => setInputValue('')}
|
|
133
|
+
/>
|
|
134
|
+
) : (
|
|
135
|
+
<Edit3Icon
|
|
136
|
+
{...getToggleButtonProps()}
|
|
137
|
+
className="absolute right-5 top-1/2 -translate-y-1/2 stroke-secondary-foreground/50 group-hover:stroke-secondary-foreground/60 group-hover:rotate-3 group-hover:scale-95"
|
|
138
|
+
/>
|
|
139
|
+
)}
|
|
140
|
+
|
|
141
|
+
<label
|
|
142
|
+
className={cn(
|
|
143
|
+
'absolute text-sm text-secondary-foreground/50',
|
|
144
|
+
'left-2 -top-0.5 -translate-y-1/2 text-muted-foreground bg-background rounded-2xl px-1',
|
|
145
|
+
)}
|
|
146
|
+
{...getLabelProps()}
|
|
147
|
+
>
|
|
148
|
+
Application
|
|
149
|
+
</label>
|
|
150
|
+
</div>
|
|
151
|
+
</PopoverTrigger>
|
|
152
|
+
|
|
153
|
+
<PopoverContent
|
|
154
|
+
className={cn(
|
|
155
|
+
'w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] bg-popover text-popover-foreground z-50 origin-(--radix-popover-content-transform-origin) rounded-b-md border shadow-md outline-hidden',
|
|
156
|
+
{ hidden: !comboIsOpen },
|
|
157
|
+
)}
|
|
158
|
+
onOpenAutoFocus={(e) => e.preventDefault()}
|
|
159
|
+
forceMount
|
|
160
|
+
>
|
|
161
|
+
<div {...getMenuProps()} className="">
|
|
162
|
+
{[...mapDisplayedItems(displayedItems)].map(
|
|
163
|
+
({ item, itemRenderData, isChild }, index) => {
|
|
164
|
+
return (
|
|
165
|
+
<DisplayItem
|
|
166
|
+
key={item.slug}
|
|
167
|
+
ctx={ctx}
|
|
168
|
+
item={item}
|
|
169
|
+
itemRenderData={itemRenderData}
|
|
170
|
+
isChild={isChild}
|
|
171
|
+
selected={comboSelectedItem?.slug === item.slug}
|
|
172
|
+
highlighted={highlightedIndex === index}
|
|
173
|
+
getItemProps={getItemProps}
|
|
174
|
+
/>
|
|
175
|
+
)
|
|
176
|
+
},
|
|
177
|
+
)}
|
|
178
|
+
{displayedItems.length === 0 && (
|
|
179
|
+
<div className="text-secondary-foreground/50">
|
|
180
|
+
'{comboInputValue}' not found. Try a different search.
|
|
181
|
+
</div>
|
|
182
|
+
)}
|
|
183
|
+
</div>
|
|
184
|
+
<div className="flex justify-end items-center p-1 bg-secondary/30 border-t">
|
|
185
|
+
<Button className="h-1" variant="outline" size={'sm'}>
|
|
186
|
+
All Apps (34) <ExpandIcon />
|
|
187
|
+
</Button>
|
|
188
|
+
</div>
|
|
189
|
+
</PopoverContent>
|
|
190
|
+
{/* </PopoverAnchor> */}
|
|
191
|
+
</Popover>
|
|
192
|
+
</EhBaseSelectorRoot>
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface DisplayItemProps
|
|
197
|
+
extends React.ComponentPropsWithoutRef<'div'>,
|
|
198
|
+
AppAutoCompleteAmend {
|
|
199
|
+
item: BaseAutoCompletableItem
|
|
200
|
+
itemRenderData: BaseAutoCompleteItemRender
|
|
201
|
+
isChild?: boolean
|
|
202
|
+
selected: boolean
|
|
203
|
+
highlighted: boolean
|
|
204
|
+
getItemProps: (props: { item: BaseAutoCompletableItem }) => any
|
|
205
|
+
ctx: AutoCompleteContext
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function DisplayItem({
|
|
209
|
+
item,
|
|
210
|
+
itemRenderData,
|
|
211
|
+
selected,
|
|
212
|
+
isChild,
|
|
213
|
+
highlighted,
|
|
214
|
+
ctx,
|
|
215
|
+
getItemProps,
|
|
216
|
+
...props
|
|
217
|
+
}: DisplayItemProps) {
|
|
218
|
+
const { displayName, parentDisplayName, isDefaultGroupItem } = itemRenderData
|
|
219
|
+
|
|
220
|
+
const content = () => {
|
|
221
|
+
let finalStr = [parentDisplayName, isChild ? '-' : false, displayName]
|
|
222
|
+
.filter(Boolean)
|
|
223
|
+
.join(' / ')
|
|
224
|
+
if (isDefaultGroupItem && parentDisplayName) {
|
|
225
|
+
finalStr = parentDisplayName
|
|
226
|
+
}
|
|
227
|
+
if (isChild) {
|
|
228
|
+
return (
|
|
229
|
+
<div className="flex flex-row gap-1 items-center">
|
|
230
|
+
<div className="text-secondary-foreground/50 pl-2">
|
|
231
|
+
<CornerDownRight size={14} />
|
|
232
|
+
</div>
|
|
233
|
+
<div className="">
|
|
234
|
+
{highlightMatches(displayName, ctx.searchString)}
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return highlightMatches(finalStr, ctx.searchString)
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return (
|
|
244
|
+
<div
|
|
245
|
+
className={cn(
|
|
246
|
+
'cursor-pointer text-secondary-foreground px-4 py-2 rounded-md',
|
|
247
|
+
{
|
|
248
|
+
'bg-accent': highlighted,
|
|
249
|
+
},
|
|
250
|
+
)}
|
|
251
|
+
{...getItemProps({
|
|
252
|
+
item,
|
|
253
|
+
})}
|
|
254
|
+
{...props}
|
|
255
|
+
>
|
|
256
|
+
{content()}
|
|
257
|
+
</div>
|
|
258
|
+
)
|
|
259
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import type { ResourceJumpItem } from '../types'
|
|
3
|
+
import type { EhPluginResouceJumpCtx } from '~/modules/pluginCore/types'
|
|
4
|
+
import { getJumpUrl } from '~/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin'
|
|
5
|
+
|
|
6
|
+
export interface JumpUrlParams extends React.ComponentPropsWithoutRef<'a'> {
|
|
7
|
+
children: ReactNode
|
|
8
|
+
ctx: EhPluginResouceJumpCtx
|
|
9
|
+
jumpResource: ResourceJumpItem
|
|
10
|
+
id?: string
|
|
11
|
+
// substitution?: EhSubstitutionValue;
|
|
12
|
+
className?: string
|
|
13
|
+
isMain?: boolean
|
|
14
|
+
prefetch?: boolean
|
|
15
|
+
testId?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function JumpALink({
|
|
19
|
+
children,
|
|
20
|
+
ctx,
|
|
21
|
+
id,
|
|
22
|
+
jumpResource,
|
|
23
|
+
// substitution,
|
|
24
|
+
className,
|
|
25
|
+
isMain,
|
|
26
|
+
testId,
|
|
27
|
+
}: JumpUrlParams) {
|
|
28
|
+
const onClick = () => {
|
|
29
|
+
// if (jumpResource == null) {
|
|
30
|
+
// return
|
|
31
|
+
// }
|
|
32
|
+
// ...existing code...
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const jumpUrl = getJumpUrl(jumpResource, ctx)
|
|
36
|
+
if (!jumpUrl) {
|
|
37
|
+
return undefined
|
|
38
|
+
}
|
|
39
|
+
return (
|
|
40
|
+
<a
|
|
41
|
+
id={id}
|
|
42
|
+
data-testid={testId}
|
|
43
|
+
href={jumpUrl}
|
|
44
|
+
onClick={onClick}
|
|
45
|
+
onAuxClick={onClick}
|
|
46
|
+
className={className}
|
|
47
|
+
target="_blank"
|
|
48
|
+
rel="noreferrer"
|
|
49
|
+
title={isMain ? 'Jump to selected app' : undefined}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</a>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import cn from 'classnames'
|
|
2
|
+
import { useResourceJumpContext } from '../ResourceJumpContext'
|
|
3
|
+
import { JumpALink } from './JumpALink'
|
|
4
|
+
import { useEnvironmentContext } from '~/modules/environment/EnvironmentContext'
|
|
5
|
+
import {
|
|
6
|
+
formatJumpButtonTitle,
|
|
7
|
+
isAutocompleteItem,
|
|
8
|
+
} from '~/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin'
|
|
9
|
+
|
|
10
|
+
export const JUMP_MAIN_BTN_ID = 'jump-main-button'
|
|
11
|
+
|
|
12
|
+
export interface JumpMainButtonProps {
|
|
13
|
+
className?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function JumpMainButton({ className }: JumpMainButtonProps) {
|
|
17
|
+
const { currentResourceJump, getJumpUrl } = useResourceJumpContext()
|
|
18
|
+
|
|
19
|
+
const { currentEnv } = useEnvironmentContext()
|
|
20
|
+
|
|
21
|
+
const url =
|
|
22
|
+
currentResourceJump && currentEnv
|
|
23
|
+
? getJumpUrl(currentResourceJump.slug, currentEnv.slug)
|
|
24
|
+
: undefined
|
|
25
|
+
|
|
26
|
+
let buttonTitle = 'n/a'
|
|
27
|
+
if (isAutocompleteItem(currentResourceJump)) {
|
|
28
|
+
// If the current resource jump is an autocomplete item, format the button title
|
|
29
|
+
buttonTitle = formatJumpButtonTitle(currentResourceJump)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// .btn:active:hover,
|
|
33
|
+
// .btn:active:focus {
|
|
34
|
+
// animation: button-pop 0s ease-out;
|
|
35
|
+
// transform: scale(var(--btn-focus-scale, 0.97));
|
|
36
|
+
// }
|
|
37
|
+
|
|
38
|
+
// @media (prefers-reduced-motion: no-preference) {
|
|
39
|
+
|
|
40
|
+
// .btn {
|
|
41
|
+
// animation: button-pop var(--animation-btn, 0.25s) ease-out;
|
|
42
|
+
// }
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div className={cn('relative flex justify-center', className)}>
|
|
47
|
+
{currentResourceJump !== undefined && url !== undefined ? (
|
|
48
|
+
<JumpALink
|
|
49
|
+
id={JUMP_MAIN_BTN_ID}
|
|
50
|
+
testId={'jump-main-button'}
|
|
51
|
+
ctx={{
|
|
52
|
+
env: currentEnv,
|
|
53
|
+
}}
|
|
54
|
+
jumpResource={currentResourceJump}
|
|
55
|
+
isMain={true}
|
|
56
|
+
className={cn(
|
|
57
|
+
'border border-secondary-foreground/50 primary text-center rounded-md px-8 py-4 h-auto shadow-xl group indicator relative hover:bg-base-content/10 hover:text-base-content w-full hover:bg-accent hover:text-accent-foreground ease-out ',
|
|
58
|
+
'active:hover:scale-(--btn-focus-scale) active:focus:scale-(--btn-focus-scale) motion-safe:duration-200',
|
|
59
|
+
)}
|
|
60
|
+
>
|
|
61
|
+
<div className="absolute top-0 bottom-0 right-0 flex items-center text-xl text-hopper invisible lg:visible font-semibold select-none">
|
|
62
|
+
<div
|
|
63
|
+
className={cn(
|
|
64
|
+
'mr-12 group-hover:motion-safe:-translate-x-0.5 group-hover:motion-safe:translate-y-0.5 group-hover:motion-safe:scale-y-90 group-hover:motion-safe:rotate-2 origin-bottom transition-transform motion-safe:duration-100',
|
|
65
|
+
)}
|
|
66
|
+
>
|
|
67
|
+
JUMP
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
className={'flex flex-col gap-6'}
|
|
72
|
+
data-testid={'jump-main-button-text'}
|
|
73
|
+
>
|
|
74
|
+
<div>
|
|
75
|
+
<code>{buttonTitle}</code>
|
|
76
|
+
</div>
|
|
77
|
+
<div>
|
|
78
|
+
<code>{currentEnv?.slug}</code>
|
|
79
|
+
</div>
|
|
80
|
+
<div
|
|
81
|
+
className={
|
|
82
|
+
'group-hover:underline text-xs text-wrap font-semibold'
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
{url}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</JumpALink>
|
|
89
|
+
) : (
|
|
90
|
+
<div className="border border-dashed border-black dark:border-white rounded flex justify-center p-4 flex-col cursor-not-allowed w-full">
|
|
91
|
+
not ready
|
|
92
|
+
{/* <MainJumpButtonNotReady isHovered={isHovered} /> */}
|
|
93
|
+
</div>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { EhJumpResourceSelector } from './EhJumpResourceSelector'
|
|
2
|
+
import type { ResourceJumpLoaderReturn } from '../types'
|
|
3
|
+
import { Separator } from '~/components/ui/separator'
|
|
4
|
+
import { EnvironmentProvider } from '~/modules/environment/EnvironmentContext'
|
|
5
|
+
import { EhEnvSelector } from '~/modules/environment/ui/EhEnvSelector'
|
|
6
|
+
import { ResourceJumpProvider } from '~/modules/resourceJump/ResourceJumpContext'
|
|
7
|
+
import { JumpMainButton } from '~/modules/resourceJump/ui/JumpMainButton'
|
|
8
|
+
import { EnvQuickJumpBar } from '~/ui/components/quickBar/EnvQuickJumpBar'
|
|
9
|
+
import { MainLayout } from '~/ui/layout/MainLayout'
|
|
10
|
+
import { TopLevelProviders } from '~/ui/layout/TopLevelProviders'
|
|
11
|
+
|
|
12
|
+
export interface ResourceJumpLayoutProps {
|
|
13
|
+
loaderData: ResourceJumpLoaderReturn
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function ResourceJumpLayout({
|
|
17
|
+
loaderData: loaderData,
|
|
18
|
+
}: ResourceJumpLayoutProps) {
|
|
19
|
+
return (
|
|
20
|
+
<TopLevelProviders>
|
|
21
|
+
<EnvironmentProvider initialEnvSlug={loaderData.envSlug}>
|
|
22
|
+
<ResourceJumpProvider resourceJumpLoader={loaderData}>
|
|
23
|
+
<MainLayout>
|
|
24
|
+
<div className="flex gap-4 flex-row">
|
|
25
|
+
<EhEnvSelector className="flex flex-col items-start gap-2 w-4/12" />
|
|
26
|
+
<div>
|
|
27
|
+
<Separator
|
|
28
|
+
orientation="vertical"
|
|
29
|
+
className="bg-secondary-foreground/10"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
<EhJumpResourceSelector className="flex flex-col items-start gap-2 w-8/12" />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div>
|
|
36
|
+
<div className="flex flex-col items-start gap-2 w-4/12">
|
|
37
|
+
<EnvQuickJumpBar className="w-full" />
|
|
38
|
+
</div>
|
|
39
|
+
<div>
|
|
40
|
+
<Separator
|
|
41
|
+
orientation="vertical"
|
|
42
|
+
className="bg-secondary-foreground/10"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div>
|
|
47
|
+
<JumpMainButton className="px-8 py-4 w-full max-w-[1000px] justify-self-center mt-4" />
|
|
48
|
+
</div>
|
|
49
|
+
{/* <QuickJumpBar /> */}
|
|
50
|
+
|
|
51
|
+
{/* <AppSelectorDemo /> */}
|
|
52
|
+
|
|
53
|
+
{/* AppDropdownContent for testing - make it larger
|
|
54
|
+
<div className="border border-border rounded-lg p-6 bg-card">
|
|
55
|
+
<h2 className="text-lg font-semibold mb-4">AppDropdownContent Preview</h2>
|
|
56
|
+
<div className="w-full max-w-2xl">
|
|
57
|
+
<AppDropdownContent
|
|
58
|
+
searchValue=""
|
|
59
|
+
onSelect={(value) => console.log("Selected:", value)}
|
|
60
|
+
getItemProps={(options) => options}
|
|
61
|
+
highlightedIndex={-1}
|
|
62
|
+
isUntouched={true}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</div> */}
|
|
66
|
+
|
|
67
|
+
{/* <WidgetGrid widgets={widgets} onAddWidget={handleAddWidget} /> */}
|
|
68
|
+
</MainLayout>
|
|
69
|
+
</ResourceJumpProvider>
|
|
70
|
+
</EnvironmentProvider>
|
|
71
|
+
</TopLevelProviders>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createContext, use, useEffect, useMemo } from 'react'
|
|
2
|
+
import type { ReactNode } from 'react'
|
|
3
|
+
import type { ResouceJumpItemParent } from '~/modules/resourceJump/types'
|
|
4
|
+
import { useBootstrapConfig } from '~/modules/config/BootstrapConfigContext'
|
|
5
|
+
import { usePluginManagerForPlugin } from '~/modules/pluginCore/PluginManagerContext'
|
|
6
|
+
|
|
7
|
+
export interface PageUrlPluginContextIface {}
|
|
8
|
+
|
|
9
|
+
const PageUrlPluginContext = createContext<
|
|
10
|
+
PageUrlPluginContextIface | undefined
|
|
11
|
+
>(undefined)
|
|
12
|
+
|
|
13
|
+
interface PageUrlPluginProviderProps {
|
|
14
|
+
children: ReactNode
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function PageUrlPluginContextProvider({
|
|
18
|
+
children,
|
|
19
|
+
}: PageUrlPluginProviderProps) {
|
|
20
|
+
const { setResouceJumps } = usePluginManagerForPlugin('pageUrl')
|
|
21
|
+
const { apps } = useBootstrapConfig()
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const jumpLinks = Object.values(apps).flatMap((app) => {
|
|
25
|
+
const parent: ResouceJumpItemParent = {
|
|
26
|
+
type: 'pageUrlParent',
|
|
27
|
+
displayName: app.displayName,
|
|
28
|
+
hasSingleChild: app.ui?.pages.length === 1,
|
|
29
|
+
}
|
|
30
|
+
return (
|
|
31
|
+
app.ui?.pages.map((page) => {
|
|
32
|
+
return {
|
|
33
|
+
type: 'pageUrl',
|
|
34
|
+
displayName: page.displayName || page.slug,
|
|
35
|
+
parent: parent,
|
|
36
|
+
slug: `${app.slug}-${page.slug}`,
|
|
37
|
+
}
|
|
38
|
+
}) || []
|
|
39
|
+
)
|
|
40
|
+
})
|
|
41
|
+
setResouceJumps(jumpLinks)
|
|
42
|
+
}, [apps, setResouceJumps])
|
|
43
|
+
|
|
44
|
+
const value: PageUrlPluginContextIface = useMemo(() => ({}), [])
|
|
45
|
+
|
|
46
|
+
return <PageUrlPluginContext value={value}>{children}</PageUrlPluginContext>
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function usePageUrlPlugin(): PageUrlPluginContextIface {
|
|
50
|
+
const context = use(PageUrlPluginContext)
|
|
51
|
+
if (context === undefined) {
|
|
52
|
+
throw new Error('useEhUserContext must be used within an EhUserProvider')
|
|
53
|
+
}
|
|
54
|
+
return context
|
|
55
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BaseAutoCompleteItemRender,
|
|
3
|
+
EhPluginResouceJumpCtx,
|
|
4
|
+
} from '~/modules/pluginCore/types'
|
|
5
|
+
import type { ResourceJumpItem } from '~/modules/resourceJump/types'
|
|
6
|
+
import type { PluginPageUrlAutocompleteItem } from './pageUrlTypes'
|
|
7
|
+
|
|
8
|
+
export function isAutocompleteItem(
|
|
9
|
+
item: { type?: string } | null | undefined,
|
|
10
|
+
): item is PluginPageUrlAutocompleteItem {
|
|
11
|
+
return item?.type === 'pageUrl'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function getRenderData(
|
|
15
|
+
item: PluginPageUrlAutocompleteItem,
|
|
16
|
+
): BaseAutoCompleteItemRender {
|
|
17
|
+
return {
|
|
18
|
+
displayName: item.displayName,
|
|
19
|
+
parentDisplayName: item.parent?.displayName,
|
|
20
|
+
isDefaultGroupItem: item.slug.endsWith('-home'),
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function autocompleteFilter(
|
|
25
|
+
items: Array<PluginPageUrlAutocompleteItem>,
|
|
26
|
+
needle: string,
|
|
27
|
+
): Array<PluginPageUrlAutocompleteItem> {
|
|
28
|
+
return items.filter((item) => {
|
|
29
|
+
return (
|
|
30
|
+
item.displayName.toLowerCase().includes(needle.toLowerCase()) ||
|
|
31
|
+
(item.parent &&
|
|
32
|
+
item.parent.displayName.toLowerCase().includes(needle.toLowerCase()))
|
|
33
|
+
)
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function autocompleteToString(
|
|
38
|
+
item: PluginPageUrlAutocompleteItem,
|
|
39
|
+
): string {
|
|
40
|
+
return formatJumpButtonTitle(item)
|
|
41
|
+
// return item.displayName;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function formatJumpButtonTitle(
|
|
45
|
+
item: PluginPageUrlAutocompleteItem,
|
|
46
|
+
): string {
|
|
47
|
+
if (item.parent && item.parent.displayName) {
|
|
48
|
+
if (item.parent.hasSingleChild) {
|
|
49
|
+
return item.parent.displayName
|
|
50
|
+
}
|
|
51
|
+
return `${item.parent.displayName} :: ${item.displayName}`
|
|
52
|
+
}
|
|
53
|
+
return item.displayName
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function getJumpUrl(
|
|
57
|
+
jumpResource: ResourceJumpItem | undefined,
|
|
58
|
+
ctx: EhPluginResouceJumpCtx,
|
|
59
|
+
): string {
|
|
60
|
+
console.log('jump Url', jumpResource, ctx)
|
|
61
|
+
|
|
62
|
+
if (!jumpResource) {
|
|
63
|
+
return ''
|
|
64
|
+
}
|
|
65
|
+
return `https://${jumpResource.slug}.ru`
|
|
66
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PluginPageUrlAutoCompletableParent,
|
|
3
|
+
PluginPageUrlAutocompleteItem,
|
|
4
|
+
} from './pageUrlTypes'
|
|
5
|
+
import type {
|
|
6
|
+
EhPluginResouceJumpFactoryCtx,
|
|
7
|
+
EhPluginResourceJumpable,
|
|
8
|
+
} from '~/modules/pluginCore/types'
|
|
9
|
+
|
|
10
|
+
export class PageUrlJumpPlugin implements EhPluginResourceJumpable {
|
|
11
|
+
public readonly name = 'pageUrl'
|
|
12
|
+
|
|
13
|
+
factoryPageJumpAutocompleteItems({
|
|
14
|
+
bootstrapConfig,
|
|
15
|
+
}: EhPluginResouceJumpFactoryCtx): Array<PluginPageUrlAutocompleteItem> {
|
|
16
|
+
return Object.values(bootstrapConfig.apps).flatMap((app) => {
|
|
17
|
+
const parent: PluginPageUrlAutoCompletableParent = {
|
|
18
|
+
type: 'pageUrlParent',
|
|
19
|
+
displayName: app.displayName,
|
|
20
|
+
hasSingleChild: app.ui?.pages.length === 1,
|
|
21
|
+
}
|
|
22
|
+
return (
|
|
23
|
+
app.ui?.pages.map((page) => {
|
|
24
|
+
return {
|
|
25
|
+
type: 'pageUrl',
|
|
26
|
+
displayName: page.displayName || page.slug,
|
|
27
|
+
parent: parent,
|
|
28
|
+
slug: `${app.slug}-${page.slug}`,
|
|
29
|
+
}
|
|
30
|
+
}) || []
|
|
31
|
+
)
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function formatPageTitleForMainJumpButton() {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BaseAppAutoCompletableParent,
|
|
3
|
+
BaseAutoCompletableItem,
|
|
4
|
+
} from '~/modules/pluginCore/types'
|
|
5
|
+
|
|
6
|
+
export interface PluginPageUrlAutoCompletableParent
|
|
7
|
+
extends BaseAppAutoCompletableParent {
|
|
8
|
+
type: 'pageUrlParent'
|
|
9
|
+
displayName: string
|
|
10
|
+
aliases?: Array<string>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface PluginPageUrlAutocompleteItem extends BaseAutoCompletableItem {
|
|
14
|
+
type: 'pageUrl'
|
|
15
|
+
displayName: string
|
|
16
|
+
parent?: PluginPageUrlAutoCompletableParent
|
|
17
|
+
}
|