zudoku 0.47.2 → 0.48.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/app/ZuploBuildConfig.d.ts +4 -114
- package/dist/app/ZuploBuildConfig.js +1 -1
- package/dist/app/ZuploBuildConfig.js.map +1 -1
- package/dist/app/demo.js +4 -3
- package/dist/app/demo.js.map +1 -1
- package/dist/app/main.js +5 -5
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js +4 -3
- package/dist/app/standalone.js.map +1 -1
- package/dist/config/loader.js +1 -2
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/BuildSchema.d.ts +20 -44
- package/dist/config/validators/BuildSchema.js +3 -14
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +7217 -0
- package/dist/config/validators/InputNavigationSchema.js +74 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -0
- package/dist/config/validators/InputNavigationSchema.test-d.d.ts +1 -0
- package/dist/config/validators/InputNavigationSchema.test-d.js +146 -0
- package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -0
- package/dist/config/validators/NavigationSchema.d.ts +44 -0
- package/dist/config/validators/NavigationSchema.js +95 -0
- package/dist/config/validators/NavigationSchema.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +2 -1
- package/dist/config/validators/icon-types.js +1775 -1
- package/dist/config/validators/icon-types.js.map +1 -1
- package/dist/config/validators/validate.d.ts +442 -5780
- package/dist/config/validators/validate.js +37 -55
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +0 -2
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/components/BuildCheck.js +1 -1
- package/dist/lib/components/BuildCheck.js.map +1 -1
- package/dist/lib/components/Header.js +10 -9
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +6 -2
- package/dist/lib/components/Heading.js +2 -2
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Main.js +4 -4
- package/dist/lib/components/Main.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +5 -5
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/PageProgress.d.ts +1 -0
- package/dist/lib/components/PageProgress.js +20 -0
- package/dist/lib/components/PageProgress.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +2 -3
- package/dist/lib/components/TopNavigation.js +45 -44
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +3 -7
- package/dist/lib/components/context/ZudokuContext.js +44 -26
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/Navigation.d.ts +5 -0
- package/dist/lib/components/navigation/Navigation.js +12 -0
- package/dist/lib/components/navigation/Navigation.js.map +1 -0
- package/dist/lib/components/navigation/{SidebarBadge.d.ts → NavigationBadge.d.ts} +1 -1
- package/dist/lib/components/navigation/{SidebarBadge.js → NavigationBadge.js} +2 -2
- package/dist/lib/components/navigation/NavigationBadge.js.map +1 -0
- package/dist/lib/components/navigation/NavigationCategory.d.ts +5 -0
- package/dist/lib/components/navigation/{SidebarCategory.js → NavigationCategory.js} +14 -12
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -0
- package/dist/lib/components/navigation/NavigationItem.d.ts +6 -0
- package/dist/lib/components/navigation/NavigationItem.js +47 -0
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -0
- package/dist/lib/components/navigation/{SidebarWrapper.d.ts → NavigationWrapper.d.ts} +1 -1
- package/dist/lib/components/navigation/{SidebarWrapper.js → NavigationWrapper.js} +3 -3
- package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -0
- package/dist/lib/components/navigation/utils.d.ts +7 -9
- package/dist/lib/components/navigation/utils.js +17 -17
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +6 -8
- package/dist/lib/core/ZudokuContext.js +5 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +2 -2
- package/dist/lib/hooks/useEvent.test.js +5 -3
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +1 -1
- package/dist/lib/plugins/api-catalog/index.d.ts +6 -6
- package/dist/lib/plugins/api-catalog/index.js +10 -10
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +4 -4
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/custom-pages/index.d.ts +3 -2
- package/dist/lib/plugins/custom-pages/index.js +15 -8
- package/dist/lib/plugins/custom-pages/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +6 -3
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/lib/plugins/markdown/index.js +9 -26
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/graphql.js +2 -2
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +3 -3
- package/dist/lib/plugins/openapi/index.js +9 -9
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +3 -3
- package/dist/lib/plugins/openapi/util/createNavigationCategory.d.ts +9 -0
- package/dist/lib/plugins/openapi/util/{createSidebarCategory.js → createNavigationCategory.js} +5 -4
- package/dist/lib/plugins/openapi/util/createNavigationCategory.js.map +1 -0
- package/dist/lib/plugins/openapi/util/getRoutes.js +2 -2
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +1 -1
- package/dist/lib/util/useScrollToAnchor.js +3 -3
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/SchemaManager.d.ts +4 -4
- package/dist/vite/api/SchemaManager.js +19 -19
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +4 -4
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/config.js +1 -0
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +8 -8
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +2 -0
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-custom-pages.js +2 -2
- package/dist/vite/plugin-custom-pages.js.map +1 -1
- package/dist/vite/plugin-docs.js +61 -59
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/{plugin-sidebar.d.ts → plugin-navigation.d.ts} +1 -1
- package/dist/vite/{plugin-sidebar.js → plugin-navigation.js} +20 -19
- package/dist/vite/plugin-navigation.js.map +1 -0
- package/dist/vite/plugin.js +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/shadcn-registry.d.ts +4 -4
- package/lib/{Markdown-C5j8kKSX.js → Markdown-DCAIYXF5.js} +480 -475
- package/lib/Markdown-DCAIYXF5.js.map +1 -0
- package/lib/{MdxPage-CKTMf1cR.js → MdxPage-Cf9YXWoC.js} +30 -30
- package/lib/MdxPage-Cf9YXWoC.js.map +1 -0
- package/lib/OasProvider-JMVTfG6_.js +35 -0
- package/lib/OasProvider-JMVTfG6_.js.map +1 -0
- package/lib/{OperationList-BJAKaG5p.js → OperationList-m4tFCI4S.js} +8 -8
- package/lib/{OperationList-BJAKaG5p.js.map → OperationList-m4tFCI4S.js.map} +1 -1
- package/lib/{RouteGuard-B7GVW4oL.js → RouteGuard-gV7nvzi7.js} +2 -2
- package/lib/{RouteGuard-B7GVW4oL.js.map → RouteGuard-gV7nvzi7.js.map} +1 -1
- package/lib/{SchemaList-Dgc0A8x5.js → SchemaList-_wRy4aQ0.js} +20 -20
- package/lib/SchemaList-_wRy4aQ0.js.map +1 -0
- package/lib/{SchemaView-DVx-jFN4.js → SchemaView-CRl_cQYH.js} +3 -3
- package/lib/{SchemaView-DVx-jFN4.js.map → SchemaView-CRl_cQYH.js.map} +1 -1
- package/lib/{SignUp-CRIKdWt9.js → SignUp-B6w5AwHM.js} +2 -2
- package/lib/{SignUp-CRIKdWt9.js.map → SignUp-B6w5AwHM.js.map} +1 -1
- package/lib/{Slot-ITby_hMb.js → Slot-BkYrj_uC.js} +4 -4
- package/lib/{Slot-ITby_hMb.js.map → Slot-BkYrj_uC.js.map} +1 -1
- package/lib/{SyntaxHighlight-CqKHkyEy.js → SyntaxHighlight-CH9OUJre.js} +2 -2
- package/lib/{SyntaxHighlight-CqKHkyEy.js.map → SyntaxHighlight-CH9OUJre.js.map} +1 -1
- package/lib/{Toc-Csq3UNtW.js → Toc-DRxqEsFc.js} +2 -2
- package/lib/{Toc-Csq3UNtW.js.map → Toc-DRxqEsFc.js.map} +1 -1
- package/lib/{circular-BP4OrHFK.js → circular-wJaV4vh_.js} +2 -2
- package/lib/{circular-BP4OrHFK.js.map → circular-wJaV4vh_.js.map} +1 -1
- package/lib/{createServer-zu4cDiPe.js → createServer-DN5AJLcN.js} +3 -3
- package/lib/{createServer-zu4cDiPe.js.map → createServer-DN5AJLcN.js.map} +1 -1
- package/lib/{errors-CPPSp5F4.js → errors-D_5vKvUq.js} +3 -3
- package/lib/{errors-CPPSp5F4.js.map → errors-D_5vKvUq.js.map} +1 -1
- package/lib/hook-CHXroBFt.js +1503 -0
- package/lib/hook-CHXroBFt.js.map +1 -0
- package/lib/{index-jWXxqkni.js → index-DJVaRmzI.js} +63 -62
- package/lib/index-DJVaRmzI.js.map +1 -0
- package/lib/{mutation-C1XCQTQL.js → mutation-BpcyTgWI.js} +2 -2
- package/lib/{mutation-C1XCQTQL.js.map → mutation-BpcyTgWI.js.map} +1 -1
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/{useMutation-BKvPttRn.js → useMutation-N4ockVKi.js} +3 -3
- package/lib/{useMutation-BKvPttRn.js.map → useMutation-N4ockVKi.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +2 -2
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +2 -2
- package/lib/zudoku.components.js +2756 -3424
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +44 -44
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +42 -39
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +22 -16
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +20 -69
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -5
- package/lib/zudoku.plugin-search-pagefind.js +2 -2
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +12 -9
- package/src/app/ZuploBuildConfig.ts +1 -1
- package/src/app/demo.tsx +4 -3
- package/src/app/main.css +5 -0
- package/src/app/main.tsx +6 -5
- package/src/app/standalone.tsx +4 -3
- package/src/lib/components/BuildCheck.tsx +1 -1
- package/src/lib/components/Header.tsx +5 -3
- package/src/lib/components/Heading.tsx +7 -3
- package/src/lib/components/Main.tsx +8 -8
- package/src/lib/components/MobileTopNavigation.tsx +12 -11
- package/src/lib/components/PageProgress.tsx +28 -0
- package/src/lib/components/TopNavigation.tsx +57 -66
- package/src/lib/components/context/ZudokuContext.ts +50 -32
- package/src/lib/components/navigation/{Sidebar.tsx → Navigation.tsx} +18 -16
- package/src/lib/components/navigation/{SidebarBadge.tsx → NavigationBadge.tsx} +1 -1
- package/src/lib/components/navigation/{SidebarCategory.tsx → NavigationCategory.tsx} +16 -14
- package/src/lib/components/navigation/{SidebarItem.tsx → NavigationItem.tsx} +23 -17
- package/src/lib/components/navigation/{SidebarWrapper.tsx → NavigationWrapper.tsx} +2 -2
- package/src/lib/components/navigation/utils.ts +27 -28
- package/src/lib/core/ZudokuContext.ts +9 -15
- package/src/lib/core/plugins.ts +2 -2
- package/src/lib/hooks/useEvent.test.tsx +7 -5
- package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
- package/src/lib/plugins/api-catalog/index.tsx +19 -19
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +6 -5
- package/src/lib/plugins/custom-pages/index.tsx +20 -11
- package/src/lib/plugins/markdown/MdxPage.tsx +6 -3
- package/src/lib/plugins/markdown/index.tsx +19 -40
- package/src/lib/plugins/openapi/OperationList.tsx +1 -1
- package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
- package/src/lib/plugins/openapi/SchemaList.tsx +2 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +5 -5
- package/src/lib/plugins/openapi/graphql/graphql.ts +6 -6
- package/src/lib/plugins/openapi/index.tsx +11 -11
- package/src/lib/plugins/openapi/interfaces.ts +3 -3
- package/src/lib/plugins/openapi/util/{createSidebarCategory.tsx → createNavigationCategory.tsx} +6 -5
- package/src/lib/plugins/openapi/util/getRoutes.tsx +2 -2
- package/src/lib/plugins/openapi/util/methodColorMap.tsx +1 -1
- package/src/lib/util/useScrollToAnchor.ts +3 -3
- package/dist/config/validators/InputSidebarSchema.d.ts +0 -220
- package/dist/config/validators/InputSidebarSchema.js +0 -63
- package/dist/config/validators/InputSidebarSchema.js.map +0 -1
- package/dist/config/validators/SidebarSchema.d.ts +0 -46
- package/dist/config/validators/SidebarSchema.js +0 -118
- package/dist/config/validators/SidebarSchema.js.map +0 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +0 -5
- package/dist/lib/components/navigation/Sidebar.js +0 -10
- package/dist/lib/components/navigation/Sidebar.js.map +0 -1
- package/dist/lib/components/navigation/SidebarBadge.js.map +0 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +0 -5
- package/dist/lib/components/navigation/SidebarCategory.js.map +0 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +0 -6
- package/dist/lib/components/navigation/SidebarItem.js +0 -44
- package/dist/lib/components/navigation/SidebarItem.js.map +0 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +0 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +0 -32
- package/dist/lib/plugins/markdown/resolver.js +0 -46
- package/dist/lib/plugins/markdown/resolver.js.map +0 -1
- package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +0 -9
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +0 -1
- package/dist/vite/plugin-sidebar.js.map +0 -1
- package/lib/Markdown-C5j8kKSX.js.map +0 -1
- package/lib/MdxPage-CKTMf1cR.js.map +0 -1
- package/lib/OasProvider-_GzmsbMg.js +0 -33
- package/lib/OasProvider-_GzmsbMg.js.map +0 -1
- package/lib/SchemaList-Dgc0A8x5.js.map +0 -1
- package/lib/hook-7wZANGJP.js +0 -1483
- package/lib/hook-7wZANGJP.js.map +0 -1
- package/lib/index-jWXxqkni.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.js.map +0 -1
- package/src/lib/plugins/markdown/resolver.ts +0 -59
package/lib/zudoku.hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z as p } from "./index--oeBayMa.js";
|
|
2
|
-
import { k as n, i as a, m as c } from "./hook-
|
|
3
|
-
import { C as H } from "./hook-
|
|
2
|
+
import { k as n, i as a, m as c } from "./hook-CHXroBFt.js";
|
|
3
|
+
import { C as H } from "./hook-CHXroBFt.js";
|
|
4
4
|
import { u as f } from "./useExposedProps-BZQkZneR.js";
|
|
5
5
|
import { useState as i, useEffect as E } from "react";
|
|
6
6
|
import { u as d } from "./index-QzXzw_ra.js";
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { s as f } from "./index-BvvmIczU.js";
|
|
3
3
|
import { d as b, m as j } from "./chunk-DQRVZFIR-BblmKnHy.js";
|
|
4
|
-
import { u as x, d as
|
|
5
|
-
import { H as
|
|
4
|
+
import { u as x, d as v, j as d } from "./hook-CHXroBFt.js";
|
|
5
|
+
import { H as y } from "./index.esm-BFcSKCe-.js";
|
|
6
6
|
import { Link as N } from "./zudoku.components.js";
|
|
7
|
-
import { H as
|
|
8
|
-
const
|
|
9
|
-
items:
|
|
10
|
-
filterCatalogItems: o = (
|
|
7
|
+
import { H as k, M as S } from "./Markdown-DCAIYXF5.js";
|
|
8
|
+
const w = ({
|
|
9
|
+
items: n,
|
|
10
|
+
filterCatalogItems: o = (r) => r,
|
|
11
11
|
label: c = "API Library",
|
|
12
|
-
categoryLabel:
|
|
12
|
+
categoryLabel: s
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
queryFn: () => o(
|
|
16
|
-
queryKey: ["catalogItems",
|
|
17
|
-
}),
|
|
18
|
-
return /* @__PURE__ */ t.jsxs("section", { className: "pt-(--padding-content-top)", ...
|
|
19
|
-
/* @__PURE__ */ t.jsx(
|
|
20
|
-
|
|
14
|
+
const r = x(), a = b({ path: "/catalog/:category" })?.params.category, l = v({
|
|
15
|
+
queryFn: () => o(n, { auth: r }),
|
|
16
|
+
queryKey: ["catalogItems", r]
|
|
17
|
+
}), m = a ? { "data-pagefind-ignore": "all" } : {};
|
|
18
|
+
return /* @__PURE__ */ t.jsxs("section", { className: "pt-(--padding-content-top)", ...m, children: [
|
|
19
|
+
/* @__PURE__ */ t.jsx(y, { children: /* @__PURE__ */ t.jsxs("title", { children: [
|
|
20
|
+
s ? `${s} - ` : "",
|
|
21
21
|
c
|
|
22
22
|
] }) }),
|
|
23
23
|
/* @__PURE__ */ t.jsxs("div", { className: "grid gap-4", children: [
|
|
24
|
-
/* @__PURE__ */ t.jsxs(
|
|
24
|
+
/* @__PURE__ */ t.jsxs(k, { level: 2, children: [
|
|
25
25
|
c,
|
|
26
|
-
|
|
26
|
+
s && ` - ${s}`
|
|
27
27
|
] }),
|
|
28
28
|
/* @__PURE__ */ t.jsx("div", { className: "grid grid-cols-2 gap-4", children: l.data.filter(
|
|
29
|
-
(e) => !
|
|
30
|
-
(i) => i.tags.find((
|
|
29
|
+
(e) => !a || e.categories.find(
|
|
30
|
+
(i) => i.tags.find((g) => h(i.label, g) === a)
|
|
31
31
|
)
|
|
32
32
|
).map((e) => /* @__PURE__ */ t.jsx(
|
|
33
33
|
N,
|
|
34
34
|
{
|
|
35
|
-
to:
|
|
35
|
+
to: d(e.path),
|
|
36
36
|
className: "no-underline hover:!text-foreground",
|
|
37
37
|
children: /* @__PURE__ */ t.jsxs("div", { className: "border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal", children: [
|
|
38
38
|
/* @__PURE__ */ t.jsx("span", { className: "font-semibold", children: e.label }),
|
|
39
39
|
/* @__PURE__ */ t.jsx(
|
|
40
|
-
|
|
40
|
+
S,
|
|
41
41
|
{
|
|
42
42
|
className: "text-sm whitespace-pre-wrap mb-6 line-clamp-2",
|
|
43
43
|
content: e.description
|
|
@@ -49,69 +49,69 @@ const H = ({
|
|
|
49
49
|
)) })
|
|
50
50
|
] })
|
|
51
51
|
] });
|
|
52
|
-
},
|
|
53
|
-
|
|
52
|
+
}, h = (n, o) => f(`${n}-${o}`), q = ({
|
|
53
|
+
path: n,
|
|
54
54
|
items: o,
|
|
55
55
|
label: c,
|
|
56
|
-
categories:
|
|
57
|
-
filterCatalogItems:
|
|
56
|
+
categories: s = [],
|
|
57
|
+
filterCatalogItems: r
|
|
58
58
|
}) => {
|
|
59
59
|
const p = Object.fromEntries(
|
|
60
|
-
|
|
61
|
-
(
|
|
62
|
-
|
|
60
|
+
s.flatMap(
|
|
61
|
+
(a) => [void 0, ...a.tags].map((l) => [
|
|
62
|
+
d(n, l ? h(a.label, l) : void 0),
|
|
63
63
|
l
|
|
64
64
|
])
|
|
65
65
|
)
|
|
66
66
|
);
|
|
67
67
|
return {
|
|
68
|
-
|
|
68
|
+
getNavigation: async (a) => {
|
|
69
69
|
if (!Object.keys(p).some(
|
|
70
|
-
(e) => j(e,
|
|
70
|
+
(e) => j(e, a)
|
|
71
71
|
))
|
|
72
72
|
return [];
|
|
73
|
-
const
|
|
73
|
+
const m = s.map((e) => ({
|
|
74
74
|
type: "category",
|
|
75
75
|
label: e.label,
|
|
76
76
|
collapsible: !1,
|
|
77
77
|
items: e.tags.map((i) => ({
|
|
78
|
-
type: "
|
|
79
|
-
|
|
78
|
+
type: "link",
|
|
79
|
+
to: d(n, h(e.label, i)),
|
|
80
80
|
label: i,
|
|
81
81
|
badge: {
|
|
82
82
|
label: String(
|
|
83
83
|
o.filter(
|
|
84
|
-
(
|
|
84
|
+
(g) => g.categories.find((u) => u.tags.includes(i))
|
|
85
85
|
).length
|
|
86
86
|
),
|
|
87
87
|
color: "outline"
|
|
88
88
|
}
|
|
89
89
|
}))
|
|
90
90
|
}));
|
|
91
|
-
return
|
|
92
|
-
type: "
|
|
93
|
-
|
|
91
|
+
return m.unshift({
|
|
92
|
+
type: "link",
|
|
93
|
+
to: d(n),
|
|
94
94
|
label: "Overview",
|
|
95
95
|
badge: { label: String(o.length), color: "outline" }
|
|
96
|
-
}),
|
|
96
|
+
}), m;
|
|
97
97
|
},
|
|
98
|
-
getRoutes: () => Object.entries(p).map(([
|
|
99
|
-
path:
|
|
98
|
+
getRoutes: () => Object.entries(p).map(([a, l]) => ({
|
|
99
|
+
path: a,
|
|
100
100
|
element: /* @__PURE__ */ t.jsx(
|
|
101
|
-
|
|
101
|
+
w,
|
|
102
102
|
{
|
|
103
103
|
label: c,
|
|
104
104
|
categoryLabel: l,
|
|
105
105
|
items: o,
|
|
106
|
-
filterCatalogItems:
|
|
107
|
-
categories:
|
|
106
|
+
filterCatalogItems: r,
|
|
107
|
+
categories: s
|
|
108
108
|
}
|
|
109
109
|
)
|
|
110
110
|
}))
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
113
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
q as apiCatalogPlugin,
|
|
115
|
+
h as getKey
|
|
116
116
|
};
|
|
117
117
|
//# sourceMappingURL=zudoku.plugin-api-catalog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-api-catalog.js","sources":["../src/lib/plugins/api-catalog/Catalog.tsx","../src/lib/plugins/api-catalog/index.tsx"],"sourcesContent":["import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMatch } from \"react-router\";\nimport { Link } from \"zudoku/components\";\nimport { useAuthState } from \"../../authentication/state.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { type ApiCatalogPluginOptions, getKey } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n filterCatalogItems = (items) => items,\n label = \"API Library\",\n categoryLabel,\n}: Omit<ApiCatalogPluginOptions, \"
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-api-catalog.js","sources":["../src/lib/plugins/api-catalog/Catalog.tsx","../src/lib/plugins/api-catalog/index.tsx"],"sourcesContent":["import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMatch } from \"react-router\";\nimport { Link } from \"zudoku/components\";\nimport { useAuthState } from \"../../authentication/state.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { type ApiCatalogPluginOptions, getKey } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n filterCatalogItems = (items) => items,\n label = \"API Library\",\n categoryLabel,\n}: Omit<ApiCatalogPluginOptions, \"path\"> & {\n categoryLabel?: string;\n}) => {\n const auth = useAuthState();\n const match = useMatch({ path: \"/catalog/:category\" });\n const activeCategory = match?.params.category;\n\n const catalogItems = useSuspenseQuery({\n queryFn: () => filterCatalogItems(items, { auth }),\n queryKey: [\"catalogItems\", auth],\n });\n\n // Only index the overview page, ignore the rest\n const dataSet = activeCategory ? { \"data-pagefind-ignore\": \"all\" } : {};\n\n return (\n <section className=\"pt-(--padding-content-top)\" {...dataSet}>\n <Helmet>\n <title>\n {categoryLabel ? `${categoryLabel} - ` : \"\"}\n {label}\n </title>\n </Helmet>\n <div className=\"grid gap-4\">\n <Heading level={2}>\n {label}\n {categoryLabel && ` - ${categoryLabel}`}\n </Heading>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {catalogItems.data\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find((t) => getKey(c.label, t) === activeCategory),\n ),\n )\n .map((api) => (\n <Link\n to={joinUrl(api.path)}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div className=\"border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\">\n <span className=\"font-semibold\">{api.label}</span>\n <Markdown\n className=\"text-sm whitespace-pre-wrap mb-6 line-clamp-2\"\n content={api.description}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </section>\n );\n};\n","import slugify from \"@sindresorhus/slugify\";\nimport { matchPath } from \"react-router\";\nimport type { NavigationItem } from \"../../../config/validators/NavigationSchema.js\";\nimport type { AuthState } from \"../../authentication/state.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport const getKey = (category: string, tag: string) =>\n slugify(`${category}-${tag}`);\n\nexport type ApiCatalogItem = {\n path: string;\n label: string;\n description: string;\n categories: CatalogCategory[];\n};\n\nexport type CatalogCategory = {\n label: string;\n tags: string[];\n};\n\nexport type ApiCatalogPluginOptions = {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n};\n\nexport type CatalogContext<ProviderData = unknown> = {\n auth: AuthState<ProviderData>;\n};\n\nexport type FilterCatalogItemsFn<ProviderData = unknown> = (\n items: ApiCatalogItem[],\n { auth }: CatalogContext<ProviderData>,\n) => ApiCatalogItem[];\n\nexport const apiCatalogPlugin = ({\n path,\n items,\n label,\n categories = [],\n filterCatalogItems,\n}: {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n}): ZudokuPlugin => {\n const paths = Object.fromEntries(\n categories.flatMap((category) =>\n [undefined, ...category.tags].map((tag) => [\n joinUrl(path, tag ? getKey(category.label, tag) : undefined),\n tag,\n ]),\n ),\n );\n\n return {\n getNavigation: async (currentPath) => {\n const matches = Object.keys(paths).some((path) =>\n matchPath(path, currentPath),\n );\n\n if (!matches) {\n return [];\n }\n\n const navigation: NavigationItem[] = categories.map((category) => ({\n type: \"category\",\n label: category.label,\n collapsible: false,\n items: category.tags.map((tag) => ({\n type: \"link\",\n to: joinUrl(path, getKey(category.label, tag)),\n label: tag,\n badge: {\n label: String(\n items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n ),\n color: \"outline\",\n },\n })),\n }));\n\n navigation.unshift({\n type: \"link\",\n to: joinUrl(path),\n label: \"Overview\",\n badge: { label: String(items.length), color: \"outline\" },\n });\n\n return navigation;\n },\n getRoutes: () =>\n Object.entries(paths).map(([path, tag]) => ({\n path,\n element: (\n <Catalog\n label={label}\n categoryLabel={tag}\n items={items}\n filterCatalogItems={filterCatalogItems}\n categories={categories}\n />\n ),\n })),\n };\n};\n"],"names":["Catalog","items","filterCatalogItems","label","categoryLabel","auth","useAuthState","activeCategory","useMatch","catalogItems","useSuspenseQuery","dataSet","jsxs","jsx","Helmet","Heading","api","c","t","getKey","Link","joinUrl","Markdown","category","tag","slugify","apiCatalogPlugin","path","categories","paths","currentPath","matchPath","navigation"],"mappings":"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"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { CheckIcon as _, XIcon as se, PencilLineIcon as ne,
|
|
3
|
-
import { D as ce, S as O, R as ue } from "./Slot-
|
|
2
|
+
import { CheckIcon as _, XIcon as se, PencilLineIcon as ne, RefreshCwIcon as ie, EyeOffIcon as re, EyeIcon as ae, CopyIcon as oe, TrashIcon as le, KeyRoundIcon as de } from "lucide-react";
|
|
3
|
+
import { D as ce, S as O, R as ue } from "./Slot-BkYrj_uC.js";
|
|
4
4
|
import { i as P } from "./invariant-DAFpPywt.js";
|
|
5
|
-
import { O as
|
|
6
|
-
import { i as
|
|
5
|
+
import { O as fe, L as Q } from "./chunk-DQRVZFIR-BblmKnHy.js";
|
|
6
|
+
import { i as he, k as pe, e as xe, d as me } from "./hook-CHXroBFt.js";
|
|
7
7
|
import { Button as j } from "./ui/Button.js";
|
|
8
|
-
import { u as z } from "./useMutation-
|
|
8
|
+
import { u as z } from "./useMutation-N4ockVKi.js";
|
|
9
9
|
import * as S from "react";
|
|
10
10
|
import ye, { createContext as q, useRef as D, useLayoutEffect as ge, useEffect as B, useId as L, useContext as $, useInsertionEffect as je, useMemo as M, useCallback as Ce, Children as ve, isValidElement as we, useState as E } from "react";
|
|
11
11
|
import { C as ke, a as be } from "./Card-DPhGbYUM.js";
|
|
@@ -13,8 +13,8 @@ import { D as U, e as W, a as X, b as Y, c as G, d as J, f as V, g as K } from "
|
|
|
13
13
|
import { Input as Ee } from "./ui/Input.js";
|
|
14
14
|
import { c as R } from "./cn-wvCW-ho6.js";
|
|
15
15
|
const De = () => {
|
|
16
|
-
const t =
|
|
17
|
-
return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(
|
|
16
|
+
const t = he();
|
|
17
|
+
return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(fe, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
|
|
18
18
|
"Please login first to view this page",
|
|
19
19
|
/* @__PURE__ */ e.jsx(j, { onClick: () => t.login(), children: "Login" })
|
|
20
20
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(ce, { className: "max-w-[600px]", children: [
|
|
@@ -66,45 +66,45 @@ function ze({ children: t, isPresent: i, anchorX: s }) {
|
|
|
66
66
|
right: 0
|
|
67
67
|
}), { nonce: u } = $(Ae);
|
|
68
68
|
return je(() => {
|
|
69
|
-
const { width: m, height:
|
|
70
|
-
if (i || !o.current || !m || !
|
|
69
|
+
const { width: m, height: f, top: x, left: c, right: d } = r.current;
|
|
70
|
+
if (i || !o.current || !m || !f)
|
|
71
71
|
return;
|
|
72
72
|
const y = s === "left" ? `left: ${c}` : `right: ${d}`;
|
|
73
73
|
o.current.dataset.motionPopId = n;
|
|
74
|
-
const
|
|
75
|
-
return u && (
|
|
74
|
+
const h = document.createElement("style");
|
|
75
|
+
return u && (h.nonce = u), document.head.appendChild(h), h.sheet && h.sheet.insertRule(`
|
|
76
76
|
[data-motion-pop-id="${n}"] {
|
|
77
77
|
position: absolute !important;
|
|
78
78
|
width: ${m}px !important;
|
|
79
|
-
height: ${
|
|
79
|
+
height: ${f}px !important;
|
|
80
80
|
${y}px !important;
|
|
81
81
|
top: ${x}px !important;
|
|
82
82
|
}
|
|
83
83
|
`), () => {
|
|
84
|
-
document.head.contains(
|
|
84
|
+
document.head.contains(h) && document.head.removeChild(h);
|
|
85
85
|
};
|
|
86
86
|
}, [i]), e.jsx(Te, { isPresent: i, childRef: o, sizeRef: r, children: S.cloneElement(t, { ref: o }) });
|
|
87
87
|
}
|
|
88
88
|
const Me = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: r, mode: u, anchorX: m }) => {
|
|
89
|
-
const
|
|
89
|
+
const f = Z(Se), x = L();
|
|
90
90
|
let c = !0, d = M(() => (c = !1, {
|
|
91
91
|
id: x,
|
|
92
92
|
initial: i,
|
|
93
93
|
isPresent: s,
|
|
94
94
|
custom: o,
|
|
95
95
|
onExitComplete: (y) => {
|
|
96
|
-
|
|
97
|
-
for (const
|
|
98
|
-
if (!
|
|
96
|
+
f.set(y, !0);
|
|
97
|
+
for (const h of f.values())
|
|
98
|
+
if (!h)
|
|
99
99
|
return;
|
|
100
100
|
n && n();
|
|
101
101
|
},
|
|
102
|
-
register: (y) => (
|
|
103
|
-
}), [s,
|
|
102
|
+
register: (y) => (f.set(y, !1), () => f.delete(y))
|
|
103
|
+
}), [s, f, n]);
|
|
104
104
|
return r && c && (d = { ...d }), M(() => {
|
|
105
|
-
|
|
105
|
+
f.forEach((y, h) => f.set(h, !1));
|
|
106
106
|
}, [s]), S.useEffect(() => {
|
|
107
|
-
!s && !
|
|
107
|
+
!s && !f.size && n && n();
|
|
108
108
|
}, [s]), u === "popLayout" && (t = e.jsx(ze, { isPresent: s, anchorX: m, children: t })), e.jsx(ee.Provider, { value: d, children: t });
|
|
109
109
|
};
|
|
110
110
|
function Se() {
|
|
@@ -130,9 +130,9 @@ function H(t) {
|
|
|
130
130
|
}), i;
|
|
131
131
|
}
|
|
132
132
|
const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: o = !0, mode: r = "sync", propagate: u = !1, anchorX: m = "left" }) => {
|
|
133
|
-
const [
|
|
133
|
+
const [f, x] = qe(u), c = M(() => H(t), [t]), d = u && !f ? [] : c.map(N), y = D(!0), h = D(c), k = Z(() => /* @__PURE__ */ new Map()), [a, l] = E(c), [p, v] = E(c);
|
|
134
134
|
Ie(() => {
|
|
135
|
-
y.current = !1,
|
|
135
|
+
y.current = !1, h.current = c;
|
|
136
136
|
for (let w = 0; w < p.length; w++) {
|
|
137
137
|
const g = N(p[w]);
|
|
138
138
|
d.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
|
|
@@ -150,7 +150,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
150
150
|
process.env.NODE_ENV !== "production" && r === "wait" && p.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
151
151
|
const { forceRender: A } = $(Pe);
|
|
152
152
|
return e.jsx(e.Fragment, { children: p.map((w) => {
|
|
153
|
-
const g = N(w), b = u && !
|
|
153
|
+
const g = N(w), b = u && !f ? !1 : c === p || d.includes(g), T = () => {
|
|
154
154
|
if (k.has(g))
|
|
155
155
|
k.set(g, !0);
|
|
156
156
|
else
|
|
@@ -158,14 +158,14 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
158
158
|
let F = !0;
|
|
159
159
|
k.forEach((te) => {
|
|
160
160
|
te || (F = !1);
|
|
161
|
-
}), F && (A?.(), v(
|
|
161
|
+
}), F && (A?.(), v(h.current), u && x?.(), n && n());
|
|
162
162
|
};
|
|
163
163
|
return e.jsx(Me, { isPresent: b, initial: !y.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: o, mode: r, onExitComplete: b ? void 0 : T, anchorX: m, children: w }, g);
|
|
164
164
|
}) });
|
|
165
165
|
}, $e = ({ service: t }) => {
|
|
166
166
|
const i = pe(), s = xe(), [n, o] = E(
|
|
167
167
|
null
|
|
168
|
-
), [r, u] = E(""), { data: m, isFetching:
|
|
168
|
+
), [r, u] = E(""), { data: m, isFetching: f } = me({
|
|
169
169
|
queryFn: () => t.getConsumers(i),
|
|
170
170
|
queryKey: ["api-keys"],
|
|
171
171
|
retry: !1
|
|
@@ -226,7 +226,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
226
226
|
onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
|
|
227
227
|
}), y = (a, l) => {
|
|
228
228
|
o(a), u(l);
|
|
229
|
-
},
|
|
229
|
+
}, h = (a) => {
|
|
230
230
|
r.trim() && c.mutate({
|
|
231
231
|
consumerId: a,
|
|
232
232
|
label: r.trim()
|
|
@@ -273,7 +273,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
273
273
|
value: r,
|
|
274
274
|
onChange: (l) => u(l.target.value),
|
|
275
275
|
onKeyDown: (l) => {
|
|
276
|
-
l.key === "Enter" ?
|
|
276
|
+
l.key === "Enter" ? h(a.id) : l.key === "Escape" && k();
|
|
277
277
|
},
|
|
278
278
|
className: "text-lg font-medium",
|
|
279
279
|
autoFocus: !0
|
|
@@ -285,7 +285,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
285
285
|
{
|
|
286
286
|
size: "icon",
|
|
287
287
|
variant: "ghost",
|
|
288
|
-
onClick: () =>
|
|
288
|
+
onClick: () => h(a.id),
|
|
289
289
|
disabled: !r.trim(),
|
|
290
290
|
children: /* @__PURE__ */ e.jsx(_, { size: 16 })
|
|
291
291
|
}
|
|
@@ -317,17 +317,20 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
317
317
|
] })
|
|
318
318
|
] }),
|
|
319
319
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
|
|
320
|
-
t.updateConsumer && /* @__PURE__ */ e.
|
|
320
|
+
t.updateConsumer && /* @__PURE__ */ e.jsxs(
|
|
321
321
|
j,
|
|
322
322
|
{
|
|
323
|
-
size: "icon",
|
|
324
323
|
variant: "ghost",
|
|
325
324
|
onClick: () => y(a.id, a.label),
|
|
326
325
|
className: R(
|
|
326
|
+
"flex gap-2",
|
|
327
327
|
n === a.id && "opacity-0! pointer-events-none"
|
|
328
328
|
),
|
|
329
329
|
disabled: n === a.id,
|
|
330
|
-
children:
|
|
330
|
+
children: [
|
|
331
|
+
/* @__PURE__ */ e.jsx(ne, { size: 16 }),
|
|
332
|
+
"Edit label"
|
|
333
|
+
]
|
|
331
334
|
}
|
|
332
335
|
),
|
|
333
336
|
t.rollKey && /* @__PURE__ */ e.jsxs(U, { children: [
|
|
@@ -337,7 +340,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
337
340
|
title: "Roll this key",
|
|
338
341
|
variant: "ghost",
|
|
339
342
|
disabled: d.isPending,
|
|
340
|
-
className: "flex items-center gap-
|
|
343
|
+
className: "flex items-center gap-2",
|
|
341
344
|
children: [
|
|
342
345
|
/* @__PURE__ */ e.jsx(
|
|
343
346
|
ie,
|
|
@@ -346,7 +349,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
346
349
|
className: d.isPending ? "animate-spin" : void 0
|
|
347
350
|
}
|
|
348
351
|
),
|
|
349
|
-
"Roll"
|
|
352
|
+
"Roll key"
|
|
350
353
|
]
|
|
351
354
|
}
|
|
352
355
|
) }),
|
|
@@ -382,7 +385,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
382
385
|
keyId: l.id
|
|
383
386
|
});
|
|
384
387
|
},
|
|
385
|
-
className: x.variables?.keyId === l.id && (x.isPending ||
|
|
388
|
+
className: x.variables?.keyId === l.id && (x.isPending || f) ? "opacity-10!" : void 0
|
|
386
389
|
}
|
|
387
390
|
),
|
|
388
391
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
|
|
@@ -402,7 +405,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
402
405
|
onDeleteKey: i,
|
|
403
406
|
className: s
|
|
404
407
|
}) => {
|
|
405
|
-
const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn:
|
|
408
|
+
const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn: f, expiresOn: x } = t, c = x && new Date(x) < /* @__PURE__ */ new Date(), d = x ? Math.ceil(
|
|
406
409
|
(new Date(x).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
|
|
407
410
|
) : 1 / 0, y = d <= 7 && !c;
|
|
408
411
|
return /* @__PURE__ */ e.jsxs("div", { className: R("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
@@ -427,7 +430,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
427
430
|
j,
|
|
428
431
|
{
|
|
429
432
|
variant: "ghost",
|
|
430
|
-
onClick: () => o((
|
|
433
|
+
onClick: () => o((h) => !h),
|
|
431
434
|
size: "icon",
|
|
432
435
|
children: n ? /* @__PURE__ */ e.jsx(re, { size: 16 }) : /* @__PURE__ */ e.jsx(ae, { size: 16 })
|
|
433
436
|
}
|
|
@@ -447,9 +450,9 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
447
450
|
)
|
|
448
451
|
] }),
|
|
449
452
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
|
|
450
|
-
|
|
453
|
+
f && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
451
454
|
"Created ",
|
|
452
|
-
Fe(
|
|
455
|
+
Fe(f),
|
|
453
456
|
"."
|
|
454
457
|
] }),
|
|
455
458
|
" ",
|