initial vitepress site with basic nav

This commit is contained in:
mrflos 2023-05-20 19:37:42 +03:00
parent a7df2e049d
commit 2029f16583
1900 changed files with 1014692 additions and 0 deletions

View file

@ -0,0 +1 @@
export declare function groupBy<TValue extends Record<string, unknown>>(values: TValue[], predicate: (value: TValue) => string): Record<string, TValue[]>;

View file

@ -0,0 +1,17 @@
export function groupBy(values, predicate) {
return values.reduce(function (acc, item) {
var key = predicate(item);
if (!acc.hasOwnProperty(key)) {
acc[key] = [];
} // We limit each section to show 5 hits maximum.
// This acts as a frontend alternative to `distinct`.
if (acc[key].length < 5) {
acc[key].push(item);
}
return acc;
}, {});
}

View file

@ -0,0 +1 @@
export declare function identity<TParam>(x: TParam): TParam;

View file

@ -0,0 +1,3 @@
export function identity(x) {
return x;
}

View file

@ -0,0 +1,5 @@
export * from './groupBy';
export * from './identity';
export * from './isModifierEvent';
export * from './noop';
export * from './removeHighlightTags';

View file

@ -0,0 +1,5 @@
export * from './groupBy';
export * from './identity';
export * from './isModifierEvent';
export * from './noop';
export * from './removeHighlightTags';

View file

@ -0,0 +1,5 @@
/**
* Detect when an event is modified with a special key to let the browser
* trigger its default behavior.
*/
export declare function isModifierEvent<TEvent extends KeyboardEvent | MouseEvent>(event: TEvent): boolean;

View file

@ -0,0 +1,8 @@
/**
* Detect when an event is modified with a special key to let the browser
* trigger its default behavior.
*/
export function isModifierEvent(event) {
var isMiddleClick = event.button === 1;
return isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
}

View file

@ -0,0 +1 @@
export declare function noop(..._args: any[]): void;

1
node_modules/@docsearch/react/dist/esm/utils/noop.js generated vendored Normal file
View file

@ -0,0 +1 @@
export function noop() {}

View file

@ -0,0 +1,2 @@
import type { DocSearchHit, InternalDocSearchHit } from '../types';
export declare function removeHighlightTags(hit: DocSearchHit | InternalDocSearchHit): string;

View file

@ -0,0 +1,16 @@
var regexHighlightTags = /(<mark>|<\/mark>)/g;
var regexHasHighlightTags = RegExp(regexHighlightTags.source);
export function removeHighlightTags(hit) {
var _internalDocSearchHit, _internalDocSearchHit2, _internalDocSearchHit3, _hit$_highlightResult, _hit$_highlightResult2;
var internalDocSearchHit = hit;
if (!internalDocSearchHit.__docsearch_parent && !hit._highlightResult) {
return hit.hierarchy.lvl0;
}
var _ref = (internalDocSearchHit.__docsearch_parent ? (_internalDocSearchHit = internalDocSearchHit.__docsearch_parent) === null || _internalDocSearchHit === void 0 ? void 0 : (_internalDocSearchHit2 = _internalDocSearchHit._highlightResult) === null || _internalDocSearchHit2 === void 0 ? void 0 : (_internalDocSearchHit3 = _internalDocSearchHit2.hierarchy) === null || _internalDocSearchHit3 === void 0 ? void 0 : _internalDocSearchHit3.lvl0 : (_hit$_highlightResult = hit._highlightResult) === null || _hit$_highlightResult === void 0 ? void 0 : (_hit$_highlightResult2 = _hit$_highlightResult.hierarchy) === null || _hit$_highlightResult2 === void 0 ? void 0 : _hit$_highlightResult2.lvl0) || {},
value = _ref.value;
return value && regexHasHighlightTags.test(value) ? value.replace(regexHighlightTags, '') : value;
}