create-instantsearch-app 6.4.1 → 7.0.0

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.
Files changed (150) hide show
  1. package/README.md +4 -5
  2. package/package.json +3 -2
  3. package/src/api/__tests__/__snapshots__/index.test.js.snap +4 -4
  4. package/src/api/__tests__/resolve-template.test.js +0 -28
  5. package/src/api/resolve-template.js +1 -28
  6. package/src/templates/React InstantSearch/.editorconfig +0 -1
  7. package/src/templates/React InstantSearch/.gitignore.template +20 -18
  8. package/src/templates/React InstantSearch/.template.js +4 -3
  9. package/src/templates/React InstantSearch/README.md +0 -2
  10. package/src/templates/React InstantSearch/package.json +8 -21
  11. package/src/templates/React InstantSearch/src/App.css +11 -0
  12. package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/App.tsx.hbs +3 -3
  13. package/src/templates/React InstantSearch Native/.gitignore.template +13 -16
  14. package/src/templates/React InstantSearch Native/.template.js +2 -1
  15. package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/App.tsx.hbs +1 -1
  16. package/src/templates/React InstantSearch Native/app.json +24 -1
  17. package/src/templates/React InstantSearch Native/package.json +14 -16
  18. package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/InfiniteHits.tsx +1 -1
  19. package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/SearchBox.tsx.hbs +1 -1
  20. package/src/utils/__tests__/fetchLibraryVersions.test.js +24 -0
  21. package/src/utils/__tests__/index.test.js +8 -5
  22. package/src/utils/fetchLibraryVersions.js +37 -0
  23. package/src/utils/index.js +1 -18
  24. package/src/templates/Autocomplete.js 0/.editorconfig +0 -9
  25. package/src/templates/Autocomplete.js 0/.eslintignore +0 -3
  26. package/src/templates/Autocomplete.js 0/.eslintrc.js +0 -3
  27. package/src/templates/Autocomplete.js 0/.gitignore.template +0 -22
  28. package/src/templates/Autocomplete.js 0/.prettierrc +0 -5
  29. package/src/templates/Autocomplete.js 0/.template.js +0 -13
  30. package/src/templates/Autocomplete.js 0/README.md +0 -21
  31. package/src/templates/Autocomplete.js 0/favicon.png +0 -0
  32. package/src/templates/Autocomplete.js 0/index.html.hbs +0 -46
  33. package/src/templates/Autocomplete.js 0/manifest.webmanifest +0 -15
  34. package/src/templates/Autocomplete.js 0/package.json +0 -26
  35. package/src/templates/Autocomplete.js 0/src/app.css +0 -85
  36. package/src/templates/Autocomplete.js 0/src/app.js.hbs +0 -31
  37. package/src/templates/Autocomplete.js 0/src/index.css +0 -7
  38. package/src/templates/InstantSearch.js 2/.editorconfig +0 -9
  39. package/src/templates/InstantSearch.js 2/.eslintignore +0 -3
  40. package/src/templates/InstantSearch.js 2/.eslintrc.js +0 -3
  41. package/src/templates/InstantSearch.js 2/.gitignore.template +0 -22
  42. package/src/templates/InstantSearch.js 2/.prettierrc +0 -5
  43. package/src/templates/InstantSearch.js 2/.template.js +0 -14
  44. package/src/templates/InstantSearch.js 2/README.md +0 -21
  45. package/src/templates/InstantSearch.js 2/favicon.png +0 -0
  46. package/src/templates/InstantSearch.js 2/index.html.hbs +0 -56
  47. package/src/templates/InstantSearch.js 2/manifest.webmanifest +0 -15
  48. package/src/templates/InstantSearch.js 2/package.json +0 -22
  49. package/src/templates/InstantSearch.js 2/src/app.css +0 -75
  50. package/src/templates/InstantSearch.js 2/src/app.js.hbs +0 -54
  51. package/src/templates/InstantSearch.js 2/src/index.css +0 -10
  52. package/src/templates/JavaScript Helper 2/.editorconfig +0 -9
  53. package/src/templates/JavaScript Helper 2/.eslintignore +0 -3
  54. package/src/templates/JavaScript Helper 2/.eslintrc.js +0 -3
  55. package/src/templates/JavaScript Helper 2/.gitignore.template +0 -22
  56. package/src/templates/JavaScript Helper 2/.prettierrc +0 -5
  57. package/src/templates/JavaScript Helper 2/.template.js +0 -14
  58. package/src/templates/JavaScript Helper 2/README.md +0 -21
  59. package/src/templates/JavaScript Helper 2/favicon.png +0 -0
  60. package/src/templates/JavaScript Helper 2/index.html.hbs +0 -42
  61. package/src/templates/JavaScript Helper 2/manifest.webmanifest +0 -15
  62. package/src/templates/JavaScript Helper 2/package.json +0 -26
  63. package/src/templates/JavaScript Helper 2/src/app.css +0 -74
  64. package/src/templates/JavaScript Helper 2/src/app.js.hbs +0 -44
  65. package/src/templates/JavaScript Helper 2/src/index.css +0 -10
  66. package/src/templates/React InstantSearch/.eslintrc.js +0 -3
  67. package/src/templates/React InstantSearch/public/favicon.png +0 -0
  68. package/src/templates/React InstantSearch/public/index.html +0 -29
  69. package/src/templates/React InstantSearch/public/manifest.json +0 -15
  70. package/src/templates/React InstantSearch/src/App.js.hbs +0 -112
  71. package/src/templates/React InstantSearch/src/index.css +0 -10
  72. package/src/templates/React InstantSearch/src/index.js +0 -6
  73. package/src/templates/React InstantSearch Hooks/.editorconfig +0 -8
  74. package/src/templates/React InstantSearch Hooks/.gitignore.template +0 -23
  75. package/src/templates/React InstantSearch Hooks/.prettierrc +0 -5
  76. package/src/templates/React InstantSearch Hooks/.template.js +0 -25
  77. package/src/templates/React InstantSearch Hooks/README.md +0 -19
  78. package/src/templates/React InstantSearch Hooks/package.json +0 -21
  79. package/src/templates/React InstantSearch Hooks/src/App.css +0 -71
  80. package/src/templates/React InstantSearch Hooks Native/.gitignore.template +0 -14
  81. package/src/templates/React InstantSearch Hooks Native/.template.js +0 -34
  82. package/src/templates/React InstantSearch Hooks Native/README.md +0 -19
  83. package/src/templates/React InstantSearch Hooks Native/app.json +0 -30
  84. package/src/templates/React InstantSearch Hooks Native/babel.config.js +0 -6
  85. package/src/templates/React InstantSearch Hooks Native/package.json +0 -30
  86. package/src/templates/React InstantSearch Native/.editorconfig +0 -9
  87. package/src/templates/React InstantSearch Native/.eslintrc.js +0 -3
  88. package/src/templates/React InstantSearch Native/.prettierrc +0 -5
  89. package/src/templates/React InstantSearch Native/.watchmanconfig +0 -1
  90. package/src/templates/React InstantSearch Native/App.js.hbs +0 -38
  91. package/src/templates/React InstantSearch Native/src/Highlight.js +0 -36
  92. package/src/templates/React InstantSearch Native/src/InfiniteHits.js.hbs +0 -56
  93. package/src/templates/React InstantSearch Native/src/SearchBox.js.hbs +0 -42
  94. package/src/templates/React InstantSearch widget/.eslintignore +0 -2
  95. package/src/templates/React InstantSearch widget/.eslintrc.cjs +0 -13
  96. package/src/templates/React InstantSearch widget/.prettierrc +0 -5
  97. package/src/templates/React InstantSearch widget/.template.js +0 -21
  98. package/src/templates/React InstantSearch widget/CONTRIBUTING.md +0 -49
  99. package/src/templates/React InstantSearch widget/LICENSE.md.hbs +0 -21
  100. package/src/templates/React InstantSearch widget/README.md +0 -85
  101. package/src/templates/React InstantSearch widget/babel.config.cjs +0 -8
  102. package/src/templates/React InstantSearch widget/example/index.html.hbs +0 -12
  103. package/src/templates/React InstantSearch widget/example/index.tsx.hbs +0 -22
  104. package/src/templates/React InstantSearch widget/package.json.hbs +0 -81
  105. package/src/templates/React InstantSearch widget/src/index.tsx.hbs +0 -3
  106. package/src/templates/React InstantSearch widget/src/lib/__tests__/dummy-test.tsx.hbs +0 -39
  107. package/src/templates/React InstantSearch widget/src/lib/component.tsx.hbs +0 -15
  108. package/src/templates/React InstantSearch widget/src/lib/connector.ts.hbs +0 -35
  109. package/src/templates/React InstantSearch widget/src/lib/widget.tsx.hbs +0 -14
  110. package/src/templates/React InstantSearch widget/src/types/connector.ts +0 -17
  111. package/src/templates/React InstantSearch widget/tsconfig.declaration.json +0 -10
  112. package/src/templates/React InstantSearch widget/tsconfig.json +0 -20
  113. package/src/templates/React InstantSearch widget/vite.config.ts +0 -34
  114. package/src/templates/Vue InstantSearch 1/.editorconfig +0 -9
  115. package/src/templates/Vue InstantSearch 1/.eslintrc.js +0 -9
  116. package/src/templates/Vue InstantSearch 1/.gitignore.template +0 -21
  117. package/src/templates/Vue InstantSearch 1/.prettierrc +0 -5
  118. package/src/templates/Vue InstantSearch 1/.template.js +0 -14
  119. package/src/templates/Vue InstantSearch 1/README.md +0 -21
  120. package/src/templates/Vue InstantSearch 1/babel.config.js +0 -3
  121. package/src/templates/Vue InstantSearch 1/package.json +0 -35
  122. package/src/templates/Vue InstantSearch 1/public/favicon.png +0 -0
  123. package/src/templates/Vue InstantSearch 1/public/index.html +0 -22
  124. package/src/templates/Vue InstantSearch 1/src/App.vue +0 -167
  125. package/src/templates/Vue InstantSearch 1/src/main.js +0 -11
  126. package/src/templates/Vue InstantSearch 2/.editorconfig +0 -9
  127. package/src/templates/Vue InstantSearch 2/.eslintrc.js +0 -9
  128. package/src/templates/Vue InstantSearch 2/.gitignore.template +0 -21
  129. package/src/templates/Vue InstantSearch 2/.prettierrc +0 -5
  130. package/src/templates/Vue InstantSearch 2/.template.js +0 -15
  131. package/src/templates/Vue InstantSearch 2/README.md +0 -21
  132. package/src/templates/Vue InstantSearch 2/babel.config.js +0 -3
  133. package/src/templates/Vue InstantSearch 2/package.json +0 -37
  134. package/src/templates/Vue InstantSearch 2/public/favicon.png +0 -0
  135. package/src/templates/Vue InstantSearch 2/public/index.html +0 -22
  136. package/src/templates/Vue InstantSearch 2/src/App.vue +0 -147
  137. package/src/templates/Vue InstantSearch 2/src/main.js +0 -11
  138. package/src/utils/__tests__/__snapshots__/index.test.js.snap +0 -7
  139. /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/favicon.png +0 -0
  140. /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/index.html +0 -0
  141. /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/Panel.tsx +0 -0
  142. /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/index.tsx +0 -0
  143. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/.expo-shared/assets.json +0 -0
  144. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/adaptive-icon.png +0 -0
  145. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/favicon.png +0 -0
  146. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/icon.png +0 -0
  147. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/splash.png +0 -0
  148. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/Highlight.tsx +0 -0
  149. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/tsconfig.json +0 -0
  150. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/types/ProductHit.ts +0 -0
