create-instantsearch-app 6.4.2 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/package.json +3 -2
- package/src/api/__tests__/__snapshots__/index.test.js.snap +4 -4
- package/src/api/__tests__/resolve-template.test.js +0 -28
- package/src/api/resolve-template.js +1 -28
- package/src/templates/React InstantSearch/.editorconfig +0 -1
- package/src/templates/React InstantSearch/.gitignore.template +20 -18
- package/src/templates/React InstantSearch/.template.js +4 -3
- package/src/templates/React InstantSearch/README.md +0 -2
- package/src/templates/React InstantSearch/package.json +8 -21
- package/src/templates/React InstantSearch/src/App.css +11 -0
- package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/App.tsx.hbs +3 -3
- package/src/templates/React InstantSearch Native/.gitignore.template +13 -16
- package/src/templates/React InstantSearch Native/.template.js +2 -1
- package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/App.tsx.hbs +1 -1
- package/src/templates/React InstantSearch Native/app.json +24 -1
- package/src/templates/React InstantSearch Native/package.json +14 -16
- package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/InfiniteHits.tsx +1 -1
- package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/SearchBox.tsx.hbs +1 -1
- package/src/utils/__tests__/index.test.js +8 -5
- package/src/templates/Autocomplete.js 0/.editorconfig +0 -9
- package/src/templates/Autocomplete.js 0/.eslintignore +0 -3
- package/src/templates/Autocomplete.js 0/.eslintrc.js +0 -3
- package/src/templates/Autocomplete.js 0/.gitignore.template +0 -22
- package/src/templates/Autocomplete.js 0/.prettierrc +0 -5
- package/src/templates/Autocomplete.js 0/.template.js +0 -13
- package/src/templates/Autocomplete.js 0/README.md +0 -21
- package/src/templates/Autocomplete.js 0/favicon.png +0 -0
- package/src/templates/Autocomplete.js 0/index.html.hbs +0 -46
- package/src/templates/Autocomplete.js 0/manifest.webmanifest +0 -15
- package/src/templates/Autocomplete.js 0/package.json +0 -26
- package/src/templates/Autocomplete.js 0/src/app.css +0 -85
- package/src/templates/Autocomplete.js 0/src/app.js.hbs +0 -31
- package/src/templates/Autocomplete.js 0/src/index.css +0 -7
- package/src/templates/InstantSearch.js 2/.editorconfig +0 -9
- package/src/templates/InstantSearch.js 2/.eslintignore +0 -3
- package/src/templates/InstantSearch.js 2/.eslintrc.js +0 -3
- package/src/templates/InstantSearch.js 2/.gitignore.template +0 -22
- package/src/templates/InstantSearch.js 2/.prettierrc +0 -5
- package/src/templates/InstantSearch.js 2/.template.js +0 -14
- package/src/templates/InstantSearch.js 2/README.md +0 -21
- package/src/templates/InstantSearch.js 2/favicon.png +0 -0
- package/src/templates/InstantSearch.js 2/index.html.hbs +0 -56
- package/src/templates/InstantSearch.js 2/manifest.webmanifest +0 -15
- package/src/templates/InstantSearch.js 2/package.json +0 -22
- package/src/templates/InstantSearch.js 2/src/app.css +0 -75
- package/src/templates/InstantSearch.js 2/src/app.js.hbs +0 -54
- package/src/templates/InstantSearch.js 2/src/index.css +0 -10
- package/src/templates/JavaScript Helper 2/.editorconfig +0 -9
- package/src/templates/JavaScript Helper 2/.eslintignore +0 -3
- package/src/templates/JavaScript Helper 2/.eslintrc.js +0 -3
- package/src/templates/JavaScript Helper 2/.gitignore.template +0 -22
- package/src/templates/JavaScript Helper 2/.prettierrc +0 -5
- package/src/templates/JavaScript Helper 2/.template.js +0 -14
- package/src/templates/JavaScript Helper 2/README.md +0 -21
- package/src/templates/JavaScript Helper 2/favicon.png +0 -0
- package/src/templates/JavaScript Helper 2/index.html.hbs +0 -42
- package/src/templates/JavaScript Helper 2/manifest.webmanifest +0 -15
- package/src/templates/JavaScript Helper 2/package.json +0 -26
- package/src/templates/JavaScript Helper 2/src/app.css +0 -74
- package/src/templates/JavaScript Helper 2/src/app.js.hbs +0 -44
- package/src/templates/JavaScript Helper 2/src/index.css +0 -10
- package/src/templates/React InstantSearch/.eslintrc.js +0 -3
- package/src/templates/React InstantSearch/public/favicon.png +0 -0
- package/src/templates/React InstantSearch/public/index.html +0 -29
- package/src/templates/React InstantSearch/public/manifest.json +0 -15
- package/src/templates/React InstantSearch/src/App.js.hbs +0 -112
- package/src/templates/React InstantSearch/src/index.css +0 -10
- package/src/templates/React InstantSearch/src/index.js +0 -6
- package/src/templates/React InstantSearch Hooks/.editorconfig +0 -8
- package/src/templates/React InstantSearch Hooks/.gitignore.template +0 -23
- package/src/templates/React InstantSearch Hooks/.prettierrc +0 -5
- package/src/templates/React InstantSearch Hooks/.template.js +0 -25
- package/src/templates/React InstantSearch Hooks/README.md +0 -19
- package/src/templates/React InstantSearch Hooks/package.json +0 -21
- package/src/templates/React InstantSearch Hooks/src/App.css +0 -71
- package/src/templates/React InstantSearch Hooks Native/.gitignore.template +0 -14
- package/src/templates/React InstantSearch Hooks Native/.template.js +0 -34
- package/src/templates/React InstantSearch Hooks Native/README.md +0 -19
- package/src/templates/React InstantSearch Hooks Native/app.json +0 -30
- package/src/templates/React InstantSearch Hooks Native/babel.config.js +0 -6
- package/src/templates/React InstantSearch Hooks Native/package.json +0 -30
- package/src/templates/React InstantSearch Native/.editorconfig +0 -9
- package/src/templates/React InstantSearch Native/.eslintrc.js +0 -3
- package/src/templates/React InstantSearch Native/.prettierrc +0 -5
- package/src/templates/React InstantSearch Native/.watchmanconfig +0 -1
- package/src/templates/React InstantSearch Native/App.js.hbs +0 -38
- package/src/templates/React InstantSearch Native/src/Highlight.js +0 -36
- package/src/templates/React InstantSearch Native/src/InfiniteHits.js.hbs +0 -56
- package/src/templates/React InstantSearch Native/src/SearchBox.js.hbs +0 -42
- package/src/templates/React InstantSearch widget/.eslintignore +0 -2
- package/src/templates/React InstantSearch widget/.eslintrc.cjs +0 -13
- package/src/templates/React InstantSearch widget/.prettierrc +0 -5
- package/src/templates/React InstantSearch widget/.template.js +0 -21
- package/src/templates/React InstantSearch widget/CONTRIBUTING.md +0 -49
- package/src/templates/React InstantSearch widget/LICENSE.md.hbs +0 -21
- package/src/templates/React InstantSearch widget/README.md +0 -85
- package/src/templates/React InstantSearch widget/babel.config.cjs +0 -8
- package/src/templates/React InstantSearch widget/example/index.html.hbs +0 -12
- package/src/templates/React InstantSearch widget/example/index.tsx.hbs +0 -22
- package/src/templates/React InstantSearch widget/package.json.hbs +0 -81
- package/src/templates/React InstantSearch widget/src/index.tsx.hbs +0 -3
- package/src/templates/React InstantSearch widget/src/lib/__tests__/dummy-test.tsx.hbs +0 -39
- package/src/templates/React InstantSearch widget/src/lib/component.tsx.hbs +0 -15
- package/src/templates/React InstantSearch widget/src/lib/connector.ts.hbs +0 -35
- package/src/templates/React InstantSearch widget/src/lib/widget.tsx.hbs +0 -14
- package/src/templates/React InstantSearch widget/src/types/connector.ts +0 -17
- package/src/templates/React InstantSearch widget/tsconfig.declaration.json +0 -10
- package/src/templates/React InstantSearch widget/tsconfig.json +0 -20
- package/src/templates/React InstantSearch widget/vite.config.ts +0 -34
- package/src/templates/Vue InstantSearch 1/.editorconfig +0 -9
- package/src/templates/Vue InstantSearch 1/.eslintrc.js +0 -9
- package/src/templates/Vue InstantSearch 1/.gitignore.template +0 -21
- package/src/templates/Vue InstantSearch 1/.prettierrc +0 -5
- package/src/templates/Vue InstantSearch 1/.template.js +0 -14
- package/src/templates/Vue InstantSearch 1/README.md +0 -21
- package/src/templates/Vue InstantSearch 1/babel.config.js +0 -3
- package/src/templates/Vue InstantSearch 1/package.json +0 -35
- package/src/templates/Vue InstantSearch 1/public/favicon.png +0 -0
- package/src/templates/Vue InstantSearch 1/public/index.html +0 -22
- package/src/templates/Vue InstantSearch 1/src/App.vue +0 -167
- package/src/templates/Vue InstantSearch 1/src/main.js +0 -11
- package/src/templates/Vue InstantSearch 2/.editorconfig +0 -9
- package/src/templates/Vue InstantSearch 2/.eslintrc.js +0 -9
- package/src/templates/Vue InstantSearch 2/.gitignore.template +0 -21
- package/src/templates/Vue InstantSearch 2/.prettierrc +0 -5
- package/src/templates/Vue InstantSearch 2/.template.js +0 -15
- package/src/templates/Vue InstantSearch 2/README.md +0 -21
- package/src/templates/Vue InstantSearch 2/babel.config.js +0 -3
- package/src/templates/Vue InstantSearch 2/package.json +0 -37
- package/src/templates/Vue InstantSearch 2/public/favicon.png +0 -0
- package/src/templates/Vue InstantSearch 2/public/index.html +0 -22
- package/src/templates/Vue InstantSearch 2/src/App.vue +0 -147
- package/src/templates/Vue InstantSearch 2/src/main.js +0 -11
- package/src/utils/__tests__/__snapshots__/index.test.js.snap +0 -7
- /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/favicon.png +0 -0
- /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/index.html +0 -0
- /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/Panel.tsx +0 -0
- /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/index.tsx +0 -0
- /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/.expo-shared/assets.json +0 -0
- /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/adaptive-icon.png +0 -0
- /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/favicon.png +0 -0
- /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/icon.png +0 -0
- /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/splash.png +0 -0
- /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/Highlight.tsx +0 -0
- /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/tsconfig.json +0 -0
- /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/types/ProductHit.ts +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{name}}",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"main": "src/app.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"start": "parcel index.html --port 3000",
|
|
8
|
-
"build": "parcel build index.html",
|
|
9
|
-
"lint": "eslint ."
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"algoliasearch": "3.35.1",
|
|
13
|
-
"autocomplete.js": "{{libraryVersion}}"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"babel-eslint": "10.0.2",
|
|
17
|
-
"eslint": "6.8.0",
|
|
18
|
-
"eslint-config-algolia": "15.0.0",
|
|
19
|
-
"eslint-config-prettier": "6.10.0",
|
|
20
|
-
"eslint-plugin-import": "2.20.1",
|
|
21
|
-
"eslint-plugin-prettier": "3.1.2",
|
|
22
|
-
"eslint-plugin-eslint-comments": "3.1.2",
|
|
23
|
-
"parcel-bundler": "1.12.5",
|
|
24
|
-
"prettier": "1.19.1"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
.header {
|
|
2
|
-
align-items: center;
|
|
3
|
-
background-image: linear-gradient(73deg, #3369e7, #1cc7d0);
|
|
4
|
-
color: #fff;
|
|
5
|
-
display: flex;
|
|
6
|
-
margin-bottom: 1rem;
|
|
7
|
-
min-height: 50px;
|
|
8
|
-
padding: 0.5rem 1rem;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.header a {
|
|
12
|
-
color: #fff;
|
|
13
|
-
text-decoration: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.header-title {
|
|
17
|
-
font-size: 1.2rem;
|
|
18
|
-
font-weight: normal;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.header-subtitle::before {
|
|
22
|
-
content: ' ▸ ';
|
|
23
|
-
padding: 0 0.5rem;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.header-subtitle {
|
|
27
|
-
font-size: 1.2rem;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.container {
|
|
31
|
-
margin: 0 auto;
|
|
32
|
-
max-width: 460px;
|
|
33
|
-
padding: 1rem;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
#searchBox {
|
|
37
|
-
margin-bottom: 2rem;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.ais-SearchBox-form:before {
|
|
41
|
-
z-index: 1;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.ais-SearchBox-input {
|
|
45
|
-
min-height: 2.5rem;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.algolia-autocomplete {
|
|
49
|
-
width: 100%;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.algolia-autocomplete .aa-input,
|
|
53
|
-
.algolia-autocomplete .aa-hint {
|
|
54
|
-
width: 100%;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.algolia-autocomplete .aa-hint {
|
|
58
|
-
color: #999;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.algolia-autocomplete .aa-dropdown-menu {
|
|
62
|
-
background-color: #fff;
|
|
63
|
-
border: 1px solid rgba(150, 150, 150, 0.16);
|
|
64
|
-
border-radius: 3px;
|
|
65
|
-
box-shadow: 0 0 0 1px rgba(35, 38, 59, 0.05),
|
|
66
|
-
0 8px 16px -4px rgba(35, 38, 59, 0.25);
|
|
67
|
-
margin-top: 5px;
|
|
68
|
-
width: 100%;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.algolia-autocomplete .aa-dropdown-menu .aa-suggestion {
|
|
72
|
-
color: #23263b;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
font-weight: bold;
|
|
75
|
-
padding: 0.5rem 1rem;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.algolia-autocomplete .aa-dropdown-menu .aa-suggestion em {
|
|
79
|
-
font-style: normal;
|
|
80
|
-
font-weight: normal;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor {
|
|
84
|
-
background-color: #f5f5fa;
|
|
85
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import algoliasearch from 'algoliasearch';
|
|
2
|
-
import autocomplete from 'autocomplete.js';
|
|
3
|
-
|
|
4
|
-
const client = algoliasearch('{{appId}}', '{{apiKey}}');
|
|
5
|
-
const index = client.initIndex('{{indexName}}');
|
|
6
|
-
|
|
7
|
-
autocomplete(
|
|
8
|
-
'#searchBox input[type=search]',
|
|
9
|
-
{
|
|
10
|
-
hint: false,
|
|
11
|
-
debug: process.env.NODE_ENV === 'development',
|
|
12
|
-
},
|
|
13
|
-
[
|
|
14
|
-
{
|
|
15
|
-
source: autocomplete.sources.hits(index, { hitsPerPage: 5 }),
|
|
16
|
-
displayKey: '{{attributesToDisplay.[0]}}',
|
|
17
|
-
templates: {
|
|
18
|
-
suggestion(suggestion) {
|
|
19
|
-
{{#if attributesToDisplay.[0]}}
|
|
20
|
-
return suggestion._highlightResult.{{attributesToDisplay.[0]}}.value;
|
|
21
|
-
{{else}}
|
|
22
|
-
return JSON.stringify(suggestion);
|
|
23
|
-
{{/if}}
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
]
|
|
28
|
-
).on('autocomplete:selected', (event, suggestion, dataset) => {
|
|
29
|
-
// eslint-disable-next-line no-console
|
|
30
|
-
console.log({ suggestion, dataset });
|
|
31
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
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*
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const install = require('../../tasks/node/install');
|
|
2
|
-
const teardown = require('../../tasks/node/teardown');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
libraryName: 'instantsearch.js',
|
|
6
|
-
templateName: 'instantsearch.js-2.x',
|
|
7
|
-
supportedVersion: '>= 2.0.0 < 3.0.0',
|
|
8
|
-
appName: 'instantsearch.js-app',
|
|
9
|
-
keywords: ['algolia', 'InstantSearch', 'Vanilla', 'instantsearch.js'],
|
|
10
|
-
tasks: {
|
|
11
|
-
install,
|
|
12
|
-
teardown,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# {{name}}
|
|
2
|
-
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
|
-
|
|
5
|
-
## Get started
|
|
6
|
-
|
|
7
|
-
To run this project locally, install the dependencies and run the local server:
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
npm install
|
|
11
|
-
npm start
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Alternatively, you may use [Yarn](https://http://yarnpkg.com/):
|
|
15
|
-
|
|
16
|
-
```sh
|
|
17
|
-
yarn
|
|
18
|
-
yarn start
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Open http://localhost:3000 to see your app.
|
|
Binary file
|
|
@@ -1,56 +0,0 @@
|
|
|
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="https://cdn.jsdelivr.net/npm/instantsearch.js@{{libraryVersion}}/dist/instantsearch.min.css">
|
|
13
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.js@{{libraryVersion}}/dist/instantsearch-theme-algolia.min.css">
|
|
14
|
-
<link rel="stylesheet" href="./src/index.css">
|
|
15
|
-
<link rel="stylesheet" href="./src/app.css">
|
|
16
|
-
|
|
17
|
-
<title>{{name}}</title>
|
|
18
|
-
</head>
|
|
19
|
-
|
|
20
|
-
<body>
|
|
21
|
-
<header class="header">
|
|
22
|
-
<h1 class="header-title">
|
|
23
|
-
<a href="/">{{name}}</a>
|
|
24
|
-
</h1>
|
|
25
|
-
<p class="header-subtitle">
|
|
26
|
-
using
|
|
27
|
-
<a href="https://github.com/algolia/instantsearch/tree/v2.10.5">
|
|
28
|
-
InstantSearch.js
|
|
29
|
-
</a>
|
|
30
|
-
</p>
|
|
31
|
-
</header>
|
|
32
|
-
|
|
33
|
-
<div class="container">
|
|
34
|
-
<div class="search-panel">
|
|
35
|
-
{{#if attributesForFaceting}}
|
|
36
|
-
<div class="search-panel__filters">
|
|
37
|
-
{{#each attributesForFaceting}}
|
|
38
|
-
<div id="{{this}}-list"></div>
|
|
39
|
-
{{/each}}
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
{{/if}}
|
|
43
|
-
<div class="search-panel__results">
|
|
44
|
-
<div id="searchbox"></div>
|
|
45
|
-
<div id="hits"></div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div id="pagination"></div>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@{{libraryVersion}}"></script>
|
|
53
|
-
<script src="./src/app.js"></script>
|
|
54
|
-
</body>
|
|
55
|
-
|
|
56
|
-
</html>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "{{name}}",
|
|
3
|
-
"name": "{{name}} 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
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{name}}",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"main": "src/app.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"start": "parcel index.html --port 3000",
|
|
8
|
-
"build": "parcel build index.html",
|
|
9
|
-
"lint": "eslint .",
|
|
10
|
-
"lint:fix": "npm run lint -- --fix"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"babel-eslint": "10.0.2",
|
|
14
|
-
"eslint": "5.7.0",
|
|
15
|
-
"eslint-config-algolia": "13.2.3",
|
|
16
|
-
"eslint-config-prettier": "3.6.0",
|
|
17
|
-
"eslint-plugin-import": "2.19.1",
|
|
18
|
-
"eslint-plugin-prettier": "3.1.2",
|
|
19
|
-
"parcel-bundler": "1.12.5",
|
|
20
|
-
"prettier": "1.19.1"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
em {
|
|
2
|
-
background: cyan;
|
|
3
|
-
font-style: normal;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.header {
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
min-height: 50px;
|
|
10
|
-
padding: 0.5rem 1rem;
|
|
11
|
-
background-image: linear-gradient(284deg, #fedd4e, #fcb43a);
|
|
12
|
-
color: #fff;
|
|
13
|
-
margin-bottom: 1rem;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.header a {
|
|
17
|
-
color: #fff;
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.header-title {
|
|
22
|
-
font-size: 1.2rem;
|
|
23
|
-
font-weight: normal;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.header-title::after {
|
|
27
|
-
content: ' ▸ ';
|
|
28
|
-
padding: 0 0.5rem;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.header-subtitle {
|
|
32
|
-
font-size: 1.2rem;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.container {
|
|
36
|
-
max-width: 1200px;
|
|
37
|
-
margin: 0 auto;
|
|
38
|
-
padding: 1rem;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.search-panel {
|
|
42
|
-
display: flex;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.search-panel__filters {
|
|
46
|
-
flex: 1;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.search-panel__results {
|
|
50
|
-
flex: 3;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.ais-hits {
|
|
54
|
-
display: grid;
|
|
55
|
-
grid-template-columns: 47.5% 47.5%;
|
|
56
|
-
grid-gap: 1rem;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.ais-hits--item {
|
|
60
|
-
min-height: 100px;
|
|
61
|
-
padding: 1rem;
|
|
62
|
-
background: #fff;
|
|
63
|
-
border-radius: 4px;
|
|
64
|
-
border: 1px solid rgba(150, 150, 150, 0.16);
|
|
65
|
-
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.16);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
#searchbox {
|
|
69
|
-
margin-bottom: 2rem;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
#pagination {
|
|
73
|
-
margin: 2rem auto;
|
|
74
|
-
text-align: center;
|
|
75
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/* global instantsearch */
|
|
2
|
-
|
|
3
|
-
const search = instantsearch({
|
|
4
|
-
appId: '{{appId}}',
|
|
5
|
-
apiKey: '{{apiKey}}',
|
|
6
|
-
indexName: '{{indexName}}',
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
search.addWidget(
|
|
10
|
-
instantsearch.widgets.searchBox({
|
|
11
|
-
container: '#searchbox',
|
|
12
|
-
autofocus: false,
|
|
13
|
-
{{#if searchPlaceholder}}
|
|
14
|
-
placeholder: '{{searchPlaceholder}}',
|
|
15
|
-
{{/if}}
|
|
16
|
-
})
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
search.addWidget(
|
|
20
|
-
instantsearch.widgets.hits({
|
|
21
|
-
container: '#hits',
|
|
22
|
-
{{#if attributesToDisplay}}
|
|
23
|
-
templates: {
|
|
24
|
-
item: `
|
|
25
|
-
<article>
|
|
26
|
-
<h1>\{{{_highlightResult.{{attributesToDisplay.[0]}}.value}}}</h1>
|
|
27
|
-
{{#each attributesToDisplay}}
|
|
28
|
-
{{#unless @first}}
|
|
29
|
-
<p>\{{{_highlightResult.{{this}}.value}}}</p>
|
|
30
|
-
{{/unless}}
|
|
31
|
-
{{/each}}
|
|
32
|
-
</article>
|
|
33
|
-
`,
|
|
34
|
-
},
|
|
35
|
-
{{/if}}
|
|
36
|
-
})
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
{{#each attributesForFaceting}}
|
|
40
|
-
search.addWidget(
|
|
41
|
-
instantsearch.widgets.refinementList({
|
|
42
|
-
container: '#{{this}}-list',
|
|
43
|
-
attributeName: '{{this}}',
|
|
44
|
-
})
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
{{/each}}
|
|
48
|
-
search.addWidget(
|
|
49
|
-
instantsearch.widgets.pagination({
|
|
50
|
-
container: '#pagination',
|
|
51
|
-
})
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
search.start();
|
|
@@ -1,22 +0,0 @@
|
|
|
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*
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const install = require('../../tasks/node/install');
|
|
2
|
-
const teardown = require('../../tasks/node/teardown');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
libraryName: 'algoliasearch-helper',
|
|
6
|
-
templateName: 'javascript-helper-2.x',
|
|
7
|
-
supportedVersion: '>= 2.0.0 < 3.0.0',
|
|
8
|
-
appName: 'javascript-helper-app',
|
|
9
|
-
keywords: ['algolia', 'JavaScript', 'Helper', 'algoliasearch-helper'],
|
|
10
|
-
tasks: {
|
|
11
|
-
install,
|
|
12
|
-
teardown,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# {{name}}
|
|
2
|
-
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
|
-
|
|
5
|
-
## Get started
|
|
6
|
-
|
|
7
|
-
To run this project locally, install the dependencies and run the local server:
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
npm install
|
|
11
|
-
npm start
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Alternatively, you may use [Yarn](https://http://yarnpkg.com/):
|
|
15
|
-
|
|
16
|
-
```sh
|
|
17
|
-
yarn
|
|
18
|
-
yarn start
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Open http://localhost:3000 to see your app.
|
|
Binary file
|
|
@@ -1,42 +0,0 @@
|
|
|
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>{{name}}</title>
|
|
16
|
-
</head>
|
|
17
|
-
|
|
18
|
-
<body>
|
|
19
|
-
<header class="header">
|
|
20
|
-
<h1 class="header-title">
|
|
21
|
-
<a href="/">{{name}}</a>
|
|
22
|
-
</h1>
|
|
23
|
-
<p class="header-subtitle">using the
|
|
24
|
-
<a href="https://github.com/algolia/algoliasearch-helper-js">Algolia Search Helper for JavaScript</a>
|
|
25
|
-
</p>
|
|
26
|
-
</header>
|
|
27
|
-
|
|
28
|
-
<div class="container">
|
|
29
|
-
<div class="container-app">
|
|
30
|
-
<div id="searchBox">
|
|
31
|
-
<form role="search">
|
|
32
|
-
<input type="search" placeholder="{{searchPlaceholder}}" />
|
|
33
|
-
</form>
|
|
34
|
-
</div>
|
|
35
|
-
<div id="hits"></div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<script src="./src/app.js"></script>
|
|
40
|
-
</body>
|
|
41
|
-
|
|
42
|
-
</html>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "{{name}}",
|
|
3
|
-
"name": "{{name}} 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
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{name}}",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"main": "src/app.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"start": "parcel index.html --port 3000",
|
|
8
|
-
"build": "parcel build index.html",
|
|
9
|
-
"lint": "eslint .",
|
|
10
|
-
"lint:fix": "npm run lint -- --fix"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"algoliasearch": "4",
|
|
14
|
-
"algoliasearch-helper": "{{libraryVersion}}"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"babel-eslint": "10.0.3",
|
|
18
|
-
"eslint": "5.7.0",
|
|
19
|
-
"eslint-config-algolia": "13.2.3",
|
|
20
|
-
"eslint-config-prettier": "3.6.0",
|
|
21
|
-
"eslint-plugin-import": "2.19.1",
|
|
22
|
-
"eslint-plugin-prettier": "3.1.2",
|
|
23
|
-
"parcel-bundler": "1.12.5",
|
|
24
|
-
"prettier": "1.19.1"
|
|
25
|
-
}
|
|
26
|
-
}
|