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 type MaybePromise<TResolution> = Promise<TResolution> | TResolution;

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,4 @@
export declare type UserAgent = {
segment: string;
version?: string;
};

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,3 @@
export declare function createRef<TValue>(initialValue: TValue): {
current: TValue;
};

View file

@ -0,0 +1,5 @@
export function createRef(initialValue) {
return {
current: initialValue
};
}

View file

@ -0,0 +1 @@
export declare function debounce<TParams>(fn: (...params: TParams[]) => void, time: number): (...args: TParams[]) => void;

View file

@ -0,0 +1,16 @@
export function debounce(fn, time) {
var timerId = undefined;
return function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (timerId) {
clearTimeout(timerId);
}
timerId = setTimeout(function () {
return fn.apply(void 0, args);
}, time);
};
}

View file

@ -0,0 +1,5 @@
/**
* Decycles objects with circular references.
* This is used to print cyclic structures in development environment only.
*/
export declare function decycle(obj: any, seen?: Set<unknown>): any;

View file

@ -0,0 +1,45 @@
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
/**
* Decycles objects with circular references.
* This is used to print cyclic structures in development environment only.
*/
export function decycle(obj) {
var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();
if (!(process.env.NODE_ENV !== 'production') || !obj || _typeof(obj) !== 'object') {
return obj;
}
if (seen.has(obj)) {
return '[Circular]';
}
var newSeen = seen.add(obj);
if (Array.isArray(obj)) {
return obj.map(function (x) {
return decycle(x, newSeen);
});
}
return Object.fromEntries(Object.entries(obj).map(function (_ref) {
var _ref2 = _slicedToArray(_ref, 2),
key = _ref2[0],
value = _ref2[1];
return [key, decycle(value, newSeen)];
}));
}

View file

@ -0,0 +1 @@
export declare function flatten<TType>(values: Array<TType | TType[]>): TType[];

View file

@ -0,0 +1,5 @@
export function flatten(values) {
return values.reduce(function (a, b) {
return a.concat(b);
}, []);
}

View file

@ -0,0 +1 @@
export declare function generateAutocompleteId(): string;

View file

@ -0,0 +1,4 @@
var autocompleteId = 0;
export function generateAutocompleteId() {
return "autocomplete-".concat(autocompleteId++);
}

View file

@ -0,0 +1 @@
export declare function getAttributeValueByPath<TRecord>(record: TRecord, path: string[]): any;

View file

@ -0,0 +1,5 @@
export function getAttributeValueByPath(record, path) {
return path.reduce(function (current, key) {
return current && current[key];
}, record);
}

View file

@ -0,0 +1,3 @@
export declare function getItemsCount<TAutocompleteState extends {
collections: any[];
}>(state: TAutocompleteState): number;

View file

@ -0,0 +1,9 @@
export function getItemsCount(state) {
if (state.collections.length === 0) {
return 0;
}
return state.collections.reduce(function (sum, collection) {
return sum + collection.items.length;
}, 0);
}

View file

@ -0,0 +1,15 @@
export * from './createRef';
export * from './debounce';
export * from './decycle';
export * from './flatten';
export * from './generateAutocompleteId';
export * from './getAttributeValueByPath';
export * from './getItemsCount';
export * from './invariant';
export * from './isEqual';
export * from './MaybePromise';
export * from './noop';
export * from './UserAgent';
export * from './userAgents';
export * from './version';
export * from './warn';

View file

@ -0,0 +1,15 @@
export * from './createRef';
export * from './debounce';
export * from './decycle';
export * from './flatten';
export * from './generateAutocompleteId';
export * from './getAttributeValueByPath';
export * from './getItemsCount';
export * from './invariant';
export * from './isEqual';
export * from './MaybePromise';
export * from './noop';
export * from './UserAgent';
export * from './userAgents';
export * from './version';
export * from './warn';

View file

@ -0,0 +1,6 @@
/**
* Throws an error if the condition is not met in development mode.
* This is used to make development a better experience to provide guidance as
* to where the error comes from.
*/
export declare function invariant(condition: boolean, message: string | (() => string)): void;

View file

@ -0,0 +1,14 @@
/**
* Throws an error if the condition is not met in development mode.
* This is used to make development a better experience to provide guidance as
* to where the error comes from.
*/
export function invariant(condition, message) {
if (!(process.env.NODE_ENV !== 'production')) {
return;
}
if (!condition) {
throw new Error("[Autocomplete] ".concat(typeof message === 'function' ? message() : message));
}
}

View file

@ -0,0 +1 @@
export declare function isEqual(first: any, second: any): boolean;

View file

@ -0,0 +1,31 @@
function isPrimitive(obj) {
return obj !== Object(obj);
}
export function isEqual(first, second) {
if (first === second) {
return true;
}
if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') {
return first === second;
}
if (Object.keys(first).length !== Object.keys(second).length) {
return false;
}
for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {
var key = _Object$keys[_i];
if (!(key in second)) {
return false;
}
if (!isEqual(first[key], second[key])) {
return false;
}
}
return true;
}

View file

@ -0,0 +1 @@
export declare const noop: () => void;

View file

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

View file

@ -0,0 +1,4 @@
export declare const userAgents: {
segment: string;
version: string;
}[];

View file

@ -0,0 +1,5 @@
import { version } from './version';
export var userAgents = [{
segment: 'autocomplete-core',
version: version
}];

View file

@ -0,0 +1 @@
export declare const version = "1.8.2";

View file

@ -0,0 +1 @@
export var version = '1.8.2';

View file

@ -0,0 +1,8 @@
export declare const warnCache: {
current: {};
};
/**
* Logs a warning if the condition is not met.
* This is used to log issues in development environment only.
*/
export declare function warn(condition: boolean, message: string): void;

View file

@ -0,0 +1,26 @@
export var warnCache = {
current: {}
};
/**
* Logs a warning if the condition is not met.
* This is used to log issues in development environment only.
*/
export function warn(condition, message) {
if (!(process.env.NODE_ENV !== 'production')) {
return;
}
if (condition) {
return;
}
var sanitizedMessage = message.trim();
var hasAlreadyPrinted = warnCache.current[sanitizedMessage];
if (!hasAlreadyPrinted) {
warnCache.current[sanitizedMessage] = true; // eslint-disable-next-line no-console
console.warn("[Autocomplete] ".concat(sanitizedMessage));
}
}