vue-instantsearch 4.28.0 → 4.29.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/package.json +6 -6
- package/src/__tests__/common-widgets.test.js +6 -0
- package/src/__tests__/index.js +2 -2
- package/src/components/Feeds.js +4 -4
- package/src/components/__tests__/Feeds-integration.js +5 -5
- package/src/components/__tests__/Feeds.js +2 -2
- package/src/components/__tests__/RefinementList.js +14 -2
- package/vue2/cjs/index.js +1 -1
- package/vue2/es/package.json.js +1 -1
- package/vue2/umd/index.js +1 -1
- package/vue3/cjs/index.js +1 -1
- package/vue3/es/package.json.js +1 -1
- package/vue3/umd/index.js +1 -1
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"autocomplete"
|
|
17
17
|
],
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"version": "4.
|
|
19
|
+
"version": "4.29.0",
|
|
20
20
|
"files": [
|
|
21
21
|
"vue2",
|
|
22
22
|
"vue3",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@swc/helpers": "0.5.18",
|
|
40
|
-
"instantsearch-ui-components": "0.
|
|
41
|
-
"instantsearch.js": "4.
|
|
40
|
+
"instantsearch-ui-components": "0.34.0",
|
|
41
|
+
"instantsearch.js": "4.109.0",
|
|
42
42
|
"mitt": "^2.1.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@vue/test-utils": "1.3.0",
|
|
63
63
|
"@vue/test-utils2": "npm:@vue/test-utils@2.0.0-rc.11",
|
|
64
64
|
"algoliasearch": "5.1.1",
|
|
65
|
-
"algoliasearch-helper": "3.29.
|
|
65
|
+
"algoliasearch-helper": "3.29.3",
|
|
66
66
|
"babel-preset-vue": "2.0.2",
|
|
67
|
-
"instantsearch.css": "8.
|
|
67
|
+
"instantsearch.css": "8.19.0",
|
|
68
68
|
"rollup-plugin-vue2": "npm:rollup-plugin-vue@4.3.2",
|
|
69
69
|
"rollup-plugin-vue3": "npm:rollup-plugin-vue@6.0.0",
|
|
70
70
|
"vue": "2.7.14",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"vuex": "3.5.1",
|
|
82
82
|
"vuex4": "npm:vuex@4.0.0"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "23976edc5a20705cf11bee60c7b837f815299ed3"
|
|
85
85
|
}
|
|
@@ -596,6 +596,9 @@ const testSetups = {
|
|
|
596
596
|
createFilterSuggestionsWidgetTests() {
|
|
597
597
|
throw new Error('FilterSuggestions is not supported in Vue InstantSearch');
|
|
598
598
|
},
|
|
599
|
+
createPromptSuggestionsWidgetTests() {
|
|
600
|
+
throw new Error('PromptSuggestions is not supported in Vue InstantSearch');
|
|
601
|
+
},
|
|
599
602
|
};
|
|
600
603
|
|
|
601
604
|
const testOptions = {
|
|
@@ -658,6 +661,9 @@ const testOptions = {
|
|
|
658
661
|
createFilterSuggestionsWidgetTests: {
|
|
659
662
|
skippedTests: { 'FilterSuggestions widget common tests': true },
|
|
660
663
|
},
|
|
664
|
+
createPromptSuggestionsWidgetTests: {
|
|
665
|
+
skippedTests: { 'PromptSuggestions widget common tests': true },
|
|
666
|
+
},
|
|
661
667
|
};
|
|
662
668
|
|
|
663
669
|
describe('Common widget tests (Vue InstantSearch)', () => {
|
package/src/__tests__/index.js
CHANGED
|
@@ -46,7 +46,7 @@ function getAllComponents() {
|
|
|
46
46
|
|
|
47
47
|
try {
|
|
48
48
|
suitClass = mixins
|
|
49
|
-
.find(mixin => mixin.methods && mixin.methods.suit)
|
|
49
|
+
.find((mixin) => mixin.methods && mixin.methods.suit)
|
|
50
50
|
.methods.suit();
|
|
51
51
|
} catch (e) {
|
|
52
52
|
/* no suit class, so will fail the assertions */
|
|
@@ -85,7 +85,7 @@ function getAllComponents() {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
const Component = {
|
|
88
|
-
render: renderCompat(h =>
|
|
88
|
+
render: renderCompat((h) =>
|
|
89
89
|
h(
|
|
90
90
|
AisInstantSearch,
|
|
91
91
|
{
|
package/src/components/Feeds.js
CHANGED
|
@@ -18,7 +18,7 @@ const AisFeedProvider = {
|
|
|
18
18
|
$_ais_getParentIndex: () => this.feedContainer,
|
|
19
19
|
};
|
|
20
20
|
},
|
|
21
|
-
render: renderCompat(function(h) {
|
|
21
|
+
render: renderCompat(function (h) {
|
|
22
22
|
const defaultSlot = getScopedSlot(this, 'default');
|
|
23
23
|
return h('div', {}, defaultSlot ? defaultSlot() : []);
|
|
24
24
|
}),
|
|
@@ -113,7 +113,7 @@ export default {
|
|
|
113
113
|
|
|
114
114
|
// Create new FeedContainers (synchronous — must be registered before render)
|
|
115
115
|
const toAdd = [];
|
|
116
|
-
feedIDs.forEach(feedID => {
|
|
116
|
+
feedIDs.forEach((feedID) => {
|
|
117
117
|
if (!this.feedContainers.has(feedID)) {
|
|
118
118
|
const pendingContainer = this.pendingRemovals.get(feedID);
|
|
119
119
|
if (pendingContainer) {
|
|
@@ -136,7 +136,7 @@ export default {
|
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
138
|
},
|
|
139
|
-
render: renderCompat(function(h) {
|
|
139
|
+
render: renderCompat(function (h) {
|
|
140
140
|
if (!this.state) {
|
|
141
141
|
return h('div', { class: [this.suit()] });
|
|
142
142
|
}
|
|
@@ -144,7 +144,7 @@ export default {
|
|
|
144
144
|
const feedIDs = this.state.feedIDs || [];
|
|
145
145
|
const defaultSlot = getScopedSlot(this, 'default');
|
|
146
146
|
|
|
147
|
-
const children = feedIDs.map(feedID => {
|
|
147
|
+
const children = feedIDs.map((feedID) => {
|
|
148
148
|
const container = this.feedContainers.get(feedID);
|
|
149
149
|
if (!container || !defaultSlot) {
|
|
150
150
|
return null;
|
|
@@ -10,7 +10,7 @@ import { mount, nextTick } from '../../../test/utils';
|
|
|
10
10
|
import Feeds from '../Feeds';
|
|
11
11
|
import InstantSearch from '../InstantSearch';
|
|
12
12
|
|
|
13
|
-
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
13
|
+
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
14
14
|
|
|
15
15
|
describe('AisFeeds (integration)', () => {
|
|
16
16
|
it('registers feed containers and scopes slot descendants', async () => {
|
|
@@ -57,9 +57,9 @@ describe('AisFeeds (integration)', () => {
|
|
|
57
57
|
const widgets = wrapper
|
|
58
58
|
.findComponent(InstantSearch)
|
|
59
59
|
.vm.instantSearchInstance.mainIndex.getWidgets();
|
|
60
|
-
expect(widgets.some(widget => widget.$$type === 'ais.feeds')).toBe(true);
|
|
61
|
-
expect(
|
|
62
|
-
|
|
63
|
-
);
|
|
60
|
+
expect(widgets.some((widget) => widget.$$type === 'ais.feeds')).toBe(true);
|
|
61
|
+
expect(
|
|
62
|
+
widgets.some((widget) => widget.$$type === 'ais.feedContainer')
|
|
63
|
+
).toBe(true);
|
|
64
64
|
});
|
|
65
65
|
});
|
|
@@ -8,7 +8,7 @@ import Feeds from '../Feeds';
|
|
|
8
8
|
|
|
9
9
|
jest.mock('../../mixins/widget');
|
|
10
10
|
jest.mock('instantsearch.js/es/connectors/feeds/FeedContainer', () => ({
|
|
11
|
-
createFeedContainer: jest.fn(feedID => ({ __feedID: feedID })),
|
|
11
|
+
createFeedContainer: jest.fn((feedID) => ({ __feedID: feedID })),
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
14
|
describe('AisFeeds', () => {
|
|
@@ -17,7 +17,7 @@ describe('AisFeeds', () => {
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
it('passes arguments to connector', () => {
|
|
20
|
-
const transformFeeds = feeds => feeds;
|
|
20
|
+
const transformFeeds = (feeds) => feeds;
|
|
21
21
|
const wrapper = mount(Feeds, {
|
|
22
22
|
propsData: {
|
|
23
23
|
isolated: false,
|
|
@@ -12,8 +12,20 @@ jest.mock('../../mixins/panel');
|
|
|
12
12
|
|
|
13
13
|
const defaultState = {
|
|
14
14
|
items: [
|
|
15
|
-
{
|
|
16
|
-
|
|
15
|
+
{
|
|
16
|
+
value: 'Apple',
|
|
17
|
+
label: 'Apple',
|
|
18
|
+
highlighted: 'Apple',
|
|
19
|
+
count: 746,
|
|
20
|
+
isRefined: false,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: 'Samsung',
|
|
24
|
+
label: 'Samsung',
|
|
25
|
+
highlighted: 'Samsung',
|
|
26
|
+
count: 633,
|
|
27
|
+
isRefined: false,
|
|
28
|
+
},
|
|
17
29
|
],
|
|
18
30
|
canRefine: true,
|
|
19
31
|
canToggleShowMore: true,
|