react-instantsearch 7.5.5 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ui/Breadcrumb.js +8 -8
- package/dist/cjs/ui/ClearRefinements.js +3 -3
- package/dist/cjs/ui/CurrentRefinements.js +9 -8
- package/dist/cjs/ui/HierarchicalMenu.js +9 -9
- package/dist/cjs/ui/Highlight.js +5 -5
- package/dist/cjs/ui/HitsPerPage.js +4 -4
- package/dist/cjs/ui/InfiniteHits.js +6 -6
- package/dist/cjs/ui/InternalHighlight.js +8 -51
- package/dist/cjs/ui/Menu.js +8 -8
- package/dist/cjs/ui/Pagination.js +12 -12
- package/dist/cjs/ui/PoweredBy.js +4 -4
- package/dist/cjs/ui/RangeInput.js +9 -9
- package/dist/cjs/ui/RefinementList.js +11 -11
- package/dist/cjs/ui/SearchBox.js +10 -12
- package/dist/cjs/ui/Snippet.js +5 -5
- package/dist/cjs/ui/SortBy.js +4 -4
- package/dist/cjs/ui/Stats.js +2 -2
- package/dist/cjs/ui/ToggleRefinement.js +5 -5
- package/dist/cjs/ui/lib/index.js +0 -11
- package/dist/cjs/widgets/Hits.js +41 -10
- package/dist/es/ui/Breadcrumb.js +1 -1
- package/dist/es/ui/ClearRefinements.js +1 -1
- package/dist/es/ui/CurrentRefinements.js +2 -1
- package/dist/es/ui/HierarchicalMenu.js +1 -1
- package/dist/es/ui/Highlight.d.ts +1 -1
- package/dist/es/ui/Highlight.js +1 -1
- package/dist/es/ui/HitsPerPage.js +1 -1
- package/dist/es/ui/InfiniteHits.js +1 -1
- package/dist/es/ui/InternalHighlight.d.ts +1 -32
- package/dist/es/ui/InternalHighlight.js +6 -47
- package/dist/es/ui/Menu.js +1 -1
- package/dist/es/ui/Pagination.js +1 -1
- package/dist/es/ui/PoweredBy.js +1 -1
- package/dist/es/ui/RangeInput.js +1 -1
- package/dist/es/ui/RefinementList.js +1 -1
- package/dist/es/ui/SearchBox.js +2 -4
- package/dist/es/ui/Snippet.d.ts +1 -1
- package/dist/es/ui/Snippet.js +1 -1
- package/dist/es/ui/SortBy.js +1 -1
- package/dist/es/ui/Stats.js +1 -1
- package/dist/es/ui/ToggleRefinement.js +1 -1
- package/dist/es/ui/lib/index.d.ts +0 -1
- package/dist/es/ui/lib/index.js +0 -1
- package/dist/es/widgets/Hits.d.ts +11 -4
- package/dist/es/widgets/Hits.js +37 -8
- package/dist/umd/ReactInstantSearch.js +224 -109
- package/dist/umd/ReactInstantSearch.js.map +1 -1
- package/dist/umd/ReactInstantSearch.min.js +1 -1
- package/dist/umd/ReactInstantSearch.min.js.map +1 -1
- package/package.json +9 -8
- package/dist/cjs/ui/Hits.js +0 -49
- package/dist/cjs/ui/lib/cx.js +0 -12
- package/dist/es/ui/Hits.d.ts +0 -31
- package/dist/es/ui/Hits.js +0 -42
- package/dist/es/ui/lib/cx.d.ts +0 -1
- package/dist/es/ui/lib/cx.js +0 -6
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-instantsearch",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"description": "⚡ Lightning-fast search for React, by Algolia",
|
|
5
|
-
"source": "src/index.ts",
|
|
6
5
|
"types": "dist/es/index.d.ts",
|
|
7
6
|
"main": "dist/cjs/index.js",
|
|
8
7
|
"module": "dist/es/index.js",
|
|
@@ -38,23 +37,25 @@
|
|
|
38
37
|
],
|
|
39
38
|
"scripts": {
|
|
40
39
|
"clean": "rm -rf dist",
|
|
41
|
-
"watch": "yarn build:cjs --watch",
|
|
42
40
|
"build": "yarn build:cjs && yarn build:es && yarn build:umd && yarn build:types",
|
|
43
41
|
"build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/cjs --ignore '**/__tests__/**/*','**/__mocks__/**/*' --quiet && ../../scripts/prepare-cjs.sh",
|
|
44
|
-
"build:es": "BABEL_ENV=es babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/es --ignore '**/__tests__/**/*','**/__mocks__/**/*'
|
|
42
|
+
"build:es:base": "BABEL_ENV=es babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/es --ignore '**/__tests__/**/*','**/__mocks__/**/*'",
|
|
43
|
+
"build:es": "yarn build:es:base --quiet",
|
|
45
44
|
"build:umd": "BABEL_ENV=rollup rollup -c rollup.config.js",
|
|
46
45
|
"build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/es",
|
|
47
|
-
"test:exports": "node ./test/module/is-es-module.mjs && node ./test/module/is-cjs-module.cjs"
|
|
46
|
+
"test:exports": "node ./test/module/is-es-module.mjs && node ./test/module/is-cjs-module.cjs",
|
|
47
|
+
"watch:es": "yarn --silent build:es:base --watch"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/runtime": "^7.1.2",
|
|
51
|
-
"instantsearch
|
|
52
|
-
"
|
|
51
|
+
"instantsearch-ui-components": "0.4.0",
|
|
52
|
+
"instantsearch.js": "4.66.0",
|
|
53
|
+
"react-instantsearch-core": "7.7.0"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
56
|
"algoliasearch": ">= 3.1 < 5",
|
|
56
57
|
"react": ">= 16.8.0 < 19",
|
|
57
58
|
"react-dom": ">= 16.8.0 < 19"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "358f849cba15cbbb415da05feb582b47358aa239"
|
|
60
61
|
}
|
package/dist/cjs/ui/Hits.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Hits = Hits;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _cx = require("./lib/cx");
|
|
9
|
-
var _excluded = ["hits", "sendEvent", "hitComponent", "classNames"];
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
12
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
|
-
function DefaultHitComponent(_ref) {
|
|
15
|
-
var hit = _ref.hit;
|
|
16
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
|
-
style: {
|
|
18
|
-
wordBreak: 'break-all'
|
|
19
|
-
}
|
|
20
|
-
}, JSON.stringify(hit).slice(0, 100), "\u2026");
|
|
21
|
-
}
|
|
22
|
-
function Hits(_ref2) {
|
|
23
|
-
var hits = _ref2.hits,
|
|
24
|
-
sendEvent = _ref2.sendEvent,
|
|
25
|
-
_ref2$hitComponent = _ref2.hitComponent,
|
|
26
|
-
HitComponent = _ref2$hitComponent === void 0 ? DefaultHitComponent : _ref2$hitComponent,
|
|
27
|
-
_ref2$classNames = _ref2.classNames,
|
|
28
|
-
classNames = _ref2$classNames === void 0 ? {} : _ref2$classNames,
|
|
29
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
31
|
-
className: (0, _cx.cx)('ais-Hits', classNames.root, hits.length === 0 && (0, _cx.cx)('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
32
|
-
}), /*#__PURE__*/_react.default.createElement("ol", {
|
|
33
|
-
className: (0, _cx.cx)('ais-Hits-list', classNames.list)
|
|
34
|
-
}, hits.map(function (hit) {
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement("li", {
|
|
36
|
-
key: hit.objectID,
|
|
37
|
-
className: (0, _cx.cx)('ais-Hits-item', classNames.item),
|
|
38
|
-
onClick: function onClick() {
|
|
39
|
-
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
40
|
-
},
|
|
41
|
-
onAuxClick: function onAuxClick() {
|
|
42
|
-
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
43
|
-
}
|
|
44
|
-
}, /*#__PURE__*/_react.default.createElement(HitComponent, {
|
|
45
|
-
hit: hit,
|
|
46
|
-
sendEvent: sendEvent
|
|
47
|
-
}));
|
|
48
|
-
})));
|
|
49
|
-
}
|
package/dist/cjs/ui/lib/cx.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.cx = cx;
|
|
7
|
-
function cx() {
|
|
8
|
-
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
-
classNames[_key] = arguments[_key];
|
|
10
|
-
}
|
|
11
|
-
return classNames.filter(Boolean).join(' ');
|
|
12
|
-
}
|
package/dist/es/ui/Hits.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Hit } from 'instantsearch.js';
|
|
3
|
-
import type { SendEventForHits } from 'instantsearch.js/es/lib/utils';
|
|
4
|
-
export type HitsProps<THit> = React.ComponentProps<'div'> & {
|
|
5
|
-
hits: THit[];
|
|
6
|
-
sendEvent: SendEventForHits;
|
|
7
|
-
hitComponent?: React.JSXElementConstructor<{
|
|
8
|
-
hit: THit;
|
|
9
|
-
sendEvent: SendEventForHits;
|
|
10
|
-
}>;
|
|
11
|
-
classNames?: Partial<HitsClassNames>;
|
|
12
|
-
};
|
|
13
|
-
export type HitsClassNames = {
|
|
14
|
-
/**
|
|
15
|
-
* Class names to apply to the root element
|
|
16
|
-
*/
|
|
17
|
-
root: string;
|
|
18
|
-
/**
|
|
19
|
-
* Class names to apply to the root element without results
|
|
20
|
-
*/
|
|
21
|
-
emptyRoot: string;
|
|
22
|
-
/**
|
|
23
|
-
* Class names to apply to the list element
|
|
24
|
-
*/
|
|
25
|
-
list: string;
|
|
26
|
-
/**
|
|
27
|
-
* Class names to apply to each item element
|
|
28
|
-
*/
|
|
29
|
-
item: string;
|
|
30
|
-
};
|
|
31
|
-
export declare function Hits<THit extends Hit>({ hits, sendEvent, hitComponent: HitComponent, classNames, ...props }: HitsProps<THit>): JSX.Element;
|
package/dist/es/ui/Hits.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
var _excluded = ["hits", "sendEvent", "hitComponent", "classNames"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { cx } from "./lib/cx.js";
|
|
7
|
-
function DefaultHitComponent(_ref) {
|
|
8
|
-
var hit = _ref.hit;
|
|
9
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
style: {
|
|
11
|
-
wordBreak: 'break-all'
|
|
12
|
-
}
|
|
13
|
-
}, JSON.stringify(hit).slice(0, 100), "\u2026");
|
|
14
|
-
}
|
|
15
|
-
export function Hits(_ref2) {
|
|
16
|
-
var hits = _ref2.hits,
|
|
17
|
-
sendEvent = _ref2.sendEvent,
|
|
18
|
-
_ref2$hitComponent = _ref2.hitComponent,
|
|
19
|
-
HitComponent = _ref2$hitComponent === void 0 ? DefaultHitComponent : _ref2$hitComponent,
|
|
20
|
-
_ref2$classNames = _ref2.classNames,
|
|
21
|
-
classNames = _ref2$classNames === void 0 ? {} : _ref2$classNames,
|
|
22
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
23
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
24
|
-
className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
25
|
-
}), /*#__PURE__*/React.createElement("ol", {
|
|
26
|
-
className: cx('ais-Hits-list', classNames.list)
|
|
27
|
-
}, hits.map(function (hit) {
|
|
28
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
29
|
-
key: hit.objectID,
|
|
30
|
-
className: cx('ais-Hits-item', classNames.item),
|
|
31
|
-
onClick: function onClick() {
|
|
32
|
-
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
33
|
-
},
|
|
34
|
-
onAuxClick: function onAuxClick() {
|
|
35
|
-
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
36
|
-
}
|
|
37
|
-
}, /*#__PURE__*/React.createElement(HitComponent, {
|
|
38
|
-
hit: hit,
|
|
39
|
-
sendEvent: sendEvent
|
|
40
|
-
}));
|
|
41
|
-
})));
|
|
42
|
-
}
|
package/dist/es/ui/lib/cx.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cx(...classNames: Array<string | number | boolean | undefined | null>): string;
|