@igstack/app-catalog-frontend-core 6.14.0 → 6.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/api/infra/trpc.d.ts +36 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/internal.d.ts +1 -0
- package/dist/esm/internal.js +2 -0
- package/dist/esm/internal.js.map +1 -1
- package/dist/esm/lib/externalLink.d.ts +8 -0
- package/dist/esm/lib/externalLink.js +9 -0
- package/dist/esm/lib/externalLink.js.map +1 -0
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.d.ts +3 -1
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.js +2 -0
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.js.map +1 -1
- package/dist/esm/modules/appCatalog/hooks/useUpdateApp.d.ts +36 -36
- package/dist/esm/modules/appCatalog/ui/components/SectionTabs.d.ts +2 -1
- package/dist/esm/modules/appCatalog/ui/components/SectionTabs.js +11 -1
- package/dist/esm/modules/appCatalog/ui/components/SectionTabs.js.map +1 -1
- package/dist/esm/modules/appCatalog/ui/components/SourcesList.d.ts +10 -0
- package/dist/esm/modules/appCatalog/ui/components/SourcesList.js +51 -0
- package/dist/esm/modules/appCatalog/ui/components/SourcesList.js.map +1 -0
- package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js +9 -52
- package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js.map +1 -1
- package/dist/esm/modules/appCatalog/ui/pages/ServiceDesksPage.js +12 -7
- package/dist/esm/modules/appCatalog/ui/pages/ServiceDesksPage.js.map +1 -1
- package/dist/esm/modules/communityTools/useCommunityTools.d.ts +6 -6
- package/dist/esm/modules/mcpCatalog/McpAccessLine.d.ts +5 -0
- package/dist/esm/modules/mcpCatalog/McpAccessLine.js +48 -0
- package/dist/esm/modules/mcpCatalog/McpAccessLine.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpCatalogPage.d.ts +11 -0
- package/dist/esm/modules/mcpCatalog/McpCatalogPage.js +289 -0
- package/dist/esm/modules/mcpCatalog/McpCatalogPage.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpInfoTiles.d.ts +5 -0
- package/dist/esm/modules/mcpCatalog/McpInfoTiles.js +88 -0
- package/dist/esm/modules/mcpCatalog/McpInfoTiles.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpSafetyLines.d.ts +5 -0
- package/dist/esm/modules/mcpCatalog/McpSafetyLines.js +82 -0
- package/dist/esm/modules/mcpCatalog/McpSafetyLines.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpSearchResult.d.ts +18 -0
- package/dist/esm/modules/mcpCatalog/McpSearchResult.js +150 -0
- package/dist/esm/modules/mcpCatalog/McpSearchResult.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpServerDetail.d.ts +8 -0
- package/dist/esm/modules/mcpCatalog/McpServerDetail.js +116 -0
- package/dist/esm/modules/mcpCatalog/McpServerDetail.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpServerRow.d.ts +10 -0
- package/dist/esm/modules/mcpCatalog/McpServerRow.js +75 -0
- package/dist/esm/modules/mcpCatalog/McpServerRow.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpToolsTable.d.ts +5 -0
- package/dist/esm/modules/mcpCatalog/McpToolsTable.js +24 -0
- package/dist/esm/modules/mcpCatalog/McpToolsTable.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/Triad.d.ts +13 -0
- package/dist/esm/modules/mcpCatalog/Triad.js +175 -0
- package/dist/esm/modules/mcpCatalog/Triad.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/cart/McpCart.d.ts +15 -0
- package/dist/esm/modules/mcpCatalog/cart/McpCart.js +156 -0
- package/dist/esm/modules/mcpCatalog/cart/McpCart.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/cart/useMcpCart.d.ts +11 -0
- package/dist/esm/modules/mcpCatalog/cart/useMcpCart.js +48 -0
- package/dist/esm/modules/mcpCatalog/cart/useMcpCart.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/InstallButton.d.ts +12 -0
- package/dist/esm/modules/mcpCatalog/install/InstallButton.js +126 -0
- package/dist/esm/modules/mcpCatalog/install/InstallButton.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/InstallMenu.d.ts +14 -0
- package/dist/esm/modules/mcpCatalog/install/InstallMenu.js +139 -0
- package/dist/esm/modules/mcpCatalog/install/InstallMenu.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.d.ts +10 -0
- package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.js +161 -0
- package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/installOptions.d.ts +40 -0
- package/dist/esm/modules/mcpCatalog/install/installOptions.js +204 -0
- package/dist/esm/modules/mcpCatalog/install/installOptions.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.d.ts +14 -0
- package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.js +39 -0
- package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/searchMcpServers.d.ts +25 -0
- package/dist/esm/modules/mcpCatalog/searchMcpServers.js +44 -0
- package/dist/esm/modules/mcpCatalog/searchMcpServers.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/signIn.d.ts +13 -0
- package/dist/esm/modules/mcpCatalog/signIn.js +29 -0
- package/dist/esm/modules/mcpCatalog/signIn.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/useHasMcpServers.d.ts +8 -0
- package/dist/esm/modules/mcpCatalog/useHasMcpServers.js +13 -0
- package/dist/esm/modules/mcpCatalog/useHasMcpServers.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.d.ts +7 -0
- package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.js +16 -0
- package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js +3 -3
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js +1 -1
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/checks.js +1 -1
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js +2 -2
- package/dist/esm/routeTree.gen.d.ts +43 -17
- package/dist/esm/routeTree.gen.js +15 -3
- package/dist/esm/routeTree.gen.js.map +1 -1
- package/dist/esm/routes/_layout/community.$slug.d.ts +3 -3
- package/dist/esm/routes/_layout/community.d.ts +3 -3
- package/dist/esm/routes/_layout/mcp.$slug.d.ts +9 -0
- package/dist/esm/routes/_layout/mcp._slug.js +8 -0
- package/dist/esm/routes/_layout/mcp._slug.js.map +1 -0
- package/dist/esm/routes/_layout/mcp.d.ts +5 -1
- package/dist/esm/routes/_layout/mcp.js +45 -5
- package/dist/esm/routes/_layout/mcp.js.map +1 -1
- package/dist/esm/types/uiSettings.d.ts +10 -0
- package/dist/esm/ui/button.d.ts +1 -1
- package/dist/esm/ui/components/header/Header.js +1 -5
- package/dist/esm/ui/components/header/Header.js.map +1 -1
- package/dist/esm/ui/empty.d.ts +1 -1
- package/dist/esm/ui/item.d.ts +1 -1
- package/dist/esm/userDb/AcDb.d.ts +10 -0
- package/dist/esm/userDb/AcDb.js +6 -0
- package/dist/esm/userDb/AcDb.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/modules/communityTools/timeAgo.test.ts +16 -0
- package/src/index.tsx +6 -1
- package/src/internal.ts +1 -0
- package/src/lib/externalLink.ts +10 -0
- package/src/modules/appCatalog/context/AppCatalogContext.tsx +5 -0
- package/src/modules/appCatalog/ui/components/SectionTabs.tsx +14 -1
- package/src/modules/appCatalog/ui/components/SourcesList.tsx +62 -0
- package/src/modules/appCatalog/ui/detail/AppDetails.tsx +6 -52
- package/src/modules/appCatalog/ui/pages/ServiceDesksPage.tsx +18 -3
- package/src/modules/mcpCatalog/McpAccessLine.tsx +54 -0
- package/src/modules/mcpCatalog/McpCatalogPage.tsx +324 -0
- package/src/modules/mcpCatalog/McpInfoTiles.tsx +112 -0
- package/src/modules/mcpCatalog/McpSafetyLines.tsx +89 -0
- package/src/modules/mcpCatalog/McpSearchResult.tsx +173 -0
- package/src/modules/mcpCatalog/McpServerDetail.tsx +145 -0
- package/src/modules/mcpCatalog/McpServerRow.tsx +78 -0
- package/src/modules/mcpCatalog/McpToolsTable.tsx +36 -0
- package/src/modules/mcpCatalog/Triad.tsx +213 -0
- package/src/modules/mcpCatalog/cart/McpCart.tsx +171 -0
- package/src/modules/mcpCatalog/cart/useMcpCart.ts +64 -0
- package/src/modules/mcpCatalog/install/InstallButton.tsx +154 -0
- package/src/modules/mcpCatalog/install/InstallMenu.tsx +160 -0
- package/src/modules/mcpCatalog/install/WhatHappensDialog.tsx +199 -0
- package/src/modules/mcpCatalog/install/installOptions.tsx +266 -0
- package/src/modules/mcpCatalog/install/useMcpPrefs.ts +55 -0
- package/src/modules/mcpCatalog/searchMcpServers.ts +84 -0
- package/src/modules/mcpCatalog/signIn.ts +34 -0
- package/src/modules/mcpCatalog/useHasMcpServers.ts +22 -0
- package/src/modules/mcpCatalog/useMcpCatalogConfig.ts +20 -0
- package/src/routeTree.gen.ts +36 -5
- package/src/routes/_layout/mcp.$slug.tsx +10 -0
- package/src/routes/_layout/mcp.tsx +63 -3
- package/src/types/uiSettings.ts +11 -0
- package/src/ui/components/header/Header.tsx +1 -7
- package/src/userDb/AcDb.ts +13 -0
- package/dist/esm/modules/appCatalog/ui/pages/McpPage.d.ts +0 -11
- package/dist/esm/modules/appCatalog/ui/pages/McpPage.js +0 -227
- package/dist/esm/modules/appCatalog/ui/pages/McpPage.js.map +0 -1
- package/dist/esm/modules/appCatalog/utils/fetchMcpTools.d.ts +0 -32
- package/dist/esm/modules/appCatalog/utils/fetchMcpTools.js +0 -79
- package/dist/esm/modules/appCatalog/utils/fetchMcpTools.js.map +0 -1
- package/src/modules/appCatalog/ui/pages/McpPage.tsx +0 -275
- package/src/modules/appCatalog/utils/fetchMcpTools.ts +0 -140
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const Route: import('@tanstack/router-core').Route<import('@tanstack/react-router').Register, import('@tanstack/router-core').Route<import('@tanstack/react-router').Register, import('@tanstack/react-router').RootRoute<import('@tanstack/react-router').Register, undefined, import('../..').AcRouterContext, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "", "/", "/_layout", "/_layout", undefined, import('@tanstack/router-core').ResolveParams<"">, import('@tanstack/router-core').AnyContext, import('../..').AcRouterContext, import('../..').AcRouterContext, {}, typeof import('../../modules/communityTools/communityToolsConfigLoader.js').communityToolsConfigLoader, unknown, unknown, unknown, unknown, undefined>, "/mcp", "/mcp", "/_layout/mcp", "/_layout/mcp", z.ZodObject<{
|
|
3
|
+
q: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>>>;
|
|
4
|
+
cart: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>>>;
|
|
5
|
+
}, z.core.$strip>, import('@tanstack/router-core').ResolveParams<"/mcp">, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
|
|
@@ -1,13 +1,53 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createFileRoute, useNavigate, useParams, Outlet } from "@tanstack/react-router";
|
|
3
3
|
import { AppCatalogLayout } from "../../modules/appCatalog/ui/layout/AppCatalogLayout.js";
|
|
4
|
-
import {
|
|
4
|
+
import { McpCatalogPage } from "../../modules/mcpCatalog/McpCatalogPage.js";
|
|
5
|
+
import { McpServerDetail } from "../../modules/mcpCatalog/McpServerDetail.js";
|
|
6
|
+
import { useHasMcpServers } from "../../modules/mcpCatalog/useHasMcpServers.js";
|
|
7
|
+
import { NotFoundError } from "../../ui/error/NotFoundError.js";
|
|
8
|
+
import { TopLevelProvidersForErrors } from "../../ui/layout/TopLevelProvidersForErrors.js";
|
|
9
|
+
import { object, union, string, number } from "../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js";
|
|
10
|
+
const text = union([string(), number()]).transform(String).optional().catch(void 0);
|
|
11
|
+
const searchSchema = object({
|
|
12
|
+
/** The search, so a search can be shared. */
|
|
13
|
+
q: text,
|
|
14
|
+
/** Comma-separated slugs of a shared cart. */
|
|
15
|
+
cart: text
|
|
16
|
+
});
|
|
5
17
|
const Route = createFileRoute("/_layout/mcp")({
|
|
6
|
-
component: RouteComponent
|
|
18
|
+
component: RouteComponent,
|
|
19
|
+
validateSearch: searchSchema
|
|
7
20
|
});
|
|
8
21
|
function RouteComponent() {
|
|
9
22
|
const { queryClient, trpcClient } = Route.useRouteContext();
|
|
10
|
-
|
|
23
|
+
const { q } = Route.useSearch();
|
|
24
|
+
const navigate = useNavigate();
|
|
25
|
+
const { slug } = useParams({ strict: false });
|
|
26
|
+
const hasServers = useHasMcpServers(queryClient);
|
|
27
|
+
if (hasServers === false) {
|
|
28
|
+
return /* @__PURE__ */ jsx(TopLevelProvidersForErrors, { children: /* @__PURE__ */ jsx(NotFoundError, {}) });
|
|
29
|
+
}
|
|
30
|
+
return /* @__PURE__ */ jsxs(AppCatalogLayout, { queryClient, trpcClient, children: [
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
McpCatalogPage,
|
|
33
|
+
{
|
|
34
|
+
q: q ?? "",
|
|
35
|
+
onQueryChange: (next) => void navigate({
|
|
36
|
+
to: ".",
|
|
37
|
+
search: (prev) => ({ ...prev, q: next || void 0 }),
|
|
38
|
+
replace: true
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
slug && /* @__PURE__ */ jsx(
|
|
43
|
+
McpServerDetail,
|
|
44
|
+
{
|
|
45
|
+
slug,
|
|
46
|
+
onClose: () => void navigate({ to: "/mcp", search: (prev) => prev })
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ jsx(Outlet, {})
|
|
50
|
+
] });
|
|
11
51
|
}
|
|
12
52
|
export {
|
|
13
53
|
Route
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sources":["../../../../src/routes/_layout/mcp.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"mcp.js","sources":["../../../../src/routes/_layout/mcp.tsx"],"sourcesContent":["import {\n Outlet,\n createFileRoute,\n useNavigate,\n useParams,\n} from '@tanstack/react-router'\nimport { z } from 'zod'\nimport { AppCatalogLayout } from '~/modules/appCatalog/ui/layout/AppCatalogLayout'\nimport { McpCatalogPage } from '~/modules/mcpCatalog/McpCatalogPage'\nimport { McpServerDetail } from '~/modules/mcpCatalog/McpServerDetail'\nimport { useHasMcpServers } from '~/modules/mcpCatalog/useHasMcpServers'\nimport { NotFoundError } from '~/ui/error/NotFoundError'\nimport { TopLevelProvidersForErrors } from '~/ui/layout/TopLevelProvidersForErrors'\n\n// The router JSON-parses search values, so `?cart=123` or `?q=42` arrive as\n// numbers; both are text here.\nconst text = z\n .union([z.string(), z.number()])\n .transform(String)\n .optional()\n .catch(undefined)\n\n// Both absent by default, so a plain /mcp link stays plain.\nconst searchSchema = z.object({\n /** The search, so a search can be shared. */\n q: text,\n /** Comma-separated slugs of a shared cart. */\n cart: text,\n})\n\nexport const Route = createFileRoute('/_layout/mcp')({\n component: RouteComponent,\n validateSearch: searchSchema,\n})\n\nfunction RouteComponent() {\n const { queryClient, trpcClient } = Route.useRouteContext()\n const { q } = Route.useSearch()\n // Unscoped, so `to: '.'` is the current match: a child route under /mcp\n // keeps its params while the query changes.\n const navigate = useNavigate()\n // Set while a server's dialog is open: the child route's slug.\n const { slug } = useParams({ strict: false })\n const hasServers = useHasMcpServers(queryClient)\n\n if (hasServers === false) {\n return (\n <TopLevelProvidersForErrors>\n <NotFoundError />\n </TopLevelProvidersForErrors>\n )\n }\n\n return (\n <AppCatalogLayout queryClient={queryClient} trpcClient={trpcClient}>\n <McpCatalogPage\n q={q ?? ''}\n onQueryChange={(next) =>\n void navigate({\n to: '.',\n search: (prev) => ({ ...prev, q: next || undefined }),\n replace: true,\n })\n }\n />\n {slug && (\n <McpServerDetail\n slug={slug}\n // Back to the list with the search it was opened from.\n onClose={() => void navigate({ to: '/mcp', search: (prev) => prev })}\n />\n )}\n {/* The detail route renders nothing; the dialog above reads its slug. */}\n <Outlet />\n </AppCatalogLayout>\n )\n}\n"],"names":["z.union","z.string","z.number","z.object"],"mappings":";;;;;;;;;AAgBA,MAAM,OAAOA,MACJ,CAACC,OAAE,GAAUC,OAAE,CAAQ,CAAC,EAC9B,UAAU,MAAM,EAChB,WACA,MAAM,MAAS;AAGlB,MAAM,eAAeC,OAAS;AAAA;AAAA,EAE5B,GAAG;AAAA;AAAA,EAEH,MAAM;AACR,CAAC;AAEM,MAAM,QAAQ,gBAAgB,cAAc,EAAE;AAAA,EACnD,WAAW;AAAA,EACX,gBAAgB;AAClB,CAAC;AAED,SAAS,iBAAiB;AACxB,QAAM,EAAE,aAAa,eAAe,MAAM,gBAAA;AAC1C,QAAM,EAAE,EAAA,IAAM,MAAM,UAAA;AAGpB,QAAM,WAAW,YAAA;AAEjB,QAAM,EAAE,KAAA,IAAS,UAAU,EAAE,QAAQ,OAAO;AAC5C,QAAM,aAAa,iBAAiB,WAAW;AAE/C,MAAI,eAAe,OAAO;AACxB,WACE,oBAAC,4BAAA,EACC,UAAA,oBAAC,eAAA,CAAA,CAAc,GACjB;AAAA,EAEJ;AAEA,SACE,qBAAC,kBAAA,EAAiB,aAA0B,YAC1C,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,KAAK;AAAA,QACR,eAAe,CAAC,SACd,KAAK,SAAS;AAAA,UACZ,IAAI;AAAA,UACJ,QAAQ,CAAC,UAAU,EAAE,GAAG,MAAM,GAAG,QAAQ;UACzC,SAAS;AAAA,QAAA,CACV;AAAA,MAAA;AAAA,IAAA;AAAA,IAGJ,QACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QAEA,SAAS,MAAM,KAAK,SAAS,EAAE,IAAI,QAAQ,QAAQ,CAAC,SAAS,KAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,wBAItE,QAAA,CAAA,CAAO;AAAA,EAAA,GACV;AAEJ;"}
|
|
@@ -20,6 +20,14 @@ export interface AreasSettings {
|
|
|
20
20
|
/** Title of the merged first group. Defaults to "Day-to-day tools". */
|
|
21
21
|
dayToDayLabel?: string;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Presentation of the Service Desks view's area sections. A desk's area comes
|
|
25
|
+
* from its portal data, so the core knows none of them.
|
|
26
|
+
*/
|
|
27
|
+
export interface ServiceDesksSettings {
|
|
28
|
+
/** Icon per area name, as the portals spell it. Areas without one show the accent bar. */
|
|
29
|
+
areaIcons?: Record<string, AreaIcon>;
|
|
30
|
+
}
|
|
23
31
|
/**
|
|
24
32
|
* UI settings passed from the app entry point.
|
|
25
33
|
*/
|
|
@@ -40,6 +48,8 @@ export interface UiSettings {
|
|
|
40
48
|
chatChannelUrlTemplate?: string;
|
|
41
49
|
/** Area sections on the home view: icons and the day-to-day fold. */
|
|
42
50
|
areas?: AreasSettings;
|
|
51
|
+
/** The Service Desks view's area sections. */
|
|
52
|
+
serviceDesks?: ServiceDesksSettings;
|
|
43
53
|
/** PWA auto-update configuration (idle timeout, check interval, debug) */
|
|
44
54
|
pwaAutoUpdate?: PwaAutoUpdateOptions;
|
|
45
55
|
/**
|
package/dist/esm/ui/button.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "icon" | "default" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
8
8
|
asChild?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Link } from "@tanstack/react-router";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
import {
|
|
4
|
+
import { LogOut, X } from "lucide-react";
|
|
5
5
|
import { use } from "react";
|
|
6
6
|
import SvgAppCatalog from "../../../assets/app-catalog.svg.js";
|
|
7
7
|
import { useTRPC } from "../../../api/infra/trpc.js";
|
|
@@ -145,10 +145,6 @@ function Header({ middle }) {
|
|
|
145
145
|
] }) }),
|
|
146
146
|
middle && /* @__PURE__ */ jsx("div", { className: "flex-1", children: middle }),
|
|
147
147
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 ml-auto", children: [
|
|
148
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", asChild: true, children: /* @__PURE__ */ jsxs(Link, { to: "/mcp", children: [
|
|
149
|
-
/* @__PURE__ */ jsx(Plug, {}),
|
|
150
|
-
"MCP"
|
|
151
|
-
] }) }),
|
|
152
148
|
/* @__PURE__ */ jsx(ThemeSwitcher, {}),
|
|
153
149
|
isLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "w-8 h-8 rounded-full" }) : !isAuthenticated ? (
|
|
154
150
|
// The catalog is browsable without signing in; Sign in is for the parts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../../../../src/ui/components/header/Header.tsx"],"sourcesContent":["import type {\n AppVersionInfo,\n VersionInfo,\n} from '@igstack/app-catalog-backend-core'\nimport { Link } from '@tanstack/react-router'\nimport { useQuery } from '@tanstack/react-query'\nimport { LogOut, Plug, X } from 'lucide-react'\nimport React, { use } from 'react'\nimport AppCatalogLogo from '~/assets/app-catalog.svg?react'\nimport { useTRPC } from '~/api/infra/trpc'\nimport { ThemeSwitcher } from '~/components/ThemeSwitcher'\nimport { AppCatalogContext } from '~/modules/appCatalog/context/AppCatalogContext'\nimport { AttributionFooter } from '~/modules/appCatalog/ui/catalog/AttributionFooter'\nimport {\n useAuth,\n useAuthActions,\n useIsAuthenticated,\n useUser,\n} from '~/modules/auth'\nimport { useAuthModal } from '~/modules/auth/AuthModalContext'\nimport { Button } from '~/ui/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '~/ui/dropdown-menu'\nimport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverTrigger,\n} from '~/ui/popover'\nimport { Skeleton } from '~/ui/skeleton'\n\nfunction ShaSuffix({ version }: { version: VersionInfo }) {\n if (!version.sha) return null\n if (version.shaUrl) {\n return (\n <>\n {' '}\n <a\n href={version.shaUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-muted-foreground hover:text-primary\"\n onClick={(e) => e.stopPropagation()}\n >\n ({version.sha})\n </a>\n </>\n )\n }\n return <span className=\"text-muted-foreground\"> ({version.sha})</span>\n}\n\nfunction VersionItem({\n label,\n version,\n}: {\n label: string\n version: VersionInfo\n}) {\n return (\n <div className=\"flex items-center justify-between gap-4 py-1\">\n <span className=\"text-xs text-muted-foreground\">{label}</span>\n <span className=\"text-sm font-medium text-right\">\n {version.url ? (\n <a\n href={version.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-primary hover:text-primary/80 transition-colors\"\n onClick={(e) => e.stopPropagation()}\n >\n {version.displayName}\n </a>\n ) : (\n version.displayName\n )}\n <ShaSuffix version={version} />\n </span>\n </div>\n )\n}\n\nexport function VersionDisplay({ versions }: { versions: AppVersionInfo }) {\n const isLocal =\n versions.backend?.displayName === 'local' && !versions.coreVersion\n\n if (isLocal) {\n return (\n <span className=\"text-xs text-muted-foreground\" title=\"Local\">\n local\n </span>\n )\n }\n\n return (\n <div className=\"flex flex-col divide-y\">\n {versions.backend && (\n <VersionItem label=\"Pipeline\" version={versions.backend} />\n )}\n {versions.coreVersion && (\n <VersionItem label=\"Core\" version={versions.coreVersion} />\n )}\n {versions.frontend && (\n <VersionItem label=\"FE\" version={versions.frontend} />\n )}\n </div>\n )\n}\n\n/**\n * Version detail moved behind an on-demand popover (same click-to-reveal\n * pattern as PersonBadge's approver chips) instead of always-visible text —\n * keeps the header compact. Content is unchanged: same Pipeline/Core/FE\n * lines, links, and SHA suffix as before, just revealed on click.\n */\nexport function VersionPopover({ versions }: { versions: AppVersionInfo }) {\n const isLocal =\n versions.backend?.displayName === 'local' && !versions.coreVersion\n\n if (isLocal) {\n return (\n <span className=\"text-xs text-muted-foreground\" title=\"Local\">\n local\n </span>\n )\n }\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[10px] font-mono leading-none text-muted-foreground hover:bg-primary/15 hover:text-primary transition-colors\"\n aria-label=\"Show version details\"\n title=\"Version details\"\n data-testid=\"version-info-trigger\"\n >\n {versions.backend?.displayName ?? '?'}\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"start\" className=\"w-72 p-0 overflow-hidden\">\n <div className=\"flex items-center justify-between px-3 py-2 border-b bg-muted/40\">\n <span className=\"text-sm font-semibold\">Version details</span>\n <PopoverClose\n className=\"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors\"\n aria-label=\"Close\"\n >\n <X className=\"size-3.5\" />\n </PopoverClose>\n </div>\n <div className=\"px-3 py-1\">\n <VersionDisplay versions={versions} />\n </div>\n <AttributionFooter variant=\"popover\" />\n </PopoverContent>\n </Popover>\n )\n}\n\nexport interface HeaderProps {\n middle?: React.ReactNode\n}\n\nexport function Header({ middle }: HeaderProps) {\n const { isLoading } = useAuth()\n const isAuthenticated = useIsAuthenticated()\n const user = useUser()\n const { logout, devLogin } = useAuthActions()\n const { open: openLoginModal } = useAuthModal()\n const appCatalogContextMaybe = use(AppCatalogContext)\n const trpc = useTRPC()\n const { data: providersData } = useQuery(\n trpc.auth.getProviders.queryOptions(),\n )\n\n const handleLogout = async () => {\n try {\n await logout()\n } catch (error) {\n console.error('Logout failed:', error)\n }\n }\n\n const handleLoginClick = () => {\n // Preserve the current URL for redirect after login\n const currentUrl = window.location.pathname + window.location.search\n openLoginModal(currentUrl)\n }\n\n return (\n <div className=\"flex items-center mb-4 pb-4 gap-4 border-b\">\n <div className=\"flex items-center gap-4\">\n <div className=\"flex items-center gap-2\">\n <Link to=\"/\">\n <AppCatalogLogo className=\"h-16 w-16\" />\n </Link>\n <div className=\"flex flex-col items-start\">\n <Link to=\"/\" className=\"font-serif text-lg font-semibold\">\n App Catalog\n </Link>\n {appCatalogContextMaybe?.versions && (\n <VersionPopover versions={appCatalogContextMaybe.versions} />\n )}\n </div>\n </div>\n </div>\n {middle && <div className=\"flex-1\">{middle}</div>}\n <div className=\"flex items-center gap-3 ml-auto\">\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/mcp\">\n <Plug />\n MCP\n </Link>\n </Button>\n <ThemeSwitcher />\n {isLoading ? (\n <Skeleton className=\"w-8 h-8 rounded-full\" />\n ) : !isAuthenticated ? (\n // The catalog is browsable without signing in; Sign in is for the parts\n // that need an identity (comments, admin). DEV Login is gated behind\n // `devLoginEnabled`, so it never reaches a real deployment.\n <div className=\"flex items-center gap-2\">\n {providersData?.devLoginEnabled && (\n <button\n type=\"button\"\n onClick={devLogin}\n className=\"text-xs font-medium px-2 py-1 rounded bg-amber-500/20 text-amber-600 dark:text-amber-400 hover:bg-amber-500/30 border border-amber-500/30 cursor-pointer\"\n >\n DEV Login\n </button>\n )}\n <button\n type=\"button\"\n onClick={handleLoginClick}\n className=\"text-sm font-medium text-muted-foreground hover:text-foreground cursor-pointer\"\n >\n Sign in\n </button>\n </div>\n ) : (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"w-8 h-8 rounded-full p-0 hover:bg-accent hover:text-accent-foreground cursor-pointer\"\n aria-label={`User menu for ${user?.name || 'User'}`}\n data-testid=\"user-avatar-button\"\n >\n {user?.image ? (\n <img\n src={user.image}\n alt={user.name || 'User'}\n className=\"w-full h-full rounded-full object-cover\"\n />\n ) : (\n <div className=\"flex items-center justify-center w-full h-full rounded-full bg-primary text-primary-foreground text-xs font-semibold\">\n {(user?.name || user?.email || '?').charAt(0).toUpperCase()}\n </div>\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-56\">\n <div className=\"px-2 py-3 flex items-center gap-3\">\n {user?.image ? (\n <img\n src={user.image}\n alt={user.name || 'User'}\n className=\"w-10 h-10 rounded-full object-cover shrink-0\"\n />\n ) : (\n <div className=\"flex items-center justify-center w-10 h-10 rounded-full bg-primary text-primary-foreground text-sm font-semibold shrink-0\">\n {(user?.name || user?.email || '?').charAt(0).toUpperCase()}\n </div>\n )}\n <div className=\"flex flex-col min-w-0\">\n <p className=\"text-xs text-muted-foreground truncate\">\n @{user?.email?.split('@')[0] || 'user'}\n </p>\n <p className=\"text-sm font-medium truncate\">\n {user?.name || 'User'}\n </p>\n </div>\n </div>\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={handleLogout}>\n <LogOut className=\"h-4 w-4 mr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C,EAAE,cAAY,CAC5D;AAAA,UAAA;AAAA,QAAA,GAGN;AAAA,QACA,qBAAC,qBAAA,EAAoB,OAAM,OAAM,WAAU,QACzC,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,WAAU,qCACZ,UAAA;AAAA,aAAA,6BAAM,SACL;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,KAAK,KAAK;AAAA,gBACV,KAAK,KAAK,QAAQ;AAAA,gBAClB,WAAU;AAAA,cAAA;AAAA,YAAA,IAGZ,oBAAC,OAAA,EAAI,WAAU,6HACX,YAAA,6BAAM,UAAQ,6BAAM,UAAS,KAAK,OAAO,CAAC,EAAE,eAChD;AAAA,YAEF,qBAAC,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,cAAA,qBAAC,KAAA,EAAE,WAAU,0CAAyC,UAAA;AAAA,gBAAA;AAAA,kBAClD,kCAAM,UAAN,mBAAa,MAAM,KAAK,OAAM;AAAA,cAAA,GAClC;AAAA,kCACC,KAAA,EAAE,WAAU,gCACV,WAAA,6BAAM,SAAQ,OAAA,CACjB;AAAA,YAAA,EAAA,CACF;AAAA,UAAA,GACF;AAAA,8BACC,uBAAA,EAAsB;AAAA,UACvB,qBAAC,kBAAA,EAAiB,SAAS,cACzB,UAAA;AAAA,YAAA,oBAAC,QAAA,EAAO,WAAU,eAAA,CAAe;AAAA,YACjC,oBAAC,UAAK,UAAA,WAAA,CAAQ;AAAA,UAAA,EAAA,CAChB;AAAA,QAAA,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../../src/ui/components/header/Header.tsx"],"sourcesContent":["import type {\n AppVersionInfo,\n VersionInfo,\n} from '@igstack/app-catalog-backend-core'\nimport { Link } from '@tanstack/react-router'\nimport { useQuery } from '@tanstack/react-query'\nimport { LogOut, X } from 'lucide-react'\nimport React, { use } from 'react'\nimport AppCatalogLogo from '~/assets/app-catalog.svg?react'\nimport { useTRPC } from '~/api/infra/trpc'\nimport { ThemeSwitcher } from '~/components/ThemeSwitcher'\nimport { AppCatalogContext } from '~/modules/appCatalog/context/AppCatalogContext'\nimport { AttributionFooter } from '~/modules/appCatalog/ui/catalog/AttributionFooter'\nimport {\n useAuth,\n useAuthActions,\n useIsAuthenticated,\n useUser,\n} from '~/modules/auth'\nimport { useAuthModal } from '~/modules/auth/AuthModalContext'\nimport { Button } from '~/ui/button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '~/ui/dropdown-menu'\nimport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverTrigger,\n} from '~/ui/popover'\nimport { Skeleton } from '~/ui/skeleton'\n\nfunction ShaSuffix({ version }: { version: VersionInfo }) {\n if (!version.sha) return null\n if (version.shaUrl) {\n return (\n <>\n {' '}\n <a\n href={version.shaUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-muted-foreground hover:text-primary\"\n onClick={(e) => e.stopPropagation()}\n >\n ({version.sha})\n </a>\n </>\n )\n }\n return <span className=\"text-muted-foreground\"> ({version.sha})</span>\n}\n\nfunction VersionItem({\n label,\n version,\n}: {\n label: string\n version: VersionInfo\n}) {\n return (\n <div className=\"flex items-center justify-between gap-4 py-1\">\n <span className=\"text-xs text-muted-foreground\">{label}</span>\n <span className=\"text-sm font-medium text-right\">\n {version.url ? (\n <a\n href={version.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-primary hover:text-primary/80 transition-colors\"\n onClick={(e) => e.stopPropagation()}\n >\n {version.displayName}\n </a>\n ) : (\n version.displayName\n )}\n <ShaSuffix version={version} />\n </span>\n </div>\n )\n}\n\nexport function VersionDisplay({ versions }: { versions: AppVersionInfo }) {\n const isLocal =\n versions.backend?.displayName === 'local' && !versions.coreVersion\n\n if (isLocal) {\n return (\n <span className=\"text-xs text-muted-foreground\" title=\"Local\">\n local\n </span>\n )\n }\n\n return (\n <div className=\"flex flex-col divide-y\">\n {versions.backend && (\n <VersionItem label=\"Pipeline\" version={versions.backend} />\n )}\n {versions.coreVersion && (\n <VersionItem label=\"Core\" version={versions.coreVersion} />\n )}\n {versions.frontend && (\n <VersionItem label=\"FE\" version={versions.frontend} />\n )}\n </div>\n )\n}\n\n/**\n * Version detail moved behind an on-demand popover (same click-to-reveal\n * pattern as PersonBadge's approver chips) instead of always-visible text —\n * keeps the header compact. Content is unchanged: same Pipeline/Core/FE\n * lines, links, and SHA suffix as before, just revealed on click.\n */\nexport function VersionPopover({ versions }: { versions: AppVersionInfo }) {\n const isLocal =\n versions.backend?.displayName === 'local' && !versions.coreVersion\n\n if (isLocal) {\n return (\n <span className=\"text-xs text-muted-foreground\" title=\"Local\">\n local\n </span>\n )\n }\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[10px] font-mono leading-none text-muted-foreground hover:bg-primary/15 hover:text-primary transition-colors\"\n aria-label=\"Show version details\"\n title=\"Version details\"\n data-testid=\"version-info-trigger\"\n >\n {versions.backend?.displayName ?? '?'}\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"start\" className=\"w-72 p-0 overflow-hidden\">\n <div className=\"flex items-center justify-between px-3 py-2 border-b bg-muted/40\">\n <span className=\"text-sm font-semibold\">Version details</span>\n <PopoverClose\n className=\"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors\"\n aria-label=\"Close\"\n >\n <X className=\"size-3.5\" />\n </PopoverClose>\n </div>\n <div className=\"px-3 py-1\">\n <VersionDisplay versions={versions} />\n </div>\n <AttributionFooter variant=\"popover\" />\n </PopoverContent>\n </Popover>\n )\n}\n\nexport interface HeaderProps {\n middle?: React.ReactNode\n}\n\nexport function Header({ middle }: HeaderProps) {\n const { isLoading } = useAuth()\n const isAuthenticated = useIsAuthenticated()\n const user = useUser()\n const { logout, devLogin } = useAuthActions()\n const { open: openLoginModal } = useAuthModal()\n const appCatalogContextMaybe = use(AppCatalogContext)\n const trpc = useTRPC()\n const { data: providersData } = useQuery(\n trpc.auth.getProviders.queryOptions(),\n )\n\n const handleLogout = async () => {\n try {\n await logout()\n } catch (error) {\n console.error('Logout failed:', error)\n }\n }\n\n const handleLoginClick = () => {\n // Preserve the current URL for redirect after login\n const currentUrl = window.location.pathname + window.location.search\n openLoginModal(currentUrl)\n }\n\n return (\n <div className=\"flex items-center mb-4 pb-4 gap-4 border-b\">\n <div className=\"flex items-center gap-4\">\n <div className=\"flex items-center gap-2\">\n <Link to=\"/\">\n <AppCatalogLogo className=\"h-16 w-16\" />\n </Link>\n <div className=\"flex flex-col items-start\">\n <Link to=\"/\" className=\"font-serif text-lg font-semibold\">\n App Catalog\n </Link>\n {appCatalogContextMaybe?.versions && (\n <VersionPopover versions={appCatalogContextMaybe.versions} />\n )}\n </div>\n </div>\n </div>\n {middle && <div className=\"flex-1\">{middle}</div>}\n <div className=\"flex items-center gap-3 ml-auto\">\n <ThemeSwitcher />\n {isLoading ? (\n <Skeleton className=\"w-8 h-8 rounded-full\" />\n ) : !isAuthenticated ? (\n // The catalog is browsable without signing in; Sign in is for the parts\n // that need an identity (comments, admin). DEV Login is gated behind\n // `devLoginEnabled`, so it never reaches a real deployment.\n <div className=\"flex items-center gap-2\">\n {providersData?.devLoginEnabled && (\n <button\n type=\"button\"\n onClick={devLogin}\n className=\"text-xs font-medium px-2 py-1 rounded bg-amber-500/20 text-amber-600 dark:text-amber-400 hover:bg-amber-500/30 border border-amber-500/30 cursor-pointer\"\n >\n DEV Login\n </button>\n )}\n <button\n type=\"button\"\n onClick={handleLoginClick}\n className=\"text-sm font-medium text-muted-foreground hover:text-foreground cursor-pointer\"\n >\n Sign in\n </button>\n </div>\n ) : (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"w-8 h-8 rounded-full p-0 hover:bg-accent hover:text-accent-foreground cursor-pointer\"\n aria-label={`User menu for ${user?.name || 'User'}`}\n data-testid=\"user-avatar-button\"\n >\n {user?.image ? (\n <img\n src={user.image}\n alt={user.name || 'User'}\n className=\"w-full h-full rounded-full object-cover\"\n />\n ) : (\n <div className=\"flex items-center justify-center w-full h-full rounded-full bg-primary text-primary-foreground text-xs font-semibold\">\n {(user?.name || user?.email || '?').charAt(0).toUpperCase()}\n </div>\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-56\">\n <div className=\"px-2 py-3 flex items-center gap-3\">\n {user?.image ? (\n <img\n src={user.image}\n alt={user.name || 'User'}\n className=\"w-10 h-10 rounded-full object-cover shrink-0\"\n />\n ) : (\n <div className=\"flex items-center justify-center w-10 h-10 rounded-full bg-primary text-primary-foreground text-sm font-semibold shrink-0\">\n {(user?.name || user?.email || '?').charAt(0).toUpperCase()}\n </div>\n )}\n <div className=\"flex flex-col min-w-0\">\n <p className=\"text-xs text-muted-foreground truncate\">\n @{user?.email?.split('@')[0] || 'user'}\n </p>\n <p className=\"text-sm font-medium truncate\">\n {user?.name || 'User'}\n </p>\n </div>\n </div>\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={handleLogout}>\n <LogOut className=\"h-4 w-4 mr-2\" />\n <span>Sign out</span>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n )\n}\n"],"names":["AppCatalogLogo"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,SAAS,UAAU,EAAE,WAAqC;AACxD,MAAI,CAAC,QAAQ,IAAK,QAAO;AACzB,MAAI,QAAQ,QAAQ;AAClB,WACE,qBAAA,UAAA,EACG,UAAA;AAAA,MAAA;AAAA,MACD;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM,QAAQ;AAAA,UACd,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,WAAU;AAAA,UACV,SAAS,CAAC,MAAM,E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kCACC,KAAA,EAAE,WAAU,gCACV,WAAA,6BAAM,SAAQ,OAAA,CACjB;AAAA,YAAA,EAAA,CACF;AAAA,UAAA,GACF;AAAA,8BACC,uBAAA,EAAsB;AAAA,UACvB,qBAAC,kBAAA,EAAiB,SAAS,cACzB,UAAA;AAAA,YAAA,oBAAC,QAAA,EAAO,WAAU,eAAA,CAAe;AAAA,YACjC,oBAAC,UAAK,UAAA,WAAA,CAAQ;AAAA,UAAA,EAAA,CAChB;AAAA,QAAA,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
package/dist/esm/ui/empty.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
declare function Empty({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const emptyMediaVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "icon" | "default" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
package/dist/esm/ui/item.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare function Item({ className, variant, size, asChild, ...props }: React.Com
|
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
declare const itemMediaVariants: (props?: ({
|
|
14
|
-
variant?: "
|
|
14
|
+
variant?: "image" | "icon" | "default" | null | undefined;
|
|
15
15
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
16
16
|
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof itemMediaVariants>): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare function ItemContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as Dexie, Table } from 'dexie';
|
|
2
2
|
import { AppCatalogData, TRPCRouter } from '@igstack/app-catalog-backend-core';
|
|
3
|
+
import { InstallOptionId } from '@igstack/app-catalog-shared-core';
|
|
3
4
|
import { inferRouterOutputs } from '@trpc/server';
|
|
4
5
|
export type CommunityToolsConfig = inferRouterOutputs<TRPCRouter>['communityTools']['config'];
|
|
5
6
|
export interface AppClickHistoryItem {
|
|
@@ -7,10 +8,19 @@ export interface AppClickHistoryItem {
|
|
|
7
8
|
appSlug: string;
|
|
8
9
|
timestamp: number;
|
|
9
10
|
}
|
|
11
|
+
/** The MCP tab's remembered choices, one row per key. */
|
|
12
|
+
export type McpPref = {
|
|
13
|
+
key: 'installWith';
|
|
14
|
+
value: InstallOptionId;
|
|
15
|
+
} | {
|
|
16
|
+
key: 'installed';
|
|
17
|
+
value: string[];
|
|
18
|
+
};
|
|
10
19
|
export declare class AcDb extends Dexie {
|
|
11
20
|
appCatalog: Table<AppCatalogData>;
|
|
12
21
|
appClickHistory: Table<AppClickHistoryItem>;
|
|
13
22
|
communityToolsConfig: Table<CommunityToolsConfig>;
|
|
23
|
+
mcpPrefs: Table<McpPref, McpPref['key']>;
|
|
14
24
|
constructor();
|
|
15
25
|
/**
|
|
16
26
|
* Resets the entire database by deleting and recreating it
|
package/dist/esm/userDb/AcDb.js
CHANGED
|
@@ -14,6 +14,12 @@ class AcDb extends Dexie {
|
|
|
14
14
|
appClickHistory: "++id, appSlug, timestamp",
|
|
15
15
|
communityToolsConfig: ""
|
|
16
16
|
});
|
|
17
|
+
this.version(4).stores({
|
|
18
|
+
appCatalog: "",
|
|
19
|
+
appClickHistory: "++id, appSlug, timestamp",
|
|
20
|
+
communityToolsConfig: "",
|
|
21
|
+
mcpPrefs: "key"
|
|
22
|
+
});
|
|
17
23
|
}
|
|
18
24
|
/**
|
|
19
25
|
* Resets the entire database by deleting and recreating it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDb.js","sources":["../../../src/userDb/AcDb.ts"],"sourcesContent":["import Dexie from 'dexie'\nimport type {\n AppCatalogData,\n TRPCRouter,\n} from '@igstack/app-catalog-backend-core'\nimport type { inferRouterOutputs } from '@trpc/server'\nimport type { Table } from 'dexie'\n\nexport type CommunityToolsConfig =\n inferRouterOutputs<TRPCRouter>['communityTools']['config']\n\nexport interface AppClickHistoryItem {\n id?: number\n appSlug: string\n timestamp: number\n}\n\nexport class AcDb extends Dexie {\n appCatalog!: Table<AppCatalogData>\n appClickHistory!: Table<AppClickHistoryItem>\n communityToolsConfig!: Table<CommunityToolsConfig>\n\n constructor() {\n super('app-catalog')\n this.version(1).stores({\n appCatalog: '',\n })\n this.version(2).stores({\n appCatalog: '',\n appClickHistory: '++id, appSlug, timestamp',\n })\n this.version(3).stores({\n appCatalog: '',\n appClickHistory: '++id, appSlug, timestamp',\n communityToolsConfig: '',\n })\n }\n\n /**\n * Resets the entire database by deleting and recreating it\n * This clears all data and resets version tracking to fix migration issues\n */\n async resetDatabase(): Promise<void> {\n const dbName = this.name\n this.close()\n await Dexie.delete(dbName)\n await this.open()\n }\n}\n\nexport enum dbCacheDbKeys {\n AppCatalog = 'appCatalog',\n CommunityToolsConfig = 'communityToolsConfig',\n}\n"],"names":["dbCacheDbKeys"],"mappings":";
|
|
1
|
+
{"version":3,"file":"AcDb.js","sources":["../../../src/userDb/AcDb.ts"],"sourcesContent":["import Dexie from 'dexie'\nimport type {\n AppCatalogData,\n TRPCRouter,\n} from '@igstack/app-catalog-backend-core'\nimport type { InstallOptionId } from '@igstack/app-catalog-shared-core'\nimport type { inferRouterOutputs } from '@trpc/server'\nimport type { Table } from 'dexie'\n\nexport type CommunityToolsConfig =\n inferRouterOutputs<TRPCRouter>['communityTools']['config']\n\nexport interface AppClickHistoryItem {\n id?: number\n appSlug: string\n timestamp: number\n}\n\n/** The MCP tab's remembered choices, one row per key. */\nexport type McpPref =\n | { key: 'installWith'; value: InstallOptionId }\n | { key: 'installed'; value: string[] }\n\nexport class AcDb extends Dexie {\n appCatalog!: Table<AppCatalogData>\n appClickHistory!: Table<AppClickHistoryItem>\n communityToolsConfig!: Table<CommunityToolsConfig>\n mcpPrefs!: Table<McpPref, McpPref['key']>\n\n constructor() {\n super('app-catalog')\n this.version(1).stores({\n appCatalog: '',\n })\n this.version(2).stores({\n appCatalog: '',\n appClickHistory: '++id, appSlug, timestamp',\n })\n this.version(3).stores({\n appCatalog: '',\n appClickHistory: '++id, appSlug, timestamp',\n communityToolsConfig: '',\n })\n this.version(4).stores({\n appCatalog: '',\n appClickHistory: '++id, appSlug, timestamp',\n communityToolsConfig: '',\n mcpPrefs: 'key',\n })\n }\n\n /**\n * Resets the entire database by deleting and recreating it\n * This clears all data and resets version tracking to fix migration issues\n */\n async resetDatabase(): Promise<void> {\n const dbName = this.name\n this.close()\n await Dexie.delete(dbName)\n await this.open()\n }\n}\n\nexport enum dbCacheDbKeys {\n AppCatalog = 'appCatalog',\n CommunityToolsConfig = 'communityToolsConfig',\n}\n"],"names":["dbCacheDbKeys"],"mappings":";AAuBO,MAAM,aAAa,MAAM;AAAA,EAM9B,cAAc;AACZ,UAAM,aAAa;AACnB,SAAK,QAAQ,CAAC,EAAE,OAAO;AAAA,MACrB,YAAY;AAAA,IAAA,CACb;AACD,SAAK,QAAQ,CAAC,EAAE,OAAO;AAAA,MACrB,YAAY;AAAA,MACZ,iBAAiB;AAAA,IAAA,CAClB;AACD,SAAK,QAAQ,CAAC,EAAE,OAAO;AAAA,MACrB,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,sBAAsB;AAAA,IAAA,CACvB;AACD,SAAK,QAAQ,CAAC,EAAE,OAAO;AAAA,MACrB,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,sBAAsB;AAAA,MACtB,UAAU;AAAA,IAAA,CACX;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,gBAA+B;AACnC,UAAM,SAAS,KAAK;AACpB,SAAK,MAAA;AACL,UAAM,MAAM,OAAO,MAAM;AACzB,UAAM,KAAK,KAAA;AAAA,EACb;AACF;AAEO,IAAK,kCAAAA,mBAAL;AACLA,iBAAA,YAAA,IAAa;AACbA,iBAAA,sBAAA,IAAuB;AAFb,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igstack/app-catalog-frontend-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.16.0",
|
|
4
4
|
"description": "Frontend core library for App Catalog",
|
|
5
5
|
"homepage": "https://github.com/lislon/app-catalog",
|
|
6
6
|
"repository": {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"tailwindcss": "^4.1.7",
|
|
119
119
|
"tiptap-markdown": "^0.8.0",
|
|
120
120
|
"tslib": "^2.3.0",
|
|
121
|
-
"@igstack/app-catalog-shared-core": "6.
|
|
121
|
+
"@igstack/app-catalog-shared-core": "6.16.0"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@tailwindcss/vite": "^4.0.5",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"vite-plugin-static-copy": "^3.1.4",
|
|
147
147
|
"vite-plugin-svgr": "^4.2.0",
|
|
148
148
|
"vitest": "^4.1.2",
|
|
149
|
-
"@igstack/app-catalog-backend-core": "6.
|
|
149
|
+
"@igstack/app-catalog-backend-core": "6.16.0"
|
|
150
150
|
},
|
|
151
151
|
"peerDependencies": {
|
|
152
152
|
"@tanstack/react-router": "1.170.41",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"vite": "^6.3.5",
|
|
157
157
|
"vite-plugin-svgr": "^4.2.0"
|
|
158
158
|
},
|
|
159
|
-
"gitHead": "
|
|
159
|
+
"gitHead": "adc0f1e9f8f436a53cca59190dd206b502dbc49b",
|
|
160
160
|
"scripts": {
|
|
161
161
|
"build": "vite build",
|
|
162
162
|
"build:lenient": "vite build --mode lenient",
|
|
@@ -25,4 +25,20 @@ describe('timeAgo', () => {
|
|
|
25
25
|
it('reads a time in the future as today', () => {
|
|
26
26
|
expect(timeAgo(new Date(2026, 9, 22).toISOString(), now)).toBe('today')
|
|
27
27
|
})
|
|
28
|
+
|
|
29
|
+
it('buckets by local calendar day, stable across late-evening and after-midnight', () => {
|
|
30
|
+
// Reproduces the flaky test bug: "3 days ago" must stay "3 days ago" at
|
|
31
|
+
// 23:30 and 00:30 local time, even across DST boundaries.
|
|
32
|
+
const lateEvening = new Date('2026-11-02T23:30:00-08:00') // before midnight
|
|
33
|
+
const afterMidnight = new Date('2026-11-03T00:30:00-08:00') // after midnight
|
|
34
|
+
const threeDaysAgo = (from: Date) => {
|
|
35
|
+
const d = new Date(from)
|
|
36
|
+
d.setDate(d.getDate() - 3)
|
|
37
|
+
return d.toISOString()
|
|
38
|
+
}
|
|
39
|
+
expect(timeAgo(threeDaysAgo(lateEvening), lateEvening)).toBe('3 days ago')
|
|
40
|
+
expect(timeAgo(threeDaysAgo(afterMidnight), afterMidnight)).toBe(
|
|
41
|
+
'3 days ago',
|
|
42
|
+
)
|
|
43
|
+
})
|
|
28
44
|
})
|
package/src/index.tsx
CHANGED
|
@@ -5,7 +5,12 @@ export type { AppPropsFactoryOptions } from './appPropsFactory.js'
|
|
|
5
5
|
export type { AcRouterContext, AcRouterInitParams } from './types/types'
|
|
6
6
|
export { App } from './App'
|
|
7
7
|
export type { AppProps } from './App'
|
|
8
|
-
export type {
|
|
8
|
+
export type {
|
|
9
|
+
AreaIcon,
|
|
10
|
+
AreasSettings,
|
|
11
|
+
ServiceDesksSettings,
|
|
12
|
+
UiSettings,
|
|
13
|
+
} from './types/uiSettings'
|
|
9
14
|
export {
|
|
10
15
|
DAY_TO_DAY_AREA_KEY,
|
|
11
16
|
DAY_TO_DAY_TAG,
|
package/src/internal.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leaves the page for a URL another app handles (`vscode://`, `cursor://`).
|
|
3
|
+
* An object rather than a bare function so a test can record the URL: jsdom
|
|
4
|
+
* cannot follow a custom scheme, and `window.location` cannot be stubbed.
|
|
5
|
+
*/
|
|
6
|
+
export const externalLink = {
|
|
7
|
+
open(url: string): void {
|
|
8
|
+
window.location.href = url
|
|
9
|
+
},
|
|
10
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
AppApprovalMethod,
|
|
3
3
|
AppVersionInfo,
|
|
4
|
+
CatalogMcpServer,
|
|
4
5
|
Group,
|
|
5
6
|
GroupingTagDefinition,
|
|
6
7
|
Person,
|
|
@@ -15,6 +16,8 @@ import { mergeFrontendBuildId } from '~/modules/appCatalog/context/mergeFrontend
|
|
|
15
16
|
|
|
16
17
|
export interface AppCatalogContextIface {
|
|
17
18
|
resources: Resource[]
|
|
19
|
+
/** Optional for code that builds a context by hand; the provider always sets it. */
|
|
20
|
+
mcpServers?: CatalogMcpServer[]
|
|
18
21
|
isLoadingApps: boolean
|
|
19
22
|
tagsDefinitions: GroupingTagDefinition[]
|
|
20
23
|
approvalMethods: AppApprovalMethod[]
|
|
@@ -40,6 +43,7 @@ export function AppCatalogProvider({ children }: AppCatalogProviderProps) {
|
|
|
40
43
|
const contextValue = useMemo<AppCatalogContextIface>(
|
|
41
44
|
() => ({
|
|
42
45
|
resources: data?.resources ?? [],
|
|
46
|
+
mcpServers: data?.mcpServers ?? [],
|
|
43
47
|
isLoadingApps,
|
|
44
48
|
tagsDefinitions: data?.tagsDefinitions ?? [],
|
|
45
49
|
approvalMethods: data?.approvalMethods ?? [],
|
|
@@ -53,6 +57,7 @@ export function AppCatalogProvider({ children }: AppCatalogProviderProps) {
|
|
|
53
57
|
[
|
|
54
58
|
data?.approvalMethods,
|
|
55
59
|
data?.resources,
|
|
60
|
+
data?.mcpServers,
|
|
56
61
|
data?.tagsDefinitions,
|
|
57
62
|
data?.persons,
|
|
58
63
|
data?.groups,
|
|
@@ -2,17 +2,20 @@ import { Link, useRouterState } from '@tanstack/react-router'
|
|
|
2
2
|
import { useQuery } from '@tanstack/react-query'
|
|
3
3
|
import { useTRPC } from '~/api/infra/trpc'
|
|
4
4
|
import { cn } from '~/lib/utils'
|
|
5
|
+
import { useAppCatalogContext } from '../../context/AppCatalogContext'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* The header's section tabs: one captioned link per section, so each is
|
|
8
9
|
* deep-linkable. The active tab is derived from the pathname rather than an
|
|
9
10
|
* exact-match Link, because Catalog must stay active on the app-detail routes
|
|
10
11
|
* (`/app/<slug>`, #23) and on `/catalog/apps`, which renders the same page.
|
|
11
|
-
* Community tools is hidden until the server says the feature is on
|
|
12
|
+
* Community tools is hidden until the server says the feature is on, and MCP
|
|
13
|
+
* servers until the catalog lists at least one.
|
|
12
14
|
*/
|
|
13
15
|
export function SectionTabs() {
|
|
14
16
|
const pathname = useRouterState({ select: (s) => s.location.pathname })
|
|
15
17
|
const trpc = useTRPC()
|
|
18
|
+
const { mcpServers = [] } = useAppCatalogContext()
|
|
16
19
|
const { data: communityConfig } = useQuery(
|
|
17
20
|
trpc.communityTools.config.queryOptions(),
|
|
18
21
|
)
|
|
@@ -43,6 +46,16 @@ export function SectionTabs() {
|
|
|
43
46
|
caption: 'Where to file a ticket',
|
|
44
47
|
active: pathname.startsWith('/service-desks'),
|
|
45
48
|
},
|
|
49
|
+
...(mcpServers.length > 0
|
|
50
|
+
? [
|
|
51
|
+
{
|
|
52
|
+
to: '/mcp',
|
|
53
|
+
title: 'MCP servers',
|
|
54
|
+
caption: 'Plug company systems into your AI',
|
|
55
|
+
active: pathname.startsWith('/mcp'),
|
|
56
|
+
} as const,
|
|
57
|
+
]
|
|
58
|
+
: []),
|
|
46
59
|
] as const
|
|
47
60
|
|
|
48
61
|
return (
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { SourceReference } from '@igstack/app-catalog-backend-core'
|
|
2
|
+
import { ExternalLink } from 'lucide-react'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { SourcePulse } from './SourcePulse'
|
|
5
|
+
import { displayUrl } from '~/modules/appCatalog/utils/displayUrl'
|
|
6
|
+
|
|
7
|
+
interface SourcesListProps {
|
|
8
|
+
sources: (string | SourceReference)[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function useSourceUrlsWithPulse(sources: (string | SourceReference)[]) {
|
|
12
|
+
const urls: string[] = sources.map((s) => (typeof s === 'string' ? s : s.url))
|
|
13
|
+
// The list renders bare URLs (they are editable as text), so the pulse has to
|
|
14
|
+
// be looked up rather than carried alongside. Absent until the autoupdate loop
|
|
15
|
+
// has seen the source — a freshly added one simply gets no mark.
|
|
16
|
+
const pulseByUrl = React.useMemo(() => {
|
|
17
|
+
const byUrl = new Map<string, NonNullable<SourceReference['pulse']>>()
|
|
18
|
+
for (const source of sources) {
|
|
19
|
+
if (typeof source !== 'string' && source.pulse) {
|
|
20
|
+
byUrl.set(source.url, source.pulse)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return byUrl
|
|
24
|
+
}, [sources])
|
|
25
|
+
|
|
26
|
+
return { urls, pulseByUrl }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function SourcesList({ sources }: SourcesListProps) {
|
|
30
|
+
const { urls: sourceUrls, pulseByUrl } = useSourceUrlsWithPulse(sources)
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<ul className="space-y-2">
|
|
34
|
+
{sourceUrls.map((url, index) => (
|
|
35
|
+
// `group` so hovering anywhere on the row fades that source's
|
|
36
|
+
// track in — the mark sits in a right-hand column, and row
|
|
37
|
+
// hover is what ties the two ends of a wide row together.
|
|
38
|
+
<li key={index} className="group flex items-center gap-2 text-xs">
|
|
39
|
+
<span className="text-muted-foreground shrink-0 tabular-nums">
|
|
40
|
+
{index + 1}.
|
|
41
|
+
</span>
|
|
42
|
+
{url ? (
|
|
43
|
+
<a
|
|
44
|
+
href={url}
|
|
45
|
+
target="_blank"
|
|
46
|
+
rel="noopener noreferrer"
|
|
47
|
+
className="hover:text-primary inline-flex min-w-0 items-center gap-1 truncate"
|
|
48
|
+
>
|
|
49
|
+
{displayUrl(url)}
|
|
50
|
+
<ExternalLink className="size-3 shrink-0" />
|
|
51
|
+
</a>
|
|
52
|
+
) : (
|
|
53
|
+
<span className="text-muted-foreground">—</span>
|
|
54
|
+
)}
|
|
55
|
+
{pulseByUrl.has(url) && (
|
|
56
|
+
<SourcePulse pulse={pulseByUrl.get(url)!} className="ml-auto" />
|
|
57
|
+
)}
|
|
58
|
+
</li>
|
|
59
|
+
))}
|
|
60
|
+
</ul>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Resource,
|
|
3
|
-
SourceReference,
|
|
4
|
-
} from '@igstack/app-catalog-backend-core'
|
|
1
|
+
import type { Resource } from '@igstack/app-catalog-backend-core'
|
|
5
2
|
import { Link, useSearch } from '@tanstack/react-router'
|
|
6
3
|
import { ExternalLink, Plus, Trash2 } from 'lucide-react'
|
|
7
4
|
import React from 'react'
|
|
@@ -18,6 +15,7 @@ import { InlineEditableField } from '../components/InlineEditableField'
|
|
|
18
15
|
import { MarkdownText } from '../components/MarkdownText'
|
|
19
16
|
import { ScreenshotGallery } from '../components/ScreenshotGallery'
|
|
20
17
|
import { SourcePulse } from '../components/SourcePulse'
|
|
18
|
+
import { SourcesList, useSourceUrlsWithPulse } from '../components/SourcesList'
|
|
21
19
|
import { useUpdateApp } from '../../hooks/useUpdateApp'
|
|
22
20
|
import { useAppCatalogContext } from '../../context/AppCatalogContext'
|
|
23
21
|
import { useAppClickHistory } from '../../hooks/useAppClickHistory'
|
|
@@ -192,22 +190,11 @@ export function AppDetails({
|
|
|
192
190
|
const subSlug = search.sub
|
|
193
191
|
|
|
194
192
|
const displayTags = (app.tags ?? []).filter((tag) => !tag.includes(':'))
|
|
195
|
-
const
|
|
196
|
-
app.sources
|
|
193
|
+
const { urls: sourceUrls, pulseByUrl } = useSourceUrlsWithPulse(
|
|
194
|
+
app.sources ?? [],
|
|
195
|
+
)
|
|
197
196
|
const displaySources =
|
|
198
197
|
draftSource !== null ? [...sourceUrls, draftSource] : sourceUrls
|
|
199
|
-
// The list renders bare URLs (they are editable as text), so the pulse has to
|
|
200
|
-
// be looked up rather than carried alongside. Absent until the autoupdate loop
|
|
201
|
-
// has seen the source — a freshly added one simply gets no mark.
|
|
202
|
-
const pulseByUrl = React.useMemo(() => {
|
|
203
|
-
const byUrl = new Map<string, NonNullable<SourceReference['pulse']>>()
|
|
204
|
-
for (const source of app.sources ?? []) {
|
|
205
|
-
if (typeof source !== 'string' && source.pulse) {
|
|
206
|
-
byUrl.set(source.url, source.pulse)
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
return byUrl
|
|
210
|
-
}, [app.sources])
|
|
211
198
|
|
|
212
199
|
const children = React.useMemo(
|
|
213
200
|
() => getChildResources(allResources, app.slug),
|
|
@@ -568,40 +555,7 @@ export function AppDetails({
|
|
|
568
555
|
</Button>
|
|
569
556
|
</>
|
|
570
557
|
) : (
|
|
571
|
-
<
|
|
572
|
-
{sourceUrls.map((url, index) => (
|
|
573
|
-
// `group` so hovering anywhere on the row fades that source's
|
|
574
|
-
// track in — the mark sits in a right-hand column, and row
|
|
575
|
-
// hover is what ties the two ends of a wide row together.
|
|
576
|
-
<li
|
|
577
|
-
key={index}
|
|
578
|
-
className="group flex items-center gap-2 text-xs"
|
|
579
|
-
>
|
|
580
|
-
<span className="text-muted-foreground shrink-0 tabular-nums">
|
|
581
|
-
{index + 1}.
|
|
582
|
-
</span>
|
|
583
|
-
{url ? (
|
|
584
|
-
<a
|
|
585
|
-
href={url}
|
|
586
|
-
target="_blank"
|
|
587
|
-
rel="noopener noreferrer"
|
|
588
|
-
className="hover:text-primary inline-flex min-w-0 items-center gap-1 truncate"
|
|
589
|
-
>
|
|
590
|
-
{displayUrl(url)}
|
|
591
|
-
<ExternalLink className="size-3 shrink-0" />
|
|
592
|
-
</a>
|
|
593
|
-
) : (
|
|
594
|
-
<span className="text-muted-foreground">—</span>
|
|
595
|
-
)}
|
|
596
|
-
{pulseByUrl.has(url) && (
|
|
597
|
-
<SourcePulse
|
|
598
|
-
pulse={pulseByUrl.get(url)!}
|
|
599
|
-
className="ml-auto"
|
|
600
|
-
/>
|
|
601
|
-
)}
|
|
602
|
-
</li>
|
|
603
|
-
))}
|
|
604
|
-
</ul>
|
|
558
|
+
<SourcesList sources={app.sources ?? []} />
|
|
605
559
|
)}
|
|
606
560
|
{datesLine && (
|
|
607
561
|
<p className="behind-dates" title={datesTitle}>
|