@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,209 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Popover, PopoverContent } from "@radix-ui/react-popover";
|
|
3
|
+
import { useCombobox } from "downshift";
|
|
4
|
+
import { XIcon, Edit3Icon, ExpandIcon, CornerDownRight } from "lucide-react";
|
|
5
|
+
import { unique } from "radashi";
|
|
6
|
+
import React__default, { useEffect, useMemo } from "react";
|
|
7
|
+
import { EhBaseSelectorRoot } from "../../../ui/components/commandInput/EhBaseSelector.js";
|
|
8
|
+
import { mapDisplayedItems } from "../helpers.js";
|
|
9
|
+
import { useResourceJumpContext } from "../ResourceJumpContext.js";
|
|
10
|
+
import { Button } from "../../../components/ui/button.js";
|
|
11
|
+
import { PopoverTrigger } from "../../../components/ui/popover.js";
|
|
12
|
+
import { cn } from "../../../lib/utils.js";
|
|
13
|
+
import { isAutocompleteItem, autocompleteToString, autocompleteFilter } from "../../../plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.js";
|
|
14
|
+
import { highlightMatches } from "../../../util/highlightMatches.js";
|
|
15
|
+
function EhJumpResourceSelector({
|
|
16
|
+
className = ""
|
|
17
|
+
}) {
|
|
18
|
+
const { jumpResources, currentResourceJump, setCurrentResourceJumpSlug } = useResourceJumpContext();
|
|
19
|
+
const appFilter = (needle, allItems) => {
|
|
20
|
+
return autocompleteFilter(
|
|
21
|
+
allItems.filter((i) => isAutocompleteItem(i)),
|
|
22
|
+
needle
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
const [displayedItems, setDisplayedItems] = React__default.useState(jumpResources);
|
|
26
|
+
const {
|
|
27
|
+
isOpen: comboIsOpen,
|
|
28
|
+
getLabelProps,
|
|
29
|
+
getMenuProps,
|
|
30
|
+
getInputProps,
|
|
31
|
+
getToggleButtonProps,
|
|
32
|
+
highlightedIndex,
|
|
33
|
+
getItemProps,
|
|
34
|
+
selectItem,
|
|
35
|
+
selectedItem: comboSelectedItem,
|
|
36
|
+
inputValue: comboInputValue,
|
|
37
|
+
setInputValue
|
|
38
|
+
} = useCombobox({
|
|
39
|
+
onInputValueChange({
|
|
40
|
+
inputValue: changedInputValue,
|
|
41
|
+
isOpen: changedIsOpen
|
|
42
|
+
}) {
|
|
43
|
+
if (changedIsOpen) {
|
|
44
|
+
const matchedIds = unique(appFilter(changedInputValue, jumpResources));
|
|
45
|
+
setDisplayedItems(matchedIds);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
onSelectedItemChange({ selectedItem: changedSelectedItem }) {
|
|
49
|
+
setCurrentResourceJumpSlug(changedSelectedItem == null ? void 0 : changedSelectedItem.slug);
|
|
50
|
+
},
|
|
51
|
+
// selectedItem,
|
|
52
|
+
items: displayedItems,
|
|
53
|
+
itemToString(item) {
|
|
54
|
+
if (isAutocompleteItem(item)) {
|
|
55
|
+
return autocompleteToString(item);
|
|
56
|
+
}
|
|
57
|
+
return "n/a";
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (currentResourceJump) {
|
|
62
|
+
const f = jumpResources.find((e) => e.slug === currentResourceJump.slug);
|
|
63
|
+
if (f) {
|
|
64
|
+
selectItem(f);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, [currentResourceJump, jumpResources, selectItem]);
|
|
68
|
+
const ctx = useMemo(() => {
|
|
69
|
+
return {
|
|
70
|
+
searchString: comboInputValue
|
|
71
|
+
};
|
|
72
|
+
}, [comboInputValue]);
|
|
73
|
+
return /* @__PURE__ */ jsx(EhBaseSelectorRoot, { className, children: /* @__PURE__ */ jsxs(Popover, { open: comboIsOpen, children: [
|
|
74
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "relative group hover:cursor-pointer w-full", children: [
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
"input",
|
|
77
|
+
{
|
|
78
|
+
className: cn(
|
|
79
|
+
"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 ",
|
|
80
|
+
"group-hover:border-secondary-foreground/60 group-hover:bg-secondary/30 focus:bg-secondary/30 focus:border-secondary-foreground/60",
|
|
81
|
+
"pr-12 hover:cursor-pointer"
|
|
82
|
+
),
|
|
83
|
+
...getInputProps({
|
|
84
|
+
onMouseUp: (e) => {
|
|
85
|
+
const userHasSelectedSomeText = e.currentTarget.selectionStart !== e.currentTarget.selectionEnd;
|
|
86
|
+
if (!userHasSelectedSomeText) {
|
|
87
|
+
e.currentTarget.select();
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
onKeyUp: (e) => {
|
|
91
|
+
if (e.key !== "Enter") ;
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
comboInputValue.length ? /* @__PURE__ */ jsx(
|
|
97
|
+
XIcon,
|
|
98
|
+
{
|
|
99
|
+
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",
|
|
100
|
+
onClick: () => setInputValue("")
|
|
101
|
+
}
|
|
102
|
+
) : /* @__PURE__ */ jsx(
|
|
103
|
+
Edit3Icon,
|
|
104
|
+
{
|
|
105
|
+
...getToggleButtonProps(),
|
|
106
|
+
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"
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
"label",
|
|
111
|
+
{
|
|
112
|
+
className: cn(
|
|
113
|
+
"absolute text-sm text-secondary-foreground/50",
|
|
114
|
+
"left-2 -top-0.5 -translate-y-1/2 text-muted-foreground bg-background rounded-2xl px-1"
|
|
115
|
+
),
|
|
116
|
+
...getLabelProps(),
|
|
117
|
+
children: "Application"
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] }) }),
|
|
121
|
+
/* @__PURE__ */ jsxs(
|
|
122
|
+
PopoverContent,
|
|
123
|
+
{
|
|
124
|
+
className: cn(
|
|
125
|
+
"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",
|
|
126
|
+
{ hidden: !comboIsOpen }
|
|
127
|
+
),
|
|
128
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
129
|
+
forceMount: true,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ jsxs("div", { ...getMenuProps(), className: "", children: [
|
|
132
|
+
[...mapDisplayedItems(displayedItems)].map(
|
|
133
|
+
({ item, itemRenderData, isChild }, index) => {
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
DisplayItem,
|
|
136
|
+
{
|
|
137
|
+
ctx,
|
|
138
|
+
item,
|
|
139
|
+
itemRenderData,
|
|
140
|
+
isChild,
|
|
141
|
+
selected: (comboSelectedItem == null ? void 0 : comboSelectedItem.slug) === item.slug,
|
|
142
|
+
highlighted: highlightedIndex === index,
|
|
143
|
+
getItemProps
|
|
144
|
+
},
|
|
145
|
+
item.slug
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
displayedItems.length === 0 && /* @__PURE__ */ jsxs("div", { className: "text-secondary-foreground/50", children: [
|
|
150
|
+
"'",
|
|
151
|
+
comboInputValue,
|
|
152
|
+
"' not found. Try a different search."
|
|
153
|
+
] })
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end items-center p-1 bg-secondary/30 border-t", children: /* @__PURE__ */ jsxs(Button, { className: "h-1", variant: "outline", size: "sm", children: [
|
|
156
|
+
"All Apps (34) ",
|
|
157
|
+
/* @__PURE__ */ jsx(ExpandIcon, {})
|
|
158
|
+
] }) })
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
] }) });
|
|
163
|
+
}
|
|
164
|
+
function DisplayItem({
|
|
165
|
+
item,
|
|
166
|
+
itemRenderData,
|
|
167
|
+
selected,
|
|
168
|
+
isChild,
|
|
169
|
+
highlighted,
|
|
170
|
+
ctx,
|
|
171
|
+
getItemProps,
|
|
172
|
+
...props
|
|
173
|
+
}) {
|
|
174
|
+
const { displayName, parentDisplayName, isDefaultGroupItem } = itemRenderData;
|
|
175
|
+
const content = () => {
|
|
176
|
+
let finalStr = [parentDisplayName, isChild ? "-" : false, displayName].filter(Boolean).join(" / ");
|
|
177
|
+
if (isDefaultGroupItem && parentDisplayName) {
|
|
178
|
+
finalStr = parentDisplayName;
|
|
179
|
+
}
|
|
180
|
+
if (isChild) {
|
|
181
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-1 items-center", children: [
|
|
182
|
+
/* @__PURE__ */ jsx("div", { className: "text-secondary-foreground/50 pl-2", children: /* @__PURE__ */ jsx(CornerDownRight, { size: 14 }) }),
|
|
183
|
+
/* @__PURE__ */ jsx("div", { className: "", children: highlightMatches(displayName, ctx.searchString) })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
return highlightMatches(finalStr, ctx.searchString);
|
|
187
|
+
};
|
|
188
|
+
return /* @__PURE__ */ jsx(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
className: cn(
|
|
192
|
+
"cursor-pointer text-secondary-foreground px-4 py-2 rounded-md",
|
|
193
|
+
{
|
|
194
|
+
"bg-accent": highlighted
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
...getItemProps({
|
|
198
|
+
item
|
|
199
|
+
}),
|
|
200
|
+
...props,
|
|
201
|
+
children: content()
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
export {
|
|
206
|
+
DisplayItem,
|
|
207
|
+
EhJumpResourceSelector
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=EhJumpResourceSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EhJumpResourceSelector.js","sources":["../../../../../src/modules/resourceJump/ui/EhJumpResourceSelector.tsx"],"sourcesContent":["import { Popover, PopoverContent } from '@radix-ui/react-popover'\nimport { useCombobox } from 'downshift'\nimport { CornerDownRight, Edit3Icon, ExpandIcon, XIcon } from 'lucide-react'\nimport { unique } from 'radashi'\nimport React, { useEffect, useMemo } from 'react'\nimport { EhBaseSelectorRoot } from '../../../ui/components/commandInput/EhBaseSelector'\nimport { mapDisplayedItems } from '../helpers'\nimport { useResourceJumpContext } from '../ResourceJumpContext'\nimport type {\n BaseAutoCompletableItem,\n BaseAutoCompleteItemRender,\n} from '~/modules/pluginCore/types'\nimport type {\n AppAutoCompleteAmend,\n AutoCompleteContext,\n} from '../../../ui/components/commandInput/types'\nimport { Button } from '~/components/ui/button'\nimport { PopoverTrigger } from '~/components/ui/popover'\nimport { cn } from '~/lib/utils'\nimport {\n autocompleteFilter,\n autocompleteToString,\n isAutocompleteItem,\n} from '~/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin'\nimport { highlightMatches } from '~/util/highlightMatches'\n\ninterface EhJumpResourceSelectorProps {\n className?: string\n}\n\nexport function EhJumpResourceSelector({\n className = '',\n}: EhJumpResourceSelectorProps) {\n const { jumpResources, currentResourceJump, setCurrentResourceJumpSlug } =\n useResourceJumpContext()\n\n const appFilter = (\n needle: string,\n allItems: Array<BaseAutoCompletableItem>,\n ) => {\n return autocompleteFilter(\n allItems.filter((i) => isAutocompleteItem(i)),\n needle,\n )\n }\n\n const [displayedItems, setDisplayedItems] =\n React.useState<Array<BaseAutoCompletableItem>>(jumpResources)\n\n const {\n isOpen: comboIsOpen,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getToggleButtonProps,\n highlightedIndex,\n getItemProps,\n selectItem,\n selectedItem: comboSelectedItem,\n inputValue: comboInputValue,\n setInputValue,\n } = useCombobox<BaseAutoCompletableItem>({\n onInputValueChange({\n inputValue: changedInputValue,\n isOpen: changedIsOpen,\n }) {\n if (changedIsOpen) {\n const matchedIds = unique(appFilter(changedInputValue, jumpResources))\n setDisplayedItems(matchedIds)\n }\n },\n onSelectedItemChange({ selectedItem: changedSelectedItem }) {\n setCurrentResourceJumpSlug(changedSelectedItem?.slug)\n },\n // selectedItem,\n items: displayedItems,\n itemToString(item) {\n if (isAutocompleteItem(item)) {\n return autocompleteToString(item)\n }\n return 'n/a'\n },\n })\n\n useEffect(() => {\n if (currentResourceJump) {\n const f = jumpResources.find((e) => e.slug === currentResourceJump.slug)\n if (f) {\n selectItem(f)\n }\n }\n }, [currentResourceJump, jumpResources, selectItem])\n\n const ctx = useMemo<AutoCompleteContext>(() => {\n return {\n searchString: comboInputValue,\n }\n }, [comboInputValue])\n\n return (\n <EhBaseSelectorRoot className={className}>\n <Popover open={comboIsOpen}>\n <PopoverTrigger asChild>\n <div className=\"relative group hover:cursor-pointer w-full\">\n <input\n className={cn(\n '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 ',\n 'group-hover:border-secondary-foreground/60 group-hover:bg-secondary/30 focus:bg-secondary/30 focus:border-secondary-foreground/60',\n 'pr-12 hover:cursor-pointer',\n )}\n {...getInputProps({\n onMouseUp: (e) => {\n const userHasSelectedSomeText =\n e.currentTarget.selectionStart !==\n e.currentTarget.selectionEnd\n if (!userHasSelectedSomeText) {\n // setInputValue('asdads')\n e.currentTarget.select()\n }\n },\n onKeyUp: (e) => {\n if (e.key !== 'Enter') {\n // console.log(e.target.value)\n // setLastUsersInputText(e.target.value)\n }\n },\n })}\n />\n {comboInputValue.length ? (\n <XIcon\n 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\"\n onClick={() => setInputValue('')}\n />\n ) : (\n <Edit3Icon\n {...getToggleButtonProps()}\n 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\"\n />\n )}\n\n <label\n className={cn(\n 'absolute text-sm text-secondary-foreground/50',\n 'left-2 -top-0.5 -translate-y-1/2 text-muted-foreground bg-background rounded-2xl px-1',\n )}\n {...getLabelProps()}\n >\n Application\n </label>\n </div>\n </PopoverTrigger>\n\n <PopoverContent\n className={cn(\n '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',\n { hidden: !comboIsOpen },\n )}\n onOpenAutoFocus={(e) => e.preventDefault()}\n forceMount\n >\n <div {...getMenuProps()} className=\"\">\n {[...mapDisplayedItems(displayedItems)].map(\n ({ item, itemRenderData, isChild }, index) => {\n return (\n <DisplayItem\n key={item.slug}\n ctx={ctx}\n item={item}\n itemRenderData={itemRenderData}\n isChild={isChild}\n selected={comboSelectedItem?.slug === item.slug}\n highlighted={highlightedIndex === index}\n getItemProps={getItemProps}\n />\n )\n },\n )}\n {displayedItems.length === 0 && (\n <div className=\"text-secondary-foreground/50\">\n '{comboInputValue}' not found. Try a different search.\n </div>\n )}\n </div>\n <div className=\"flex justify-end items-center p-1 bg-secondary/30 border-t\">\n <Button className=\"h-1\" variant=\"outline\" size={'sm'}>\n All Apps (34) <ExpandIcon />\n </Button>\n </div>\n </PopoverContent>\n {/* </PopoverAnchor> */}\n </Popover>\n </EhBaseSelectorRoot>\n )\n}\n\nexport interface DisplayItemProps\n extends React.ComponentPropsWithoutRef<'div'>,\n AppAutoCompleteAmend {\n item: BaseAutoCompletableItem\n itemRenderData: BaseAutoCompleteItemRender\n isChild?: boolean\n selected: boolean\n highlighted: boolean\n getItemProps: (props: { item: BaseAutoCompletableItem }) => any\n ctx: AutoCompleteContext\n}\n\nexport function DisplayItem({\n item,\n itemRenderData,\n selected,\n isChild,\n highlighted,\n ctx,\n getItemProps,\n ...props\n}: DisplayItemProps) {\n const { displayName, parentDisplayName, isDefaultGroupItem } = itemRenderData\n\n const content = () => {\n let finalStr = [parentDisplayName, isChild ? '-' : false, displayName]\n .filter(Boolean)\n .join(' / ')\n if (isDefaultGroupItem && parentDisplayName) {\n finalStr = parentDisplayName\n }\n if (isChild) {\n return (\n <div className=\"flex flex-row gap-1 items-center\">\n <div className=\"text-secondary-foreground/50 pl-2\">\n <CornerDownRight size={14} />\n </div>\n <div className=\"\">\n {highlightMatches(displayName, ctx.searchString)}\n </div>\n </div>\n )\n }\n\n return highlightMatches(finalStr, ctx.searchString)\n }\n\n return (\n <div\n className={cn(\n 'cursor-pointer text-secondary-foreground px-4 py-2 rounded-md',\n {\n 'bg-accent': highlighted,\n },\n )}\n {...getItemProps({\n item,\n })}\n {...props}\n >\n {content()}\n </div>\n )\n}\n"],"names":["React"],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ResourceJumpItem } from '../types.js';
|
|
3
|
+
import { EhPluginResouceJumpCtx } from '~/modules/pluginCore/types';
|
|
4
|
+
export interface JumpUrlParams extends React.ComponentPropsWithoutRef<'a'> {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
ctx: EhPluginResouceJumpCtx;
|
|
7
|
+
jumpResource: ResourceJumpItem;
|
|
8
|
+
id?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
isMain?: boolean;
|
|
11
|
+
prefetch?: boolean;
|
|
12
|
+
testId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function JumpALink({ children, ctx, id, jumpResource, className, isMain, testId, }: JumpUrlParams): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getJumpUrl } from "../../../plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.js";
|
|
3
|
+
function JumpALink({
|
|
4
|
+
children,
|
|
5
|
+
ctx,
|
|
6
|
+
id,
|
|
7
|
+
jumpResource,
|
|
8
|
+
// substitution,
|
|
9
|
+
className,
|
|
10
|
+
isMain,
|
|
11
|
+
testId
|
|
12
|
+
}) {
|
|
13
|
+
const onClick = () => {
|
|
14
|
+
};
|
|
15
|
+
const jumpUrl = getJumpUrl(jumpResource, ctx);
|
|
16
|
+
if (!jumpUrl) {
|
|
17
|
+
return void 0;
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
"a",
|
|
21
|
+
{
|
|
22
|
+
id,
|
|
23
|
+
"data-testid": testId,
|
|
24
|
+
href: jumpUrl,
|
|
25
|
+
onClick,
|
|
26
|
+
onAuxClick: onClick,
|
|
27
|
+
className,
|
|
28
|
+
target: "_blank",
|
|
29
|
+
rel: "noreferrer",
|
|
30
|
+
title: isMain ? "Jump to selected app" : void 0,
|
|
31
|
+
children
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
JumpALink
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=JumpALink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JumpALink.js","sources":["../../../../../src/modules/resourceJump/ui/JumpALink.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { ResourceJumpItem } from '../types'\nimport type { EhPluginResouceJumpCtx } from '~/modules/pluginCore/types'\nimport { getJumpUrl } from '~/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin'\n\nexport interface JumpUrlParams extends React.ComponentPropsWithoutRef<'a'> {\n children: ReactNode\n ctx: EhPluginResouceJumpCtx\n jumpResource: ResourceJumpItem\n id?: string\n // substitution?: EhSubstitutionValue;\n className?: string\n isMain?: boolean\n prefetch?: boolean\n testId?: string\n}\n\nexport function JumpALink({\n children,\n ctx,\n id,\n jumpResource,\n // substitution,\n className,\n isMain,\n testId,\n}: JumpUrlParams) {\n const onClick = () => {\n // if (jumpResource == null) {\n // return\n // }\n // ...existing code...\n }\n\n const jumpUrl = getJumpUrl(jumpResource, ctx)\n if (!jumpUrl) {\n return undefined\n }\n return (\n <a\n id={id}\n data-testid={testId}\n href={jumpUrl}\n onClick={onClick}\n onAuxClick={onClick}\n className={className}\n target=\"_blank\"\n rel=\"noreferrer\"\n title={isMain ? 'Jump to selected app' : undefined}\n >\n {children}\n </a>\n )\n}\n"],"names":[],"mappings":";;AAiBO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACF,GAAkB;AAChB,QAAM,UAAU,MAAM;AAAA,EAKtB;AAEA,QAAM,UAAU,WAAW,cAAc,GAAG;AAC5C,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AACA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,eAAa;AAAA,MACb,MAAM;AAAA,MACN;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,OAAO,SAAS,yBAAyB;AAAA,MAExC;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import cn from "classnames";
|
|
3
|
+
import { useResourceJumpContext } from "../ResourceJumpContext.js";
|
|
4
|
+
import { JumpALink } from "./JumpALink.js";
|
|
5
|
+
import { useEnvironmentContext } from "../../environment/EnvironmentContext.js";
|
|
6
|
+
import { isAutocompleteItem, formatJumpButtonTitle } from "../../../plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.js";
|
|
7
|
+
const JUMP_MAIN_BTN_ID = "jump-main-button";
|
|
8
|
+
function JumpMainButton({ className }) {
|
|
9
|
+
const { currentResourceJump, getJumpUrl } = useResourceJumpContext();
|
|
10
|
+
const { currentEnv } = useEnvironmentContext();
|
|
11
|
+
const url = currentResourceJump && currentEnv ? getJumpUrl(currentResourceJump.slug, currentEnv.slug) : void 0;
|
|
12
|
+
let buttonTitle = "n/a";
|
|
13
|
+
if (isAutocompleteItem(currentResourceJump)) {
|
|
14
|
+
buttonTitle = formatJumpButtonTitle(currentResourceJump);
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { className: cn("relative flex justify-center", className), children: currentResourceJump !== void 0 && url !== void 0 ? /* @__PURE__ */ jsxs(
|
|
17
|
+
JumpALink,
|
|
18
|
+
{
|
|
19
|
+
id: JUMP_MAIN_BTN_ID,
|
|
20
|
+
testId: "jump-main-button",
|
|
21
|
+
ctx: {
|
|
22
|
+
env: currentEnv
|
|
23
|
+
},
|
|
24
|
+
jumpResource: currentResourceJump,
|
|
25
|
+
isMain: true,
|
|
26
|
+
className: cn(
|
|
27
|
+
"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 ",
|
|
28
|
+
"active:hover:scale-(--btn-focus-scale) active:focus:scale-(--btn-focus-scale) motion-safe:duration-200"
|
|
29
|
+
),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-0 bottom-0 right-0 flex items-center text-xl text-hopper invisible lg:visible font-semibold select-none", children: /* @__PURE__ */ jsx(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: cn(
|
|
35
|
+
"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"
|
|
36
|
+
),
|
|
37
|
+
children: "JUMP"
|
|
38
|
+
}
|
|
39
|
+
) }),
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: "flex flex-col gap-6",
|
|
44
|
+
"data-testid": "jump-main-button-text",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("code", { children: buttonTitle }) }),
|
|
47
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("code", { children: currentEnv == null ? void 0 : currentEnv.slug }) }),
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: "group-hover:underline text-xs text-wrap font-semibold",
|
|
52
|
+
children: url
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
) : /* @__PURE__ */ jsx("div", { className: "border border-dashed border-black dark:border-white rounded flex justify-center p-4 flex-col cursor-not-allowed w-full", children: "not ready" }) });
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
JUMP_MAIN_BTN_ID,
|
|
64
|
+
JumpMainButton
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=JumpMainButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JumpMainButton.js","sources":["../../../../../src/modules/resourceJump/ui/JumpMainButton.tsx"],"sourcesContent":["import cn from 'classnames'\nimport { useResourceJumpContext } from '../ResourceJumpContext'\nimport { JumpALink } from './JumpALink'\nimport { useEnvironmentContext } from '~/modules/environment/EnvironmentContext'\nimport {\n formatJumpButtonTitle,\n isAutocompleteItem,\n} from '~/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin'\n\nexport const JUMP_MAIN_BTN_ID = 'jump-main-button'\n\nexport interface JumpMainButtonProps {\n className?: string\n}\n\nexport function JumpMainButton({ className }: JumpMainButtonProps) {\n const { currentResourceJump, getJumpUrl } = useResourceJumpContext()\n\n const { currentEnv } = useEnvironmentContext()\n\n const url =\n currentResourceJump && currentEnv\n ? getJumpUrl(currentResourceJump.slug, currentEnv.slug)\n : undefined\n\n let buttonTitle = 'n/a'\n if (isAutocompleteItem(currentResourceJump)) {\n // If the current resource jump is an autocomplete item, format the button title\n buttonTitle = formatJumpButtonTitle(currentResourceJump)\n }\n\n // .btn:active:hover,\n // .btn:active:focus {\n // animation: button-pop 0s ease-out;\n // transform: scale(var(--btn-focus-scale, 0.97));\n // }\n\n // @media (prefers-reduced-motion: no-preference) {\n\n // .btn {\n // animation: button-pop var(--animation-btn, 0.25s) ease-out;\n // }\n // }\n\n return (\n <div className={cn('relative flex justify-center', className)}>\n {currentResourceJump !== undefined && url !== undefined ? (\n <JumpALink\n id={JUMP_MAIN_BTN_ID}\n testId={'jump-main-button'}\n ctx={{\n env: currentEnv,\n }}\n jumpResource={currentResourceJump}\n isMain={true}\n className={cn(\n '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 ',\n 'active:hover:scale-(--btn-focus-scale) active:focus:scale-(--btn-focus-scale) motion-safe:duration-200',\n )}\n >\n <div className=\"absolute top-0 bottom-0 right-0 flex items-center text-xl text-hopper invisible lg:visible font-semibold select-none\">\n <div\n className={cn(\n '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',\n )}\n >\n JUMP\n </div>\n </div>\n <div\n className={'flex flex-col gap-6'}\n data-testid={'jump-main-button-text'}\n >\n <div>\n <code>{buttonTitle}</code>\n </div>\n <div>\n <code>{currentEnv?.slug}</code>\n </div>\n <div\n className={\n 'group-hover:underline text-xs text-wrap font-semibold'\n }\n >\n {url}\n </div>\n </div>\n </JumpALink>\n ) : (\n <div className=\"border border-dashed border-black dark:border-white rounded flex justify-center p-4 flex-col cursor-not-allowed w-full\">\n not ready\n {/* <MainJumpButtonNotReady isHovered={isHovered} /> */}\n </div>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;AASO,MAAM,mBAAmB;AAMzB,SAAS,eAAe,EAAE,aAAkC;AACjE,QAAM,EAAE,qBAAqB,WAAA,IAAe,uBAAA;AAE5C,QAAM,EAAE,WAAA,IAAe,sBAAA;AAEvB,QAAM,MACJ,uBAAuB,aACnB,WAAW,oBAAoB,MAAM,WAAW,IAAI,IACpD;AAEN,MAAI,cAAc;AAClB,MAAI,mBAAmB,mBAAmB,GAAG;AAE3C,kBAAc,sBAAsB,mBAAmB;AAAA,EACzD;AAeA,SACE,oBAAC,OAAA,EAAI,WAAW,GAAG,gCAAgC,SAAS,GACzD,UAAA,wBAAwB,UAAa,QAAQ,SAC5C;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,QAAQ;AAAA,MACR,KAAK;AAAA,QACH,KAAK;AAAA,MAAA;AAAA,MAEP,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAA,oBAAC,OAAA,EAAI,WAAU,wHACb,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,YAAA;AAAA,YAEH,UAAA;AAAA,UAAA;AAAA,QAAA,GAGH;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,YACX,eAAa;AAAA,YAEb,UAAA;AAAA,cAAA,oBAAC,OAAA,EACC,UAAA,oBAAC,QAAA,EAAM,UAAA,YAAA,CAAY,GACrB;AAAA,kCACC,OAAA,EACC,UAAA,oBAAC,QAAA,EAAM,UAAA,yCAAY,MAAK,GAC1B;AAAA,cACA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WACE;AAAA,kBAGD,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA,IAGF,oBAAC,OAAA,EAAI,WAAU,0HAAyH,uBAGxI,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ResourceJumpLoaderReturn } from '../types.js';
|
|
2
|
+
export interface ResourceJumpLayoutProps {
|
|
3
|
+
loaderData: ResourceJumpLoaderReturn;
|
|
4
|
+
}
|
|
5
|
+
export declare function ResourceJumpLayout({ loaderData: loaderData, }: ResourceJumpLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { EhJumpResourceSelector } from "./EhJumpResourceSelector.js";
|
|
3
|
+
import { Separator } from "../../../components/ui/separator.js";
|
|
4
|
+
import { EnvironmentProvider } from "../../environment/EnvironmentContext.js";
|
|
5
|
+
import { EhEnvSelector } from "../../environment/ui/EhEnvSelector.js";
|
|
6
|
+
import { ResourceJumpProvider } from "../ResourceJumpContext.js";
|
|
7
|
+
import { JumpMainButton } from "./JumpMainButton.js";
|
|
8
|
+
import { EnvQuickJumpBar } from "../../../ui/components/quickBar/EnvQuickJumpBar.js";
|
|
9
|
+
import { MainLayout } from "../../../ui/layout/MainLayout.js";
|
|
10
|
+
import { TopLevelProviders } from "../../../ui/layout/TopLevelProviders.js";
|
|
11
|
+
function ResourceJumpLayout({
|
|
12
|
+
loaderData
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsx(TopLevelProviders, { children: /* @__PURE__ */ jsx(EnvironmentProvider, { initialEnvSlug: loaderData.envSlug, children: /* @__PURE__ */ jsx(ResourceJumpProvider, { resourceJumpLoader: loaderData, children: /* @__PURE__ */ jsxs(MainLayout, { children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-4 flex-row", children: [
|
|
16
|
+
/* @__PURE__ */ jsx(EhEnvSelector, { className: "flex flex-col items-start gap-2 w-4/12" }),
|
|
17
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
18
|
+
Separator,
|
|
19
|
+
{
|
|
20
|
+
orientation: "vertical",
|
|
21
|
+
className: "bg-secondary-foreground/10"
|
|
22
|
+
}
|
|
23
|
+
) }),
|
|
24
|
+
/* @__PURE__ */ jsx(EhJumpResourceSelector, { className: "flex flex-col items-start gap-2 w-8/12" })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col items-start gap-2 w-4/12", children: /* @__PURE__ */ jsx(EnvQuickJumpBar, { className: "w-full" }) }),
|
|
28
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
29
|
+
Separator,
|
|
30
|
+
{
|
|
31
|
+
orientation: "vertical",
|
|
32
|
+
className: "bg-secondary-foreground/10"
|
|
33
|
+
}
|
|
34
|
+
) })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(JumpMainButton, { className: "px-8 py-4 w-full max-w-[1000px] justify-self-center mt-4" }) })
|
|
37
|
+
] }) }) }) });
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
ResourceJumpLayout
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=ResouceJumpLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResouceJumpLayout.js","sources":["../../../../../src/modules/resourceJump/ui/ResouceJumpLayout.tsx"],"sourcesContent":["import { EhJumpResourceSelector } from './EhJumpResourceSelector'\nimport type { ResourceJumpLoaderReturn } from '../types'\nimport { Separator } from '~/components/ui/separator'\nimport { EnvironmentProvider } from '~/modules/environment/EnvironmentContext'\nimport { EhEnvSelector } from '~/modules/environment/ui/EhEnvSelector'\nimport { ResourceJumpProvider } from '~/modules/resourceJump/ResourceJumpContext'\nimport { JumpMainButton } from '~/modules/resourceJump/ui/JumpMainButton'\nimport { EnvQuickJumpBar } from '~/ui/components/quickBar/EnvQuickJumpBar'\nimport { MainLayout } from '~/ui/layout/MainLayout'\nimport { TopLevelProviders } from '~/ui/layout/TopLevelProviders'\n\nexport interface ResourceJumpLayoutProps {\n loaderData: ResourceJumpLoaderReturn\n}\n\nexport function ResourceJumpLayout({\n loaderData: loaderData,\n}: ResourceJumpLayoutProps) {\n return (\n <TopLevelProviders>\n <EnvironmentProvider initialEnvSlug={loaderData.envSlug}>\n <ResourceJumpProvider resourceJumpLoader={loaderData}>\n <MainLayout>\n <div className=\"flex gap-4 flex-row\">\n <EhEnvSelector className=\"flex flex-col items-start gap-2 w-4/12\" />\n <div>\n <Separator\n orientation=\"vertical\"\n className=\"bg-secondary-foreground/10\"\n />\n </div>\n <EhJumpResourceSelector className=\"flex flex-col items-start gap-2 w-8/12\" />\n </div>\n\n <div>\n <div className=\"flex flex-col items-start gap-2 w-4/12\">\n <EnvQuickJumpBar className=\"w-full\" />\n </div>\n <div>\n <Separator\n orientation=\"vertical\"\n className=\"bg-secondary-foreground/10\"\n />\n </div>\n </div>\n <div>\n <JumpMainButton className=\"px-8 py-4 w-full max-w-[1000px] justify-self-center mt-4\" />\n </div>\n {/* <QuickJumpBar /> */}\n\n {/* <AppSelectorDemo /> */}\n\n {/* AppDropdownContent for testing - make it larger\n <div className=\"border border-border rounded-lg p-6 bg-card\">\n <h2 className=\"text-lg font-semibold mb-4\">AppDropdownContent Preview</h2>\n <div className=\"w-full max-w-2xl\">\n <AppDropdownContent\n searchValue=\"\"\n onSelect={(value) => console.log(\"Selected:\", value)}\n getItemProps={(options) => options}\n highlightedIndex={-1}\n isUntouched={true}\n />\n </div>\n </div> */}\n\n {/* <WidgetGrid widgets={widgets} onAddWidget={handleAddWidget} /> */}\n </MainLayout>\n </ResourceJumpProvider>\n </EnvironmentProvider>\n </TopLevelProviders>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;AAeO,SAAS,mBAAmB;AAAA,EACjC;AACF,GAA4B;AAC1B,SACE,oBAAC,mBAAA,EACC,UAAA,oBAAC,qBAAA,EAAoB,gBAAgB,WAAW,SAC9C,UAAA,oBAAC,sBAAA,EAAqB,oBAAoB,YACxC,UAAA,qBAAC,YAAA,EACC,UAAA;AAAA,IAAA,qBAAC,OAAA,EAAI,WAAU,uBACb,UAAA;AAAA,MAAA,oBAAC,eAAA,EAAc,WAAU,yCAAA,CAAyC;AAAA,0BACjE,OAAA,EACC,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA,GAEd;AAAA,MACA,oBAAC,wBAAA,EAAuB,WAAU,yCAAA,CAAyC;AAAA,IAAA,GAC7E;AAAA,yBAEC,OAAA,EACC,UAAA;AAAA,MAAA,oBAAC,SAAI,WAAU,0CACb,8BAAC,iBAAA,EAAgB,WAAU,UAAS,EAAA,CACtC;AAAA,0BACC,OAAA,EACC,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA,EACZ,CACF;AAAA,IAAA,GACF;AAAA,wBACC,OAAA,EACC,UAAA,oBAAC,gBAAA,EAAe,WAAU,4DAA2D,EAAA,CACvF;AAAA,EAAA,GAoBF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PageUrlPluginContextIface {
|
|
3
|
+
}
|
|
4
|
+
interface PageUrlPluginProviderProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function PageUrlPluginContextProvider({ children, }: PageUrlPluginProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function usePageUrlPlugin(): PageUrlPluginContextIface;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, createContext } from "react";
|
|
3
|
+
import { useBootstrapConfig } from "../../../modules/config/BootstrapConfigContext.js";
|
|
4
|
+
import { usePluginManagerForPlugin } from "../../../modules/pluginCore/PluginManagerContext.js";
|
|
5
|
+
const PageUrlPluginContext = createContext(void 0);
|
|
6
|
+
function PageUrlPluginContextProvider({
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
const { setResouceJumps } = usePluginManagerForPlugin("pageUrl");
|
|
10
|
+
const { apps } = useBootstrapConfig();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const jumpLinks = Object.values(apps).flatMap((app) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const parent = {
|
|
15
|
+
type: "pageUrlParent",
|
|
16
|
+
displayName: app.displayName,
|
|
17
|
+
hasSingleChild: ((_a = app.ui) == null ? void 0 : _a.pages.length) === 1
|
|
18
|
+
};
|
|
19
|
+
return ((_b = app.ui) == null ? void 0 : _b.pages.map((page) => {
|
|
20
|
+
return {
|
|
21
|
+
type: "pageUrl",
|
|
22
|
+
displayName: page.displayName || page.slug,
|
|
23
|
+
parent,
|
|
24
|
+
slug: `${app.slug}-${page.slug}`
|
|
25
|
+
};
|
|
26
|
+
})) || [];
|
|
27
|
+
});
|
|
28
|
+
setResouceJumps(jumpLinks);
|
|
29
|
+
}, [apps, setResouceJumps]);
|
|
30
|
+
const value = useMemo(() => ({}), []);
|
|
31
|
+
return /* @__PURE__ */ jsx(PageUrlPluginContext, { value, children });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
PageUrlPluginContextProvider
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=PageUrlPluginContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageUrlPluginContext.js","sources":["../../../../../src/plugins/builtin/pageUrl/PageUrlPluginContext.tsx"],"sourcesContent":["import { createContext, use, useEffect, useMemo } from 'react'\nimport type { ReactNode } from 'react'\nimport type { ResouceJumpItemParent } from '~/modules/resourceJump/types'\nimport { useBootstrapConfig } from '~/modules/config/BootstrapConfigContext'\nimport { usePluginManagerForPlugin } from '~/modules/pluginCore/PluginManagerContext'\n\nexport interface PageUrlPluginContextIface {}\n\nconst PageUrlPluginContext = createContext<\n PageUrlPluginContextIface | undefined\n>(undefined)\n\ninterface PageUrlPluginProviderProps {\n children: ReactNode\n}\n\nexport function PageUrlPluginContextProvider({\n children,\n}: PageUrlPluginProviderProps) {\n const { setResouceJumps } = usePluginManagerForPlugin('pageUrl')\n const { apps } = useBootstrapConfig()\n\n useEffect(() => {\n const jumpLinks = Object.values(apps).flatMap((app) => {\n const parent: ResouceJumpItemParent = {\n type: 'pageUrlParent',\n displayName: app.displayName,\n hasSingleChild: app.ui?.pages.length === 1,\n }\n return (\n app.ui?.pages.map((page) => {\n return {\n type: 'pageUrl',\n displayName: page.displayName || page.slug,\n parent: parent,\n slug: `${app.slug}-${page.slug}`,\n }\n }) || []\n )\n })\n setResouceJumps(jumpLinks)\n }, [apps, setResouceJumps])\n\n const value: PageUrlPluginContextIface = useMemo(() => ({}), [])\n\n return <PageUrlPluginContext value={value}>{children}</PageUrlPluginContext>\n}\n\nexport function usePageUrlPlugin(): PageUrlPluginContextIface {\n const context = use(PageUrlPluginContext)\n if (context === undefined) {\n throw new Error('useEhUserContext must be used within an EhUserProvider')\n }\n return context\n}\n"],"names":[],"mappings":";;;;AAQA,MAAM,uBAAuB,cAE3B,MAAS;AAMJ,SAAS,6BAA6B;AAAA,EAC3C;AACF,GAA+B;AAC7B,QAAM,EAAE,gBAAA,IAAoB,0BAA0B,SAAS;AAC/D,QAAM,EAAE,KAAA,IAAS,mBAAA;AAEjB,YAAU,MAAM;AACd,UAAM,YAAY,OAAO,OAAO,IAAI,EAAE,QAAQ,CAAC,QAAQ;;AACrD,YAAM,SAAgC;AAAA,QACpC,MAAM;AAAA,QACN,aAAa,IAAI;AAAA,QACjB,kBAAgB,SAAI,OAAJ,mBAAQ,MAAM,YAAW;AAAA,MAAA;AAE3C,eACE,SAAI,OAAJ,mBAAQ,MAAM,IAAI,CAAC,SAAS;AAC1B,eAAO;AAAA,UACL,MAAM;AAAA,UACN,aAAa,KAAK,eAAe,KAAK;AAAA,UACtC;AAAA,UACA,MAAM,GAAG,IAAI,IAAI,IAAI,KAAK,IAAI;AAAA,QAAA;AAAA,MAElC,OAAM,CAAA;AAAA,IAEV,CAAC;AACD,oBAAgB,SAAS;AAAA,EAC3B,GAAG,CAAC,MAAM,eAAe,CAAC;AAE1B,QAAM,QAAmC,QAAQ,OAAO,CAAA,IAAK,CAAA,CAAE;AAE/D,SAAO,oBAAC,sBAAA,EAAqB,OAAe,SAAA,CAAS;AACvD;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseAutoCompleteItemRender, EhPluginResouceJumpCtx } from '~/modules/pluginCore/types';
|
|
2
|
+
import { ResourceJumpItem } from '~/modules/resourceJump/types';
|
|
3
|
+
import { PluginPageUrlAutocompleteItem } from './pageUrlTypes.js';
|
|
4
|
+
export declare function isAutocompleteItem(item: {
|
|
5
|
+
type?: string;
|
|
6
|
+
} | null | undefined): item is PluginPageUrlAutocompleteItem;
|
|
7
|
+
export declare function getRenderData(item: PluginPageUrlAutocompleteItem): BaseAutoCompleteItemRender;
|
|
8
|
+
export declare function autocompleteFilter(items: Array<PluginPageUrlAutocompleteItem>, needle: string): Array<PluginPageUrlAutocompleteItem>;
|
|
9
|
+
export declare function autocompleteToString(item: PluginPageUrlAutocompleteItem): string;
|
|
10
|
+
export declare function formatJumpButtonTitle(item: PluginPageUrlAutocompleteItem): string;
|
|
11
|
+
export declare function getJumpUrl(jumpResource: ResourceJumpItem | undefined, ctx: EhPluginResouceJumpCtx): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function isAutocompleteItem(item) {
|
|
2
|
+
return (item == null ? void 0 : item.type) === "pageUrl";
|
|
3
|
+
}
|
|
4
|
+
function getRenderData(item) {
|
|
5
|
+
var _a;
|
|
6
|
+
return {
|
|
7
|
+
displayName: item.displayName,
|
|
8
|
+
parentDisplayName: (_a = item.parent) == null ? void 0 : _a.displayName,
|
|
9
|
+
isDefaultGroupItem: item.slug.endsWith("-home")
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function autocompleteFilter(items, needle) {
|
|
13
|
+
return items.filter((item) => {
|
|
14
|
+
return item.displayName.toLowerCase().includes(needle.toLowerCase()) || item.parent && item.parent.displayName.toLowerCase().includes(needle.toLowerCase());
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function autocompleteToString(item) {
|
|
18
|
+
return formatJumpButtonTitle(item);
|
|
19
|
+
}
|
|
20
|
+
function formatJumpButtonTitle(item) {
|
|
21
|
+
if (item.parent && item.parent.displayName) {
|
|
22
|
+
if (item.parent.hasSingleChild) {
|
|
23
|
+
return item.parent.displayName;
|
|
24
|
+
}
|
|
25
|
+
return `${item.parent.displayName} :: ${item.displayName}`;
|
|
26
|
+
}
|
|
27
|
+
return item.displayName;
|
|
28
|
+
}
|
|
29
|
+
function getJumpUrl(jumpResource, ctx) {
|
|
30
|
+
console.log("jump Url", jumpResource, ctx);
|
|
31
|
+
if (!jumpResource) {
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
return `https://${jumpResource.slug}.ru`;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
autocompleteFilter,
|
|
38
|
+
autocompleteToString,
|
|
39
|
+
formatJumpButtonTitle,
|
|
40
|
+
getJumpUrl,
|
|
41
|
+
getRenderData,
|
|
42
|
+
isAutocompleteItem
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=pageUrlAutoCompletePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageUrlAutoCompletePlugin.js","sources":["../../../../../src/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.ts"],"sourcesContent":["import type {\n BaseAutoCompleteItemRender,\n EhPluginResouceJumpCtx,\n} from '~/modules/pluginCore/types'\nimport type { ResourceJumpItem } from '~/modules/resourceJump/types'\nimport type { PluginPageUrlAutocompleteItem } from './pageUrlTypes'\n\nexport function isAutocompleteItem(\n item: { type?: string } | null | undefined,\n): item is PluginPageUrlAutocompleteItem {\n return item?.type === 'pageUrl'\n}\n\nexport function getRenderData(\n item: PluginPageUrlAutocompleteItem,\n): BaseAutoCompleteItemRender {\n return {\n displayName: item.displayName,\n parentDisplayName: item.parent?.displayName,\n isDefaultGroupItem: item.slug.endsWith('-home'),\n }\n}\n\nexport function autocompleteFilter(\n items: Array<PluginPageUrlAutocompleteItem>,\n needle: string,\n): Array<PluginPageUrlAutocompleteItem> {\n return items.filter((item) => {\n return (\n item.displayName.toLowerCase().includes(needle.toLowerCase()) ||\n (item.parent &&\n item.parent.displayName.toLowerCase().includes(needle.toLowerCase()))\n )\n })\n}\n\nexport function autocompleteToString(\n item: PluginPageUrlAutocompleteItem,\n): string {\n return formatJumpButtonTitle(item)\n // return item.displayName;\n}\n\nexport function formatJumpButtonTitle(\n item: PluginPageUrlAutocompleteItem,\n): string {\n if (item.parent && item.parent.displayName) {\n if (item.parent.hasSingleChild) {\n return item.parent.displayName\n }\n return `${item.parent.displayName} :: ${item.displayName}`\n }\n return item.displayName\n}\n\nexport function getJumpUrl(\n jumpResource: ResourceJumpItem | undefined,\n ctx: EhPluginResouceJumpCtx,\n): string {\n console.log('jump Url', jumpResource, ctx)\n\n if (!jumpResource) {\n return ''\n }\n return `https://${jumpResource.slug}.ru`\n}\n"],"names":[],"mappings":"AAOO,SAAS,mBACd,MACuC;AACvC,UAAO,6BAAM,UAAS;AACxB;AAEO,SAAS,cACd,MAC4B;AARvB;AASL,SAAO;AAAA,IACL,aAAa,KAAK;AAAA,IAClB,oBAAmB,UAAK,WAAL,mBAAa;AAAA,IAChC,oBAAoB,KAAK,KAAK,SAAS,OAAO;AAAA,EAAA;AAElD;AAEO,SAAS,mBACd,OACA,QACsC;AACtC,SAAO,MAAM,OAAO,CAAC,SAAS;AAC5B,WACE,KAAK,YAAY,YAAA,EAAc,SAAS,OAAO,aAAa,KAC3D,KAAK,UACJ,KAAK,OAAO,YAAY,YAAA,EAAc,SAAS,OAAO,aAAa;AAAA,EAEzE,CAAC;AACH;AAEO,SAAS,qBACd,MACQ;AACR,SAAO,sBAAsB,IAAI;AAEnC;AAEO,SAAS,sBACd,MACQ;AACR,MAAI,KAAK,UAAU,KAAK,OAAO,aAAa;AAC1C,QAAI,KAAK,OAAO,gBAAgB;AAC9B,aAAO,KAAK,OAAO;AAAA,IACrB;AACA,WAAO,GAAG,KAAK,OAAO,WAAW,OAAO,KAAK,WAAW;AAAA,EAC1D;AACA,SAAO,KAAK;AACd;AAEO,SAAS,WACd,cACA,KACQ;AACR,UAAQ,IAAI,YAAY,cAAc,GAAG;AAEzC,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AACA,SAAO,WAAW,aAAa,IAAI;AACrC;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginPageUrlAutocompleteItem } from './pageUrlTypes.js';
|
|
2
|
+
import { EhPluginResouceJumpFactoryCtx, EhPluginResourceJumpable } from '~/modules/pluginCore/types';
|
|
3
|
+
export declare class PageUrlJumpPlugin implements EhPluginResourceJumpable {
|
|
4
|
+
readonly name = "pageUrl";
|
|
5
|
+
factoryPageJumpAutocompleteItems({ bootstrapConfig, }: EhPluginResouceJumpFactoryCtx): Array<PluginPageUrlAutocompleteItem>;
|
|
6
|
+
}
|
|
7
|
+
export declare function formatPageTitleForMainJumpButton(): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
class PageUrlJumpPlugin {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.name = "pageUrl";
|
|
4
|
+
}
|
|
5
|
+
factoryPageJumpAutocompleteItems({
|
|
6
|
+
bootstrapConfig
|
|
7
|
+
}) {
|
|
8
|
+
return Object.values(bootstrapConfig.apps).flatMap((app) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const parent = {
|
|
11
|
+
type: "pageUrlParent",
|
|
12
|
+
displayName: app.displayName,
|
|
13
|
+
hasSingleChild: ((_a = app.ui) == null ? void 0 : _a.pages.length) === 1
|
|
14
|
+
};
|
|
15
|
+
return ((_b = app.ui) == null ? void 0 : _b.pages.map((page) => {
|
|
16
|
+
return {
|
|
17
|
+
type: "pageUrl",
|
|
18
|
+
displayName: page.displayName || page.slug,
|
|
19
|
+
parent,
|
|
20
|
+
slug: `${app.slug}-${page.slug}`
|
|
21
|
+
};
|
|
22
|
+
})) || [];
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
PageUrlJumpPlugin
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=pageUrlJumpPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageUrlJumpPlugin.js","sources":["../../../../../src/plugins/builtin/pageUrl/pageUrlJumpPlugin.ts"],"sourcesContent":["import type {\n PluginPageUrlAutoCompletableParent,\n PluginPageUrlAutocompleteItem,\n} from './pageUrlTypes'\nimport type {\n EhPluginResouceJumpFactoryCtx,\n EhPluginResourceJumpable,\n} from '~/modules/pluginCore/types'\n\nexport class PageUrlJumpPlugin implements EhPluginResourceJumpable {\n public readonly name = 'pageUrl'\n\n factoryPageJumpAutocompleteItems({\n bootstrapConfig,\n }: EhPluginResouceJumpFactoryCtx): Array<PluginPageUrlAutocompleteItem> {\n return Object.values(bootstrapConfig.apps).flatMap((app) => {\n const parent: PluginPageUrlAutoCompletableParent = {\n type: 'pageUrlParent',\n displayName: app.displayName,\n hasSingleChild: app.ui?.pages.length === 1,\n }\n return (\n app.ui?.pages.map((page) => {\n return {\n type: 'pageUrl',\n displayName: page.displayName || page.slug,\n parent: parent,\n slug: `${app.slug}-${page.slug}`,\n }\n }) || []\n )\n })\n }\n}\n\nexport function formatPageTitleForMainJumpButton() {}\n"],"names":[],"mappings":"AASO,MAAM,kBAAsD;AAAA,EAA5D,cAAA;AACL,SAAgB,OAAO;AAAA,EAAA;AAAA,EAEvB,iCAAiC;AAAA,IAC/B;AAAA,EAAA,GACsE;AACtE,WAAO,OAAO,OAAO,gBAAgB,IAAI,EAAE,QAAQ,CAAC,QAAQ;AANzD;AAOD,YAAM,SAA6C;AAAA,QACjD,MAAM;AAAA,QACN,aAAa,IAAI;AAAA,QACjB,kBAAgB,SAAI,OAAJ,mBAAQ,MAAM,YAAW;AAAA,MAAA;AAE3C,eACE,SAAI,OAAJ,mBAAQ,MAAM,IAAI,CAAC,SAAS;AAC1B,eAAO;AAAA,UACL,MAAM;AAAA,UACN,aAAa,KAAK,eAAe,KAAK;AAAA,UACtC;AAAA,UACA,MAAM,GAAG,IAAI,IAAI,IAAI,KAAK,IAAI;AAAA,QAAA;AAAA,MAElC,OAAM,CAAA;AAAA,IAEV,CAAC;AAAA,EACH;AACF;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseAppAutoCompletableParent, BaseAutoCompletableItem } from '~/modules/pluginCore/types';
|
|
2
|
+
export interface PluginPageUrlAutoCompletableParent extends BaseAppAutoCompletableParent {
|
|
3
|
+
type: 'pageUrlParent';
|
|
4
|
+
displayName: string;
|
|
5
|
+
aliases?: Array<string>;
|
|
6
|
+
}
|
|
7
|
+
export interface PluginPageUrlAutocompleteItem extends BaseAutoCompletableItem {
|
|
8
|
+
type: 'pageUrl';
|
|
9
|
+
displayName: string;
|
|
10
|
+
parent?: PluginPageUrlAutoCompletableParent;
|
|
11
|
+
}
|