@krak-stack/registry 0.1.38 → 0.1.39
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 +106 -29
- package/dist/components/ui/app-brand.js +17 -17
- package/dist/components/ui/code-block.js +4 -4
- package/dist/components/ui/copy-button.js +2 -2
- package/dist/components/ui/data-table.js +55 -55
- package/dist/components/ui/editing-locale-switcher.js +8 -8
- package/dist/components/ui/effect-form.js +12 -12
- package/dist/components/ui/error-component.js +6 -6
- package/dist/components/ui/file-picker.js +2 -2
- package/dist/components/ui/form.js +24 -24
- package/dist/components/ui/icon-input.js +5 -5
- package/dist/components/ui/locale-switcher.js +2 -2
- package/dist/components/ui/search-menu.js +2 -2
- package/dist/components/ui/sidebar-layout.js +1 -1
- package/dist/components/ui/theme-switcher.js +3 -3
- package/dist/lib/docs.js +52 -111
- package/dist/lib/docs.server.js +0 -28
- package/dist/lib/documentation-toolkit.js +0 -28
- package/dist/lib/httpapi-adapter.d.ts +73 -0
- package/dist/lib/httpapi-adapter.js +189 -0
- package/dist/lib/httpapi-cli.d.ts +4 -22
- package/dist/lib/httpapi-cli.js +199 -313
- package/dist/lib/httpapi-toolkit.d.ts +7 -16
- package/dist/lib/httpapi-toolkit.js +158 -214
- package/dist/lib/query.d.ts +2 -2
- package/dist/lib/query.js +2 -2
- package/dist/lib/webfetch-toolkit.d.ts +1 -1
- package/dist/lib/webfetch-toolkit.js +48 -50
- package/dist/oxlint/anti-slop/index.js +2 -2
- package/dist/services/agent/client/index.js +6 -6
- package/dist/services/agent/index.js +2 -2
- package/package.json +4 -12
- package/dist/lib/httpapi-client.d.ts +0 -34
- package/dist/lib/httpapi-client.js +0 -122
- package/dist/lib/httpapi-helpers.d.ts +0 -79
- package/dist/lib/httpapi-helpers.js +0 -130
- package/dist/lib/httpapi-mcp.d.ts +0 -25
- package/dist/lib/httpapi-mcp.js +0 -321
|
@@ -508,7 +508,7 @@ var FilePicker = ({
|
|
|
508
508
|
image,
|
|
509
509
|
invalid = false,
|
|
510
510
|
locale: localeOverride,
|
|
511
|
-
messages
|
|
511
|
+
messages,
|
|
512
512
|
multiple = false,
|
|
513
513
|
name,
|
|
514
514
|
onBlur,
|
|
@@ -519,7 +519,7 @@ var FilePicker = ({
|
|
|
519
519
|
title
|
|
520
520
|
}) => {
|
|
521
521
|
const locale = useKrakstackLocale(localeOverride);
|
|
522
|
-
const labels = filePickerMessages(locale,
|
|
522
|
+
const labels = filePickerMessages(locale, messages);
|
|
523
523
|
const inputRef = useRef(null);
|
|
524
524
|
const dragDepthRef = useRef(0);
|
|
525
525
|
const [dragging, setDragging] = useState(false);
|
|
@@ -1648,7 +1648,7 @@ var SingleSearchableSelectControl = ({
|
|
|
1648
1648
|
invalid,
|
|
1649
1649
|
items,
|
|
1650
1650
|
locale,
|
|
1651
|
-
messages
|
|
1651
|
+
messages,
|
|
1652
1652
|
name,
|
|
1653
1653
|
onSearchValueChange,
|
|
1654
1654
|
placeholder,
|
|
@@ -1663,7 +1663,7 @@ var SingleSearchableSelectControl = ({
|
|
|
1663
1663
|
emptyLabel,
|
|
1664
1664
|
items: mergedItems,
|
|
1665
1665
|
locale,
|
|
1666
|
-
...
|
|
1666
|
+
...messages ? { messages } : {},
|
|
1667
1667
|
onValueChange: (option) => field.handleChange(option?.value ?? ""),
|
|
1668
1668
|
placeholder,
|
|
1669
1669
|
triggerId: name,
|
|
@@ -1680,7 +1680,7 @@ var MultipleSearchableSelectControl = ({
|
|
|
1680
1680
|
invalid,
|
|
1681
1681
|
items,
|
|
1682
1682
|
locale,
|
|
1683
|
-
messages
|
|
1683
|
+
messages,
|
|
1684
1684
|
name,
|
|
1685
1685
|
onSearchValueChange,
|
|
1686
1686
|
placeholder,
|
|
@@ -1695,7 +1695,7 @@ var MultipleSearchableSelectControl = ({
|
|
|
1695
1695
|
emptyLabel,
|
|
1696
1696
|
items: mergedItems,
|
|
1697
1697
|
locale,
|
|
1698
|
-
...
|
|
1698
|
+
...messages ? { messages } : {},
|
|
1699
1699
|
multiple: true,
|
|
1700
1700
|
onValueChange: (options) => field.handleChange(options.map(({ value }) => value)),
|
|
1701
1701
|
placeholder,
|
|
@@ -1749,14 +1749,14 @@ var SearchableSelectField = ({
|
|
|
1749
1749
|
var FileField = ({
|
|
1750
1750
|
label,
|
|
1751
1751
|
accept,
|
|
1752
|
-
filePickerMessages
|
|
1752
|
+
filePickerMessages,
|
|
1753
1753
|
locale: localeOverride,
|
|
1754
|
-
messages
|
|
1754
|
+
messages,
|
|
1755
1755
|
onFileChange,
|
|
1756
1756
|
required = false
|
|
1757
1757
|
}) => {
|
|
1758
1758
|
const locale = useKrakstackLocale3(localeOverride);
|
|
1759
|
-
const labels = formMessages(locale,
|
|
1759
|
+
const labels = formMessages(locale, messages);
|
|
1760
1760
|
const field = useFieldContext();
|
|
1761
1761
|
const invalid = !field.state.meta.isValid;
|
|
1762
1762
|
return /* @__PURE__ */ jsxs6(Field, {
|
|
@@ -1774,10 +1774,10 @@ var FileField = ({
|
|
|
1774
1774
|
invalid,
|
|
1775
1775
|
locale,
|
|
1776
1776
|
messages: {
|
|
1777
|
-
...
|
|
1777
|
+
...filePickerMessages,
|
|
1778
1778
|
[locale]: {
|
|
1779
|
-
...
|
|
1780
|
-
...
|
|
1779
|
+
...filePickerMessages?.[locale.split("-")[0] ?? locale],
|
|
1780
|
+
...filePickerMessages?.[locale],
|
|
1781
1781
|
accepts: labels.accepts,
|
|
1782
1782
|
deleteFile: labels.delete
|
|
1783
1783
|
}
|
|
@@ -1802,14 +1802,14 @@ var FileField = ({
|
|
|
1802
1802
|
});
|
|
1803
1803
|
};
|
|
1804
1804
|
var ImageField = ({
|
|
1805
|
-
filePickerMessages
|
|
1805
|
+
filePickerMessages,
|
|
1806
1806
|
label,
|
|
1807
1807
|
locale: localeOverride,
|
|
1808
|
-
messages
|
|
1808
|
+
messages,
|
|
1809
1809
|
size
|
|
1810
1810
|
}) => {
|
|
1811
1811
|
const locale = useKrakstackLocale3(localeOverride);
|
|
1812
|
-
const labels = formMessages(locale,
|
|
1812
|
+
const labels = formMessages(locale, messages);
|
|
1813
1813
|
const field = useFieldContext();
|
|
1814
1814
|
const invalid = !field.state.meta.isValid;
|
|
1815
1815
|
const imageUrl = Schema2.is(Schema2.String)(field.state.value) ? field.state.value : undefined;
|
|
@@ -1835,10 +1835,10 @@ var ImageField = ({
|
|
|
1835
1835
|
invalid,
|
|
1836
1836
|
locale,
|
|
1837
1837
|
messages: {
|
|
1838
|
-
...
|
|
1838
|
+
...filePickerMessages,
|
|
1839
1839
|
[locale]: {
|
|
1840
|
-
...
|
|
1841
|
-
...
|
|
1840
|
+
...filePickerMessages?.[locale.split("-")[0] ?? locale],
|
|
1841
|
+
...filePickerMessages?.[locale],
|
|
1842
1842
|
accepts: labels.accepts,
|
|
1843
1843
|
deleteFile: labels.delete
|
|
1844
1844
|
}
|
|
@@ -1860,9 +1860,9 @@ var ImageField = ({
|
|
|
1860
1860
|
};
|
|
1861
1861
|
var BlockNavigation = ({
|
|
1862
1862
|
locale,
|
|
1863
|
-
messages
|
|
1863
|
+
messages
|
|
1864
1864
|
}) => {
|
|
1865
|
-
const labels = useFormMessages(locale,
|
|
1865
|
+
const labels = useFormMessages(locale, messages);
|
|
1866
1866
|
const form = useFormContext();
|
|
1867
1867
|
const shouldBlock = useStore(form.store, (formState) => formState.isDirty && !(formState.isSubmitting || formState.isSubmitted));
|
|
1868
1868
|
return /* @__PURE__ */ jsx13(Block, {
|
|
@@ -1903,9 +1903,9 @@ var BlockNavigation = ({
|
|
|
1903
1903
|
var SubmitButton = ({
|
|
1904
1904
|
children,
|
|
1905
1905
|
locale,
|
|
1906
|
-
messages
|
|
1906
|
+
messages
|
|
1907
1907
|
}) => {
|
|
1908
|
-
const labels = useFormMessages(locale,
|
|
1908
|
+
const labels = useFormMessages(locale, messages);
|
|
1909
1909
|
const form = useFormContext();
|
|
1910
1910
|
return /* @__PURE__ */ jsx13(form.Subscribe, {
|
|
1911
1911
|
selector: (formState) => [formState.isSubmitting],
|
|
@@ -1973,10 +1973,10 @@ var FieldWrapper = ({
|
|
|
1973
1973
|
};
|
|
1974
1974
|
var RevertButton = ({
|
|
1975
1975
|
locale,
|
|
1976
|
-
messages
|
|
1976
|
+
messages,
|
|
1977
1977
|
original
|
|
1978
1978
|
}) => {
|
|
1979
|
-
const labels = useFormMessages(locale,
|
|
1979
|
+
const labels = useFormMessages(locale, messages);
|
|
1980
1980
|
const field = useFieldContext();
|
|
1981
1981
|
if (field.state.value !== original) {
|
|
1982
1982
|
return /* @__PURE__ */ jsx13("div", {
|
|
@@ -488,10 +488,10 @@ var labels = {
|
|
|
488
488
|
select: "Sélectionner une icône"
|
|
489
489
|
}
|
|
490
490
|
};
|
|
491
|
-
var iconInputLabels = (locale,
|
|
491
|
+
var iconInputLabels = (locale, messages) => ({
|
|
492
492
|
...locale.startsWith("fr") ? labels.fr : labels.en,
|
|
493
|
-
...
|
|
494
|
-
...
|
|
493
|
+
...messages?.[locale.split("-")[0] ?? locale],
|
|
494
|
+
...messages?.[locale]
|
|
495
495
|
});
|
|
496
496
|
var iconifyCollectionUrl = (collection) => `https://icon-sets.iconify.design/${encodeURIComponent(collection)}/`;
|
|
497
497
|
function IconInput({
|
|
@@ -499,7 +499,7 @@ function IconInput({
|
|
|
499
499
|
disabled,
|
|
500
500
|
id,
|
|
501
501
|
locale: localeOverride,
|
|
502
|
-
messages
|
|
502
|
+
messages,
|
|
503
503
|
onValueChange,
|
|
504
504
|
value
|
|
505
505
|
}) {
|
|
@@ -509,7 +509,7 @@ function IconInput({
|
|
|
509
509
|
const deferredQuery = useDeferredValue(query);
|
|
510
510
|
const iconSearchResult = useIconSearchAtom(collection, deferredQuery);
|
|
511
511
|
const icons = AsyncResult.isSuccess(iconSearchResult) ? iconSearchResult.value : [];
|
|
512
|
-
const copy = iconInputLabels(locale,
|
|
512
|
+
const copy = iconInputLabels(locale, messages);
|
|
513
513
|
const isWaiting = deferredQuery.trim() !== "" && AsyncResult.isWaiting(iconSearchResult);
|
|
514
514
|
const items = icons.map((icon) => ({ label: icon, value: icon }));
|
|
515
515
|
const selectedItem = value ? { label: value, value } : null;
|
|
@@ -166,12 +166,12 @@ var localeMessages = (locale, translations) => {
|
|
|
166
166
|
var LocaleSwitcher = ({
|
|
167
167
|
locale: localeOverride,
|
|
168
168
|
locales: localeOverrides,
|
|
169
|
-
messages
|
|
169
|
+
messages,
|
|
170
170
|
onLocaleChange
|
|
171
171
|
}) => {
|
|
172
172
|
const locale = useKrakstackLocale(localeOverride);
|
|
173
173
|
const localeOptions = useKrakstackLocales(localeOverrides);
|
|
174
|
-
const labels = localeMessages(locale,
|
|
174
|
+
const labels = localeMessages(locale, messages);
|
|
175
175
|
const LocaleSchema = Schema.String.check(Schema.makeFilter((value) => localeOptions.includes(value))).annotate({ identifier: "Locale" });
|
|
176
176
|
return /* @__PURE__ */ jsxs2(DropdownMenu, {
|
|
177
177
|
children: [
|
|
@@ -284,7 +284,7 @@ function SearchMenu({
|
|
|
284
284
|
placeholder,
|
|
285
285
|
inputPlaceholder,
|
|
286
286
|
emptyMessage,
|
|
287
|
-
messages
|
|
287
|
+
messages,
|
|
288
288
|
shortcutLabel = "⌘K",
|
|
289
289
|
className,
|
|
290
290
|
open,
|
|
@@ -295,7 +295,7 @@ function SearchMenu({
|
|
|
295
295
|
shouldFilter
|
|
296
296
|
}) {
|
|
297
297
|
const locale = useKrakstackLocale(localeOverride);
|
|
298
|
-
const labels = searchMenuMessages(locale,
|
|
298
|
+
const labels = searchMenuMessages(locale, messages);
|
|
299
299
|
const resolvedTitle = title ?? labels.title;
|
|
300
300
|
const resolvedDescription = description ?? labels.description;
|
|
301
301
|
const resolvedPlaceholder = placeholder ?? labels.placeholder;
|
|
@@ -292,7 +292,7 @@ function SidebarProvider({
|
|
|
292
292
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
293
293
|
}, [setOpenProp]);
|
|
294
294
|
const toggleSidebar = React2.useCallback(() => {
|
|
295
|
-
return isMobile ? setOpenMobile((
|
|
295
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen(!open);
|
|
296
296
|
}, [isMobile, open, setOpen, setOpenMobile]);
|
|
297
297
|
React2.useEffect(() => {
|
|
298
298
|
const handleKeyDown = (event) => {
|
|
@@ -243,7 +243,7 @@ var ThemeProvider = ({
|
|
|
243
243
|
const value = useMemo(() => ({
|
|
244
244
|
systemTheme,
|
|
245
245
|
theme,
|
|
246
|
-
setTheme: (
|
|
246
|
+
setTheme: (theme) => updateTheme({ theme, systemTheme })
|
|
247
247
|
}), [systemTheme, theme, updateTheme]);
|
|
248
248
|
return /* @__PURE__ */ jsxs2(Fragment, {
|
|
249
249
|
children: [
|
|
@@ -265,13 +265,13 @@ var useTheme = () => {
|
|
|
265
265
|
};
|
|
266
266
|
var ThemeSwitcher = ({
|
|
267
267
|
locale: localeOverride,
|
|
268
|
-
messages
|
|
268
|
+
messages,
|
|
269
269
|
options = themes,
|
|
270
270
|
value,
|
|
271
271
|
onChange
|
|
272
272
|
}) => {
|
|
273
273
|
const locale = useKrakstackLocale(localeOverride);
|
|
274
|
-
const labels = themeMessages(locale,
|
|
274
|
+
const labels = themeMessages(locale, messages);
|
|
275
275
|
return /* @__PURE__ */ jsxs2(DropdownMenu, {
|
|
276
276
|
children: [
|
|
277
277
|
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
package/dist/lib/docs.js
CHANGED
|
@@ -65,38 +65,38 @@ function AppBrand(brandProps) {
|
|
|
65
65
|
].filter(Boolean).join(" ");
|
|
66
66
|
if (isStaticBrand(brandProps)) {
|
|
67
67
|
const {
|
|
68
|
-
className:
|
|
69
|
-
label:
|
|
70
|
-
subtitle:
|
|
71
|
-
icon:
|
|
72
|
-
imageSrc:
|
|
73
|
-
variant:
|
|
68
|
+
className: _className,
|
|
69
|
+
label: _label,
|
|
70
|
+
subtitle: _subtitle,
|
|
71
|
+
icon: _icon,
|
|
72
|
+
imageSrc: _imageSrc,
|
|
73
|
+
variant: _variant,
|
|
74
74
|
to: _to,
|
|
75
|
-
href:
|
|
76
|
-
...
|
|
75
|
+
href: _href,
|
|
76
|
+
...props
|
|
77
77
|
} = brandProps;
|
|
78
78
|
return /* @__PURE__ */ jsx("div", {
|
|
79
79
|
className: brandClassName,
|
|
80
|
-
...
|
|
80
|
+
...props,
|
|
81
81
|
children: content
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
if (isAnchorBrand(brandProps)) {
|
|
85
85
|
const {
|
|
86
|
-
className:
|
|
87
|
-
label:
|
|
88
|
-
subtitle:
|
|
89
|
-
icon:
|
|
90
|
-
imageSrc:
|
|
91
|
-
variant:
|
|
86
|
+
className: _className,
|
|
87
|
+
label: _label,
|
|
88
|
+
subtitle: _subtitle,
|
|
89
|
+
icon: _icon,
|
|
90
|
+
imageSrc: _imageSrc,
|
|
91
|
+
variant: _variant,
|
|
92
92
|
to: _to,
|
|
93
93
|
href,
|
|
94
|
-
...
|
|
94
|
+
...props
|
|
95
95
|
} = brandProps;
|
|
96
96
|
return /* @__PURE__ */ jsx("a", {
|
|
97
97
|
className: brandClassName,
|
|
98
98
|
href,
|
|
99
|
-
...
|
|
99
|
+
...props,
|
|
100
100
|
children: content
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -224,7 +224,7 @@ function CopyButton({
|
|
|
224
224
|
valueDescription,
|
|
225
225
|
copyVariant = "default",
|
|
226
226
|
locale: localeOverride,
|
|
227
|
-
messages
|
|
227
|
+
messages,
|
|
228
228
|
onCopied,
|
|
229
229
|
onCopyError,
|
|
230
230
|
resetDelay = 1500,
|
|
@@ -236,7 +236,7 @@ function CopyButton({
|
|
|
236
236
|
const locale = useKrakstackLocale(localeOverride);
|
|
237
237
|
const [copyState, setCopyState] = useState("idle");
|
|
238
238
|
const copyTimeout = useRef(undefined);
|
|
239
|
-
const labels = copyButtonMessages(locale,
|
|
239
|
+
const labels = copyButtonMessages(locale, messages);
|
|
240
240
|
const accessibleLabel = ariaLabel ?? (valueDescription ? `${labels.copy} ${valueDescription}` : labels.copy);
|
|
241
241
|
const isLarge = copyVariant === "large";
|
|
242
242
|
const defaultSize = copyVariant === "sm" ? "icon-xs" : isLarge ? "sm" : "icon-sm";
|
|
@@ -338,12 +338,12 @@ function CodeBlock({
|
|
|
338
338
|
code,
|
|
339
339
|
language = "text",
|
|
340
340
|
locale: localeOverride,
|
|
341
|
-
messages
|
|
341
|
+
messages
|
|
342
342
|
}) {
|
|
343
343
|
const locale = useKrakstackLocale2(localeOverride);
|
|
344
344
|
const normalizedLanguage = language.toLowerCase() || "text";
|
|
345
345
|
const highlighted = highlight(code, { lang: normalizedLanguage });
|
|
346
|
-
const labels = codeBlockMessages(locale,
|
|
346
|
+
const labels = codeBlockMessages(locale, messages);
|
|
347
347
|
return /* @__PURE__ */ jsxs3("div", {
|
|
348
348
|
className: "not-prose bg-muted overflow-hidden rounded-md border text-[var(--th-token)]",
|
|
349
349
|
"data-code-theme": true,
|
|
@@ -382,7 +382,7 @@ var MarkdownContent = ({
|
|
|
382
382
|
codeBlocks,
|
|
383
383
|
html,
|
|
384
384
|
locale,
|
|
385
|
-
messages
|
|
385
|
+
messages
|
|
386
386
|
}) => {
|
|
387
387
|
const content = [];
|
|
388
388
|
let remainingHtml = html;
|
|
@@ -401,7 +401,7 @@ var MarkdownContent = ({
|
|
|
401
401
|
code: block.code,
|
|
402
402
|
language: block.language,
|
|
403
403
|
locale,
|
|
404
|
-
messages
|
|
404
|
+
messages
|
|
405
405
|
})
|
|
406
406
|
}, `code-${index}`));
|
|
407
407
|
remainingHtml = remainingHtml.slice(markerIndex + marker.length);
|
|
@@ -675,7 +675,7 @@ function SearchMenu({
|
|
|
675
675
|
placeholder,
|
|
676
676
|
inputPlaceholder,
|
|
677
677
|
emptyMessage,
|
|
678
|
-
messages
|
|
678
|
+
messages,
|
|
679
679
|
shortcutLabel = "⌘K",
|
|
680
680
|
className,
|
|
681
681
|
open,
|
|
@@ -686,7 +686,7 @@ function SearchMenu({
|
|
|
686
686
|
shouldFilter
|
|
687
687
|
}) {
|
|
688
688
|
const locale = useKrakstackLocale3(localeOverride);
|
|
689
|
-
const labels = searchMenuMessages(locale,
|
|
689
|
+
const labels = searchMenuMessages(locale, messages);
|
|
690
690
|
const resolvedTitle = title ?? labels.title;
|
|
691
691
|
const resolvedDescription = description ?? labels.description;
|
|
692
692
|
const resolvedPlaceholder = placeholder ?? labels.placeholder;
|
|
@@ -1006,7 +1006,7 @@ function SidebarProvider({
|
|
|
1006
1006
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
1007
1007
|
}, [setOpenProp]);
|
|
1008
1008
|
const toggleSidebar = React2.useCallback(() => {
|
|
1009
|
-
return isMobile ? setOpenMobile((
|
|
1009
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen(!open);
|
|
1010
1010
|
}, [isMobile, open, setOpen, setOpenMobile]);
|
|
1011
1011
|
React2.useEffect(() => {
|
|
1012
1012
|
const handleKeyDown = (event) => {
|
|
@@ -1610,34 +1610,6 @@ var ExternalLink = makeIcon("ExternalLink", /* @__PURE__ */ jsxs11(Fragment3, {
|
|
|
1610
1610
|
})
|
|
1611
1611
|
]
|
|
1612
1612
|
}));
|
|
1613
|
-
var Hash = makeIcon("Hash", /* @__PURE__ */ jsxs11(Fragment3, {
|
|
1614
|
-
children: [
|
|
1615
|
-
/* @__PURE__ */ jsx14("line", {
|
|
1616
|
-
x1: "4",
|
|
1617
|
-
x2: "20",
|
|
1618
|
-
y1: "9",
|
|
1619
|
-
y2: "9"
|
|
1620
|
-
}),
|
|
1621
|
-
/* @__PURE__ */ jsx14("line", {
|
|
1622
|
-
x1: "4",
|
|
1623
|
-
x2: "20",
|
|
1624
|
-
y1: "15",
|
|
1625
|
-
y2: "15"
|
|
1626
|
-
}),
|
|
1627
|
-
/* @__PURE__ */ jsx14("line", {
|
|
1628
|
-
x1: "10",
|
|
1629
|
-
x2: "8",
|
|
1630
|
-
y1: "3",
|
|
1631
|
-
y2: "21"
|
|
1632
|
-
}),
|
|
1633
|
-
/* @__PURE__ */ jsx14("line", {
|
|
1634
|
-
x1: "16",
|
|
1635
|
-
x2: "14",
|
|
1636
|
-
y1: "3",
|
|
1637
|
-
y2: "21"
|
|
1638
|
-
})
|
|
1639
|
-
]
|
|
1640
|
-
}));
|
|
1641
1613
|
var DocsSection = Schema3.String.annotate({
|
|
1642
1614
|
identifier: "DocsSection"
|
|
1643
1615
|
});
|
|
@@ -1801,23 +1773,14 @@ var makeDocs = (config) => {
|
|
|
1801
1773
|
const getMessages = (locale) => getDocsMessages(locale, config.messages?.(locale));
|
|
1802
1774
|
const navigate = config.navigate ?? ((href) => window.location.assign(href));
|
|
1803
1775
|
const normalizeSearchText = (value) => value.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
1804
|
-
const searchIndex = source.pages.
|
|
1776
|
+
const searchIndex = source.pages.map((page) => {
|
|
1805
1777
|
const description = normalizeSearchText(`${page.description} ${(page.tags ?? []).join(" ")}`);
|
|
1806
|
-
return
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
},
|
|
1813
|
-
...page.headings.map((heading) => ({
|
|
1814
|
-
page,
|
|
1815
|
-
heading,
|
|
1816
|
-
title: normalizeSearchText(heading.title),
|
|
1817
|
-
description: `${normalizeSearchText(page.title)} ${description}`,
|
|
1818
|
-
content: ""
|
|
1819
|
-
}))
|
|
1820
|
-
];
|
|
1778
|
+
return {
|
|
1779
|
+
page,
|
|
1780
|
+
title: normalizeSearchText(page.title),
|
|
1781
|
+
description,
|
|
1782
|
+
content: normalizeSearchText(page.searchText)
|
|
1783
|
+
};
|
|
1821
1784
|
});
|
|
1822
1785
|
for (const page of source.pages) {
|
|
1823
1786
|
const expectedPath = page.slug === config.defaultSlug ? basePath : `${basePath}/${page.slug}`;
|
|
@@ -1858,7 +1821,7 @@ var makeDocs = (config) => {
|
|
|
1858
1821
|
const limit = options?.limit ?? 20;
|
|
1859
1822
|
const localized = searchIndex.filter((entry) => entry.page.locale === locale);
|
|
1860
1823
|
if (!normalizedQuery) {
|
|
1861
|
-
return localized.
|
|
1824
|
+
return localized.slice(0, limit).map(({ page }) => ({ page }));
|
|
1862
1825
|
}
|
|
1863
1826
|
const terms = normalizedQuery.split(/\s+/);
|
|
1864
1827
|
return localized.flatMap((entry) => {
|
|
@@ -1880,12 +1843,7 @@ var makeDocs = (config) => {
|
|
|
1880
1843
|
if (entry.title.includes(normalizedQuery))
|
|
1881
1844
|
score += 20;
|
|
1882
1845
|
return [{ entry, score }];
|
|
1883
|
-
}).sort((left, right) => right.score - left.score || left.entry.page.order - right.entry.page.order).slice(0, limit).map(({ entry }) => {
|
|
1884
|
-
const result = { page: entry.page };
|
|
1885
|
-
if ("heading" in entry)
|
|
1886
|
-
result.heading = entry.heading;
|
|
1887
|
-
return result;
|
|
1888
|
-
});
|
|
1846
|
+
}).sort((left, right) => right.score - left.score || left.entry.page.order - right.entry.page.order).slice(0, limit).map(({ entry }) => ({ page: entry.page }));
|
|
1889
1847
|
};
|
|
1890
1848
|
const url = (page, locale) => `${origin}/${locale}${page.path}`;
|
|
1891
1849
|
const editUrl = (page) => githubUrl && (config.editable?.(page) ?? true) ? `${githubUrl}/edit/${config.github?.branch ?? "main"}/${page.sourceFile}` : undefined;
|
|
@@ -1978,7 +1936,7 @@ var messages4 = {
|
|
|
1978
1936
|
downloadTable: "Download table",
|
|
1979
1937
|
onThisPage: "On this page",
|
|
1980
1938
|
searchTitle: "Search documentation",
|
|
1981
|
-
searchDescription: "Search documentation pages
|
|
1939
|
+
searchDescription: "Search documentation pages.",
|
|
1982
1940
|
searchPlaceholder: "Search documentation...",
|
|
1983
1941
|
searchInputPlaceholder: "Search documentation...",
|
|
1984
1942
|
searchEmpty: "No documentation found.",
|
|
@@ -2008,7 +1966,7 @@ var messages4 = {
|
|
|
2008
1966
|
downloadTable: "Télécharger le tableau",
|
|
2009
1967
|
onThisPage: "Sur cette page",
|
|
2010
1968
|
searchTitle: "Rechercher dans la documentation",
|
|
2011
|
-
searchDescription: "Recherchez des pages
|
|
1969
|
+
searchDescription: "Recherchez des pages dans la documentation.",
|
|
2012
1970
|
searchPlaceholder: "Rechercher dans la documentation...",
|
|
2013
1971
|
searchInputPlaceholder: "Rechercher dans la documentation...",
|
|
2014
1972
|
searchEmpty: "Aucune documentation trouvée.",
|
|
@@ -2034,7 +1992,7 @@ var getDocsMessages = (locale, overrides) => ({
|
|
|
2034
1992
|
var iconFor = (icons, name) => name ? icons[name] : undefined;
|
|
2035
1993
|
var DocsArticle = ({
|
|
2036
1994
|
locale,
|
|
2037
|
-
messages
|
|
1995
|
+
messages,
|
|
2038
1996
|
page
|
|
2039
1997
|
}) => {
|
|
2040
1998
|
return /* @__PURE__ */ jsx14(MarkdownContent, {
|
|
@@ -2043,10 +2001,10 @@ var DocsArticle = ({
|
|
|
2043
2001
|
locale,
|
|
2044
2002
|
messages: {
|
|
2045
2003
|
[locale]: {
|
|
2046
|
-
codeDescription:
|
|
2047
|
-
copy:
|
|
2048
|
-
copied:
|
|
2049
|
-
copyFailed:
|
|
2004
|
+
codeDescription: messages.copyCodeDescription,
|
|
2005
|
+
copy: messages.copyCode,
|
|
2006
|
+
copied: messages.copied,
|
|
2007
|
+
copyFailed: messages.copyFailed
|
|
2050
2008
|
}
|
|
2051
2009
|
}
|
|
2052
2010
|
});
|
|
@@ -2162,7 +2120,7 @@ var DocsMobileTableOfContents = ({
|
|
|
2162
2120
|
var DocsSearch = ({
|
|
2163
2121
|
docs,
|
|
2164
2122
|
locale,
|
|
2165
|
-
messages
|
|
2123
|
+
messages
|
|
2166
2124
|
}) => {
|
|
2167
2125
|
const [query, setQuery] = useState6("");
|
|
2168
2126
|
const deferredQuery = useDeferredValue(query);
|
|
@@ -2172,28 +2130,11 @@ var DocsSearch = ({
|
|
|
2172
2130
|
const groups = sections.map((section) => {
|
|
2173
2131
|
const sectionResults = results.filter(({ page }) => page.section === section);
|
|
2174
2132
|
if (!isSearching) {
|
|
2175
|
-
sectionResults.sort((left, right) =>
|
|
2176
|
-
const pageOrder = left.page.order - right.page.order;
|
|
2177
|
-
if (pageOrder !== 0)
|
|
2178
|
-
return pageOrder;
|
|
2179
|
-
if (!left.heading)
|
|
2180
|
-
return -1;
|
|
2181
|
-
if (!right.heading)
|
|
2182
|
-
return 1;
|
|
2183
|
-
return left.page.headings.findIndex(({ id }) => id === left.heading?.id) - right.page.headings.findIndex(({ id }) => id === right.heading?.id);
|
|
2184
|
-
});
|
|
2133
|
+
sectionResults.sort((left, right) => left.page.order - right.page.order);
|
|
2185
2134
|
}
|
|
2186
2135
|
return {
|
|
2187
|
-
heading:
|
|
2188
|
-
items: sectionResults.map(({ page
|
|
2189
|
-
id: `${page.path}#${heading.id}`,
|
|
2190
|
-
label: heading.title,
|
|
2191
|
-
description: page.title,
|
|
2192
|
-
icon: /* @__PURE__ */ jsx14(Hash, {
|
|
2193
|
-
className: "size-4"
|
|
2194
|
-
}),
|
|
2195
|
-
onSelect: () => docs.navigate(`${page.path}#${heading.id}`)
|
|
2196
|
-
} : (() => {
|
|
2136
|
+
heading: messages.sectionLabel(section),
|
|
2137
|
+
items: sectionResults.map(({ page }) => {
|
|
2197
2138
|
const item = {
|
|
2198
2139
|
id: page.path,
|
|
2199
2140
|
label: page.title,
|
|
@@ -2208,7 +2149,7 @@ var DocsSearch = ({
|
|
|
2208
2149
|
});
|
|
2209
2150
|
}
|
|
2210
2151
|
return item;
|
|
2211
|
-
})
|
|
2152
|
+
})
|
|
2212
2153
|
};
|
|
2213
2154
|
});
|
|
2214
2155
|
return /* @__PURE__ */ jsx14(SearchMenu, {
|
|
@@ -2216,11 +2157,11 @@ var DocsSearch = ({
|
|
|
2216
2157
|
locale,
|
|
2217
2158
|
messages: {
|
|
2218
2159
|
[locale]: {
|
|
2219
|
-
title:
|
|
2220
|
-
description:
|
|
2221
|
-
placeholder:
|
|
2222
|
-
inputPlaceholder:
|
|
2223
|
-
emptyMessage:
|
|
2160
|
+
title: messages.searchTitle,
|
|
2161
|
+
description: messages.searchDescription,
|
|
2162
|
+
placeholder: messages.searchPlaceholder,
|
|
2163
|
+
inputPlaceholder: messages.searchInputPlaceholder,
|
|
2164
|
+
emptyMessage: messages.searchEmpty
|
|
2224
2165
|
}
|
|
2225
2166
|
},
|
|
2226
2167
|
query,
|
package/dist/lib/docs.server.js
CHANGED
|
@@ -247,34 +247,6 @@ var ExternalLink = makeIcon("ExternalLink", /* @__PURE__ */ jsxs(Fragment, {
|
|
|
247
247
|
})
|
|
248
248
|
]
|
|
249
249
|
}));
|
|
250
|
-
var Hash = makeIcon("Hash", /* @__PURE__ */ jsxs(Fragment, {
|
|
251
|
-
children: [
|
|
252
|
-
/* @__PURE__ */ jsx("line", {
|
|
253
|
-
x1: "4",
|
|
254
|
-
x2: "20",
|
|
255
|
-
y1: "9",
|
|
256
|
-
y2: "9"
|
|
257
|
-
}),
|
|
258
|
-
/* @__PURE__ */ jsx("line", {
|
|
259
|
-
x1: "4",
|
|
260
|
-
x2: "20",
|
|
261
|
-
y1: "15",
|
|
262
|
-
y2: "15"
|
|
263
|
-
}),
|
|
264
|
-
/* @__PURE__ */ jsx("line", {
|
|
265
|
-
x1: "10",
|
|
266
|
-
x2: "8",
|
|
267
|
-
y1: "3",
|
|
268
|
-
y2: "21"
|
|
269
|
-
}),
|
|
270
|
-
/* @__PURE__ */ jsx("line", {
|
|
271
|
-
x1: "16",
|
|
272
|
-
x2: "14",
|
|
273
|
-
y1: "3",
|
|
274
|
-
y2: "21"
|
|
275
|
-
})
|
|
276
|
-
]
|
|
277
|
-
}));
|
|
278
250
|
var DocsSection = Schema3.String.annotate({
|
|
279
251
|
identifier: "DocsSection"
|
|
280
252
|
});
|
|
@@ -247,34 +247,6 @@ var ExternalLink = makeIcon("ExternalLink", /* @__PURE__ */ jsxs(Fragment, {
|
|
|
247
247
|
})
|
|
248
248
|
]
|
|
249
249
|
}));
|
|
250
|
-
var Hash = makeIcon("Hash", /* @__PURE__ */ jsxs(Fragment, {
|
|
251
|
-
children: [
|
|
252
|
-
/* @__PURE__ */ jsx("line", {
|
|
253
|
-
x1: "4",
|
|
254
|
-
x2: "20",
|
|
255
|
-
y1: "9",
|
|
256
|
-
y2: "9"
|
|
257
|
-
}),
|
|
258
|
-
/* @__PURE__ */ jsx("line", {
|
|
259
|
-
x1: "4",
|
|
260
|
-
x2: "20",
|
|
261
|
-
y1: "15",
|
|
262
|
-
y2: "15"
|
|
263
|
-
}),
|
|
264
|
-
/* @__PURE__ */ jsx("line", {
|
|
265
|
-
x1: "10",
|
|
266
|
-
x2: "8",
|
|
267
|
-
y1: "3",
|
|
268
|
-
y2: "21"
|
|
269
|
-
}),
|
|
270
|
-
/* @__PURE__ */ jsx("line", {
|
|
271
|
-
x1: "16",
|
|
272
|
-
x2: "14",
|
|
273
|
-
y1: "3",
|
|
274
|
-
y2: "21"
|
|
275
|
-
})
|
|
276
|
-
]
|
|
277
|
-
}));
|
|
278
250
|
var DocsSection = Schema3.String.annotate({
|
|
279
251
|
identifier: "DocsSection"
|
|
280
252
|
});
|