@@ -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.
@@ -1,46 +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
- Do not use @7 in production, use a complete version like x.x.x, see website for latest version:
16
- https://www.algolia.com/doc/guides/building-search-ui/installation/react/#load-the-style
17
- -->
18
- <link rel="stylesheet" href="https://unpkg.com/instantsearch.css@7/themes/satellite-min.css" />
19
-
20
- <title>{{name}}</title>
21
- </head>
22
-
23
- <body>
24
- <header class="header">
25
- <h1 class="header-title">
26
- <a href="/">{{name}}</a>
27
- </h1>
28
- <p class="header-subtitle">using
29
- <a href="https://github.com/algolia/autocomplete.js">Autocomplete.js</a>
30
- </p>
31
- </header>
32
-
33
- <div class="container">
34
- <div class="container-app">
35
- <div id="searchBox" class="ais-SearchBox">
36
- <form role="search" class="ais-SearchBox-form">
37
- <input type="search" placeholder="{{searchPlaceholder}}" class="ais-SearchBox-input" />
38
- </form>
39
- </div>
40
- </div>
41
- </div>
42
-
43
- <script src="./src/app.js"></script>
44
- </body>
45
-
46
- </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
- },
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,7 +0,0 @@
1
- body {
2
- background-color: #fcfcfd;
3
- color: #333;
4
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
5
- Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
6
- margin: 0;
7
- }
@@ -1,9 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- /node_modules
2
- /dist
3
- /.cache
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: 'algolia',
3
- };
@@ -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,5 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "proseWrap": "never",
4
- "trailingComma": "es5"
5
- }
@@ -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.
@@ -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,10 +0,0 @@
1
- body,
2
- h1 {
3
- margin: 0;
4
- padding: 0;
5
- }
6
-
7
- body {
8
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
9
- Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
10
- }
@@ -1,9 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- /node_modules
2
- /dist
3
- /.cache
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: 'algolia',
3
- };
@@ -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,5 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "proseWrap": "never",
4
- "trailingComma": "es5"
5
- }
@@ -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.