@docsearch/react
Advanced tools
Comparing version 3.0.0-alpha.40 to 3.0.0-alpha.41
@@ -11,3 +11,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
@@ -29,3 +29,3 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
var _React$useState3 = React.useState(undefined), | ||
var _React$useState3 = React.useState((props === null || props === void 0 ? void 0 : props.initialQuery) || undefined), | ||
_React$useState4 = _slicedToArray(_React$useState3, 2), | ||
@@ -32,0 +32,0 @@ initialQuery = _React$useState4[0], |
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
@@ -17,3 +17,3 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
@@ -20,0 +20,0 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
@@ -7,3 +7,3 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
@@ -10,0 +10,0 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
@@ -9,3 +9,3 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
@@ -12,0 +12,0 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
@@ -1,2 +0,2 @@ | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
@@ -3,0 +3,0 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
@@ -25,6 +25,3 @@ import React from 'react'; | ||
if (event.keyCode === 27 && isOpen || // The `Cmd+K` shortcut both opens and closes the modal. | ||
event.key === 'k' && (event.metaKey || event.ctrlKey) || // The `/` shortcut opens but doesn't close the modal because it's | ||
// a character. | ||
!isEditingContent(event) && event.key === '/' && !isOpen) { | ||
if (event.keyCode === 27 && isOpen || event.key === 'k' && (event.metaKey || event.ctrlKey) || !isEditingContent(event) && event.key === '/' && !isOpen) { | ||
event.preventDefault(); | ||
@@ -31,0 +28,0 @@ |
@@ -1,1 +0,1 @@ | ||
export declare const version = "3.0.0-alpha.40"; | ||
export declare const version = "3.0.0-alpha.41"; |
@@ -1,1 +0,1 @@ | ||
export var version = '3.0.0-alpha.40'; | ||
export var version = '3.0.0-alpha.41'; |
{ | ||
"name": "@docsearch/react", | ||
"description": "React package for DocSearch, the best search experience for docs.", | ||
"version": "3.0.0-alpha.40", | ||
"version": "3.0.0-alpha.41", | ||
"license": "MIT", | ||
@@ -39,3 +39,3 @@ "homepage": "https://docsearch.algolia.com", | ||
"@algolia/autocomplete-preset-algolia": "1.2.2", | ||
"@docsearch/css": "3.0.0-alpha.40", | ||
"@docsearch/css": "3.0.0-alpha.41", | ||
"algoliasearch": "^4.0.0" | ||
@@ -42,0 +42,0 @@ }, |
@@ -5,7 +5,5 @@ # @docsearch/react | ||
[![Percy](https://percy.io/static/images/percy-badge.svg)](https://percy.io/DX/DocSearch) | ||
## Installation | ||
```sh | ||
```bash | ||
yarn add @docsearch/react@alpha | ||
@@ -16,4 +14,32 @@ # or | ||
If you don’t want to use a package manager, you can use a standalone endpoint: | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/@docsearch/react@alpha"></script> | ||
``` | ||
## Get started | ||
DocSearch generates a fully accessible search box for you. | ||
```jsx App.js | ||
import { DocSearch } from '@docsearch/react'; | ||
import '@docsearch/css'; | ||
function App() { | ||
return ( | ||
<DocSearch | ||
appId="YOUR_APP_ID" | ||
indexName="YOUR_INDEX_NAME" | ||
apiKey="YOUR_SEARCH_API_KEY" | ||
/> | ||
); | ||
} | ||
export default App; | ||
``` | ||
## Documentation | ||
[Read documentation →](https://autocomplete-experimental.netlify.app/docs/DocSearch) | ||
[Read documentation →](https://docsearch.algolia.com/docs/DocSearch-v3) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
44
3
383018
1939
+ Added@docsearch/css@3.0.0-alpha.41(transitive)
- Removed@docsearch/css@3.0.0-alpha.40(transitive)