├── .browserslistrc
├── .circleci
└── config.yml
├── .codesandbox
└── ci.json
├── .editorconfig
├── .env.sample
├── .eslintignore
├── .eslintrc.js
├── .github
├── ISSUE_TEMPLATE
│ ├── Bug_report.md
│ └── config.yml
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── .stylelintrc.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── babel.config.js
├── bundlesize.config.json
├── examples
├── github-notification-filters
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── components
│ │ ├── FilterHeader.tsx
│ │ ├── PanelLayout.tsx
│ │ ├── PostfixItem.tsx
│ │ ├── PrefixItem.tsx
│ │ ├── QueryItem.tsx
│ │ ├── TagItem.tsx
│ │ └── index.ts
│ ├── env.ts
│ ├── favicon.png
│ ├── global.d.ts
│ ├── index.html
│ ├── items.ts
│ ├── package.json
│ ├── searchClient.ts
│ ├── style.css
│ ├── types
│ │ ├── AutocompleteItem.ts
│ │ ├── Contributor.ts
│ │ ├── NotificationFilter.ts
│ │ ├── Repository.ts
│ │ └── index.ts
│ └── utils
│ │ ├── groupBy.ts
│ │ └── index.ts
├── github-repositories-custom-plugin
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── createGitHubReposPlugin.tsx
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── html-templates
│ ├── README.md
│ ├── app.js
│ ├── capture.png
│ ├── env.js
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── instantsearch
│ ├── README.md
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── iphone-banner.png
│ ├── package.json
│ ├── src
│ │ ├── app.ts
│ │ ├── autocomplete.tsx
│ │ ├── debounce.ts
│ │ ├── instantsearch.ts
│ │ ├── isModifierEvent.ts
│ │ └── searchClient.ts
│ └── style.css
├── multiple-datasets-with-headers
│ ├── README.md
│ ├── app.tsx
│ ├── categoriesPlugin.tsx
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── panel-placement
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── playground
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── categoriesPlugin.tsx
│ ├── darkMode.ts
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ ├── shortcutsPlugin.tsx
│ ├── style.css
│ └── types
│ │ ├── Highlighted.ts
│ │ ├── ProductHit.ts
│ │ └── index.ts
├── preview-panel-in-modal
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── query-suggestions-with-categories
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── query-suggestions-with-hits
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ ├── style.css
│ └── types
│ │ ├── ProductHit.ts
│ │ └── index.ts
├── query-suggestions-with-inline-categories
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── query-suggestions-with-recent-searches-and-categories
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── query-suggestions-with-recent-searches
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── query-suggestions
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── react-17
│ ├── .eslintignore
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ ├── favicon.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── Autocomplete.tsx
│ │ ├── ClearIcon.tsx
│ │ ├── Highlight.tsx
│ │ ├── SearchIcon.tsx
│ │ ├── index.css
│ │ └── index.tsx
│ ├── tsconfig.json
│ └── vite.config.ts
├── react-instantsearch
│ ├── .gitignore
│ ├── README.md
│ ├── capture.png
│ ├── index.html
│ ├── package.json
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── components
│ │ │ ├── Autocomplete.tsx
│ │ │ ├── Hit.tsx
│ │ │ └── index.ts
│ │ ├── constants.ts
│ │ ├── favicon.png
│ │ ├── main.tsx
│ │ └── widgets
│ │ │ └── Panel.tsx
│ ├── tsconfig.json
│ └── vite.config.ts
├── react
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ └── favicon.png
│ ├── src
│ │ ├── App.tsx
│ │ ├── index.tsx
│ │ └── styles.css
│ ├── tsconfig.json
│ └── vite.config.ts
├── recently-viewed-items
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ ├── recentlyViewedItemsPlugin.tsx
│ ├── style.css
│ └── types
│ │ ├── Highlighted.ts
│ │ ├── ProductHit.ts
│ │ └── index.ts
├── redirect-url
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── reshape
│ ├── README.md
│ ├── app.tsx
│ ├── env.ts
│ ├── favicon.png
│ ├── functions
│ │ ├── AutocompleteReshapeFunction.ts
│ │ ├── groupBy.ts
│ │ ├── index.ts
│ │ ├── limit.ts
│ │ ├── normalizeReshapeSources.ts
│ │ └── uniqBy.ts
│ ├── index.html
│ ├── package.json
│ ├── productsPlugin.tsx
│ ├── searchClient.ts
│ ├── style.css
│ └── types
│ │ ├── Highlighted.ts
│ │ ├── ProductHit.ts
│ │ └── index.ts
├── slack-with-emojis-and-commands
│ ├── .eslintignore
│ ├── .gitignore
│ ├── README.md
│ ├── capture.png
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ ├── avatar.jpg
│ │ ├── favicon.png
│ │ ├── index.html
│ │ ├── manifest.json
│ │ └── robots.txt
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── Autocomplete.tsx
│ │ ├── commands.tsx
│ │ ├── components
│ │ │ ├── CommandsSource.tsx
│ │ │ ├── EmojisSource.tsx
│ │ │ └── index.ts
│ │ ├── hooks
│ │ │ ├── index.ts
│ │ │ └── useAutocomplete.ts
│ │ ├── index.css
│ │ ├── index.tsx
│ │ ├── types
│ │ │ ├── Command.ts
│ │ │ ├── Emoji.ts
│ │ │ ├── SourceProps.ts
│ │ │ └── index.ts
│ │ └── utils
│ │ │ ├── getActiveToken.ts
│ │ │ ├── getCaretCoordinates.ts
│ │ │ ├── groupBy.ts
│ │ │ ├── index.ts
│ │ │ ├── isValidCommandSlug.ts
│ │ │ ├── isValidEmojiSlug.ts
│ │ │ └── replaceAt.ts
│ ├── tsconfig.json
│ └── vite.config.ts
├── starter-algolia
│ ├── README.md
│ ├── app.tsx
│ ├── capture.jpg
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── starter
│ ├── README.md
│ ├── app.tsx
│ ├── capture.jpg
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ └── style.css
├── tags-in-searchbox
│ ├── README.md
│ ├── app.tsx
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ ├── style.css
│ └── types
│ │ ├── ProductHit.ts
│ │ ├── TagExtraData.ts
│ │ └── index.ts
├── tags-with-hits
│ ├── README.md
│ ├── app.tsx
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ ├── style.css
│ └── types
│ │ ├── ProductHit.ts
│ │ ├── TagExtraData.ts
│ │ └── index.ts
├── twitter-compose-with-typeahead
│ ├── .eslintignore
│ ├── .gitignore
│ ├── README.md
│ ├── capture.png
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ ├── favicon.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── Autocomplete.tsx
│ │ ├── hooks
│ │ │ ├── index.ts
│ │ │ └── useAutocomplete.ts
│ │ ├── index.css
│ │ ├── index.tsx
│ │ ├── types
│ │ │ ├── Account.ts
│ │ │ ├── AutocompleteItem.ts
│ │ │ └── index.ts
│ │ └── utils
│ │ │ ├── getActiveToken.ts
│ │ │ ├── index.ts
│ │ │ ├── isValidTwitterUsername.ts
│ │ │ └── replaceAt.ts
│ ├── tsconfig.json
│ └── vite.config.ts
├── two-column-layout
│ ├── .gitignore
│ ├── README.md
│ ├── capture.png
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ ├── src
│ │ ├── app.tsx
│ │ ├── components
│ │ │ ├── Blurhash.tsx
│ │ │ ├── Breadcrumb.tsx
│ │ │ ├── Icons.tsx
│ │ │ └── index.ts
│ │ ├── constants.ts
│ │ ├── functions
│ │ │ ├── createFillWith.ts
│ │ │ ├── index.ts
│ │ │ ├── normalizeReshapeSources.ts
│ │ │ └── uniqBy.ts
│ │ ├── plugins
│ │ │ ├── articlesPlugin.tsx
│ │ │ ├── brandsPlugin.tsx
│ │ │ ├── categoriesPlugin.tsx
│ │ │ ├── faqPlugin.tsx
│ │ │ ├── popularCategoriesPlugin.tsx
│ │ │ ├── popularPlugin.tsx
│ │ │ ├── productsPlugin.tsx
│ │ │ ├── querySuggestionsPlugin.tsx
│ │ │ ├── quickAccessPlugin.tsx
│ │ │ └── recentSearchesPlugin.tsx
│ │ ├── searchClient.ts
│ │ ├── types
│ │ │ ├── ArticleHit.ts
│ │ │ ├── AutocompleteHit.ts
│ │ │ ├── AutocompleteReshapeFunction.ts
│ │ │ ├── BrandHit.ts
│ │ │ ├── CategoryHit.ts
│ │ │ ├── FaqHit.ts
│ │ │ ├── PopularCategoryHit.ts
│ │ │ ├── PopularHit.ts
│ │ │ ├── ProductHit.ts
│ │ │ ├── QuickAccessHit.ts
│ │ │ └── index.ts
│ │ └── utils
│ │ │ ├── cx.ts
│ │ │ ├── hasSourceActiveItem.ts
│ │ │ ├── index.ts
│ │ │ ├── intersperse.ts
│ │ │ ├── isDetached.ts
│ │ │ └── isTouchDevice.ts
│ └── style.css
├── voice-search
│ ├── README.md
│ ├── app.tsx
│ ├── capture.png
│ ├── env.ts
│ ├── favicon.png
│ ├── index.html
│ ├── package.json
│ ├── style.css
│ ├── voiceSearchApi.ts
│ └── voiceSearchPlugin.tsx
├── vue-instantsearch
│ ├── .gitignore
│ ├── .prettierrc
│ ├── README.md
│ ├── babel.config.js
│ ├── capture.png
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ └── favicon.png
│ ├── src
│ │ ├── App.vue
│ │ ├── Autocomplete.vue
│ │ ├── constants.js
│ │ ├── main.js
│ │ ├── searchClient.js
│ │ └── utils
│ │ │ └── createElement.js
│ └── vite.config.js
└── vue
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package.json
│ ├── public
│ └── favicon.png
│ ├── src
│ ├── App.vue
│ ├── components
│ │ └── ProductItem.vue
│ ├── main.js
│ └── utils
│ │ └── createElement.js
│ ├── style.css
│ └── vite.config.js
├── global.d.ts
├── jest.config.js
├── lerna.json
├── media
├── banner.png
├── illustration.png
├── screenshot.png
└── showcase
│ ├── algolia-documentation.png
│ └── docsearch.png
├── netlify.toml
├── package.json
├── packages
├── autocomplete-core
│ ├── README.md
│ ├── package.json
│ ├── rollup.config.js
│ ├── src
│ │ ├── __tests__
│ │ │ ├── autoFocus.test.ts
│ │ │ ├── completion.test.ts
│ │ │ ├── concurrency.test.ts
│ │ │ ├── createAutocomplete.test.ts
│ │ │ ├── debouncing.test.ts
│ │ │ ├── debug.test.ts
│ │ │ ├── defaultSelectedItemId.test.ts
│ │ │ ├── environment.test.ts
│ │ │ ├── getEnvironmentProps.test.ts
│ │ │ ├── getFormProps.test.ts
│ │ │ ├── getInputProps.test.ts
│ │ │ ├── getItemProps.test.ts
│ │ │ ├── getLabelProps.test.ts
│ │ │ ├── getListProps.test.ts
│ │ │ ├── getPanelProps.test.ts
│ │ │ ├── getRootProps.test.ts
│ │ │ ├── getSources.test.ts
│ │ │ ├── id.test.ts
│ │ │ ├── initialState.test.ts
│ │ │ ├── metadata.test.ts
│ │ │ ├── navigator.test.ts
│ │ │ ├── onReset.test.ts
│ │ │ ├── onStateChange.test.ts
│ │ │ ├── onSubmit.test.ts
│ │ │ ├── openOnFocus.test.ts
│ │ │ ├── placeholder.test.ts
│ │ │ ├── plugins.test.ts
│ │ │ ├── refresh.test.ts
│ │ │ ├── reshape.test.ts
│ │ │ ├── setCollections.test.ts
│ │ │ ├── setContext.test.ts
│ │ │ ├── setIsOpen.test.ts
│ │ │ ├── setQuery.test.ts
│ │ │ ├── setSelectedItemId.test.ts
│ │ │ ├── setStatus.test.ts
│ │ │ └── stallThreshold.test.ts
│ │ ├── checkOptions.ts
│ │ ├── createAutocomplete.ts
│ │ ├── createStore.ts
│ │ ├── getAutocompleteSetters.ts
│ │ ├── getCompletion.ts
│ │ ├── getDefaultProps.ts
│ │ ├── getPropGetters.ts
│ │ ├── index.ts
│ │ ├── metadata.ts
│ │ ├── onInput.ts
│ │ ├── onKeyDown.ts
│ │ ├── reshape.ts
│ │ ├── resolve.ts
│ │ ├── stateReducer.ts
│ │ ├── types
│ │ │ ├── AutocompleteStore.ts
│ │ │ ├── AutocompleteSubscribers.ts
│ │ │ └── index.ts
│ │ └── utils
│ │ │ ├── __tests__
│ │ │ ├── createCancelablePromise.test.ts
│ │ │ ├── createCancelablePromiseList.test.ts
│ │ │ ├── createConcurrentSafePromise.test.ts
│ │ │ ├── getActiveItem.test.ts
│ │ │ ├── getNextActiveItemId.test.ts
│ │ │ ├── getNormalizedSources.test.ts
│ │ │ ├── getPluginSubmitPromise.test.ts
│ │ │ ├── isOrContainsNode.test.ts
│ │ │ ├── isSamsung.test.ts
│ │ │ └── mapToAlgoliaResponse.test.ts
│ │ │ ├── createCancelablePromise.ts
│ │ │ ├── createCancelablePromiseList.ts
│ │ │ ├── createConcurrentSafePromise.ts
│ │ │ ├── getActiveItem.ts
│ │ │ ├── getAutocompleteElementId.ts
│ │ │ ├── getNativeEvent.ts
│ │ │ ├── getNextActiveItemId.ts
│ │ │ ├── getNormalizedSources.ts
│ │ │ ├── getPluginSubmitPromise.ts
│ │ │ ├── index.ts
│ │ │ ├── isOrContainsNode.ts
│ │ │ ├── isSamsung.ts
│ │ │ └── mapToAlgoliaResponse.ts
│ └── tsconfig.declaration.json
├── autocomplete-js
│ ├── README.md
│ ├── global.d.ts
│ ├── package.json
│ ├── rollup.config.js
│ ├── src
│ │ ├── __tests__
│ │ │ ├── api.test.ts
│ │ │ ├── autocomplete.test.ts
│ │ │ ├── classNames.test.ts
│ │ │ ├── components.test.tsx
│ │ │ ├── container.test.ts
│ │ │ ├── createEffectWrapper.test.ts
│ │ │ ├── createReactiveWrapper.test.ts
│ │ │ ├── detached.test.ts
│ │ │ ├── detachedMediaQuery.test.ts
│ │ │ ├── fixtures
│ │ │ │ ├── products.json
│ │ │ │ └── query-suggestions.json
│ │ │ ├── getEnvironmentProps.test.ts
│ │ │ ├── getFormProps.test.ts
│ │ │ ├── getInputProps.test.ts
│ │ │ ├── getItemProps.test.ts
│ │ │ ├── getLabelProps.test.ts
│ │ │ ├── getListProps.test.ts
│ │ │ ├── getPanelProps.test.ts
│ │ │ ├── getRootProps.test.ts
│ │ │ ├── metadata.test.ts
│ │ │ ├── panelContainer.test.ts
│ │ │ ├── panelPlacement.test.ts
│ │ │ ├── positioning.test.ts
│ │ │ ├── render.test.ts
│ │ │ ├── renderNoResults.test.ts
│ │ │ ├── renderer.test.ts
│ │ │ ├── requester.test.ts
│ │ │ ├── templates.test.tsx
│ │ │ └── translations.test.ts
│ │ ├── autocomplete.ts
│ │ ├── components
│ │ │ ├── Highlight.ts
│ │ │ ├── ReverseHighlight.ts
│ │ │ ├── ReverseSnippet.ts
│ │ │ ├── Snippet.ts
│ │ │ └── index.ts
│ │ ├── createAutocompleteDom.ts
│ │ ├── createEffectWrapper.ts
│ │ ├── createReactiveWrapper.ts
│ │ ├── elements
│ │ │ ├── ClearIcon.ts
│ │ │ ├── Input.ts
│ │ │ ├── LoadingIcon.ts
│ │ │ ├── SearchIcon.ts
│ │ │ └── index.ts
│ │ ├── getCreateDomElement.ts
│ │ ├── getDefaultOptions.ts
│ │ ├── getPanelPlacementStyle.ts
│ │ ├── index.ts
│ │ ├── render.tsx
│ │ ├── requesters
│ │ │ ├── __tests__
│ │ │ │ ├── getAlgoliaFacets.test.ts
│ │ │ │ └── getAlgoliaResults.test.ts
│ │ │ ├── createAlgoliaRequester.ts
│ │ │ ├── getAlgoliaFacets.ts
│ │ │ ├── getAlgoliaResults.ts
│ │ │ └── index.ts
│ │ ├── types
│ │ │ ├── AutocompleteApi.ts
│ │ │ ├── AutocompleteDom.ts
│ │ │ ├── AutocompleteElement.ts
│ │ │ └── index.ts
│ │ ├── userAgents.ts
│ │ └── utils
│ │ │ ├── __tests__
│ │ │ ├── getHTMLElement.test.ts
│ │ │ ├── mergeDeep.test.ts
│ │ │ └── pickBy.test.ts
│ │ │ ├── getHTMLElement.ts
│ │ │ ├── index.ts
│ │ │ ├── mergeClassNames.ts
│ │ │ ├── mergeDeep.ts
│ │ │ ├── pickBy.ts
│ │ │ └── setProperties.ts
│ └── tsconfig.declaration.json
├── autocomplete-plugin-algolia-insights
│ ├── README.md
│ ├── package.json
│ ├── rollup.config.js
│ ├── src
│ │ ├── __tests__
│ │ │ ├── createAlgoliaInsightsPlugin.test.ts
│ │ │ └── createSearchInsightsApi.test.ts
│ │ ├── createAlgoliaInsightsPlugin.ts
│ │ ├── createClickedEvent.ts
│ │ ├── createSearchInsightsApi.ts
│ │ ├── createViewedEvents.ts
│ │ ├── index.d.ts
│ │ ├── index.ts
│ │ ├── isAlgoliaInsightsHit.ts
│ │ ├── isModernInsightsClient.ts
│ │ └── types
│ │ │ ├── AlgoliaInsightsHit.ts
│ │ │ ├── AutocompleteInsightsApi.ts
│ │ │ ├── EventParams.ts
│ │ │ ├── InsightsClient.ts
│ │ │ └── index.ts
│ └── tsconfig.declaration.json
├── autocomplete-plugin-query-suggestions
│ ├── README.md
│ ├── package.json
│ ├── rollup.config.js
│ ├── src
│ │ ├── __tests__
│ │ │ └── createQuerySuggestionsPlugin.test.ts
│ │ ├── constants.ts
│ │ ├── createQuerySuggestionsPlugin.ts
│ │ ├── getTemplates.tsx
│ │ ├── index.ts
│ │ └── types
│ │ │ ├── QuerySuggestionsHit.ts
│ │ │ ├── Translations.ts
│ │ │ └── index.ts
│ └── tsconfig.declaration.json
├── autocomplete-plugin-recent-searches
│ ├── README.md
│ ├── package.json
│ ├── rollup.config.js
│ ├── src
│ │ ├── __tests__
│ │ │ ├── createLocalStorageRecentSearchesPlugin.test.ts
│ │ │ └── createRecentSearchesPlugin.test.ts
│ │ ├── addHighlightedAttribute.ts
│ │ ├── constants.ts
│ │ ├── createLocalStorage.ts
│ │ ├── createLocalStorageRecentSearchesPlugin.ts
│ │ ├── createRecentSearchesPlugin.ts
│ │ ├── createStorageApi.ts
│ │ ├── getLocalStorage.ts
│ │ ├── getTemplates.tsx
│ │ ├── index.ts
│ │ ├── search.ts
│ │ └── types
│ │ │ ├── Highlighted.ts
│ │ │ ├── HistoryItem.ts
│ │ │ ├── RecentSearchesItem.ts
│ │ │ ├── Storage.ts
│ │ │ ├── StorageApi.ts
│ │ │ ├── Translations.ts
│ │ │ └── index.ts
│ └── tsconfig.declaration.json
├── autocomplete-plugin-redirect-url
│ ├── README.md
│ ├── package.json
│ ├── rollup.config.js
│ ├── src
│ │ ├── __tests__
│ │ │ └── createRedirectUrlPlugin.test.ts
│ │ ├── createRedirectUrlPlugin.ts
│ │ ├── index.ts
│ │ ├── templates.tsx
│ │ └── types
│ │ │ ├── Redirect.ts
│ │ │ └── index.ts
│ └── tsconfig.declaration.json
├── autocomplete-plugin-tags
│ ├── README.md
│ ├── package.json
│ ├── rollup.config.js
│ ├── src
│ │ ├── __tests__
│ │ │ └── createTagsPlugin.test.tsx
│ │ ├── createTags.ts
│ │ ├── createTagsPlugin.tsx
│ │ ├── index.ts
│ │ ├── theme.scss
│ │ └── types
│ │ │ ├── Tag.ts
│ │ │ └── index.ts
│ └── tsconfig.declaration.json
├── autocomplete-preset-algolia
│ ├── README.md
│ ├── package.json
│ ├── rollup.config.js
│ ├── src
│ │ ├── constants
│ │ │ └── index.ts
│ │ ├── highlight
│ │ │ ├── HighlightedHit.ts
│ │ │ ├── ParseAlgoliaHitParams.ts
│ │ │ ├── ParsedAttribute.ts
│ │ │ ├── SnippetedHit.ts
│ │ │ ├── __tests__
│ │ │ │ ├── isPartHighlighted.test.ts
│ │ │ │ ├── parseAlgoliaHitHighlight.test.ts
│ │ │ │ ├── parseAlgoliaHitReverseHighlight.test.ts
│ │ │ │ ├── parseAlgoliaHitReverseSnippet.test.ts
│ │ │ │ ├── parseAlgoliaHitSnippet.test.ts
│ │ │ │ ├── parseAttribute.test.ts
│ │ │ │ └── reverseHighlightedParts.test.ts
│ │ │ ├── index.ts
│ │ │ ├── isPartHighlighted.ts
│ │ │ ├── parseAlgoliaHitHighlight.ts
│ │ │ ├── parseAlgoliaHitReverseHighlight.ts
│ │ │ ├── parseAlgoliaHitReverseSnippet.ts
│ │ │ ├── parseAlgoliaHitSnippet.ts
│ │ │ ├── parseAttribute.ts
│ │ │ └── reverseHighlightedParts.ts
│ │ ├── index.ts
│ │ ├── requester
│ │ │ ├── __tests__
│ │ │ │ ├── createRequester.test.ts
│ │ │ │ ├── getAlgoliaFacets.test.ts
│ │ │ │ └── getAlgoliaResults.test.ts
│ │ │ ├── createAlgoliaRequester.ts
│ │ │ ├── createRequester.ts
│ │ │ ├── getAlgoliaFacets.ts
│ │ │ ├── getAlgoliaResults.ts
│ │ │ └── index.ts
│ │ ├── search
│ │ │ ├── __tests__
│ │ │ │ └── fetchAlgoliaResults.test.ts
│ │ │ ├── fetchAlgoliaResults.ts
│ │ │ └── index.ts
│ │ ├── types
│ │ │ └── index.ts
│ │ └── utils
│ │ │ ├── __tests__
│ │ │ └── getAppIdAndApiKey.test.ts
│ │ │ ├── getAppIdAndApiKey.ts
│ │ │ └── index.ts
│ └── tsconfig.declaration.json
├── autocomplete-shared
│ ├── global.d.ts
│ ├── package.json
│ ├── src
│ │ ├── MaybePromise.ts
│ │ ├── SearchResponse.ts
│ │ ├── UserAgent.ts
│ │ ├── __tests__
│ │ │ ├── createRef.test.ts
│ │ │ ├── debounce.test.ts
│ │ │ ├── decycle.test.ts
│ │ │ ├── flatten.test.ts
│ │ │ ├── getItemsCount.test.ts
│ │ │ ├── invariant.test.ts
│ │ │ ├── isEqual.test.ts
│ │ │ ├── noop.test.ts
│ │ │ ├── safelyRunOnBrowser.test.ts
│ │ │ └── warn.test.ts
│ │ ├── core
│ │ │ ├── AutocompleteApi.ts
│ │ │ ├── AutocompleteCollection.ts
│ │ │ ├── AutocompleteContext.ts
│ │ │ ├── AutocompleteEnvironment.ts
│ │ │ ├── AutocompleteNavigator.ts
│ │ │ ├── AutocompleteOptions.ts
│ │ │ ├── AutocompletePlugin.ts
│ │ │ ├── AutocompletePropGetters.ts
│ │ │ ├── AutocompleteReshape.ts
│ │ │ ├── AutocompleteSetters.ts
│ │ │ ├── AutocompleteSource.ts
│ │ │ ├── AutocompleteState.ts
│ │ │ └── index.ts
│ │ ├── createRef.ts
│ │ ├── debounce.ts
│ │ ├── decycle.ts
│ │ ├── flatten.ts
│ │ ├── generateAutocompleteId.ts
│ │ ├── getAttributeValueByPath.ts
│ │ ├── getItemsCount.ts
│ │ ├── index.ts
│ │ ├── invariant.ts
│ │ ├── isEqual.ts
│ │ ├── js
│ │ │ ├── AutocompleteClassNames.ts
│ │ │ ├── AutocompleteCollection.ts
│ │ │ ├── AutocompleteComponents.ts
│ │ │ ├── AutocompleteOptions.ts
│ │ │ ├── AutocompletePlugin.ts
│ │ │ ├── AutocompletePropGetters.ts
│ │ │ ├── AutocompleteRender.ts
│ │ │ ├── AutocompleteRenderer.ts
│ │ │ ├── AutocompleteSource.ts
│ │ │ ├── AutocompleteState.ts
│ │ │ ├── AutocompleteTranslations.ts
│ │ │ ├── HighlightHitParams.ts
│ │ │ └── index.ts
│ │ ├── noop.ts
│ │ ├── preset-algolia
│ │ │ ├── algoliasearch.ts
│ │ │ └── createRequester.ts
│ │ ├── safelyRunOnBrowser.ts
│ │ ├── userAgents.ts
│ │ ├── version.ts
│ │ └── warn.ts
│ └── tsconfig.declaration.json
└── autocomplete-theme-classic
│ ├── README.md
│ ├── package.json
│ └── src
│ └── theme.scss
├── postcss.config.mjs
├── renovate.json
├── scripts
├── babel
│ ├── __tests__
│ │ └── wrap-warning-with-dev-check.test.js
│ └── wrap-warning-with-dev-check.js
├── buildCss.mjs
├── getBundleBanner.mjs
├── jest
│ ├── matchers
│ │ ├── __tests__
│ │ │ └── toWarnDev.test.ts
│ │ ├── index.ts
│ │ ├── toWarnDev.d.ts
│ │ └── toWarnDev.ts
│ └── setupTests.ts
└── rollup
│ └── config.js
├── ship.config.js
├── test
├── umd.test.ts
├── utils
│ ├── castToJestMock.ts
│ ├── createApiResponse.ts
│ ├── createCollection.ts
│ ├── createMatchMedia.ts
│ ├── createNavigator.ts
│ ├── createPlayground.ts
│ ├── createScopeApi.ts
│ ├── createSearchClient.ts
│ ├── createSource.ts
│ ├── createState.ts
│ ├── defer.ts
│ ├── index.ts
│ └── runAllMicroTasks.ts
└── versions
│ └── index.js
├── tsconfig.declaration.json
├── tsconfig.json
├── website
└── _redirects
└── yarn.lock
/.browserslistrc:
--------------------------------------------------------------------------------
1 | defaults
2 |
--------------------------------------------------------------------------------
/.codesandbox/ci.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": ["packages/autocomplete-*"],
3 | "buildCommand": false,
4 | "^": "buildCommand is false because `yarn prepare` is going to build packages anyway.",
5 | "sandboxes": [
6 | "/examples/github-repositories-custom-plugin",
7 | "/examples/instantsearch",
8 | "/examples/playground",
9 | "/examples/preview-panel-in-modal",
10 | "/examples/react-renderer",
11 | "/examples/starter-algolia",
12 | "/examples/starter",
13 | "/examples/reshape",
14 | "/examples/vue"
15 | ],
16 | "node": "14"
17 | }
18 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | insert_final_newline = true
8 | trim_trailing_whitespace = true
9 |
--------------------------------------------------------------------------------
/.env.sample:
--------------------------------------------------------------------------------
1 | GITHUB_TOKEN=
2 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | .cache
2 | .parcel-cache
3 | build
4 | coverage
5 | dist
6 | node_modules
7 | examples/twitter-compose-with-typeahead
8 | examples/slack-with-emojis-and-commands
9 | examples/react-instantsearch
10 | examples/vue-instantsearch
11 | examples/react
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/Bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Help us improve Autocomplete.
4 | ---
5 |
6 | ## Description
7 |
8 |
9 |
10 | ## Reproduction
11 |
12 |
13 |
14 | [**Preview →**](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx)
15 |
16 | **Steps**
17 |
18 | 1. Go to `...`
19 | 2. Click on `...`
20 | 3. Scroll down to `...`
21 | 4. See error
22 |
23 | ## Expected behavior
24 |
25 |
26 |
27 | ## Environment
28 |
29 | - OS: [e.g. Windows / Linux / macOS / iOS / Android]
30 | - Browser: [e.g. Chrome, Safari]
31 | - Autocomplete version: [e.g. 1.0.0]
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Feature request
4 | url: https://github.com/algolia/autocomplete/discussions/new
5 | about: Request a feature to add to Autocomplete.
6 | - name: Ask a question
7 | url: https://github.com/algolia/autocomplete/discussions/new
8 | about: Ask questions and discuss with other community members.
9 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | **Summary**
7 |
8 |
13 |
14 | **Result**
15 |
16 |
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Generated files
2 | node_modules/
3 | .DS_Store
4 | .eslintcache
5 | *.log
6 | coverage/
7 | .cache
8 | .parcel-cache
9 |
10 | # Bundle build files
11 | dist/
12 |
13 | # IDE
14 | .vscode/
15 | .idea/
16 |
17 | # Environment files
18 | .env
19 |
20 | !examples/*/.env
21 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | 14.21.1
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .cache
2 | .parcel-cache
3 | build
4 | coverage
5 | dist
6 | node_modules
7 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "proseWrap": "never",
3 | "singleQuote": true,
4 | "trailingComma": "es5"
5 | }
6 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/github-notification-filters/capture.png
--------------------------------------------------------------------------------
/examples/github-notification-filters/components/FilterHeader.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxRuntime classic */
2 | /** @jsx h */
3 | import { h, Fragment } from 'preact';
4 |
5 | export function FilterHeader() {
6 | return (
7 |
8 | Available filters
9 |
10 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/components/PrefixItem.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxRuntime classic */
2 | /** @jsx h */
3 | import { h } from 'preact';
4 |
5 | import { AutocompleteItem } from '../types';
6 |
7 | type PrefixItemProps = {
8 | item: AutocompleteItem;
9 | };
10 |
11 | export function PrefixItem({ item }: PrefixItemProps) {
12 | return (
13 |
14 |
15 |
16 |
17 | {item.token}: {item.label}
18 |
19 |
20 |
21 |
22 | );
23 | }
24 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/components/QueryItem.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxRuntime classic */
2 | /** @jsx h */
3 | import { h } from 'preact';
4 |
5 | type QueryItemProps = {
6 | query: string;
7 | };
8 |
9 | export function QueryItem({ query }: QueryItemProps) {
10 | return (
11 |
12 |
13 |
14 |
15 | {query} - submit
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/components/index.ts:
--------------------------------------------------------------------------------
1 | export * from './FilterHeader';
2 | export * from './PanelLayout';
3 | export * from './PostfixItem';
4 | export * from './PrefixItem';
5 | export * from './QueryItem';
6 | export * from './TagItem';
7 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/github-notification-filters/favicon.png
--------------------------------------------------------------------------------
/examples/github-notification-filters/global.d.ts:
--------------------------------------------------------------------------------
1 | import { TagsApi } from '@algolia/autocomplete-plugin-tags';
2 |
3 | import { NotificationFilter } from './types';
4 |
5 | declare module '@algolia/autocomplete-core' {
6 | interface AutocompleteContext {
7 | tagsPlugin: TagsApi;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | GitHub notification filters | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@algolia/autocomplete-example-github-notification-filters",
3 | "description": "Autocomplete example with GitHub notification filters",
4 | "version": "1.19.2",
5 | "private": true,
6 | "license": "MIT",
7 | "scripts": {
8 | "build": "parcel build index.html",
9 | "start": "parcel index.html"
10 | },
11 | "dependencies": {
12 | "@algolia/autocomplete-js": "1.19.2",
13 | "@algolia/autocomplete-plugin-tags": "1.19.2",
14 | "@algolia/autocomplete-theme-classic": "1.19.1",
15 | "algoliasearch": "4.16.0",
16 | "preact": "10.13.2",
17 | "qs": "6.11.1"
18 | },
19 | "devDependencies": {
20 | "parcel": "2.8.3"
21 | },
22 | "keywords": [
23 | "algolia",
24 | "autocomplete",
25 | "javascript"
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/searchClient.ts:
--------------------------------------------------------------------------------
1 | import algoliasearch from 'algoliasearch/lite';
2 |
3 | const appId = 'latency';
4 | const apiKey = '147a0e7dbc37d4c4dec9ec31b0f68716';
5 |
6 | export const searchClient = algoliasearch(appId, apiKey);
7 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/types/AutocompleteItem.ts:
--------------------------------------------------------------------------------
1 | export type AutocompleteItem = {
2 | token: string;
3 | label: string;
4 | attribute: string;
5 | };
6 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/types/Contributor.ts:
--------------------------------------------------------------------------------
1 | export type Contributor = {
2 | login: string;
3 | org: string;
4 | avatar_url: string;
5 | id: number;
6 | };
7 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/types/NotificationFilter.ts:
--------------------------------------------------------------------------------
1 | export type NotificationFilter = {
2 | token: string;
3 | value: string;
4 | attribute: string;
5 | };
6 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/types/Repository.ts:
--------------------------------------------------------------------------------
1 | export type Repository = {
2 | name: string;
3 | description: string;
4 | stargazers_count: number;
5 | forks: number;
6 | language: string;
7 | owner: string;
8 | topics: string[];
9 | created_at: string;
10 | default_branch: string;
11 | homepage: string;
12 | html_url: string;
13 | id: number;
14 | license: string;
15 | open_issues: number;
16 | watchers: number;
17 | };
18 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './AutocompleteItem';
2 | export * from './Contributor';
3 | export * from './NotificationFilter';
4 | export * from './Repository';
5 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/utils/groupBy.ts:
--------------------------------------------------------------------------------
1 | export function groupBy(
2 | collection: TValue[],
3 | iteratee: (item: TValue) => TKey
4 | ) {
5 | return collection.reduce>((acc, item) => {
6 | const key = iteratee(item);
7 |
8 | if (!acc.hasOwnProperty(key)) {
9 | acc[key] = [];
10 | }
11 |
12 | acc[key].push(item);
13 |
14 | return acc;
15 | }, {} as any);
16 | }
17 |
--------------------------------------------------------------------------------
/examples/github-notification-filters/utils/index.ts:
--------------------------------------------------------------------------------
1 | export * from './groupBy';
2 |
--------------------------------------------------------------------------------
/examples/github-repositories-custom-plugin/app.tsx:
--------------------------------------------------------------------------------
1 | import { autocomplete } from '@algolia/autocomplete-js';
2 |
3 | import { createGitHubReposPlugin } from './createGitHubReposPlugin';
4 |
5 | import '@algolia/autocomplete-theme-classic';
6 |
7 | const gitHubReposPlugin = createGitHubReposPlugin({
8 | // eslint-disable-next-line @typescript-eslint/camelcase
9 | per_page: 5,
10 | });
11 |
12 | autocomplete({
13 | container: '#autocomplete',
14 | placeholder: 'Search repositories',
15 | plugins: [gitHubReposPlugin],
16 | });
17 |
--------------------------------------------------------------------------------
/examples/github-repositories-custom-plugin/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/github-repositories-custom-plugin/capture.png
--------------------------------------------------------------------------------
/examples/github-repositories-custom-plugin/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/github-repositories-custom-plugin/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/github-repositories-custom-plugin/favicon.png
--------------------------------------------------------------------------------
/examples/github-repositories-custom-plugin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Custom GitHub Repositories plugin | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/github-repositories-custom-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@algolia/autocomplete-example-github-repositories-custom-plugin",
3 | "description": "Autocomplete example with custom GitHub Repositories plugin",
4 | "version": "1.19.2",
5 | "private": true,
6 | "license": "MIT",
7 | "scripts": {
8 | "build": "parcel build index.html",
9 | "start": "parcel index.html"
10 | },
11 | "dependencies": {
12 | "@algolia/autocomplete-js": "1.19.2",
13 | "@algolia/autocomplete-theme-classic": "1.19.1",
14 | "preact": "10.13.2",
15 | "qs": "6.11.1"
16 | },
17 | "devDependencies": {
18 | "@types/debounce-promise": "^3.1.6",
19 | "@types/qs": "^6.9.6",
20 | "parcel": "2.8.3"
21 | },
22 | "keywords": [
23 | "algolia",
24 | "autocomplete",
25 | "javascript"
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/examples/github-repositories-custom-plugin/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/html-templates/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/html-templates/capture.png
--------------------------------------------------------------------------------
/examples/html-templates/env.js:
--------------------------------------------------------------------------------
1 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
2 | // apply the Babel config. We therefore need to manually override the constants
3 | // in the app.
4 | // See https://twitter.com/devongovett/status/1134231234605830144
5 | global.__DEV__ = process.env.NODE_ENV !== 'production';
6 | global.__TEST__ = false;
7 |
--------------------------------------------------------------------------------
/examples/html-templates/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/html-templates/favicon.png
--------------------------------------------------------------------------------
/examples/html-templates/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | HTML Templates | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/html-templates/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@algolia/autocomplete-example-html-templates",
3 | "description": "Autocomplete example with HTML templates",
4 | "version": "1.19.2",
5 | "private": true,
6 | "license": "MIT",
7 | "scripts": {
8 | "build": "parcel build index.html",
9 | "start": "parcel index.html"
10 | },
11 | "dependencies": {
12 | "@algolia/autocomplete-js": "1.19.2",
13 | "@algolia/autocomplete-theme-classic": "1.19.1",
14 | "algoliasearch": "4.16.0"
15 | },
16 | "devDependencies": {
17 | "@algolia/client-search": "4.16.0",
18 | "parcel": "2.8.3"
19 | },
20 | "keywords": [
21 | "algolia",
22 | "autocomplete",
23 | "javascript"
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/examples/html-templates/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/instantsearch/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/instantsearch/capture.png
--------------------------------------------------------------------------------
/examples/instantsearch/env.ts:
--------------------------------------------------------------------------------
1 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
2 | // apply the Babel config. We therefore need to manually override the constants
3 | // in the app, as well as the React pragmas.
4 | // See https://twitter.com/devongovett/status/1134231234605830144
5 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
6 | (global as any).__TEST__ = false;
7 |
--------------------------------------------------------------------------------
/examples/instantsearch/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/instantsearch/favicon.png
--------------------------------------------------------------------------------
/examples/instantsearch/iphone-banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/instantsearch/iphone-banner.png
--------------------------------------------------------------------------------
/examples/instantsearch/src/app.ts:
--------------------------------------------------------------------------------
1 | import '@algolia/autocomplete-theme-classic';
2 | import '../style.css';
3 |
4 | import { startAutocomplete } from './autocomplete';
5 | import { search } from './instantsearch';
6 |
7 | search.start();
8 | startAutocomplete(search);
9 |
--------------------------------------------------------------------------------
/examples/instantsearch/src/debounce.ts:
--------------------------------------------------------------------------------
1 | export function debounce(
2 | fn: (...params: TParams[]) => void,
3 | time: number
4 | ) {
5 | let timerId: ReturnType | undefined = undefined;
6 |
7 | return function (...args: TParams[]) {
8 | if (timerId) {
9 | clearTimeout(timerId);
10 | }
11 |
12 | timerId = setTimeout(() => fn(...args), time);
13 | };
14 | }
15 |
--------------------------------------------------------------------------------
/examples/instantsearch/src/isModifierEvent.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Detect when an event is modified with a special key to let the browser
3 | * trigger its default behavior.
4 | */
5 | export function isModifierEvent(
6 | event: TEvent
7 | ): boolean {
8 | const isMiddleClick = (event as MouseEvent).button === 1;
9 |
10 | return (
11 | isMiddleClick ||
12 | event.altKey ||
13 | event.ctrlKey ||
14 | event.metaKey ||
15 | event.shiftKey
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/examples/instantsearch/src/searchClient.ts:
--------------------------------------------------------------------------------
1 | import algoliasearch from 'algoliasearch/lite';
2 |
3 | export const searchClient = algoliasearch(
4 | 'latency',
5 | '6be0576ff61c053d5f9a3225e2a90f76'
6 | );
7 |
--------------------------------------------------------------------------------
/examples/multiple-datasets-with-headers/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/multiple-datasets-with-headers/README.md
--------------------------------------------------------------------------------
/examples/multiple-datasets-with-headers/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/multiple-datasets-with-headers/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/multiple-datasets-with-headers/favicon.png
--------------------------------------------------------------------------------
/examples/multiple-datasets-with-headers/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Multiple Datasets With Headers
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/multiple-datasets-with-headers/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/panel-placement/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/panel-placement/capture.png
--------------------------------------------------------------------------------
/examples/panel-placement/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/panel-placement/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/panel-placement/favicon.png
--------------------------------------------------------------------------------
/examples/panel-placement/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@algolia/autocomplete-example-panel-placement",
3 | "description": "Autocomplete panel placement example",
4 | "version": "1.19.2",
5 | "private": true,
6 | "license": "MIT",
7 | "scripts": {
8 | "build": "parcel build index.html",
9 | "start": "parcel index.html"
10 | },
11 | "dependencies": {
12 | "@algolia/autocomplete-core": "1.19.1",
13 | "@algolia/autocomplete-js": "1.19.2",
14 | "@algolia/autocomplete-theme-classic": "1.19.1",
15 | "algoliasearch": "4.16.0",
16 | "preact": "10.13.2"
17 | },
18 | "devDependencies": {
19 | "@algolia/client-search": "4.16.0",
20 | "parcel": "2.8.3"
21 | },
22 | "keywords": [
23 | "algolia",
24 | "autocomplete",
25 | "javascript"
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/examples/panel-placement/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | width: 100%;
19 | display: grid;
20 | grid-template-columns: 400px 1fr 400px;
21 | grid-gap: 10px;
22 | }
23 |
24 | .action {
25 | align-content: center;
26 | }
27 |
--------------------------------------------------------------------------------
/examples/playground/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/playground/capture.png
--------------------------------------------------------------------------------
/examples/playground/darkMode.ts:
--------------------------------------------------------------------------------
1 | function initTheme() {
2 | if (isDarkThemeSelected()) {
3 | applyDarkTheme();
4 | } else {
5 | applyLightTheme();
6 | }
7 | }
8 |
9 | export function isDarkThemeSelected() {
10 | return localStorage.getItem('darkMode') === 'dark';
11 | }
12 |
13 | function applyDarkTheme() {
14 | document.body.setAttribute('data-theme', 'dark');
15 | localStorage.setItem('darkMode', 'dark');
16 | }
17 |
18 | function applyLightTheme() {
19 | document.body.removeAttribute('data-theme');
20 | localStorage.removeItem('darkMode');
21 | }
22 |
23 | export function toggleTheme() {
24 | if (isDarkThemeSelected()) {
25 | applyLightTheme();
26 | } else {
27 | applyDarkTheme();
28 | }
29 | }
30 |
31 | initTheme();
32 |
--------------------------------------------------------------------------------
/examples/playground/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/playground/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/playground/favicon.png
--------------------------------------------------------------------------------
/examples/playground/types/Highlighted.ts:
--------------------------------------------------------------------------------
1 | import { HighlightResult } from '@algolia/client-search';
2 |
3 | export type Highlighted = TRecord & {
4 | _highlightResult: HighlightResult;
5 | };
6 |
--------------------------------------------------------------------------------
/examples/playground/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Highlighted';
2 | export * from './ProductHit';
3 |
--------------------------------------------------------------------------------
/examples/preview-panel-in-modal/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/preview-panel-in-modal/capture.png
--------------------------------------------------------------------------------
/examples/preview-panel-in-modal/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/preview-panel-in-modal/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/preview-panel-in-modal/favicon.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-categories/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-categories/capture.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-categories/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-categories/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-categories/favicon.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-categories/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Query Suggestions with categories | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-categories/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-hits/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-hits/capture.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-hits/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-hits/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-hits/favicon.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-hits/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Query Suggestions with hits | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-hits/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-hits/types/ProductHit.ts:
--------------------------------------------------------------------------------
1 | import { Hit } from '@algolia/client-search';
2 |
3 | type ProductRecord = {
4 | brand: string;
5 | categories: string[];
6 | description: string;
7 | image: string;
8 | name: string;
9 | price: number;
10 | rating: number;
11 | url: string;
12 | };
13 |
14 | type WithAutocompleteAnalytics = THit & {
15 | __autocomplete_indexName: string;
16 | __autocomplete_queryID: string;
17 | };
18 |
19 | export type ProductHit = WithAutocompleteAnalytics>;
20 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-hits/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ProductHit';
2 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-inline-categories/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-inline-categories/capture.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-inline-categories/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-inline-categories/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-inline-categories/favicon.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-inline-categories/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Query Suggestions with inline categories | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-inline-categories/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches-and-categories/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-recent-searches-and-categories/capture.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches-and-categories/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches-and-categories/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-recent-searches-and-categories/favicon.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches-and-categories/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Query Suggestions with recent searches and categories
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches-and-categories/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-recent-searches/capture.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions-with-recent-searches/favicon.png
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Query Suggestions with Recent Searches | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions-with-recent-searches/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions/capture.png
--------------------------------------------------------------------------------
/examples/query-suggestions/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/query-suggestions/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/query-suggestions/favicon.png
--------------------------------------------------------------------------------
/examples/query-suggestions/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Query Suggestions | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/query-suggestions/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@algolia/autocomplete-example-query-suggestions",
3 | "description": "Autocomplete example with Query Suggestions",
4 | "version": "1.19.2",
5 | "private": true,
6 | "license": "MIT",
7 | "scripts": {
8 | "build": "parcel build index.html",
9 | "start": "parcel index.html"
10 | },
11 | "dependencies": {
12 | "@algolia/autocomplete-js": "1.19.2",
13 | "@algolia/autocomplete-plugin-query-suggestions": "1.19.2",
14 | "@algolia/autocomplete-theme-classic": "1.19.1",
15 | "algoliasearch": "4.16.0",
16 | "preact": "10.13.2"
17 | },
18 | "devDependencies": {
19 | "parcel": "2.8.3"
20 | },
21 | "keywords": [
22 | "algolia",
23 | "autocomplete",
24 | "javascript"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/examples/query-suggestions/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/react-17/.eslintignore:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/examples/react-17/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/examples/react-17/README.md:
--------------------------------------------------------------------------------
1 | # Autocomplete with React 17 example
2 |
3 | This example shows how to integrate Autocomplete with React 17.
4 |
5 | ## Demo
6 |
7 | [Access the demo](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/react-17)
8 |
9 | ## How to run this example locally
10 |
11 | ### 1. Clone this repository
12 |
13 | ```sh
14 | git clone git@github.com:algolia/autocomplete.git
15 | ```
16 |
17 | ### 2. Install the dependencies and run the server
18 |
19 | ```sh
20 | yarn
21 | yarn workspace @algolia/autocomplete-example-react-17 start
22 | ```
23 |
24 | Alternatively, you may use npm:
25 |
26 | ```sh
27 | cd examples/react-17
28 | npm install
29 | npm start
30 | ```
31 |
32 | Open to see your app.
33 |
--------------------------------------------------------------------------------
/examples/react-17/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | React 17 | Autocomplete
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/react-17/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/react-17/public/favicon.png
--------------------------------------------------------------------------------
/examples/react-17/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React Renderer",
3 | "name": "Autocomplete React Renderer",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/examples/react-17/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/examples/react-17/src/App.css:
--------------------------------------------------------------------------------
1 | .container {
2 | margin: 0 auto;
3 | max-width: 640px;
4 | width: 100%;
5 | }
6 |
7 | .aa-Panel {
8 | max-width: 640px;
9 | width: 100%;
10 | }
11 |
--------------------------------------------------------------------------------
/examples/react-17/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import { Autocomplete } from './Autocomplete';
4 | import './App.css';
5 |
6 | export function App() {
7 | return (
8 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/examples/react-17/src/ClearIcon.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export function ClearIcon(props: React.SVGProps) {
4 | return (
5 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/examples/react-17/src/SearchIcon.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export function SearchIcon(props: React.SVGProps) {
4 | return (
5 |
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/examples/react-17/src/index.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem 0;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/react-17/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 |
4 | import '@algolia/autocomplete-theme-classic';
5 |
6 | import './index.css';
7 | import { App } from './App';
8 |
9 | ReactDOM.render(
10 |
11 |
12 | ,
13 | document.getElementById('root')
14 | );
15 |
--------------------------------------------------------------------------------
/examples/react-17/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "skipLibCheck": true,
7 | "esModuleInterop": true,
8 | "allowSyntheticDefaultImports": true,
9 | "strict": true,
10 | "forceConsistentCasingInFileNames": true,
11 | "noFallthroughCasesInSwitch": true,
12 | "module": "esnext",
13 | "moduleResolution": "node",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "noEmit": true,
17 | "jsx": "react-jsx"
18 | },
19 | "include": ["src"]
20 | }
21 |
--------------------------------------------------------------------------------
/examples/react-17/vite.config.ts:
--------------------------------------------------------------------------------
1 | import react from '@vitejs/plugin-react';
2 | import { defineConfig } from 'vite';
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | });
8 |
--------------------------------------------------------------------------------
/examples/react-instantsearch/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/examples/react-instantsearch/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/react-instantsearch/capture.png
--------------------------------------------------------------------------------
/examples/react-instantsearch/src/components/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Autocomplete';
2 | export * from './Hit';
3 |
--------------------------------------------------------------------------------
/examples/react-instantsearch/src/constants.ts:
--------------------------------------------------------------------------------
1 | export const INSTANT_SEARCH_INDEX_NAME = 'instant_search';
2 | export const INSTANT_SEARCH_QUERY_SUGGESTIONS =
3 | 'instant_search_demo_query_suggestions';
4 | export const INSTANT_SEARCH_HIERARCHICAL_ATTRIBUTES = [
5 | 'hierarchicalCategories.lvl0',
6 | 'hierarchicalCategories.lvl1',
7 | ];
8 |
--------------------------------------------------------------------------------
/examples/react-instantsearch/src/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/react-instantsearch/src/favicon.png
--------------------------------------------------------------------------------
/examples/react-instantsearch/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 |
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(
7 | document.getElementById('root') as HTMLElement
8 | );
9 | root.render(
10 |
11 |
12 |
13 | );
14 |
--------------------------------------------------------------------------------
/examples/react-instantsearch/src/widgets/Panel.tsx:
--------------------------------------------------------------------------------
1 | export function Panel({
2 | children,
3 | header,
4 | footer,
5 | }: React.PropsWithChildren<{
6 | header?: React.ReactNode;
7 | footer?: React.ReactNode;
8 | }>) {
9 | return (
10 |
11 | {header &&
{header}
}
12 |
{children}
13 | {footer &&
{footer}
}
14 |
15 | );
16 | }
17 |
--------------------------------------------------------------------------------
/examples/react-instantsearch/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "useDefineForClassFields": true,
5 | "lib": ["DOM", "DOM.Iterable", "ESNext"],
6 | "allowJs": false,
7 | "skipLibCheck": true,
8 | "esModuleInterop": false,
9 | "allowSyntheticDefaultImports": true,
10 | "strict": true,
11 | "forceConsistentCasingInFileNames": true,
12 | "module": "ESNext",
13 | "moduleResolution": "Node",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "noEmit": true,
17 | "jsx": "react-jsx"
18 | },
19 | "include": ["src"],
20 | }
21 |
--------------------------------------------------------------------------------
/examples/react-instantsearch/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react';
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | });
8 |
--------------------------------------------------------------------------------
/examples/react/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/examples/react/README.md:
--------------------------------------------------------------------------------
1 | # Autocomplete with React example
2 |
3 | This example shows how to integrate Autocomplete with [React 18](https://reactjs.org/blog/2022/03/29/react-v18.html).
4 |
5 | ## Demo
6 |
7 | [Access the demo](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/react)
8 |
9 | ## How to run this example locally
10 |
11 | ### 1. Clone this repository
12 |
13 | ```sh
14 | git clone git@github.com:algolia/autocomplete.git
15 | ```
16 |
17 | ### 2. Install the dependencies and run the server
18 |
19 | ```sh
20 | yarn
21 | yarn workspace @algolia/autocomplete-example-react start
22 | ```
23 |
24 | Alternatively, you may use npm:
25 |
26 | ```sh
27 | cd examples/react
28 | npm install
29 | npm start
30 | ```
31 |
32 | Open to see your app.
33 |
--------------------------------------------------------------------------------
/examples/react/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | React | Autocomplete
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/react/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/react/public/favicon.png
--------------------------------------------------------------------------------
/examples/react/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | import './styles.css';
6 |
7 | const root = ReactDOM.createRoot(
8 | document.getElementById('root') as HTMLElement
9 | );
10 | root.render(
11 |
12 |
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/examples/react/src/styles.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
9 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/react/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "allowJs": true,
10 | "skipLibCheck": true,
11 | "esModuleInterop": true,
12 | "allowSyntheticDefaultImports": true,
13 | "strict": true,
14 | "forceConsistentCasingInFileNames": true,
15 | "noFallthroughCasesInSwitch": true,
16 | "module": "esnext",
17 | "moduleResolution": "node",
18 | "resolveJsonModule": true,
19 | "isolatedModules": true,
20 | "noEmit": true,
21 | "jsx": "react-jsx"
22 | },
23 | "include": [
24 | "src"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/examples/react/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react';
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | });
8 |
--------------------------------------------------------------------------------
/examples/recently-viewed-items/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/recently-viewed-items/capture.png
--------------------------------------------------------------------------------
/examples/recently-viewed-items/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/recently-viewed-items/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/recently-viewed-items/favicon.png
--------------------------------------------------------------------------------
/examples/recently-viewed-items/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Recently Viewed Items | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/recently-viewed-items/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/recently-viewed-items/types/Highlighted.ts:
--------------------------------------------------------------------------------
1 | export type Highlighted = TItem & {
2 | _highlightResult: {
3 | label: {
4 | value: string;
5 | };
6 | };
7 | };
8 |
--------------------------------------------------------------------------------
/examples/recently-viewed-items/types/ProductHit.ts:
--------------------------------------------------------------------------------
1 | import { Hit } from '@algolia/client-search';
2 |
3 | export type ProductItem = {
4 | name: string;
5 | image: string;
6 | url: string;
7 | description: string;
8 | };
9 |
10 | export type ProductHit = Hit & {
11 | __autocomplete_indexName: string;
12 | __autocomplete_queryID: string;
13 | };
14 |
--------------------------------------------------------------------------------
/examples/recently-viewed-items/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Highlighted';
2 | export * from './ProductHit';
3 |
--------------------------------------------------------------------------------
/examples/redirect-url/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/redirect-url/capture.png
--------------------------------------------------------------------------------
/examples/redirect-url/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/redirect-url/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/redirect-url/favicon.png
--------------------------------------------------------------------------------
/examples/redirect-url/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Redirect URL | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/redirect-url/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@algolia/autocomplete-example-redirect-url",
3 | "description": "Autocomplete example for Redirect URL plugin",
4 | "version": "1.19.2",
5 | "private": true,
6 | "license": "MIT",
7 | "scripts": {
8 | "build": "parcel build index.html",
9 | "start": "parcel index.html"
10 | },
11 | "dependencies": {
12 | "@algolia/autocomplete-js": "1.19.2",
13 | "@algolia/autocomplete-plugin-redirect-url": "1.19.2",
14 | "@algolia/autocomplete-theme-classic": "1.19.1",
15 | "algoliasearch": "4.16.0",
16 | "preact": "10.13.2"
17 | },
18 | "devDependencies": {
19 | "parcel": "2.8.3"
20 | },
21 | "keywords": [
22 | "algolia",
23 | "autocomplete",
24 | "javascript"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/examples/redirect-url/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/reshape/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/reshape/README.md
--------------------------------------------------------------------------------
/examples/reshape/env.ts:
--------------------------------------------------------------------------------
1 | import * as preact from 'preact';
2 |
3 | // Parcel picks the `source` field of the monorepo packages and thus doesn't
4 | // apply the Babel config. We therefore need to manually override the constants
5 | // in the app, as well as the React pragmas.
6 | // See https://twitter.com/devongovett/status/1134231234605830144
7 | (global as any).__DEV__ = process.env.NODE_ENV !== 'production';
8 | (global as any).__TEST__ = false;
9 | (global as any).h = preact.h;
10 | (global as any).React = preact;
11 |
--------------------------------------------------------------------------------
/examples/reshape/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/reshape/favicon.png
--------------------------------------------------------------------------------
/examples/reshape/functions/AutocompleteReshapeFunction.ts:
--------------------------------------------------------------------------------
1 | import {
2 | AutocompleteReshapeSource,
3 | BaseItem,
4 | } from '@algolia/autocomplete-core';
5 |
6 | export type AutocompleteReshapeFunction = <
7 | TItem extends BaseItem
8 | >(
9 | ...params: TParams[]
10 | ) => (
11 | ...expressions: Array>
12 | ) => Array>;
13 |
--------------------------------------------------------------------------------
/examples/reshape/functions/index.ts:
--------------------------------------------------------------------------------
1 | export * from './groupBy';
2 | export * from './limit';
3 | export * from './uniqBy';
4 |
--------------------------------------------------------------------------------
/examples/reshape/functions/normalizeReshapeSources.ts:
--------------------------------------------------------------------------------
1 | import {
2 | AutocompleteReshapeSource,
3 | BaseItem,
4 | } from '@algolia/autocomplete-core';
5 | import { flatten } from '@algolia/autocomplete-shared';
6 |
7 | // We filter out falsy values because dynamic sources may not exist at every render.
8 | // We flatten to support pipe operators from functional libraries like Ramda.
9 | export function normalizeReshapeSources(
10 | sources: Array>
11 | ) {
12 | return flatten(sources).filter(Boolean);
13 | }
14 |
--------------------------------------------------------------------------------
/examples/reshape/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Reshape API | Autocomplete
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/reshape/searchClient.ts:
--------------------------------------------------------------------------------
1 | import algoliasearch from 'algoliasearch/lite';
2 |
3 | const appId = 'latency';
4 | const apiKey = '6be0576ff61c053d5f9a3225e2a90f76';
5 |
6 | export const searchClient = algoliasearch(appId, apiKey);
7 |
--------------------------------------------------------------------------------
/examples/reshape/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | background-color: rgb(244, 244, 249);
7 | color: rgb(65, 65, 65);
8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10 | sans-serif;
11 | -webkit-font-smoothing: antialiased;
12 | -moz-osx-font-smoothing: grayscale;
13 | padding: 1rem;
14 | }
15 |
16 | .container {
17 | margin: 0 auto;
18 | max-width: 640px;
19 | width: 100%;
20 | }
21 |
22 | body[data-theme='dark'] {
23 | background-color: rgb(0, 0, 0);
24 | color: rgb(183, 192, 199);
25 | }
26 |
--------------------------------------------------------------------------------
/examples/reshape/types/Highlighted.ts:
--------------------------------------------------------------------------------
1 | import { HighlightResult } from '@algolia/client-search';
2 |
3 | export type Highlighted = TRecord & {
4 | _highlightResult: HighlightResult;
5 | };
6 |
--------------------------------------------------------------------------------
/examples/reshape/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Highlighted';
2 | export * from './ProductHit';
3 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/.eslintignore:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/slack-with-emojis-and-commands/capture.png
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Slack with emojis and slash commands | Autocomplete
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/public/avatar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/slack-with-emojis-and-commands/public/avatar.jpg
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/algolia/autocomplete/de8a1955e67b8df9a7f29f8114e3c579de86bab1/examples/slack-with-emojis-and-commands/public/favicon.png
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Slack with emojis and slash commands | Autocomplete
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Slack",
3 | "name": "Slack with emojis and slash commands | Autocomplete",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import { Autocomplete } from './Autocomplete';
4 |
5 | import './App.css';
6 |
7 | export function App() {
8 | return (
9 |
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/src/components/index.ts:
--------------------------------------------------------------------------------
1 | export * from './CommandsSource';
2 | export * from './EmojisSource';
3 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/src/hooks/index.ts:
--------------------------------------------------------------------------------
1 | export * from './useAutocomplete';
2 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 |
4 | import { App } from './App';
5 |
6 | import './index.css';
7 |
8 | ReactDOM.render(
9 |
10 |
11 | ,
12 | document.getElementById('root')
13 | );
14 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/src/types/Command.ts:
--------------------------------------------------------------------------------
1 | import type { JSX } from 'react';
2 |
3 | export type Command = {
4 | slug: string;
5 | commands: string[];
6 | icon: JSX.Element;
7 | description: string;
8 | };
9 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/src/types/Emoji.ts:
--------------------------------------------------------------------------------
1 | export type Emoji = {
2 | name: string;
3 | slug: string;
4 | group: string;
5 | emoji_version: string;
6 | unicode_version: string;
7 | skin_tone_support: boolean;
8 | symbol: string;
9 | };
10 |
--------------------------------------------------------------------------------
/examples/slack-with-emojis-and-commands/src/types/SourceProps.ts:
--------------------------------------------------------------------------------
1 | import {
2 | AutocompleteApi,
3 | BaseItem,
4 | InternalAutocompleteSource,
5 | } from '@algolia/autocomplete-core';
6 |
7 | export type SourceProps = {
8 | source: InternalAutocompleteSource;
9 | items: TItem[];
10 | autocomplete: AutocompleteApi<
11 | TItem,
12 | React.BaseSyntheticEvent