Skip to content

Commit ee2d35c

Browse files
authored
feat(autocomplete): add two complete widget examples (#542)
1 parent c702951 commit ee2d35c

51 files changed

Lines changed: 17788 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.circleci/config.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ jobs:
7373
- checkout
7474
- build_project:
7575
path: 'react-instantsearch/algolia-insights'
76+
- build_project:
77+
path: 'react-instantsearch/autocomplete'
78+
- build_project:
79+
path: 'react-instantsearch/autocomplete-mentions'
7680
- build_project:
7781
path: 'react-instantsearch/conditional-debouncing'
7882
- build_project:
@@ -104,6 +108,10 @@ jobs:
104108
executor: node14
105109
steps:
106110
- checkout
111+
- build_project:
112+
path: 'instantsearch.js/autocomplete'
113+
- build_project:
114+
path: 'instantsearch.js/autocomplete-mentions'
107115
- build_project:
108116
path: 'instantsearch.js/autocomplete-results-page'
109117
- build_project:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/dist
3+
/.cache
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: 'algolia',
3+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/dist
11+
/.cache
12+
13+
# misc
14+
.DS_Store
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"proseWrap": "never",
4+
"trailingComma": "es5"
5+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# autocomplete-mentions
2+
3+
[![Edit autocomplete-mentions](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/instantsearch.js/autocomplete-mentions)
4+
5+
A headless "@" mentions text box built with the `connectAutocomplete` connector: type "@" followed by a few letters to search the `autocomplete_twitter_accounts` index and complete a handle, Twitter-style.
6+
7+
## Get started
8+
9+
To run this project locally, install the dependencies and run the local server:
10+
11+
```sh
12+
npm install
13+
npm start
14+
```
15+
16+
Alternatively, you may use [Yarn](https://http://yarnpkg.com/):
17+
18+
```sh
19+
yarn
20+
yarn start
21+
```
22+
23+
Open http://localhost:3000 to see your app.
906 Bytes
Loading
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<meta name="theme-color" content="#000000">
8+
9+
<link rel="manifest" href="./manifest.webmanifest">
10+
<link rel="shortcut icon" href="./favicon.png">
11+
12+
<link rel="stylesheet" href="./src/index.css">
13+
<link rel="stylesheet" href="./src/app.css">
14+
15+
<title>InstantSearch.js - Autocomplete mentions</title>
16+
</head>
17+
18+
<body>
19+
<main class="page">
20+
<h1 class="page-title">Headless mentions</h1>
21+
<p class="page-subtitle">
22+
A custom text box with "@" mention suggestions, built with the
23+
<code>connectAutocomplete</code> connector. Type "@" followed by a few
24+
letters.
25+
</p>
26+
27+
<div class="compose">
28+
<textarea id="compose" placeholder="What's happening?" maxlength="280"></textarea>
29+
<ul id="mentions-panel" hidden></ul>
30+
</div>
31+
</main>
32+
33+
<script src="https://cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js"></script>
34+
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4.104.0"></script>
35+
<script src="./src/app.js"></script>
36+
</body>
37+
38+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "autocomplete-mentions",
3+
"name": "autocomplete-mentions Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.png",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": "./index.html",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

0 commit comments

Comments
 (0)