Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Autocomplete to version 1.x #265

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
96682e7
remove old version of constructed final library
tw2113 Nov 10, 2022
b19cc9f
update autocomplete file path
tw2113 Nov 10, 2022
207cd2f
i have to suspect all these parts are somehow required
tw2113 Nov 10, 2022
14051d5
we actually use this still
tw2113 Nov 10, 2022
da379f4
add debug variable and register more styles
tw2113 Nov 18, 2022
161042b
pull in autocomplete classic theme
tw2113 Nov 18, 2022
fadf4d8
current status of the autocomplete js
tw2113 Nov 18, 2022
058f9ed
bit of a directory move
tw2113 Nov 18, 2022
29eeea7
template cleanup
tw2113 Nov 18, 2022
44f004b
highlighting details and formatting
tw2113 Nov 18, 2022
6d7ebb5
move our user and term templates into our new function
tw2113 Nov 18, 2022
ffb56d5
code cleanup and whatnot
tw2113 Nov 21, 2022
8d888c0
move the empty template
tw2113 Nov 23, 2022
0de8d43
code cleanup and alignment
tw2113 Nov 23, 2022
5d5ac3e
add working conditional hit item image display
tw2113 Nov 23, 2022
11fd41a
finally get working highlighting
tw2113 Nov 23, 2022
31cc91b
update to change mark to em
tw2113 Nov 23, 2022
b0cdb08
re-add snippet portion of post content
tw2113 Nov 23, 2022
53b5f04
try reworking this portion
tw2113 Nov 23, 2022
2180b7b
update our custom autocomplete classes to match current return values
tw2113 Nov 23, 2022
4d54e96
handle our "search by algolia" output on the last item in our sources
tw2113 Dec 2, 2022
8cb2e09
code touchup and destructuring usage to allow for parameter order bei…
tw2113 Dec 2, 2022
b55ff8c
re-add powered by link handling. not working yet
tw2113 Dec 3, 2022
a8630a1
re-add our debug parameter
tw2113 Dec 3, 2022
2785e46
remove previous attempts at footer templates
tw2113 Dec 3, 2022
7484086
upon further consideration, the extra function call was not providing…
tw2113 Dec 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
82 changes: 82 additions & 0 deletions assets/algoliasearch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<p align="center">
<a href="https://www.algolia.com">
<img alt="Algolia for JavaScript" src="https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/banners/javascript.png" >
</a>

<h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your JavaScript project</h4>

<p align="center">
<a href="https://npmjs.org/package/algoliasearch"><img src="https://img.shields.io/npm/v/algoliasearch.svg?style=flat-square" alt="NPM version"></img></a>
<a href="http://npm-stat.com/charts.html?package=algoliasearch"><img src="https://img.shields.io/npm/dm/algoliasearch.svg?style=flat-square" alt="NPM downloads"></a>
<a href="https://www.jsdelivr.com/package/npm/algoliasearch"><img src="https://data.jsdelivr.com/v1/package/npm/algoliasearch/badge" alt="jsDelivr Downloads"></img></a>
<a href="LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
</p>
</p>

<p align="center">
<a href="https://www.algolia.com/doc/api-client/getting-started/install/javascript/" target="_blank">Documentation</a> •
<a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> •
<a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
<a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
<a href="https://github.com/algolia/algoliasearch-client-javascript/issues" target="_blank">Report a bug</a> •
<a href="https://www.algolia.com/support" target="_blank">Support</a>
</p>

## ✨ Features

- Thin & **minimal low-level HTTP client** to interact with Algolia's API
- Works both on the **browser** and **node.js**
- **UMD compatible**, you can use it with any module loader
- Built with TypeScript

## 💡 Getting Started

First, install Algolia JavaScript API Client via the [npm](https://www.npmjs.com/get-npm) package manager:

```bash
npm install algoliasearch
```

Then, create objects on your index:

```js
const algoliasearch = require("algoliasearch");

const client = algoliasearch("YourApplicationID", "YourAdminAPIKey");
const index = client.initIndex("your_index_name");

const objects = [
{
objectID: 1,
name: "Foo"
}
];

index
.saveObjects(objects)
.then(({ objectIDs }) => {
console.log(objectIDs);
})
.catch(err => {
console.log(err);
});
```

Finally, let's actually search using the `search` method:

```js
index
.search("Fo")
.then(({ hits }) => {
console.log(hits);
})
.catch(err => {
console.log(err);
});
```

For full documentation, visit the **[online documentation](https://www.algolia.com/doc/api-client/getting-started/install/javascript/)**.

## 📄 License

Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).
49 changes: 49 additions & 0 deletions assets/algoliasearch/dist/algoliasearch-lite.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { ClientTransporterOptions } from '@algolia/client-common';
import { FindAnswersOptions } from '@algolia/client-search';
import { FindAnswersResponse } from '@algolia/client-search';
import { MultipleQueriesOptions } from '@algolia/client-search';
import { MultipleQueriesQuery } from '@algolia/client-search';
import { MultipleQueriesResponse } from '@algolia/client-search';
import { Request } from '@algolia/transporter';
import { RequestOptions } from '@algolia/transporter';
import { SearchClient as SearchClient_2 } from '@algolia/client-search';
import { SearchClientOptions } from '@algolia/client-search';
import { SearchForFacetValuesQueryParams } from '@algolia/client-search';
import { SearchForFacetValuesResponse } from '@algolia/client-search';
import { SearchIndex as SearchIndex_2 } from '@algolia/client-search';
import { SearchOptions } from '@algolia/client-search';
import { SearchResponse } from '@algolia/client-search';

declare function algoliasearch(appId: string, apiKey: string, options?: AlgoliaSearchOptions): SearchClient;

declare namespace algoliasearch {
var version: string;
}
export default algoliasearch;

export declare type AlgoliaSearchOptions = Partial<ClientTransporterOptions> & WithoutCredentials<SearchClientOptions>;

declare type Credentials = {
readonly appId: string;
readonly apiKey: string;
};

export declare type SearchClient = SearchClient_2 & {
readonly initIndex: (indexName: string) => SearchIndex;
readonly search: <TObject>(queries: readonly MultipleQueriesQuery[], requestOptions?: RequestOptions & MultipleQueriesOptions) => Readonly<Promise<MultipleQueriesResponse<TObject>>>;
readonly searchForFacetValues: (queries: ReadonlyArray<{
readonly indexName: string;
readonly params: SearchForFacetValuesQueryParams & SearchOptions;
}>, requestOptions?: RequestOptions) => Readonly<Promise<readonly SearchForFacetValuesResponse[]>>;
readonly customRequest: <TResponse>(request: Request, requestOptions?: RequestOptions) => Readonly<Promise<TResponse>>;
};

export declare type SearchIndex = SearchIndex_2 & {
readonly search: <TObject>(query: string, requestOptions?: RequestOptions & SearchOptions) => Readonly<Promise<SearchResponse<TObject>>>;
readonly searchForFacetValues: (facetName: string, facetQuery: string, requestOptions?: RequestOptions & SearchOptions) => Readonly<Promise<SearchForFacetValuesResponse>>;
readonly findAnswers: <TObject>(query: string, queryLanguages: readonly string[], requestOptions?: RequestOptions & FindAnswersOptions) => Readonly<Promise<FindAnswersResponse<TObject>>>;
};

export declare type WithoutCredentials<TClientOptions extends Credentials> = Omit<TClientOptions, keyof Credentials>;

export { }
Loading