@krak-stack/registry 0.1.11 → 0.1.14
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/README.md +31 -2
- package/dist/components/ui/app-brand.d.ts +18 -13
- package/dist/components/ui/app-brand.js +48 -15
- package/dist/components/ui/code-block.js +10 -6
- package/dist/components/ui/copy-button.d.ts +1 -1
- package/dist/components/ui/copy-button.js +1 -1
- package/dist/components/ui/data-table.d.ts +1 -1
- package/dist/components/ui/data-table.js +21 -20
- package/dist/components/ui/effect-form.js +7 -6
- package/dist/components/ui/file-picker.js +2 -1
- package/dist/components/ui/form.js +17 -15
- package/dist/components/ui/google-map.d.ts +6 -10
- package/dist/components/ui/google-map.js +19 -14
- package/dist/components/ui/locale-switcher.js +7 -1
- package/dist/components/ui/sidebar-layout.js +19 -21
- package/dist/components/ui/theme-switcher.js +1 -1
- package/dist/lib/docs-core.js +165 -109
- package/dist/lib/documentation-toolkit.d.ts +140 -0
- package/dist/lib/{docs-ai.js → documentation-toolkit.js} +54 -63
- package/dist/lib/httpapi-cli.d.ts +6 -6
- package/dist/lib/httpapi-cli.js +75 -48
- package/dist/lib/httpapi-client.d.ts +8 -2
- package/dist/lib/httpapi-client.js +21 -9
- package/dist/lib/httpapi-helpers.d.ts +15 -21
- package/dist/lib/httpapi-helpers.js +38 -26
- package/dist/lib/httpapi-mcp.js +73 -50
- package/dist/lib/httpapi-toolkit.d.ts +20 -0
- package/dist/lib/{httpapi-ai.js → httpapi-toolkit.js} +123 -100
- package/dist/lib/seo.js +29 -17
- package/dist/lib/webfetch-toolkit.d.ts +45 -0
- package/dist/lib/webfetch-toolkit.js +276 -0
- package/dist/oxlint/anti-slop/index.js +1592 -0
- package/dist/services/agent/client/atom.d.ts +7 -7
- package/dist/services/agent/client/index.js +55 -54
- package/dist/services/agent/index.d.ts +71 -71
- package/dist/services/agent/index.js +38 -19
- package/dist/services/notification/channels/index.d.ts +11 -9
- package/dist/services/notification/channels/ses/index.d.ts +6 -6
- package/dist/services/notification/channels/ses/index.js +15 -11
- package/dist/services/notification/client/index.js +3 -2
- package/dist/services/notification/client/notification-menu.d.ts +9 -9
- package/dist/services/notification/index.d.ts +7 -6
- package/dist/services/notification/persistence/drizzle.js +214 -0
- package/dist/services/notification/persistence/index.js +227 -0
- package/dist/services/notification/persistence/schema.js +118 -0
- package/dist/services/notification/public.js +3 -2
- package/dist/services/s3/index.d.ts +2 -16
- package/dist/services/s3/index.js +12 -9
- package/package.json +33 -7
- package/dist/lib/docs-ai.d.ts +0 -142
- package/dist/lib/httpapi-ai.d.ts +0 -54
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// ../../src/components/ui/google-map.tsx
|
|
2
2
|
import { Minus, Plus } from "lucide-react";
|
|
3
3
|
import { useEffect, useEffectEvent, useRef, useState } from "react";
|
|
4
|
+
import { Schema } from "effect";
|
|
4
5
|
|
|
5
6
|
// ../../src/lib/utils.ts
|
|
6
7
|
import { clsx } from "clsx";
|
|
@@ -472,28 +473,30 @@ var defaultMessages = {
|
|
|
472
473
|
zoomOut: "Zoom arrière"
|
|
473
474
|
}
|
|
474
475
|
};
|
|
475
|
-
var googleMapMessages = (overrides) => ({
|
|
476
|
-
...
|
|
476
|
+
var googleMapMessages = (locale, overrides) => ({
|
|
477
|
+
...locale.startsWith("fr") ? defaultMessages.fr : defaultMessages.en,
|
|
477
478
|
...overrides
|
|
478
479
|
});
|
|
479
480
|
var isGoogleMapsReady = (api) => Boolean(api?.maps.Map && api.maps.Marker && api.maps.Circle && api.maps.event);
|
|
480
481
|
var loadGoogleMaps = (apiKey) => {
|
|
481
|
-
if (
|
|
482
|
+
if (!globalThis.window || !globalThis.document) {
|
|
482
483
|
return Promise.reject(new Error("Google Maps requires a browser."));
|
|
483
484
|
}
|
|
484
|
-
|
|
485
|
-
|
|
485
|
+
const browserWindow = window;
|
|
486
|
+
if (isGoogleMapsReady(browserWindow.google)) {
|
|
487
|
+
return Promise.resolve(browserWindow.google);
|
|
488
|
+
}
|
|
486
489
|
if (googleMapsPromise)
|
|
487
490
|
return googleMapsPromise;
|
|
488
491
|
googleMapsPromise = new Promise((resolve, reject) => {
|
|
489
492
|
const resolveApi = () => {
|
|
490
|
-
if (isGoogleMapsReady(
|
|
491
|
-
resolve(
|
|
492
|
-
else
|
|
493
|
+
if (isGoogleMapsReady(browserWindow.google)) {
|
|
494
|
+
resolve(browserWindow.google);
|
|
495
|
+
} else
|
|
493
496
|
reject(new Error("Google Maps failed to initialize."));
|
|
494
497
|
};
|
|
495
498
|
const rejectLoad = () => reject(new Error("Google Maps failed to load."));
|
|
496
|
-
|
|
499
|
+
browserWindow.__krakStackGoogleMapsInit = resolveApi;
|
|
497
500
|
const existingScript = document.getElementById(googleMapsScriptId);
|
|
498
501
|
if (existingScript) {
|
|
499
502
|
existingScript.addEventListener("error", rejectLoad, { once: true });
|
|
@@ -508,7 +511,7 @@ var loadGoogleMaps = (apiKey) => {
|
|
|
508
511
|
document.head.append(script);
|
|
509
512
|
}).catch((error) => {
|
|
510
513
|
googleMapsPromise = undefined;
|
|
511
|
-
|
|
514
|
+
browserWindow.__krakStackGoogleMapsInit = undefined;
|
|
512
515
|
document.getElementById(googleMapsScriptId)?.remove();
|
|
513
516
|
throw error;
|
|
514
517
|
});
|
|
@@ -542,7 +545,8 @@ function GoogleMap({
|
|
|
542
545
|
minZoom = 3,
|
|
543
546
|
maxZoom = 20,
|
|
544
547
|
className,
|
|
545
|
-
messages: messageOverrides
|
|
548
|
+
messages: messageOverrides,
|
|
549
|
+
locale = getLocale()
|
|
546
550
|
}) {
|
|
547
551
|
const mapElementRef = useRef(null);
|
|
548
552
|
const apiRef = useRef(null);
|
|
@@ -556,9 +560,10 @@ function GoogleMap({
|
|
|
556
560
|
const initialZoom = clampZoom(zoom, normalizedMinZoom, normalizedMaxZoom);
|
|
557
561
|
const [loadState, setLoadState] = useState(normalizedApiKey ? "loading" : "missing-key");
|
|
558
562
|
const [currentZoom, setCurrentZoom] = useState(initialZoom);
|
|
559
|
-
const labels = googleMapMessages(messageOverrides);
|
|
560
|
-
const
|
|
561
|
-
const
|
|
563
|
+
const labels = googleMapMessages(locale, messageOverrides);
|
|
564
|
+
const markerOptions = Schema.is(Schema.Struct({ icon: Schema.optional(Schema.String) }))(marker) ? marker : undefined;
|
|
565
|
+
const markerEnabled = marker === true || markerOptions !== undefined;
|
|
566
|
+
const markerIcon = markerOptions?.icon;
|
|
562
567
|
const centerLat = center.lat;
|
|
563
568
|
const centerLng = center.lng;
|
|
564
569
|
const radiusMeters = radius?.radiusMeters;
|
|
@@ -575,7 +575,11 @@ function DropdownMenuRadioItem({
|
|
|
575
575
|
|
|
576
576
|
// ../../src/components/ui/locale-switcher.tsx
|
|
577
577
|
import { Languages } from "lucide-react";
|
|
578
|
+
import { Option, Schema } from "effect";
|
|
578
579
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
580
|
+
var LocaleSchema = Schema.Literals(locales).annotate({
|
|
581
|
+
identifier: "Locale"
|
|
582
|
+
});
|
|
579
583
|
var messages = {
|
|
580
584
|
en: {
|
|
581
585
|
title: "Switch language",
|
|
@@ -623,7 +627,9 @@ var LocaleSwitcher = ({ messages: messages2 }) => {
|
|
|
623
627
|
/* @__PURE__ */ jsx3(DropdownMenuRadioGroup, {
|
|
624
628
|
"aria-label": labels.title,
|
|
625
629
|
value: locale,
|
|
626
|
-
onValueChange: (
|
|
630
|
+
onValueChange: (value) => Schema.decodeUnknownOption(LocaleSchema)(value).pipe(Option.match({ onNone: () => {
|
|
631
|
+
return;
|
|
632
|
+
}, onSome: setLocale })),
|
|
627
633
|
children: locales.map((l) => /* @__PURE__ */ jsx3(DropdownMenuRadioItem, {
|
|
628
634
|
value: l,
|
|
629
635
|
children: labels[l]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useAtom } from "@effect/atom-react";
|
|
3
3
|
import { BrowserKeyValueStore } from "@effect/platform-browser";
|
|
4
4
|
import { Link, Outlet, useRouterState } from "@tanstack/react-router";
|
|
5
|
-
import { Schema } from "effect";
|
|
5
|
+
import { Schema as Schema2 } from "effect";
|
|
6
6
|
import { Atom } from "effect/unstable/reactivity";
|
|
7
7
|
|
|
8
8
|
// ../../src/components/ui/badge.tsx
|
|
@@ -264,6 +264,7 @@ function TooltipContent({
|
|
|
264
264
|
|
|
265
265
|
// ../../src/components/ui/sidebar.tsx
|
|
266
266
|
import { PanelLeftIcon } from "lucide-react";
|
|
267
|
+
import { Schema } from "effect";
|
|
267
268
|
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
268
269
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
269
270
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -292,18 +293,17 @@ function SidebarProvider({
|
|
|
292
293
|
const [openMobile, setOpenMobile] = React2.useState(false);
|
|
293
294
|
const [_open, _setOpen] = React2.useState(defaultOpen);
|
|
294
295
|
const open = openProp ?? _open;
|
|
295
|
-
const setOpen = React2.useCallback((
|
|
296
|
-
const openState = typeof value === "function" ? value(open) : value;
|
|
296
|
+
const setOpen = React2.useCallback((openState) => {
|
|
297
297
|
if (setOpenProp) {
|
|
298
298
|
setOpenProp(openState);
|
|
299
299
|
} else {
|
|
300
300
|
_setOpen(openState);
|
|
301
301
|
}
|
|
302
302
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
303
|
-
}, [setOpenProp
|
|
303
|
+
}, [setOpenProp]);
|
|
304
304
|
const toggleSidebar = React2.useCallback(() => {
|
|
305
|
-
return isMobile ? setOpenMobile((open2) => !open2) : setOpen(
|
|
306
|
-
}, [isMobile, setOpen, setOpenMobile]);
|
|
305
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen(!open);
|
|
306
|
+
}, [isMobile, open, setOpen, setOpenMobile]);
|
|
307
307
|
React2.useEffect(() => {
|
|
308
308
|
const handleKeyDown = (event) => {
|
|
309
309
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
@@ -324,15 +324,16 @@ function SidebarProvider({
|
|
|
324
324
|
setOpenMobile,
|
|
325
325
|
toggleSidebar
|
|
326
326
|
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
327
|
+
const wrapperStyle = {
|
|
328
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
329
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
330
|
+
...style
|
|
331
|
+
};
|
|
327
332
|
return /* @__PURE__ */ jsx7(SidebarContext.Provider, {
|
|
328
333
|
value: contextValue,
|
|
329
334
|
children: /* @__PURE__ */ jsx7("div", {
|
|
330
335
|
"data-slot": "sidebar-wrapper",
|
|
331
|
-
style:
|
|
332
|
-
"--sidebar-width": SIDEBAR_WIDTH,
|
|
333
|
-
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
334
|
-
...style
|
|
335
|
-
},
|
|
336
|
+
style: wrapperStyle,
|
|
336
337
|
className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className),
|
|
337
338
|
...props,
|
|
338
339
|
children
|
|
@@ -358,6 +359,9 @@ function Sidebar({
|
|
|
358
359
|
});
|
|
359
360
|
}
|
|
360
361
|
if (isMobile) {
|
|
362
|
+
const mobileStyle = {
|
|
363
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
364
|
+
};
|
|
361
365
|
return /* @__PURE__ */ jsx7(Sheet, {
|
|
362
366
|
open: openMobile,
|
|
363
367
|
onOpenChange: setOpenMobile,
|
|
@@ -368,9 +372,7 @@ function Sidebar({
|
|
|
368
372
|
"data-slot": "sidebar",
|
|
369
373
|
"data-mobile": "true",
|
|
370
374
|
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
371
|
-
style:
|
|
372
|
-
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
373
|
-
},
|
|
375
|
+
style: mobileStyle,
|
|
374
376
|
side,
|
|
375
377
|
children: [
|
|
376
378
|
/* @__PURE__ */ jsxs3(SheetHeader, {
|
|
@@ -586,11 +588,7 @@ function SidebarMenuButton({
|
|
|
586
588
|
if (!tooltip) {
|
|
587
589
|
return comp;
|
|
588
590
|
}
|
|
589
|
-
|
|
590
|
-
tooltip = {
|
|
591
|
-
children: tooltip
|
|
592
|
-
};
|
|
593
|
-
}
|
|
591
|
+
const tooltipProps = Schema.is(Schema.String)(tooltip) ? { children: tooltip } : tooltip;
|
|
594
592
|
return /* @__PURE__ */ jsxs3(Tooltip, {
|
|
595
593
|
children: [
|
|
596
594
|
comp,
|
|
@@ -598,7 +596,7 @@ function SidebarMenuButton({
|
|
|
598
596
|
side: "right",
|
|
599
597
|
align: "center",
|
|
600
598
|
hidden: state !== "collapsed" || isMobile,
|
|
601
|
-
...
|
|
599
|
+
...tooltipProps
|
|
602
600
|
})
|
|
603
601
|
]
|
|
604
602
|
});
|
|
@@ -610,7 +608,7 @@ var sidebarStorageRuntime = Atom.runtime(BrowserKeyValueStore.layerLocalStorage)
|
|
|
610
608
|
var sidebarOpenAtom = Atom.kvs({
|
|
611
609
|
runtime: sidebarStorageRuntime,
|
|
612
610
|
key: "sidebar:open",
|
|
613
|
-
schema:
|
|
611
|
+
schema: Schema2.Boolean,
|
|
614
612
|
defaultValue: () => true
|
|
615
613
|
});
|
|
616
614
|
var useSidebarLayout = () => {
|
|
@@ -635,7 +635,7 @@ var applyDocumentTheme = ({ theme, systemTheme }) => {
|
|
|
635
635
|
document.documentElement.classList.add(resolvedTheme);
|
|
636
636
|
};
|
|
637
637
|
var getInitialTheme = (initialTheme) => {
|
|
638
|
-
if (
|
|
638
|
+
if (!globalThis.window) {
|
|
639
639
|
return initialTheme ?? {
|
|
640
640
|
theme: DEFAULT_THEME,
|
|
641
641
|
systemTheme: DEFAULT_SYSTEM_THEME
|