\{{{_highlightResult.{{attributesToDisplay.[0]}}.value}}}
27 | {{#each attributesToDisplay}} 28 | {{#unless @first}} 29 |\{{{_highlightResult.{{this}}.value}}}
30 | {{/unless}} 31 | {{/each}} 32 |using 29 | Autocomplete.js 30 |
31 |\{{{_highlightResult.{{this}}.value}}}
30 | {{/unless}} 31 | {{/each}} 32 |25 | {{#helpers.highlight}}{ "attribute": "name" }{{/helpers.highlight}} 26 |
27 | 28 | {{#helpers.snippet}}{ "attribute": "description" }{{/helpers.snippet}} 29 | 30 | `, 31 | }, 32 | }), 33 | ]); 34 | 35 | search.start(); 36 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/src/index.ts.hbs: -------------------------------------------------------------------------------- 1 | export * from './widget'; 2 | export * from './connector'; 3 | export * from './renderer'; 4 | export * from './types'; 5 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/src/widget.ts.hbs: -------------------------------------------------------------------------------- 1 | import { connect{{ pascalCaseName }} } from './connector'; 2 | import { create{{ pascalCaseName }}Renderer } from './renderer'; 3 | import type { 4 | {{ pascalCaseName }}WidgetCreator, 5 | {{ pascalCaseName }}ConnectorParams, 6 | {{ pascalCaseName }}WidgetParams, 7 | } from './types'; 8 | 9 | /* 10 | * Widget creator 11 | * Returns a widget instance 12 | */ 13 | export const {{ camelCaseName }}: {{ pascalCaseName }}WidgetCreator = function {{ pascalCaseName }}( 14 | widgetParams 15 | ) { 16 | const rendererWidgetParams: {{ pascalCaseName }}WidgetParams = { 17 | container: widgetParams.container, 18 | // TODO: pick the widget-only parameters from the widgetParams 19 | }; 20 | 21 | const { render, dispose } = create{{ pascalCaseName }}Renderer( 22 | rendererWidgetParams 23 | ); 24 | 25 | const createWidget = connect{{ pascalCaseName }}(render, dispose); 26 | 27 | const connectorParams: {{ pascalCaseName }}ConnectorParams = { 28 | // TODO: pick the connector-only parameters from the widgetParams 29 | }; 30 | 31 | return { 32 | ...createWidget(connectorParams), 33 | $$widgetType: '{{ widgetType }}', 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/tsconfig.declaration.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "outDir": "dist/_types", 5 | "stripInternal": true, 6 | "noEmit": false, 7 | "declaration": true, 8 | "emitDeclarationOnly": true, 9 | "declarationMap": true 10 | }, 11 | "include": ["src"], 12 | "exclude": ["**/__tests__","**/index.cjs.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "moduleResolution": "node", 5 | "noEmit": true, 6 | "strict": true, 7 | "skipLibCheck": true, 8 | "allowSyntheticDefaultImports": true 9 | }, 10 | "exclude": ["dist"] 11 | } 12 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/vite.config.js: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'url'; 2 | 3 | import typescript from '@rollup/plugin-typescript'; 4 | import apiExtractor from 'rollup-plugin-api-extractor'; 5 | import vite from 'vite'; 6 | 7 | // https://vitejs.dev/config/ 8 | export default vite.defineConfig({ 9 | build: { 10 | lib: { 11 | entry: fileURLToPath(new URL('src/index.ts', import.meta.url)), 12 | name: '{{ pascalCaseName }}', 13 | fileName: 'index', 14 | formats: ['es', 'cjs', 'umd'], 15 | }, 16 | rollupOptions: { 17 | // make sure to externalize deps that shouldn't be bundled 18 | // into your library 19 | external: ['instantsearch.js'], 20 | output: { 21 | globals: { 22 | 'instantsearch.js': 'instantsearch', 23 | }, 24 | }, 25 | }, 26 | }, 27 | plugins: [ 28 | typescript({ tsconfig: 'tsconfig.declaration.json' }), 29 | apiExtractor.apiExtractor(), 30 | ], 31 | }); 32 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.editorconfig: -------------------------------------------------------------------------------- 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 10 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.gitignore.template: -------------------------------------------------------------------------------- 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* 23 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: 'instantsearch.js', 7 | supportedVersion: '>= 3.0.0 < 5.0.0', 8 | flags: { 9 | dynamicWidgets: '>= 4.30', 10 | }, 11 | templateName: 'instantsearch.js', 12 | appName: 'instantsearch.js-app', 13 | keywords: ['algolia', 'InstantSearch', 'Vanilla', 'instantsearch.js'], 14 | tasks: { 15 | install, 16 | teardown, 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/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. 22 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch.js/favicon.png -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "parcel index.html --port 3000", 7 | "build": "parcel build index.html", 8 | "lint": "eslint . && prettier --check .", 9 | "lint:fix": "eslint . --fix && prettier --write ." 10 | }, 11 | "devDependencies": { 12 | "eslint": "8.15.0", 13 | "parcel": "2.0.1", 14 | "prettier": "2.6.2" 15 | }, 16 | "dependencies": { 17 | "algoliasearch": "4", 18 | "instantsearch.js": "{{libraryVersion}}" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/src/app.css: -------------------------------------------------------------------------------- 1 | .header { 2 | display: flex; 3 | align-items: center; 4 | min-height: 50px; 5 | padding: 0.5rem 1rem; 6 | background-image: linear-gradient(284deg, #fedd4e, #fcb43a); 7 | color: #fff; 8 | margin-bottom: 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-title::after { 22 | content: ' ▸ '; 23 | padding: 0 0.5rem; 24 | } 25 | 26 | .header-subtitle { 27 | font-size: 1.2rem; 28 | } 29 | 30 | .container { 31 | max-width: 1200px; 32 | margin: 0 auto; 33 | padding: 1rem; 34 | } 35 | 36 | .search-panel { 37 | display: flex; 38 | } 39 | 40 | .search-panel__filters { 41 | flex: 1; 42 | } 43 | 44 | .search-panel__results { 45 | flex: 3; 46 | } 47 | 48 | .ais-Highlight-highlighted { 49 | color: inherit; 50 | font-size: inherit; 51 | } 52 | 53 | #searchbox { 54 | margin-bottom: 2rem; 55 | } 56 | 57 | #pagination { 58 | margin: 2rem auto; 59 | text-align: center; 60 | } 61 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/src/global.d.ts.hbs: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch/lite'; 2 | import instantsearch from 'instantsearch.js/dist/instantsearch.production.min'; 3 | 4 | declare global { 5 | interface Window { 6 | algoliasearch: typeof algoliasearch; 7 | instantsearch: typeof instantsearch; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/src/index.css: -------------------------------------------------------------------------------- 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 | } 11 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "sourceMap": true, 6 | "allowJs": true, 7 | "lib": [ 8 | "es6", 9 | "dom" 10 | ], 11 | "rootDir": "src", 12 | "moduleResolution": "node" 13 | }, 14 | "include": [ 15 | "src", 16 | "src/global.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.editorconfig: -------------------------------------------------------------------------------- 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 10 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.gitignore.template: -------------------------------------------------------------------------------- 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* 23 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | libraryName: 'algoliasearch', 6 | templateName: 'javascript-client', 7 | appName: 'javascript-client-app', 8 | keywords: ['algolia', 'JavaScript', 'Client', 'algoliasearch'], 9 | tasks: { 10 | install, 11 | teardown, 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/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. 22 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/JavaScript Client/favicon.png -------------------------------------------------------------------------------- /src/templates/JavaScript Client/index.html.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |using the 24 | Algolia Search API Client for JavaScript 25 |
26 |${hit._highlightResult.{{this}}.value}
24 | {{/unless}} 25 | {{/each}} 26 | {{else}} 27 |
28 | ${JSON.stringify(hit).slice(0, 100)}...
29 |
using the 24 | Algolia Search Helper for JavaScript 25 |
26 |${hit._highlightResult.{{this}}.value}
30 | {{/unless}} 31 | {{/each}} 32 | {{else}} 33 |
34 | ${JSON.stringify(hit).slice(0, 100)}...
35 |
using the 24 | Algolia Search Helper for JavaScript 25 |
26 |${hit._highlightResult.{{this}}.value}
30 | {{/unless}} 31 | {{/each}} 32 | {{else}} 33 |
34 | ${JSON.stringify(hit).slice(0, 100)}...
35 |