initial vitepress site with basic nav
This commit is contained in:
parent
a7df2e049d
commit
2029f16583
1900 changed files with 1014692 additions and 0 deletions
15
node_modules/@algolia/autocomplete-preset-algolia/README.md
generated
vendored
Normal file
15
node_modules/@algolia/autocomplete-preset-algolia/README.md
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
# @algolia/autocomplete-preset-algolia
|
||||
|
||||
The Algolia preset provides fetching and highlighting utilities for usage with Algolia.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
yarn add @algolia/autocomplete-preset-algolia
|
||||
# or
|
||||
npm install @algolia/autocomplete-preset-algolia
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
See [**Documentation**](https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-preset-algolia).
|
2
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.d.ts
generated
vendored
Normal file
2
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
export declare const HIGHLIGHT_PRE_TAG = "__aa-highlight__";
|
||||
export declare const HIGHLIGHT_POST_TAG = "__/aa-highlight__";
|
2
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.js
generated
vendored
Normal file
2
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
export var HIGHLIGHT_PRE_TAG = '__aa-highlight__';
|
||||
export var HIGHLIGHT_POST_TAG = '__/aa-highlight__';
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { HighlightResult } from '../types';
|
||||
export declare type HighlightedHit<THit> = THit & {
|
||||
_highlightResult?: HighlightResult<THit>;
|
||||
};
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.js
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export {};
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
export declare type ParseAlgoliaHitParams<TItem> = {
|
||||
hit: TItem;
|
||||
attribute: keyof TItem | string[];
|
||||
};
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.js
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export {};
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
export declare type ParsedAttribute = {
|
||||
value: string;
|
||||
isHighlighted: boolean;
|
||||
};
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.js
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export {};
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { SnippetResult } from '../types';
|
||||
export declare type SnippetedHit<THit> = THit & {
|
||||
_snippetResult?: SnippetResult<THit>;
|
||||
};
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.js
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export {};
|
6
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.d.ts
generated
vendored
Normal file
6
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
export * from './HighlightedHit';
|
||||
export * from './parseAlgoliaHitHighlight';
|
||||
export * from './parseAlgoliaHitReverseHighlight';
|
||||
export * from './parseAlgoliaHitReverseSnippet';
|
||||
export * from './parseAlgoliaHitSnippet';
|
||||
export * from './SnippetedHit';
|
6
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.js
generated
vendored
Normal file
6
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
export * from './HighlightedHit';
|
||||
export * from './parseAlgoliaHitHighlight';
|
||||
export * from './parseAlgoliaHitReverseHighlight';
|
||||
export * from './parseAlgoliaHitReverseSnippet';
|
||||
export * from './parseAlgoliaHitSnippet';
|
||||
export * from './SnippetedHit';
|
2
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.d.ts
generated
vendored
Normal file
2
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
import { ParsedAttribute } from './ParsedAttribute';
|
||||
export declare function isPartHighlighted(parts: ParsedAttribute[], i: number): boolean;
|
30
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.js
generated
vendored
Normal file
30
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
var htmlEscapes = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
''': "'"
|
||||
};
|
||||
var hasAlphanumeric = new RegExp(/\w/i);
|
||||
var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;
|
||||
var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);
|
||||
|
||||
function unescape(value) {
|
||||
return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {
|
||||
return htmlEscapes[character];
|
||||
}) : value;
|
||||
}
|
||||
|
||||
export function isPartHighlighted(parts, i) {
|
||||
var _parts, _parts2;
|
||||
|
||||
var current = parts[i];
|
||||
var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true;
|
||||
var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true;
|
||||
|
||||
if (!hasAlphanumeric.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) {
|
||||
return isPreviousHighlighted;
|
||||
}
|
||||
|
||||
return current.isHighlighted;
|
||||
}
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { HighlightedHit } from './HighlightedHit';
|
||||
import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';
|
||||
import { ParsedAttribute } from './ParsedAttribute';
|
||||
export declare function parseAlgoliaHitHighlight<THit extends HighlightedHit<unknown>>({ hit, attribute, }: ParseAlgoliaHitParams<THit>): ParsedAttribute[];
|
29
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js
generated
vendored
Normal file
29
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread 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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
||||
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
||||
|
||||
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; }
|
||||
|
||||
import { getAttributeValueByPath, warn } from '@algolia/autocomplete-shared';
|
||||
import { parseAttribute } from './parseAttribute';
|
||||
export function parseAlgoliaHitHighlight(_ref) {
|
||||
var hit = _ref.hit,
|
||||
attribute = _ref.attribute;
|
||||
var path = Array.isArray(attribute) ? attribute : [attribute];
|
||||
var highlightedValue = getAttributeValueByPath(hit, ['_highlightResult'].concat(_toConsumableArray(path), ['value']));
|
||||
|
||||
if (typeof highlightedValue !== 'string') {
|
||||
process.env.NODE_ENV !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToHighlight`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/') : void 0;
|
||||
highlightedValue = getAttributeValueByPath(hit, path) || '';
|
||||
}
|
||||
|
||||
return parseAttribute({
|
||||
highlightedValue: highlightedValue
|
||||
});
|
||||
}
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { HighlightedHit } from './HighlightedHit';
|
||||
import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';
|
||||
import { ParsedAttribute } from './ParsedAttribute';
|
||||
export declare function parseAlgoliaHitReverseHighlight<THit extends HighlightedHit<unknown>>(props: ParseAlgoliaHitParams<THit>): ParsedAttribute[];
|
5
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.js
generated
vendored
Normal file
5
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { parseAlgoliaHitHighlight } from './parseAlgoliaHitHighlight';
|
||||
import { reverseHighlightedParts } from './reverseHighlightedParts';
|
||||
export function parseAlgoliaHitReverseHighlight(props) {
|
||||
return reverseHighlightedParts(parseAlgoliaHitHighlight(props));
|
||||
}
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';
|
||||
import { ParsedAttribute } from './ParsedAttribute';
|
||||
import { SnippetedHit } from './SnippetedHit';
|
||||
export declare function parseAlgoliaHitReverseSnippet<THit extends SnippetedHit<unknown>>(props: ParseAlgoliaHitParams<THit>): ParsedAttribute[];
|
5
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.js
generated
vendored
Normal file
5
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { parseAlgoliaHitSnippet } from './parseAlgoliaHitSnippet';
|
||||
import { reverseHighlightedParts } from './reverseHighlightedParts';
|
||||
export function parseAlgoliaHitReverseSnippet(props) {
|
||||
return reverseHighlightedParts(parseAlgoliaHitSnippet(props));
|
||||
}
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';
|
||||
import { ParsedAttribute } from './ParsedAttribute';
|
||||
import { SnippetedHit } from './SnippetedHit';
|
||||
export declare function parseAlgoliaHitSnippet<THit extends SnippetedHit<unknown>>({ hit, attribute, }: ParseAlgoliaHitParams<THit>): ParsedAttribute[];
|
29
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.js
generated
vendored
Normal file
29
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread 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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
||||
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
||||
|
||||
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; }
|
||||
|
||||
import { getAttributeValueByPath, warn } from '@algolia/autocomplete-shared';
|
||||
import { parseAttribute } from './parseAttribute';
|
||||
export function parseAlgoliaHitSnippet(_ref) {
|
||||
var hit = _ref.hit,
|
||||
attribute = _ref.attribute;
|
||||
var path = Array.isArray(attribute) ? attribute : [attribute];
|
||||
var highlightedValue = getAttributeValueByPath(hit, ['_snippetResult'].concat(_toConsumableArray(path), ['value']));
|
||||
|
||||
if (typeof highlightedValue !== 'string') {
|
||||
process.env.NODE_ENV !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToSnippet`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/') : void 0;
|
||||
highlightedValue = getAttributeValueByPath(hit, path) || '';
|
||||
}
|
||||
|
||||
return parseAttribute({
|
||||
highlightedValue: highlightedValue
|
||||
});
|
||||
}
|
6
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.d.ts
generated
vendored
Normal file
6
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { ParsedAttribute } from './ParsedAttribute';
|
||||
declare type ParseAttributeParams = {
|
||||
highlightedValue: string;
|
||||
};
|
||||
export declare function parseAttribute({ highlightedValue, }: ParseAttributeParams): ParsedAttribute[];
|
||||
export {};
|
52
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.js
generated
vendored
Normal file
52
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.js
generated
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
import { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants';
|
||||
|
||||
/**
|
||||
* Creates a data structure that allows to concatenate similar highlighting
|
||||
* parts in a single value.
|
||||
*/
|
||||
function createAttributeSet() {
|
||||
var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var value = initialValue;
|
||||
return {
|
||||
get: function get() {
|
||||
return value;
|
||||
},
|
||||
add: function add(part) {
|
||||
var lastPart = value[value.length - 1];
|
||||
|
||||
if ((lastPart === null || lastPart === void 0 ? void 0 : lastPart.isHighlighted) === part.isHighlighted) {
|
||||
value[value.length - 1] = {
|
||||
value: lastPart.value + part.value,
|
||||
isHighlighted: lastPart.isHighlighted
|
||||
};
|
||||
} else {
|
||||
value.push(part);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function parseAttribute(_ref) {
|
||||
var highlightedValue = _ref.highlightedValue;
|
||||
var preTagParts = highlightedValue.split(HIGHLIGHT_PRE_TAG);
|
||||
var firstValue = preTagParts.shift();
|
||||
var parts = createAttributeSet(firstValue ? [{
|
||||
value: firstValue,
|
||||
isHighlighted: false
|
||||
}] : []);
|
||||
preTagParts.forEach(function (part) {
|
||||
var postTagParts = part.split(HIGHLIGHT_POST_TAG);
|
||||
parts.add({
|
||||
value: postTagParts[0],
|
||||
isHighlighted: true
|
||||
});
|
||||
|
||||
if (postTagParts[1] !== '') {
|
||||
parts.add({
|
||||
value: postTagParts[1],
|
||||
isHighlighted: false
|
||||
});
|
||||
}
|
||||
});
|
||||
return parts.get();
|
||||
}
|
5
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.d.ts
generated
vendored
Normal file
5
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { ParsedAttribute } from './ParsedAttribute';
|
||||
export declare function reverseHighlightedParts(parts: ParsedAttribute[]): {
|
||||
isHighlighted: boolean;
|
||||
value: string;
|
||||
}[];
|
25
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.js
generated
vendored
Normal file
25
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.js
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
import { isPartHighlighted } from './isPartHighlighted';
|
||||
export function reverseHighlightedParts(parts) {
|
||||
// We don't want to highlight the whole word when no parts match.
|
||||
if (!parts.some(function (part) {
|
||||
return part.isHighlighted;
|
||||
})) {
|
||||
return parts.map(function (part) {
|
||||
return _objectSpread(_objectSpread({}, part), {}, {
|
||||
isHighlighted: false
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return parts.map(function (part, i) {
|
||||
return _objectSpread(_objectSpread({}, part), {}, {
|
||||
isHighlighted: !isPartHighlighted(parts, i)
|
||||
});
|
||||
});
|
||||
}
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
export * from './highlight';
|
||||
export * from './requester';
|
||||
export * from './search';
|
||||
export * from './types';
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.js
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
export * from './highlight';
|
||||
export * from './requester';
|
||||
export * from './search';
|
||||
export * from './types';
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.d.ts
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare const createAlgoliaRequester: (requesterParams: import("./createRequester").RequesterParams<any>) => <TTHit>(requestParams: import("./createRequester").RequestParams<TTHit>) => import("./createRequester").RequesterDescription<TTHit>;
|
3
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.js
generated
vendored
Normal file
3
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { fetchAlgoliaResults } from '../search';
|
||||
import { createRequester } from './createRequester';
|
||||
export var createAlgoliaRequester = createRequester(fetchAlgoliaResults, 'algolia');
|
74
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.d.ts
generated
vendored
Normal file
74
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
import { fetchAlgoliaResults } from '../search';
|
||||
import type { MultipleQueriesQuery, SearchForFacetValuesResponse, SearchResponse, SearchClient } from '../types';
|
||||
declare type Fetcher = typeof fetchAlgoliaResults;
|
||||
declare type FacetHit = {
|
||||
label: string;
|
||||
count: number;
|
||||
_highlightResult: {
|
||||
label: {
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
export declare type FetcherParams = Pick<Parameters<Fetcher>[0], 'searchClient' | 'queries'>;
|
||||
export declare type RequesterParams<THit> = {
|
||||
transformResponse(response: TransformResponseParams<THit>): TransformedRequesterResponse<THit>;
|
||||
};
|
||||
declare type TransformResponseParams<THit> = {
|
||||
results: Array<SearchResponse<THit> | SearchForFacetValuesResponse>;
|
||||
hits: Array<SearchResponse<THit>['hits']>;
|
||||
facetHits: FacetHit[][];
|
||||
};
|
||||
export declare type TransformedRequesterResponse<THit> = Array<SearchResponse<THit>['hits']> | SearchResponse<THit>['hits'] | FacetHit[][] | FacetHit[];
|
||||
export declare type TransformResponse<THit> = (response: TransformResponseParams<THit>) => TransformedRequesterResponse<THit>;
|
||||
declare type FetcherParamsQuery<THit> = {
|
||||
query: MultipleQueriesQuery;
|
||||
sourceId: string;
|
||||
transformResponse: TransformResponse<THit>;
|
||||
};
|
||||
declare type ExecuteParams<THit> = {
|
||||
searchClient: SearchClient;
|
||||
requests: Array<FetcherParamsQuery<THit>>;
|
||||
};
|
||||
export declare type Execute<THit> = (params: ExecuteParams<THit>) => Promise<ExecuteResponse<THit>>;
|
||||
export declare type ExecuteResponse<THit> = Array<{
|
||||
items: SearchResponse<THit> | SearchForFacetValuesResponse;
|
||||
sourceId: string;
|
||||
transformResponse: TransformResponse<THit>;
|
||||
}>;
|
||||
export declare type RequestParams<THit> = FetcherParams & {
|
||||
/**
|
||||
* The function to transform the Algolia response before passing it to the Autocomplete state. You have access to the full Algolia results, as well as the pre-computed hits and facet hits.
|
||||
*
|
||||
* This is useful to manipulate the hits, or store data from the results in the [context](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/context/).
|
||||
*/
|
||||
transformResponse?: TransformResponse<THit>;
|
||||
};
|
||||
export declare type RequesterDescription<THit> = {
|
||||
/**
|
||||
* The search client used for this request. Multiple queries with the same client are batched (if `requesterId` is also the same).
|
||||
*/
|
||||
searchClient: SearchClient;
|
||||
/**
|
||||
* Identifies requesters to confirm their queries should be batched.
|
||||
* This ensures that requesters with the same client but different
|
||||
* post-processing functions don't get batched.
|
||||
* When falsy, batching is disabled.
|
||||
* For example, the Algolia requesters use "algolia".
|
||||
*/
|
||||
requesterId?: string;
|
||||
/**
|
||||
* The search parameters used for this query.
|
||||
*/
|
||||
queries: MultipleQueriesQuery[];
|
||||
/**
|
||||
* Transforms the response of this search before returning it to the caller.
|
||||
*/
|
||||
transformResponse: TransformResponse<THit>;
|
||||
/**
|
||||
* Post-processing function for multi-queries.
|
||||
*/
|
||||
execute: Execute<THit>;
|
||||
};
|
||||
export declare function createRequester(fetcher: Fetcher, requesterId?: string): (requesterParams: RequesterParams<any>) => <TTHit>(requestParams: RequestParams<TTHit>) => RequesterDescription<TTHit>;
|
||||
export {};
|
36
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.js
generated
vendored
Normal file
36
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.js
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
export function createRequester(fetcher, requesterId) {
|
||||
function execute(fetcherParams) {
|
||||
return fetcher({
|
||||
searchClient: fetcherParams.searchClient,
|
||||
queries: fetcherParams.requests.map(function (x) {
|
||||
return x.query;
|
||||
})
|
||||
}).then(function (responses) {
|
||||
return responses.map(function (response, index) {
|
||||
var _fetcherParams$reques = fetcherParams.requests[index],
|
||||
sourceId = _fetcherParams$reques.sourceId,
|
||||
transformResponse = _fetcherParams$reques.transformResponse;
|
||||
return {
|
||||
items: response,
|
||||
sourceId: sourceId,
|
||||
transformResponse: transformResponse
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return function createSpecifiedRequester(requesterParams) {
|
||||
return function requester(requestParams) {
|
||||
return _objectSpread(_objectSpread({
|
||||
requesterId: requesterId,
|
||||
execute: execute
|
||||
}, requesterParams), requestParams);
|
||||
};
|
||||
};
|
||||
}
|
5
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.d.ts
generated
vendored
Normal file
5
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { RequestParams } from './createRequester';
|
||||
/**
|
||||
* Retrieves Algolia facet hits from multiple indices.
|
||||
*/
|
||||
export declare function getAlgoliaFacets<TTHit>(requestParams: RequestParams<TTHit>): import("./createRequester").RequesterDescription<TTHit>;
|
26
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.js
generated
vendored
Normal file
26
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
import { createAlgoliaRequester } from './createAlgoliaRequester';
|
||||
|
||||
/**
|
||||
* Retrieves Algolia facet hits from multiple indices.
|
||||
*/
|
||||
export function getAlgoliaFacets(requestParams) {
|
||||
var requester = createAlgoliaRequester({
|
||||
transformResponse: function transformResponse(response) {
|
||||
return response.facetHits;
|
||||
}
|
||||
});
|
||||
var queries = requestParams.queries.map(function (query) {
|
||||
return _objectSpread(_objectSpread({}, query), {}, {
|
||||
type: 'facet'
|
||||
});
|
||||
});
|
||||
return requester(_objectSpread(_objectSpread({}, requestParams), {}, {
|
||||
queries: queries
|
||||
}));
|
||||
}
|
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.d.ts
generated
vendored
Normal file
4
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* Retrieves Algolia results from multiple indices.
|
||||
*/
|
||||
export declare const getAlgoliaResults: <TTHit>(requestParams: import("./createRequester").RequestParams<TTHit>) => import("./createRequester").RequesterDescription<TTHit>;
|
10
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js
generated
vendored
Normal file
10
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { createAlgoliaRequester } from './createAlgoliaRequester';
|
||||
/**
|
||||
* Retrieves Algolia results from multiple indices.
|
||||
*/
|
||||
|
||||
export var getAlgoliaResults = createAlgoliaRequester({
|
||||
transformResponse: function transformResponse(response) {
|
||||
return response.hits;
|
||||
}
|
||||
});
|
3
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.d.ts
generated
vendored
Normal file
3
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
export * from './createRequester';
|
||||
export * from './getAlgoliaFacets';
|
||||
export * from './getAlgoliaResults';
|
3
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.js
generated
vendored
Normal file
3
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
export * from './createRequester';
|
||||
export * from './getAlgoliaFacets';
|
||||
export * from './getAlgoliaResults';
|
19
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.d.ts
generated
vendored
Normal file
19
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { UserAgent } from '@algolia/autocomplete-shared';
|
||||
import type { MultipleQueriesQuery, SearchForFacetValuesResponse, SearchResponse, SearchClient } from '../types';
|
||||
export interface SearchParams {
|
||||
/**
|
||||
* The initialized Algolia search client.
|
||||
*/
|
||||
searchClient: SearchClient;
|
||||
/**
|
||||
* A list of queries to execute.
|
||||
*/
|
||||
queries: MultipleQueriesQuery[];
|
||||
/**
|
||||
* A list of user agents to add to the search client.
|
||||
*
|
||||
* This is useful to track usage of an integration.
|
||||
*/
|
||||
userAgents?: UserAgent[];
|
||||
}
|
||||
export declare function fetchAlgoliaResults<TRecord>({ searchClient, queries, userAgents, }: SearchParams): Promise<Array<SearchResponse<TRecord> | SearchForFacetValuesResponse>>;
|
56
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.js
generated
vendored
Normal file
56
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.js
generated
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
var _excluded = ["params"];
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread 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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
||||
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
||||
|
||||
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; }
|
||||
|
||||
import { userAgents as coreUserAgents } from '@algolia/autocomplete-shared';
|
||||
import { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants';
|
||||
export function fetchAlgoliaResults(_ref) {
|
||||
var searchClient = _ref.searchClient,
|
||||
queries = _ref.queries,
|
||||
_ref$userAgents = _ref.userAgents,
|
||||
userAgents = _ref$userAgents === void 0 ? [] : _ref$userAgents;
|
||||
|
||||
if (typeof searchClient.addAlgoliaAgent === 'function') {
|
||||
var algoliaAgents = [].concat(_toConsumableArray(coreUserAgents), _toConsumableArray(userAgents));
|
||||
algoliaAgents.forEach(function (_ref2) {
|
||||
var segment = _ref2.segment,
|
||||
version = _ref2.version;
|
||||
searchClient.addAlgoliaAgent(segment, version);
|
||||
});
|
||||
}
|
||||
|
||||
return searchClient.search(queries.map(function (searchParameters) {
|
||||
var params = searchParameters.params,
|
||||
headers = _objectWithoutProperties(searchParameters, _excluded);
|
||||
|
||||
return _objectSpread(_objectSpread({}, headers), {}, {
|
||||
params: _objectSpread({
|
||||
hitsPerPage: 5,
|
||||
highlightPreTag: HIGHLIGHT_PRE_TAG,
|
||||
highlightPostTag: HIGHLIGHT_POST_TAG
|
||||
}, params)
|
||||
});
|
||||
})).then(function (response) {
|
||||
return response.results;
|
||||
});
|
||||
}
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.d.ts
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './fetchAlgoliaResults';
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.js
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './fetchAlgoliaResults';
|
54
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/types/algoliasearch.d.ts
generated
vendored
Normal file
54
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/types/algoliasearch.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
import * as ClientSearch from '@algolia/client-search';
|
||||
import type * as AlgoliaSearch from 'algoliasearch/lite';
|
||||
declare type AnyToUnknown<TSubject> = (any extends TSubject ? true : false) extends true ? unknown : TSubject;
|
||||
declare type SearchClientShape = {
|
||||
search: unknown;
|
||||
};
|
||||
declare type ClientLiteV5 = AnyToUnknown<
|
||||
/** @ts-ignore */
|
||||
ReturnType<typeof AlgoliaSearch.liteClient>>;
|
||||
declare type ClientSearchV5 = AnyToUnknown<
|
||||
/** @ts-ignore */
|
||||
ReturnType<typeof ClientSearch.searchClient>>;
|
||||
declare type ClientV5 = ClientLiteV5 extends SearchClientShape ? ClientLiteV5 : ClientSearchV5 extends SearchClientShape ? ClientSearchV5 : unknown;
|
||||
declare type PickForClient<TMapping extends {
|
||||
v4: unknown;
|
||||
v5: unknown;
|
||||
}> = ClientV5 extends SearchClientShape ? TMapping['v5'] : TMapping['v4'];
|
||||
export declare type SearchClient = PickForClient<{
|
||||
/** @ts-ignore */
|
||||
v4: AlgoliaSearch.SearchClient;
|
||||
/** @ts-ignore */
|
||||
v5: ClientV5;
|
||||
}>;
|
||||
export declare type MultipleQueriesQuery = PickForClient<{
|
||||
/** @ts-ignore */
|
||||
v4: ClientSearch.MultipleQueriesQuery;
|
||||
/** @ts-ignore */
|
||||
v5: AlgoliaSearch.LegacySearchMethodProps[number];
|
||||
}>;
|
||||
export declare type SearchForFacetValuesResponse = PickForClient<{
|
||||
/** @ts-ignore */
|
||||
v4: ClientSearch.SearchForFacetValuesResponse;
|
||||
/** @ts-ignore */
|
||||
v5: AlgoliaSearch.SearchForFacetValuesResponse;
|
||||
}>;
|
||||
export declare type SearchResponse<THit> = PickForClient<{
|
||||
/** @ts-ignore */
|
||||
v4: ClientSearch.SearchResponse<THit>;
|
||||
/** @ts-ignore */
|
||||
v5: AlgoliaSearch.SearchResponse<THit>;
|
||||
}>;
|
||||
export declare type HighlightResult<THit> = PickForClient<{
|
||||
/** @ts-ignore */
|
||||
v4: ClientSearch.HighlightResult<THit>;
|
||||
/** @ts-ignore */
|
||||
v5: AlgoliaSearch.HighlightResult;
|
||||
}>;
|
||||
export declare type SnippetResult<THit> = PickForClient<{
|
||||
/** @ts-ignore */
|
||||
v4: ClientSearch.SnippetResult<THit>;
|
||||
/** @ts-ignore */
|
||||
v5: AlgoliaSearch.SnippetResult;
|
||||
}>;
|
||||
export {};
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/types/algoliasearch.js
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/types/algoliasearch.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export {};
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/types/index.d.ts
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/types/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './algoliasearch';
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/types/index.js
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/esm/types/index.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './algoliasearch';
|
405
node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js
generated
vendored
Normal file
405
node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js
generated
vendored
Normal file
|
@ -0,0 +1,405 @@
|
|||
/*! @algolia/autocomplete-preset-algolia 1.8.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/autocomplete-preset-algolia"] = {}));
|
||||
})(this, (function (exports) { 'use strict';
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
})), keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = null != arguments[i] ? arguments[i] : {};
|
||||
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) {
|
||||
if (source == null) return {};
|
||||
var target = {};
|
||||
var sourceKeys = Object.keys(source);
|
||||
var key, i;
|
||||
|
||||
for (i = 0; i < sourceKeys.length; i++) {
|
||||
key = sourceKeys[i];
|
||||
if (excluded.indexOf(key) >= 0) continue;
|
||||
target[key] = source[key];
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _objectWithoutProperties(source, excluded) {
|
||||
if (source == null) return {};
|
||||
|
||||
var target = _objectWithoutPropertiesLoose(source, excluded);
|
||||
|
||||
var key, i;
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
||||
|
||||
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
||||
key = sourceSymbolKeys[i];
|
||||
if (excluded.indexOf(key) >= 0) continue;
|
||||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
|
||||
function _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
||||
}
|
||||
|
||||
function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
||||
}
|
||||
|
||||
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 _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
|
||||
function getAttributeValueByPath(record, path) {
|
||||
return path.reduce(function (current, key) {
|
||||
return current && current[key];
|
||||
}, record);
|
||||
}
|
||||
|
||||
var version = '1.8.2';
|
||||
|
||||
var userAgents = [{
|
||||
segment: 'autocomplete-core',
|
||||
version: version
|
||||
}];
|
||||
|
||||
var warnCache = {
|
||||
current: {}
|
||||
};
|
||||
/**
|
||||
* Logs a warning if the condition is not met.
|
||||
* This is used to log issues in development environment only.
|
||||
*/
|
||||
|
||||
function warn(condition, message) {
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
var HIGHLIGHT_PRE_TAG = '__aa-highlight__';
|
||||
var HIGHLIGHT_POST_TAG = '__/aa-highlight__';
|
||||
|
||||
/**
|
||||
* Creates a data structure that allows to concatenate similar highlighting
|
||||
* parts in a single value.
|
||||
*/
|
||||
function createAttributeSet() {
|
||||
var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var value = initialValue;
|
||||
return {
|
||||
get: function get() {
|
||||
return value;
|
||||
},
|
||||
add: function add(part) {
|
||||
var lastPart = value[value.length - 1];
|
||||
|
||||
if ((lastPart === null || lastPart === void 0 ? void 0 : lastPart.isHighlighted) === part.isHighlighted) {
|
||||
value[value.length - 1] = {
|
||||
value: lastPart.value + part.value,
|
||||
isHighlighted: lastPart.isHighlighted
|
||||
};
|
||||
} else {
|
||||
value.push(part);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function parseAttribute(_ref) {
|
||||
var highlightedValue = _ref.highlightedValue;
|
||||
var preTagParts = highlightedValue.split(HIGHLIGHT_PRE_TAG);
|
||||
var firstValue = preTagParts.shift();
|
||||
var parts = createAttributeSet(firstValue ? [{
|
||||
value: firstValue,
|
||||
isHighlighted: false
|
||||
}] : []);
|
||||
preTagParts.forEach(function (part) {
|
||||
var postTagParts = part.split(HIGHLIGHT_POST_TAG);
|
||||
parts.add({
|
||||
value: postTagParts[0],
|
||||
isHighlighted: true
|
||||
});
|
||||
|
||||
if (postTagParts[1] !== '') {
|
||||
parts.add({
|
||||
value: postTagParts[1],
|
||||
isHighlighted: false
|
||||
});
|
||||
}
|
||||
});
|
||||
return parts.get();
|
||||
}
|
||||
|
||||
function parseAlgoliaHitHighlight(_ref) {
|
||||
var hit = _ref.hit,
|
||||
attribute = _ref.attribute;
|
||||
var path = Array.isArray(attribute) ? attribute : [attribute];
|
||||
var highlightedValue = getAttributeValueByPath(hit, ['_highlightResult'].concat(_toConsumableArray(path), ['value']));
|
||||
|
||||
if (typeof highlightedValue !== 'string') {
|
||||
"development" !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToHighlight`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/') : void 0;
|
||||
highlightedValue = getAttributeValueByPath(hit, path) || '';
|
||||
}
|
||||
|
||||
return parseAttribute({
|
||||
highlightedValue: highlightedValue
|
||||
});
|
||||
}
|
||||
|
||||
var htmlEscapes = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
''': "'"
|
||||
};
|
||||
var hasAlphanumeric = new RegExp(/\w/i);
|
||||
var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;
|
||||
var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);
|
||||
|
||||
function unescape(value) {
|
||||
return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {
|
||||
return htmlEscapes[character];
|
||||
}) : value;
|
||||
}
|
||||
|
||||
function isPartHighlighted(parts, i) {
|
||||
var _parts, _parts2;
|
||||
|
||||
var current = parts[i];
|
||||
var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true;
|
||||
var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true;
|
||||
|
||||
if (!hasAlphanumeric.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) {
|
||||
return isPreviousHighlighted;
|
||||
}
|
||||
|
||||
return current.isHighlighted;
|
||||
}
|
||||
|
||||
function reverseHighlightedParts(parts) {
|
||||
// We don't want to highlight the whole word when no parts match.
|
||||
if (!parts.some(function (part) {
|
||||
return part.isHighlighted;
|
||||
})) {
|
||||
return parts.map(function (part) {
|
||||
return _objectSpread2(_objectSpread2({}, part), {}, {
|
||||
isHighlighted: false
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return parts.map(function (part, i) {
|
||||
return _objectSpread2(_objectSpread2({}, part), {}, {
|
||||
isHighlighted: !isPartHighlighted(parts, i)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function parseAlgoliaHitReverseHighlight(props) {
|
||||
return reverseHighlightedParts(parseAlgoliaHitHighlight(props));
|
||||
}
|
||||
|
||||
function parseAlgoliaHitSnippet(_ref) {
|
||||
var hit = _ref.hit,
|
||||
attribute = _ref.attribute;
|
||||
var path = Array.isArray(attribute) ? attribute : [attribute];
|
||||
var highlightedValue = getAttributeValueByPath(hit, ['_snippetResult'].concat(_toConsumableArray(path), ['value']));
|
||||
|
||||
if (typeof highlightedValue !== 'string') {
|
||||
"development" !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToSnippet`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/') : void 0;
|
||||
highlightedValue = getAttributeValueByPath(hit, path) || '';
|
||||
}
|
||||
|
||||
return parseAttribute({
|
||||
highlightedValue: highlightedValue
|
||||
});
|
||||
}
|
||||
|
||||
function parseAlgoliaHitReverseSnippet(props) {
|
||||
return reverseHighlightedParts(parseAlgoliaHitSnippet(props));
|
||||
}
|
||||
|
||||
function createRequester(fetcher, requesterId) {
|
||||
function execute(fetcherParams) {
|
||||
return fetcher({
|
||||
searchClient: fetcherParams.searchClient,
|
||||
queries: fetcherParams.requests.map(function (x) {
|
||||
return x.query;
|
||||
})
|
||||
}).then(function (responses) {
|
||||
return responses.map(function (response, index) {
|
||||
var _fetcherParams$reques = fetcherParams.requests[index],
|
||||
sourceId = _fetcherParams$reques.sourceId,
|
||||
transformResponse = _fetcherParams$reques.transformResponse;
|
||||
return {
|
||||
items: response,
|
||||
sourceId: sourceId,
|
||||
transformResponse: transformResponse
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return function createSpecifiedRequester(requesterParams) {
|
||||
return function requester(requestParams) {
|
||||
return _objectSpread2(_objectSpread2({
|
||||
requesterId: requesterId,
|
||||
execute: execute
|
||||
}, requesterParams), requestParams);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
var _excluded = ["params"];
|
||||
function fetchAlgoliaResults(_ref) {
|
||||
var searchClient = _ref.searchClient,
|
||||
queries = _ref.queries,
|
||||
_ref$userAgents = _ref.userAgents,
|
||||
userAgents$1 = _ref$userAgents === void 0 ? [] : _ref$userAgents;
|
||||
|
||||
if (typeof searchClient.addAlgoliaAgent === 'function') {
|
||||
var algoliaAgents = [].concat(_toConsumableArray(userAgents), _toConsumableArray(userAgents$1));
|
||||
algoliaAgents.forEach(function (_ref2) {
|
||||
var segment = _ref2.segment,
|
||||
version = _ref2.version;
|
||||
searchClient.addAlgoliaAgent(segment, version);
|
||||
});
|
||||
}
|
||||
|
||||
return searchClient.search(queries.map(function (searchParameters) {
|
||||
var params = searchParameters.params,
|
||||
headers = _objectWithoutProperties(searchParameters, _excluded);
|
||||
|
||||
return _objectSpread2(_objectSpread2({}, headers), {}, {
|
||||
params: _objectSpread2({
|
||||
hitsPerPage: 5,
|
||||
highlightPreTag: HIGHLIGHT_PRE_TAG,
|
||||
highlightPostTag: HIGHLIGHT_POST_TAG
|
||||
}, params)
|
||||
});
|
||||
})).then(function (response) {
|
||||
return response.results;
|
||||
});
|
||||
}
|
||||
|
||||
var createAlgoliaRequester = createRequester(fetchAlgoliaResults, 'algolia');
|
||||
|
||||
/**
|
||||
* Retrieves Algolia facet hits from multiple indices.
|
||||
*/
|
||||
function getAlgoliaFacets(requestParams) {
|
||||
var requester = createAlgoliaRequester({
|
||||
transformResponse: function transformResponse(response) {
|
||||
return response.facetHits;
|
||||
}
|
||||
});
|
||||
var queries = requestParams.queries.map(function (query) {
|
||||
return _objectSpread2(_objectSpread2({}, query), {}, {
|
||||
type: 'facet'
|
||||
});
|
||||
});
|
||||
return requester(_objectSpread2(_objectSpread2({}, requestParams), {}, {
|
||||
queries: queries
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves Algolia results from multiple indices.
|
||||
*/
|
||||
|
||||
var getAlgoliaResults = createAlgoliaRequester({
|
||||
transformResponse: function transformResponse(response) {
|
||||
return response.hits;
|
||||
}
|
||||
});
|
||||
|
||||
exports.createRequester = createRequester;
|
||||
exports.fetchAlgoliaResults = fetchAlgoliaResults;
|
||||
exports.getAlgoliaFacets = getAlgoliaFacets;
|
||||
exports.getAlgoliaResults = getAlgoliaResults;
|
||||
exports.parseAlgoliaHitHighlight = parseAlgoliaHitHighlight;
|
||||
exports.parseAlgoliaHitReverseHighlight = parseAlgoliaHitReverseHighlight;
|
||||
exports.parseAlgoliaHitReverseSnippet = parseAlgoliaHitReverseSnippet;
|
||||
exports.parseAlgoliaHitSnippet = parseAlgoliaHitSnippet;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=index.development.js.map
|
1
node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js.map
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js
generated
vendored
Normal file
3
node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js.map
generated
vendored
Normal file
1
node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
44
node_modules/@algolia/autocomplete-preset-algolia/package.json
generated
vendored
Normal file
44
node_modules/@algolia/autocomplete-preset-algolia/package.json
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"name": "@algolia/autocomplete-preset-algolia",
|
||||
"description": "Presets for building autocomplete experiences with Algolia.",
|
||||
"version": "1.8.2",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/algolia/autocomplete",
|
||||
"repository": "algolia/autocomplete",
|
||||
"author": {
|
||||
"name": "Algolia, Inc.",
|
||||
"url": "https://www.algolia.com"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist/"
|
||||
],
|
||||
"source": "src/index.ts",
|
||||
"types": "dist/esm/index.d.ts",
|
||||
"module": "dist/esm/index.js",
|
||||
"main": "dist/umd/index.production.js",
|
||||
"umd:main": "dist/umd/index.production.js",
|
||||
"unpkg": "dist/umd/index.production.js",
|
||||
"jsdelivr": "dist/umd/index.production.js",
|
||||
"scripts": {
|
||||
"build:clean": "rm -rf ./dist",
|
||||
"build:esm": "babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm --ignore '**/*/__tests__/'",
|
||||
"build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/esm",
|
||||
"build:umd": "rollup --config",
|
||||
"build": "yarn build:clean && yarn build:umd && yarn build:esm && yarn build:types",
|
||||
"on:change": "concurrently \"yarn build:esm\" \"yarn build:types\"",
|
||||
"prepare": "yarn build:esm && yarn build:types",
|
||||
"watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@algolia/autocomplete-shared": "1.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@algolia/client-search": "4.14.3",
|
||||
"algoliasearch": "4.14.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@algolia/client-search": ">= 4.9.1 < 6",
|
||||
"algoliasearch": ">= 4.9.1 < 6"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue