@searchspring/snap-store-mobx 0.39.2 → 0.40.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/Autocomplete/AutocompleteStore.d.ts +5 -1
- package/dist/cjs/Autocomplete/AutocompleteStore.d.ts.map +1 -1
- package/dist/cjs/Autocomplete/AutocompleteStore.js +25 -2
- package/dist/cjs/Autocomplete/Stores/AutocompleteHistoryStore.d.ts +8 -0
- package/dist/cjs/Autocomplete/Stores/AutocompleteHistoryStore.d.ts.map +1 -0
- package/dist/cjs/Autocomplete/Stores/AutocompleteHistoryStore.js +41 -0
- package/dist/cjs/Autocomplete/Stores/index.d.ts +1 -0
- package/dist/cjs/Autocomplete/Stores/index.d.ts.map +1 -1
- package/dist/cjs/Autocomplete/Stores/index.js +3 -1
- package/dist/cjs/Recommendation/Stores/RecommendationProfileStore.d.ts +1 -1
- package/dist/cjs/Recommendation/Stores/RecommendationProfileStore.d.ts.map +1 -1
- package/dist/cjs/Search/SearchStore.d.ts +2 -1
- package/dist/cjs/Search/SearchStore.d.ts.map +1 -1
- package/dist/cjs/Search/SearchStore.js +9 -1
- package/dist/cjs/Search/Stores/SearchHistoryStore.d.ts +19 -0
- package/dist/cjs/Search/Stores/SearchHistoryStore.d.ts.map +1 -0
- package/dist/cjs/Search/Stores/SearchHistoryStore.js +91 -0
- package/dist/cjs/Search/Stores/SearchMerchandisingStore.d.ts +1 -0
- package/dist/cjs/Search/Stores/SearchMerchandisingStore.d.ts.map +1 -1
- package/dist/cjs/Search/Stores/SearchMerchandisingStore.js +2 -0
- package/dist/cjs/Search/Stores/SearchPaginationStore.d.ts +3 -3
- package/dist/cjs/Search/Stores/SearchPaginationStore.d.ts.map +1 -1
- package/dist/cjs/Search/Stores/SearchQueryStore.d.ts +1 -2
- package/dist/cjs/Search/Stores/SearchQueryStore.d.ts.map +1 -1
- package/dist/cjs/Search/Stores/SearchQueryStore.js +4 -2
- package/dist/cjs/Search/Stores/SearchResultStore.d.ts +2 -2
- package/dist/cjs/Search/Stores/SearchResultStore.d.ts.map +1 -1
- package/dist/cjs/Search/Stores/index.d.ts +1 -0
- package/dist/cjs/Search/Stores/index.d.ts.map +1 -1
- package/dist/cjs/Search/Stores/index.js +3 -1
- package/dist/cjs/types.d.ts +8 -0
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/Autocomplete/AutocompleteStore.d.ts +5 -1
- package/dist/esm/Autocomplete/AutocompleteStore.d.ts.map +1 -1
- package/dist/esm/Autocomplete/AutocompleteStore.js +25 -4
- package/dist/esm/Autocomplete/Stores/AutocompleteHistoryStore.d.ts +8 -0
- package/dist/esm/Autocomplete/Stores/AutocompleteHistoryStore.d.ts.map +1 -0
- package/dist/esm/Autocomplete/Stores/AutocompleteHistoryStore.js +16 -0
- package/dist/esm/Autocomplete/Stores/index.d.ts +1 -0
- package/dist/esm/Autocomplete/Stores/index.d.ts.map +1 -1
- package/dist/esm/Autocomplete/Stores/index.js +1 -0
- package/dist/esm/Recommendation/Stores/RecommendationProfileStore.d.ts +1 -1
- package/dist/esm/Recommendation/Stores/RecommendationProfileStore.d.ts.map +1 -1
- package/dist/esm/Search/SearchStore.d.ts +2 -1
- package/dist/esm/Search/SearchStore.d.ts.map +1 -1
- package/dist/esm/Search/SearchStore.js +9 -1
- package/dist/esm/Search/Stores/SearchHistoryStore.d.ts +19 -0
- package/dist/esm/Search/Stores/SearchHistoryStore.d.ts.map +1 -0
- package/dist/esm/Search/Stores/SearchHistoryStore.js +72 -0
- package/dist/esm/Search/Stores/SearchMerchandisingStore.d.ts +1 -0
- package/dist/esm/Search/Stores/SearchMerchandisingStore.d.ts.map +1 -1
- package/dist/esm/Search/Stores/SearchMerchandisingStore.js +2 -0
- package/dist/esm/Search/Stores/SearchPaginationStore.d.ts +3 -3
- package/dist/esm/Search/Stores/SearchPaginationStore.d.ts.map +1 -1
- package/dist/esm/Search/Stores/SearchQueryStore.d.ts +1 -2
- package/dist/esm/Search/Stores/SearchQueryStore.d.ts.map +1 -1
- package/dist/esm/Search/Stores/SearchQueryStore.js +2 -2
- package/dist/esm/Search/Stores/SearchResultStore.d.ts +2 -2
- package/dist/esm/Search/Stores/SearchResultStore.d.ts.map +1 -1
- package/dist/esm/Search/Stores/index.d.ts +1 -0
- package/dist/esm/Search/Stores/index.d.ts.map +1 -1
- package/dist/esm/Search/Stores/index.js +1 -0
- package/dist/esm/types.d.ts +8 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@ import { UrlManager } from '@searchspring/snap-url-manager';
|
|
|
2
2
|
import { AbstractStore } from '../Abstract/AbstractStore';
|
|
3
3
|
import { SearchFilterStore, SearchResultStore, SearchMerchandisingStore, SearchPaginationStore, SearchSortingStore } from '../Search/Stores';
|
|
4
4
|
import { StorageStore } from '../Storage/StorageStore';
|
|
5
|
-
import { AutocompleteStateStore, AutocompleteTermStore, AutocompleteQueryStore, AutocompleteFacetStore, AutocompleteTrendingStore } from './Stores';
|
|
5
|
+
import { AutocompleteStateStore, AutocompleteTermStore, AutocompleteQueryStore, AutocompleteFacetStore, AutocompleteTrendingStore, AutocompleteHistoryStore } from './Stores';
|
|
6
6
|
import type { AutocompleteResponseModel, MetaResponseModel } from '@searchspring/snapi-types';
|
|
7
7
|
import type { TrendingResponseModel } from '@searchspring/snap-client';
|
|
8
8
|
import type { AutocompleteStoreConfig, StoreServices } from '../types';
|
|
@@ -20,10 +20,14 @@ export declare class AutocompleteStore extends AbstractStore {
|
|
|
20
20
|
state: AutocompleteStateStore;
|
|
21
21
|
storage: StorageStore;
|
|
22
22
|
trending: AutocompleteTrendingStore;
|
|
23
|
+
history: AutocompleteHistoryStore;
|
|
23
24
|
constructor(config: AutocompleteStoreConfig, services: StoreServices);
|
|
24
25
|
reset(): void;
|
|
26
|
+
initHistory(): void;
|
|
25
27
|
resetTrending(): void;
|
|
28
|
+
resetHistory(): void;
|
|
26
29
|
resetTerms(): void;
|
|
30
|
+
resetSuggestions(): void;
|
|
27
31
|
setService(name: keyof StoreServices, service: UrlManager): void;
|
|
28
32
|
updateTrendingTerms(data: TrendingResponseModel): void;
|
|
29
33
|
update(data?: AutocompleteResponseModel & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteStore.d.ts","sourceRoot":"","sources":["../../../src/Autocomplete/AutocompleteStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"AutocompleteStore.d.ts","sourceRoot":"","sources":["../../../src/Autocomplete/AutocompleteStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAe,MAAM,yBAAyB,CAAC;AACpE,OAAO,EACN,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,qBAAa,iBAAkB,SAAQ,aAAa;IAC5C,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAG,iBAAiB,CAAC;IACzB,aAAa,EAAG,wBAAwB,CAAC;IACzC,MAAM,EAAG,sBAAsB,CAAC;IAChC,KAAK,EAAG,qBAAqB,CAAC;IAC9B,MAAM,EAAG,sBAAsB,CAAC;IAChC,OAAO,EAAG,iBAAiB,CAAC;IAC5B,OAAO,EAAG,iBAAiB,CAAC;IAC5B,UAAU,EAAG,qBAAqB,CAAC;IACnC,OAAO,EAAG,kBAAkB,CAAC;IAC7B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,yBAAyB,CAAC;IACpC,OAAO,EAAE,wBAAwB,CAAC;gBAE7B,MAAM,EAAE,uBAAuB,EAAE,QAAQ,EAAE,aAAa;IAgC7D,KAAK,IAAI,IAAI;IAMb,WAAW,IAAI,IAAI;IAgBnB,aAAa,IAAI,IAAI;IAQrB,YAAY,IAAI,IAAI;IAMpB,UAAU,IAAI,IAAI;IAMlB,gBAAgB,IAAI,IAAI;IAMxB,UAAU,CAAC,IAAI,EAAE,MAAM,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;IAShE,mBAAmB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAWtD,MAAM,CAAC,IAAI,GAAE,yBAAyB,GAAG;QAAE,IAAI,CAAC,EAAE,iBAAiB,CAAA;KAAO,GAAG,IAAI;CAwDxF"}
|
|
@@ -34,6 +34,8 @@ var AutocompleteStore = /** @class */ (function (_super) {
|
|
|
34
34
|
_this.state = new Stores_2.AutocompleteStateStore(services);
|
|
35
35
|
_this.storage = new StorageStore_1.StorageStore();
|
|
36
36
|
_this.trending = [];
|
|
37
|
+
_this.history = [];
|
|
38
|
+
_this.initHistory();
|
|
37
39
|
_this.reset();
|
|
38
40
|
(0, mobx_1.makeObservable)(_this, {
|
|
39
41
|
state: mobx_1.observable,
|
|
@@ -51,7 +53,18 @@ var AutocompleteStore = /** @class */ (function (_super) {
|
|
|
51
53
|
AutocompleteStore.prototype.reset = function () {
|
|
52
54
|
this.state.reset();
|
|
53
55
|
this.update();
|
|
54
|
-
this.
|
|
56
|
+
this.resetTerms();
|
|
57
|
+
};
|
|
58
|
+
AutocompleteStore.prototype.initHistory = function () {
|
|
59
|
+
var _this = this;
|
|
60
|
+
var _a, _b, _c;
|
|
61
|
+
var limit = (_b = (_a = this.config.settings) === null || _a === void 0 ? void 0 : _a.history) === null || _b === void 0 ? void 0 : _b.limit;
|
|
62
|
+
if (limit) {
|
|
63
|
+
var historyStore = new Stores_1.SearchHistoryStore({ siteId: (_c = this.config.globals) === null || _c === void 0 ? void 0 : _c.siteId }, this.services);
|
|
64
|
+
this.history = new Stores_2.AutocompleteHistoryStore(this.services, historyStore.getStoredData(limit), function () {
|
|
65
|
+
_this.resetTerms();
|
|
66
|
+
}, this.state);
|
|
67
|
+
}
|
|
55
68
|
};
|
|
56
69
|
AutocompleteStore.prototype.resetTrending = function () {
|
|
57
70
|
var _a;
|
|
@@ -61,7 +74,17 @@ var AutocompleteStore = /** @class */ (function (_super) {
|
|
|
61
74
|
});
|
|
62
75
|
}
|
|
63
76
|
};
|
|
77
|
+
AutocompleteStore.prototype.resetHistory = function () {
|
|
78
|
+
this.history.forEach(function (term) {
|
|
79
|
+
term.active = false;
|
|
80
|
+
});
|
|
81
|
+
};
|
|
64
82
|
AutocompleteStore.prototype.resetTerms = function () {
|
|
83
|
+
this.resetSuggestions();
|
|
84
|
+
this.resetTrending();
|
|
85
|
+
this.resetHistory();
|
|
86
|
+
};
|
|
87
|
+
AutocompleteStore.prototype.resetSuggestions = function () {
|
|
65
88
|
var _a;
|
|
66
89
|
(_a = this.terms) === null || _a === void 0 ? void 0 : _a.forEach(function (term) {
|
|
67
90
|
term.active = false;
|
|
@@ -97,7 +120,7 @@ var AutocompleteStore = /** @class */ (function (_super) {
|
|
|
97
120
|
// only run if we want to update the terms (not locked)
|
|
98
121
|
if (!this.state.locks.terms.locked) {
|
|
99
122
|
this.terms = new Stores_2.AutocompleteTermStore(this.services, data.autocomplete || {}, data.pagination || {}, function () {
|
|
100
|
-
_this.
|
|
123
|
+
_this.resetTerms();
|
|
101
124
|
}, this.state);
|
|
102
125
|
// only lock if there was data
|
|
103
126
|
data.autocomplete && this.state.locks.terms.lock();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StoreServices } from '../../types';
|
|
2
|
+
import type { AutocompleteStateStore } from './AutocompleteStateStore';
|
|
3
|
+
import { Term } from './AutocompleteTermStore';
|
|
4
|
+
export declare class AutocompleteHistoryStore extends Array<Term> {
|
|
5
|
+
static get [Symbol.species](): ArrayConstructor;
|
|
6
|
+
constructor(services: StoreServices, queries: string[], resetTerms: () => void, rootState: AutocompleteStateStore);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=AutocompleteHistoryStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutocompleteHistoryStore.d.ts","sourceRoot":"","sources":["../../../../src/Autocomplete/Stores/AutocompleteHistoryStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,qBAAa,wBAAyB,SAAQ,KAAK,CAAC,IAAI,CAAC;IACxD,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAE9C;gBAEW,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,IAAI,EAAE,SAAS,EAAE,sBAAsB;CAoBjH"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AutocompleteHistoryStore = void 0;
|
|
19
|
+
var AutocompleteTermStore_1 = require("./AutocompleteTermStore");
|
|
20
|
+
var AutocompleteHistoryStore = /** @class */ (function (_super) {
|
|
21
|
+
__extends(AutocompleteHistoryStore, _super);
|
|
22
|
+
function AutocompleteHistoryStore(services, queries, resetTerms, rootState) {
|
|
23
|
+
var terms = [];
|
|
24
|
+
queries === null || queries === void 0 ? void 0 : queries.map(function (query) {
|
|
25
|
+
terms.push(new AutocompleteTermStore_1.Term(services, {
|
|
26
|
+
active: false,
|
|
27
|
+
value: query,
|
|
28
|
+
}, terms, resetTerms, rootState));
|
|
29
|
+
});
|
|
30
|
+
return _super.apply(this, terms) || this;
|
|
31
|
+
}
|
|
32
|
+
Object.defineProperty(AutocompleteHistoryStore, Symbol.species, {
|
|
33
|
+
get: function () {
|
|
34
|
+
return Array;
|
|
35
|
+
},
|
|
36
|
+
enumerable: false,
|
|
37
|
+
configurable: true
|
|
38
|
+
});
|
|
39
|
+
return AutocompleteHistoryStore;
|
|
40
|
+
}(Array));
|
|
41
|
+
exports.AutocompleteHistoryStore = AutocompleteHistoryStore;
|
|
@@ -3,4 +3,5 @@ export { AutocompleteQueryStore } from './AutocompleteQueryStore';
|
|
|
3
3
|
export { AutocompleteStateStore } from './AutocompleteStateStore';
|
|
4
4
|
export { AutocompleteTermStore } from './AutocompleteTermStore';
|
|
5
5
|
export { AutocompleteTrendingStore } from './AutocompleteTrendingStore';
|
|
6
|
+
export { AutocompleteHistoryStore } from './AutocompleteHistoryStore';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Autocomplete/Stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Autocomplete/Stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AutocompleteTrendingStore = exports.AutocompleteTermStore = exports.AutocompleteStateStore = exports.AutocompleteQueryStore = exports.AutocompleteFacetStore = void 0;
|
|
3
|
+
exports.AutocompleteHistoryStore = exports.AutocompleteTrendingStore = exports.AutocompleteTermStore = exports.AutocompleteStateStore = exports.AutocompleteQueryStore = exports.AutocompleteFacetStore = void 0;
|
|
4
4
|
var AutocompleteFacetStore_1 = require("./AutocompleteFacetStore");
|
|
5
5
|
Object.defineProperty(exports, "AutocompleteFacetStore", { enumerable: true, get: function () { return AutocompleteFacetStore_1.AutocompleteFacetStore; } });
|
|
6
6
|
var AutocompleteQueryStore_1 = require("./AutocompleteQueryStore");
|
|
@@ -11,3 +11,5 @@ var AutocompleteTermStore_1 = require("./AutocompleteTermStore");
|
|
|
11
11
|
Object.defineProperty(exports, "AutocompleteTermStore", { enumerable: true, get: function () { return AutocompleteTermStore_1.AutocompleteTermStore; } });
|
|
12
12
|
var AutocompleteTrendingStore_1 = require("./AutocompleteTrendingStore");
|
|
13
13
|
Object.defineProperty(exports, "AutocompleteTrendingStore", { enumerable: true, get: function () { return AutocompleteTrendingStore_1.AutocompleteTrendingStore; } });
|
|
14
|
+
var AutocompleteHistoryStore_1 = require("./AutocompleteHistoryStore");
|
|
15
|
+
Object.defineProperty(exports, "AutocompleteHistoryStore", { enumerable: true, get: function () { return AutocompleteHistoryStore_1.AutocompleteHistoryStore; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StoreServices } from '../../types';
|
|
2
1
|
import type { RecommendCombinedResponseModel } from '@searchspring/snap-client';
|
|
2
|
+
import type { StoreServices } from '../../types';
|
|
3
3
|
export declare class RecommendationProfileStore {
|
|
4
4
|
tag: string;
|
|
5
5
|
placement: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecommendationProfileStore.d.ts","sourceRoot":"","sources":["../../../../src/Recommendation/Stores/RecommendationProfileStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RecommendationProfileStore.d.ts","sourceRoot":"","sources":["../../../../src/Recommendation/Stores/RecommendationProfileStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,0BAA0B;IAC/B,GAAG,EAAG,MAAM,CAAC;IACb,SAAS,EAAG,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;gBAE7B,QAAQ,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,8BAA8B;CAe1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SearchResponseModel, MetaResponseModel } from '@searchspring/snapi-types';
|
|
2
2
|
import type { SearchStoreConfig, StoreServices } from '../types';
|
|
3
|
-
import { SearchMerchandisingStore, SearchFacetStore, SearchFilterStore, SearchResultStore, SearchPaginationStore, SearchSortingStore, SearchQueryStore } from './Stores';
|
|
3
|
+
import { SearchMerchandisingStore, SearchFacetStore, SearchFilterStore, SearchResultStore, SearchPaginationStore, SearchSortingStore, SearchQueryStore, SearchHistoryStore } from './Stores';
|
|
4
4
|
import { AbstractStore } from '../Abstract/AbstractStore';
|
|
5
5
|
import { StorageStore } from '../Storage/StorageStore';
|
|
6
6
|
export declare class SearchStore extends AbstractStore {
|
|
@@ -14,6 +14,7 @@ export declare class SearchStore extends AbstractStore {
|
|
|
14
14
|
pagination: SearchPaginationStore;
|
|
15
15
|
sorting: SearchSortingStore;
|
|
16
16
|
storage: StorageStore;
|
|
17
|
+
history: SearchHistoryStore;
|
|
17
18
|
constructor(config: SearchStoreConfig, services: StoreServices);
|
|
18
19
|
reset(): void;
|
|
19
20
|
update(data?: SearchResponseModel & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchStore.d.ts","sourceRoot":"","sources":["../../../src/Search/SearchStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EACN,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchStore.d.ts","sourceRoot":"","sources":["../../../src/Search/SearchStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EACN,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,WAAY,SAAQ,aAAa;IACtC,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAG,iBAAiB,CAAC;IACzB,aAAa,EAAG,wBAAwB,CAAC;IACzC,MAAM,EAAG,gBAAgB,CAAC;IAC1B,MAAM,EAAG,gBAAgB,CAAC;IAC1B,OAAO,EAAG,iBAAiB,CAAC;IAC5B,OAAO,EAAG,iBAAiB,CAAC;IAC5B,UAAU,EAAG,qBAAqB,CAAC;IACnC,OAAO,EAAG,kBAAkB,CAAC;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,kBAAkB,CAAC;gBAEvB,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa;IAiDvD,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,IAAI,GAAE,mBAAmB,GAAG;QAAE,IAAI,CAAC,EAAE,iBAAiB,CAAA;KAAO,GAAG,IAAI;CAoBlF"}
|
|
@@ -24,13 +24,21 @@ var SearchStore = /** @class */ (function (_super) {
|
|
|
24
24
|
__extends(SearchStore, _super);
|
|
25
25
|
function SearchStore(config, services) {
|
|
26
26
|
var _this = this;
|
|
27
|
-
var _a;
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
28
28
|
_this = _super.call(this, config) || this;
|
|
29
29
|
if (typeof services != 'object' || typeof ((_a = services.urlManager) === null || _a === void 0 ? void 0 : _a.subscribe) != 'function') {
|
|
30
30
|
throw new Error("Invalid service 'urlManager' passed to SearchStore. Missing \"subscribe\" function.");
|
|
31
31
|
}
|
|
32
32
|
_this.services = services;
|
|
33
33
|
_this.storage = new StorageStore_1.StorageStore();
|
|
34
|
+
var historyConfig = {
|
|
35
|
+
url: (_c = (_b = _this.config.settings) === null || _b === void 0 ? void 0 : _b.history) === null || _c === void 0 ? void 0 : _c.url,
|
|
36
|
+
max: (_e = (_d = _this.config.settings) === null || _d === void 0 ? void 0 : _d.history) === null || _e === void 0 ? void 0 : _e.max,
|
|
37
|
+
};
|
|
38
|
+
if ((_f = _this.config.globals) === null || _f === void 0 ? void 0 : _f.siteId) {
|
|
39
|
+
historyConfig.siteId = (_g = _this.config.globals) === null || _g === void 0 ? void 0 : _g.siteId;
|
|
40
|
+
}
|
|
41
|
+
_this.history = new Stores_1.SearchHistoryStore(historyConfig, _this.services);
|
|
34
42
|
_this.update();
|
|
35
43
|
(0, mobx_1.makeObservable)(_this, {
|
|
36
44
|
search: mobx_1.observable,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoreServices } from '../../types';
|
|
2
|
+
import { Query } from './SearchQueryStore';
|
|
3
|
+
export declare type HistoryStoreConfig = {
|
|
4
|
+
siteId?: string;
|
|
5
|
+
max?: number;
|
|
6
|
+
url?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class SearchHistoryStore {
|
|
9
|
+
private config;
|
|
10
|
+
private storage;
|
|
11
|
+
private services;
|
|
12
|
+
constructor(config: HistoryStoreConfig, services: StoreServices);
|
|
13
|
+
get queries(): Query[];
|
|
14
|
+
save(term: string): void;
|
|
15
|
+
remove(term: string): void;
|
|
16
|
+
reset(): void;
|
|
17
|
+
getStoredData(limit?: number): string[];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=SearchHistoryStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchHistoryStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchHistoryStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,oBAAY,kBAAkB,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AACF,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,QAAQ,CAAgB;gBAEpB,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa;IAuB/D,IAAI,OAAO,IAAI,KAAK,EAAE,CAGrB;IAEM,IAAI,CAAC,IAAI,EAAE,MAAM;IAkBjB,MAAM,CAAC,IAAI,EAAE,MAAM;IAWnB,KAAK,IAAI,IAAI;IAIb,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;CAmB9C"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SearchHistoryStore = void 0;
|
|
15
|
+
var StorageStore_1 = require("../../Storage/StorageStore");
|
|
16
|
+
var SearchQueryStore_1 = require("./SearchQueryStore");
|
|
17
|
+
var SearchHistoryStore = /** @class */ (function () {
|
|
18
|
+
function SearchHistoryStore(config, services) {
|
|
19
|
+
var _this = this;
|
|
20
|
+
this.config = config;
|
|
21
|
+
this.services = services;
|
|
22
|
+
if (this.config.url) {
|
|
23
|
+
this.services.urlManager = this.services.urlManager.withConfig(function (translatorConfig) {
|
|
24
|
+
return __assign(__assign({}, translatorConfig), { urlRoot: _this.config.url });
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (!Number.isInteger(this.config.max)) {
|
|
28
|
+
this.config.max = 25;
|
|
29
|
+
}
|
|
30
|
+
this.storage = new StorageStore_1.StorageStore({
|
|
31
|
+
type: StorageStore_1.StorageType.LOCAL,
|
|
32
|
+
key: "ss-history".concat(this.config.siteId ? "-".concat(this.config.siteId) : ""),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(SearchHistoryStore.prototype, "queries", {
|
|
36
|
+
get: function () {
|
|
37
|
+
var _this = this;
|
|
38
|
+
var queries = this.getStoredData();
|
|
39
|
+
return queries.map(function (query) { return new SearchQueryStore_1.Query(_this.services, query); });
|
|
40
|
+
},
|
|
41
|
+
enumerable: false,
|
|
42
|
+
configurable: true
|
|
43
|
+
});
|
|
44
|
+
SearchHistoryStore.prototype.save = function (term) {
|
|
45
|
+
var history = this.getStoredData();
|
|
46
|
+
// removing term if already present
|
|
47
|
+
var index = history.indexOf(term);
|
|
48
|
+
if (index != -1) {
|
|
49
|
+
history.splice(index, 1);
|
|
50
|
+
}
|
|
51
|
+
// adding term to array
|
|
52
|
+
history.unshift(term);
|
|
53
|
+
if (history.length > this.config.max) {
|
|
54
|
+
history.pop();
|
|
55
|
+
}
|
|
56
|
+
this.storage.set('history', JSON.stringify(history));
|
|
57
|
+
};
|
|
58
|
+
SearchHistoryStore.prototype.remove = function (term) {
|
|
59
|
+
var history = this.getStoredData();
|
|
60
|
+
// removing term if already present
|
|
61
|
+
var index = history.indexOf(term);
|
|
62
|
+
if (index != -1) {
|
|
63
|
+
history.splice(index, 1);
|
|
64
|
+
this.storage.set('history', JSON.stringify(history));
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
SearchHistoryStore.prototype.reset = function () {
|
|
68
|
+
this.storage.clear();
|
|
69
|
+
};
|
|
70
|
+
SearchHistoryStore.prototype.getStoredData = function (limit) {
|
|
71
|
+
var storedHistory = this.storage.get('history');
|
|
72
|
+
if (storedHistory) {
|
|
73
|
+
try {
|
|
74
|
+
var history_1 = JSON.parse(storedHistory);
|
|
75
|
+
if (Array.isArray(history_1)) {
|
|
76
|
+
if (limit && Number.isInteger(limit)) {
|
|
77
|
+
return history_1.slice(0, limit);
|
|
78
|
+
}
|
|
79
|
+
return history_1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
// storage corrupted - resetting it
|
|
84
|
+
this.reset();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return [];
|
|
88
|
+
};
|
|
89
|
+
return SearchHistoryStore;
|
|
90
|
+
}());
|
|
91
|
+
exports.SearchHistoryStore = SearchHistoryStore;
|
|
@@ -13,6 +13,7 @@ export declare class SearchMerchandisingStore {
|
|
|
13
13
|
content: BannerContent;
|
|
14
14
|
campaigns: SearchResponseModelMerchandisingCampaigns[];
|
|
15
15
|
landingPage?: SearchResponseModelMerchandisingCampaigns;
|
|
16
|
+
personalized?: boolean;
|
|
16
17
|
constructor(services: StoreServices, merchData: SearchResponseModelMerchandising);
|
|
17
18
|
}
|
|
18
19
|
declare class Content extends Array<string | SearchResponseModelMerchandisingContentInline> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchMerchandisingStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchMerchandisingStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EACX,gCAAgC,EAChC,6CAA6C,EAC7C,yCAAyC,EACzC,MAAM,2BAA2B,CAAC;AAEnC,oBAAY,WAAW;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CACjB;AAED,oBAAY,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAElE,qBAAa,wBAAwB;IAC7B,QAAQ,SAAM;IACd,OAAO,EAAE,aAAa,CAAM;IAC5B,SAAS,EAAE,yCAAyC,EAAE,CAAM;IAC5D,WAAW,CAAC,EAAE,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchMerchandisingStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchMerchandisingStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EACX,gCAAgC,EAChC,6CAA6C,EAC7C,yCAAyC,EACzC,MAAM,2BAA2B,CAAC;AAEnC,oBAAY,WAAW;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CACjB;AAED,oBAAY,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAElE,qBAAa,wBAAwB;IAC7B,QAAQ,SAAM;IACd,OAAO,EAAE,aAAa,CAAM;IAC5B,SAAS,EAAE,yCAAyC,EAAE,CAAM;IAC5D,WAAW,CAAC,EAAE,yCAAyC,CAAC;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;gBAElB,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,gCAAgC;CAwBhF;AAED,cAAM,OAAQ,SAAQ,KAAK,CAAC,MAAM,GAAG,6CAA6C,CAAC;IAClF,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAE9C;gBAEW,OAAO,EAAE,MAAM,EAAE,GAAG,6CAA6C,EAAE;CAG/E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StoreConfigs, StoreServices } from '../../types';
|
|
2
2
|
import type { SearchResponseModelPagination, MetaResponseModel } from '@searchspring/snapi-types';
|
|
3
3
|
import type { UrlManager } from '@searchspring/snap-url-manager';
|
|
4
4
|
export declare class SearchPaginationStore {
|
|
@@ -12,8 +12,8 @@ export declare class SearchPaginationStore {
|
|
|
12
12
|
defaultPageSize: number;
|
|
13
13
|
totalResults: number;
|
|
14
14
|
totalPages: number;
|
|
15
|
-
controllerConfig:
|
|
16
|
-
constructor(config:
|
|
15
|
+
controllerConfig: StoreConfigs;
|
|
16
|
+
constructor(config: StoreConfigs, services: StoreServices, paginationData: SearchResponseModelPagination | undefined, meta: MetaResponseModel);
|
|
17
17
|
get begin(): number;
|
|
18
18
|
get end(): number;
|
|
19
19
|
get multiplePages(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchPaginationStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchPaginationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SearchPaginationStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchPaginationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,qBAAa,qBAAqB;IAC1B,QAAQ,EAAE,aAAa,CAAC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oreServices, search: SearchResponseModelSearch);
|
|
10
10
|
}
|
|
11
|
-
declare class Query {
|
|
11
|
+
export declare class Query {
|
|
12
12
|
string: string;
|
|
13
13
|
url: UrlManager;
|
|
14
14
|
constructor(services: StoreServices, query: string);
|
|
15
15
|
}
|
|
16
|
-
export {};
|
|
17
16
|
//# sourceMappingURL=SearchQueryStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchQueryStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchQueryStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,sCAAsC,EAAE,MAAM,2BAA2B,CAAC;AAEnH,qBAAa,gBAAgB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,SAAS,CAAC,EAAE,sCAAsC,CAAC;gBAE9C,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAyB;CAyBtE;AASD,
|
|
1
|
+
{"version":3,"file":"SearchQueryStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchQueryStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,sCAAsC,EAAE,MAAM,2BAA2B,CAAC;AAEnH,qBAAa,gBAAgB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,SAAS,CAAC,EAAE,sCAAsC,CAAC;gBAE9C,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAyB;CAyBtE;AASD,qBAAa,KAAK;IACV,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,UAAU,CAAC;gBAEX,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM;CASlD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchQueryStore = void 0;
|
|
3
|
+
exports.Query = exports.SearchQueryStore = void 0;
|
|
4
4
|
var mobx_1 = require("mobx");
|
|
5
5
|
var SearchQueryStore = /** @class */ (function () {
|
|
6
6
|
function SearchQueryStore(services, search) {
|
|
@@ -28,11 +28,13 @@ var SearchQueryStore = /** @class */ (function () {
|
|
|
28
28
|
exports.SearchQueryStore = SearchQueryStore;
|
|
29
29
|
var Query = /** @class */ (function () {
|
|
30
30
|
function Query(services, query) {
|
|
31
|
+
var _a;
|
|
31
32
|
this.string = query;
|
|
32
|
-
this.url = services.urlManager.remove('page').remove('filter').set('query', this.string);
|
|
33
|
+
this.url = (_a = services === null || services === void 0 ? void 0 : services.urlManager) === null || _a === void 0 ? void 0 : _a.remove('page').remove('filter').set('query', this.string);
|
|
33
34
|
(0, mobx_1.makeObservable)(this, {
|
|
34
35
|
string: mobx_1.observable,
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
return Query;
|
|
38
39
|
}());
|
|
40
|
+
exports.Query = Query;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StoreServices, StoreConfigs } from '../../types';
|
|
2
2
|
import type { SearchResponseModelResult, SearchResponseModelPagination, SearchResponseModelMerchandising, SearchResponseModelResultMappings, SearchResponseModelMerchandisingContentInline, SearchResponseModelMerchandisingContentConfig } from '@searchspring/snapi-types';
|
|
3
3
|
export declare class SearchResultStore extends Array<Product | Banner> {
|
|
4
4
|
static get [Symbol.species](): ArrayConstructor;
|
|
5
|
-
constructor(config:
|
|
5
|
+
constructor(config: StoreConfigs, services: StoreServices, resultData?: SearchResponseModelResult[], paginationData?: SearchResponseModelPagination, merchData?: SearchResponseModelMerchandising);
|
|
6
6
|
}
|
|
7
7
|
export declare class Banner {
|
|
8
8
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResultStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchResultStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SearchResultStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchResultStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqB,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EACX,yBAAyB,EACzB,6BAA6B,EAC7B,gCAAgC,EAChC,iCAAiC,EACjC,6CAA6C,EAC7C,6CAA6C,EAC7C,MAAM,2BAA2B,CAAC;AAEnC,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC7D,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAE9C;gBAGA,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,aAAa,EACvB,UAAU,CAAC,EAAE,yBAAyB,EAAE,EACxC,cAAc,CAAC,EAAE,6BAA6B,EAC9C,SAAS,CAAC,EAAE,gCAAgC;CAqB7C;AAED,qBAAa,MAAM;IACX,IAAI,SAAY;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IACzC,QAAQ,EAAE,iCAAiC,CAEhD;IACK,MAAM,KAAM;IACZ,MAAM,EAAE,6CAA6C,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;gBAET,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,6CAA6C;CAW1F;AAED,qBAAa,OAAO;IACZ,IAAI,SAAa;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IACzC,QAAQ,EAAE,iCAAiC,CAEhD;IACK,MAAM,KAAM;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAM;gBAExB,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAyB;CA8BtE;AAED,cAAM,KAAK;IACH,IAAI,SAAW;IACf,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IACzC,MAAM,KAAM;gBAEP,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAyB;CAUtE"}
|
|
@@ -5,4 +5,5 @@ export { SearchPaginationStore } from './SearchPaginationStore';
|
|
|
5
5
|
export { SearchResultStore, Product, Banner } from './SearchResultStore';
|
|
6
6
|
export { SearchSortingStore } from './SearchSortingStore';
|
|
7
7
|
export { SearchQueryStore } from './SearchQueryStore';
|
|
8
|
+
export { SearchHistoryStore } from './SearchHistoryStore';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChI,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChI,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchQueryStore = exports.SearchSortingStore = exports.Banner = exports.Product = exports.SearchResultStore = exports.SearchPaginationStore = exports.Filter = exports.SearchFilterStore = exports.FacetRangeValue = exports.FacetHierarchyValue = exports.FacetValue = exports.RangeFacet = exports.ValueFacet = exports.SearchFacetStore = exports.ContentType = exports.SearchMerchandisingStore = void 0;
|
|
3
|
+
exports.SearchHistoryStore = exports.SearchQueryStore = exports.SearchSortingStore = exports.Banner = exports.Product = exports.SearchResultStore = exports.SearchPaginationStore = exports.Filter = exports.SearchFilterStore = exports.FacetRangeValue = exports.FacetHierarchyValue = exports.FacetValue = exports.RangeFacet = exports.ValueFacet = exports.SearchFacetStore = exports.ContentType = exports.SearchMerchandisingStore = void 0;
|
|
4
4
|
var SearchMerchandisingStore_1 = require("./SearchMerchandisingStore");
|
|
5
5
|
Object.defineProperty(exports, "SearchMerchandisingStore", { enumerable: true, get: function () { return SearchMerchandisingStore_1.SearchMerchandisingStore; } });
|
|
6
6
|
Object.defineProperty(exports, "ContentType", { enumerable: true, get: function () { return SearchMerchandisingStore_1.ContentType; } });
|
|
@@ -24,3 +24,5 @@ var SearchSortingStore_1 = require("./SearchSortingStore");
|
|
|
24
24
|
Object.defineProperty(exports, "SearchSortingStore", { enumerable: true, get: function () { return SearchSortingStore_1.SearchSortingStore; } });
|
|
25
25
|
var SearchQueryStore_1 = require("./SearchQueryStore");
|
|
26
26
|
Object.defineProperty(exports, "SearchQueryStore", { enumerable: true, get: function () { return SearchQueryStore_1.SearchQueryStore; } });
|
|
27
|
+
var SearchHistoryStore_1 = require("./SearchHistoryStore");
|
|
28
|
+
Object.defineProperty(exports, "SearchHistoryStore", { enumerable: true, get: function () { return SearchHistoryStore_1.SearchHistoryStore; } });
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ export declare type SearchStoreConfig = StoreConfig & {
|
|
|
20
20
|
backfill?: number;
|
|
21
21
|
restorePosition?: boolean;
|
|
22
22
|
};
|
|
23
|
+
history?: {
|
|
24
|
+
url?: string;
|
|
25
|
+
max?: number;
|
|
26
|
+
};
|
|
23
27
|
};
|
|
24
28
|
};
|
|
25
29
|
export declare type FacetStoreConfig = {
|
|
@@ -61,6 +65,10 @@ export declare type AutocompleteStoreConfig = StoreConfig & {
|
|
|
61
65
|
limit: number;
|
|
62
66
|
showResults?: boolean;
|
|
63
67
|
};
|
|
68
|
+
history?: {
|
|
69
|
+
limit: number;
|
|
70
|
+
showResults?: boolean;
|
|
71
|
+
};
|
|
64
72
|
};
|
|
65
73
|
};
|
|
66
74
|
export declare type RecommendationStoreConfig = StoreConfig & {
|
package/dist/c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,CAAC;QACF,OAAO,CAAC,EAAE;YACT,KAAK,EAAE,MAAM,CAAC;YACd,WAAW,CAAC,EAAE,OAAO,CAAC;SACtB,CAAC;KACF,CAAC;CACF,CAAC;AAGF,oBAAY,yBAAyB,GAAG,WAAW,GAAG;IACrD,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,YAAY,GAAG,iBAAiB,GAAG,uBAAuB,GAAG,iBAAiB,GAAG,yBAAyB,CAAC;AAEvH,oBAAY,aAAa,GAAG;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,oBAAY,SAAS;IACpB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,KAAK,UAAU;CACf;AAED,oBAAY,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,wCAAwC,EAAE,CAAC;IACjD,KAAK,EAAE,GAAG,CAAC;CACX,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { UrlManager } from '@searchspring/snap-url-manager';
|
|
|
2
2
|
import { AbstractStore } from '../Abstract/AbstractStore';
|
|
3
3
|
import { SearchFilterStore, SearchResultStore, SearchMerchandisingStore, SearchPaginationStore, SearchSortingStore } from '../Search/Stores';
|
|
4
4
|
import { StorageStore } from '../Storage/StorageStore';
|
|
5
|
-
import { AutocompleteStateStore, AutocompleteTermStore, AutocompleteQueryStore, AutocompleteFacetStore, AutocompleteTrendingStore } from './Stores';
|
|
5
|
+
import { AutocompleteStateStore, AutocompleteTermStore, AutocompleteQueryStore, AutocompleteFacetStore, AutocompleteTrendingStore, AutocompleteHistoryStore } from './Stores';
|
|
6
6
|
import type { AutocompleteResponseModel, MetaResponseModel } from '@searchspring/snapi-types';
|
|
7
7
|
import type { TrendingResponseModel } from '@searchspring/snap-client';
|
|
8
8
|
import type { AutocompleteStoreConfig, StoreServices } from '../types';
|
|
@@ -20,10 +20,14 @@ export declare class AutocompleteStore extends AbstractStore {
|
|
|
20
20
|
state: AutocompleteStateStore;
|
|
21
21
|
storage: StorageStore;
|
|
22
22
|
trending: AutocompleteTrendingStore;
|
|
23
|
+
history: AutocompleteHistoryStore;
|
|
23
24
|
constructor(config: AutocompleteStoreConfig, services: StoreServices);
|
|
24
25
|
reset(): void;
|
|
26
|
+
initHistory(): void;
|
|
25
27
|
resetTrending(): void;
|
|
28
|
+
resetHistory(): void;
|
|
26
29
|
resetTerms(): void;
|
|
30
|
+
resetSuggestions(): void;
|
|
27
31
|
setService(name: keyof StoreServices, service: UrlManager): void;
|
|
28
32
|
updateTrendingTerms(data: TrendingResponseModel): void;
|
|
29
33
|
update(data?: AutocompleteResponseModel & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteStore.d.ts","sourceRoot":"","sources":["../../../src/Autocomplete/AutocompleteStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"AutocompleteStore.d.ts","sourceRoot":"","sources":["../../../src/Autocomplete/AutocompleteStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAe,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,IAAI,CAAC,EAAE,iBAAiB,CAAA;KAAO,GAAG,IAAI;CAwDxF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { makeObservable, observable } from 'mobx';
|
|
2
2
|
import { AbstractStore } from '../Abstract/AbstractStore';
|
|
3
|
-
import { SearchFilterStore, SearchResultStore, SearchMerchandisingStore, SearchPaginationStore, SearchSortingStore } from '../Search/Stores';
|
|
3
|
+
import { SearchFilterStore, SearchResultStore, SearchMerchandisingStore, SearchPaginationStore, SearchSortingStore, SearchHistoryStore, } from '../Search/Stores';
|
|
4
4
|
import { StorageStore } from '../Storage/StorageStore';
|
|
5
|
-
import { AutocompleteStateStore, AutocompleteTermStore, AutocompleteQueryStore, AutocompleteFacetStore, AutocompleteTrendingStore } from './Stores';
|
|
5
|
+
import { AutocompleteStateStore, AutocompleteTermStore, AutocompleteQueryStore, AutocompleteFacetStore, AutocompleteTrendingStore, AutocompleteHistoryStore, } from './Stores';
|
|
6
6
|
export class AutocompleteStore extends AbstractStore {
|
|
7
7
|
constructor(config, services) {
|
|
8
8
|
super(config);
|
|
@@ -13,6 +13,8 @@ export class AutocompleteStore extends AbstractStore {
|
|
|
13
13
|
this.state = new AutocompleteStateStore(services);
|
|
14
14
|
this.storage = new StorageStore();
|
|
15
15
|
this.trending = [];
|
|
16
|
+
this.history = [];
|
|
17
|
+
this.initHistory();
|
|
16
18
|
this.reset();
|
|
17
19
|
makeObservable(this, {
|
|
18
20
|
state: observable,
|
|
@@ -29,7 +31,16 @@ export class AutocompleteStore extends AbstractStore {
|
|
|
29
31
|
reset() {
|
|
30
32
|
this.state.reset();
|
|
31
33
|
this.update();
|
|
32
|
-
this.
|
|
34
|
+
this.resetTerms();
|
|
35
|
+
}
|
|
36
|
+
initHistory() {
|
|
37
|
+
const limit = this.config.settings?.history?.limit;
|
|
38
|
+
if (limit) {
|
|
39
|
+
const historyStore = new SearchHistoryStore({ siteId: this.config.globals?.siteId }, this.services);
|
|
40
|
+
this.history = new AutocompleteHistoryStore(this.services, historyStore.getStoredData(limit), () => {
|
|
41
|
+
this.resetTerms();
|
|
42
|
+
}, this.state);
|
|
43
|
+
}
|
|
33
44
|
}
|
|
34
45
|
resetTrending() {
|
|
35
46
|
if (this.trending?.length) {
|
|
@@ -38,7 +49,17 @@ export class AutocompleteStore extends AbstractStore {
|
|
|
38
49
|
});
|
|
39
50
|
}
|
|
40
51
|
}
|
|
52
|
+
resetHistory() {
|
|
53
|
+
this.history.forEach((term) => {
|
|
54
|
+
term.active = false;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
41
57
|
resetTerms() {
|
|
58
|
+
this.resetSuggestions();
|
|
59
|
+
this.resetTrending();
|
|
60
|
+
this.resetHistory();
|
|
61
|
+
}
|
|
62
|
+
resetSuggestions() {
|
|
42
63
|
this.terms?.forEach((term) => {
|
|
43
64
|
term.active = false;
|
|
44
65
|
});
|
|
@@ -69,7 +90,7 @@ export class AutocompleteStore extends AbstractStore {
|
|
|
69
90
|
// only run if we want to update the terms (not locked)
|
|
70
91
|
if (!this.state.locks.terms.locked) {
|
|
71
92
|
this.terms = new AutocompleteTermStore(this.services, data.autocomplete || {}, data.pagination || {}, () => {
|
|
72
|
-
this.
|
|
93
|
+
this.resetTerms();
|
|
73
94
|
}, this.state);
|
|
74
95
|
// only lock if there was data
|
|
75
96
|
data.autocomplete && this.state.locks.terms.lock();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StoreServices } from '../../types';
|
|
2
|
+
import type { AutocompleteStateStore } from './AutocompleteStateStore';
|
|
3
|
+
import { Term } from './AutocompleteTermStore';
|
|
4
|
+
export declare class AutocompleteHistoryStore extends Array<Term> {
|
|
5
|
+
static get [Symbol.species](): ArrayConstructor;
|
|
6
|
+
constructor(services: StoreServices, queries: string[], resetTerms: () => void, rootState: AutocompleteStateStore);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=AutocompleteHistoryStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutocompleteHistoryStore.d.ts","sourceRoot":"","sources":["../../../../src/Autocomplete/Stores/AutocompleteHistoryStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,qBAAa,wBAAyB,SAAQ,KAAK,CAAC,IAAI,CAAC;IACxD,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAE9C;gBAEW,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,IAAI,EAAE,SAAS,EAAE,sBAAsB;CAoBjH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Term } from './AutocompleteTermStore';
|
|
2
|
+
export class AutocompleteHistoryStore extends Array {
|
|
3
|
+
static get [Symbol.species]() {
|
|
4
|
+
return Array;
|
|
5
|
+
}
|
|
6
|
+
constructor(services, queries, resetTerms, rootState) {
|
|
7
|
+
const terms = [];
|
|
8
|
+
queries?.map((query) => {
|
|
9
|
+
terms.push(new Term(services, {
|
|
10
|
+
active: false,
|
|
11
|
+
value: query,
|
|
12
|
+
}, terms, resetTerms, rootState));
|
|
13
|
+
});
|
|
14
|
+
super(...terms);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -3,4 +3,5 @@ export { AutocompleteQueryStore } from './AutocompleteQueryStore';
|
|
|
3
3
|
export { AutocompleteStateStore } from './AutocompleteStateStore';
|
|
4
4
|
export { AutocompleteTermStore } from './AutocompleteTermStore';
|
|
5
5
|
export { AutocompleteTrendingStore } from './AutocompleteTrendingStore';
|
|
6
|
+
export { AutocompleteHistoryStore } from './AutocompleteHistoryStore';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Autocomplete/Stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Autocomplete/Stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -3,3 +3,4 @@ export { AutocompleteQueryStore } from './AutocompleteQueryStore';
|
|
|
3
3
|
export { AutocompleteStateStore } from './AutocompleteStateStore';
|
|
4
4
|
export { AutocompleteTermStore } from './AutocompleteTermStore';
|
|
5
5
|
export { AutocompleteTrendingStore } from './AutocompleteTrendingStore';
|
|
6
|
+
export { AutocompleteHistoryStore } from './AutocompleteHistoryStore';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StoreServices } from '../../types';
|
|
2
1
|
import type { RecommendCombinedResponseModel } from '@searchspring/snap-client';
|
|
2
|
+
import type { StoreServices } from '../../types';
|
|
3
3
|
export declare class RecommendationProfileStore {
|
|
4
4
|
tag: string;
|
|
5
5
|
placement: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecommendationProfileStore.d.ts","sourceRoot":"","sources":["../../../../src/Recommendation/Stores/RecommendationProfileStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RecommendationProfileStore.d.ts","sourceRoot":"","sources":["../../../../src/Recommendation/Stores/RecommendationProfileStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,0BAA0B;IAC/B,GAAG,EAAG,MAAM,CAAC;IACb,SAAS,EAAG,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;gBAE7B,QAAQ,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,8BAA8B;CAe1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SearchResponseModel, MetaResponseModel } from '@searchspring/snapi-types';
|
|
2
2
|
import type { SearchStoreConfig, StoreServices } from '../types';
|
|
3
|
-
import { SearchMerchandisingStore, SearchFacetStore, SearchFilterStore, SearchResultStore, SearchPaginationStore, SearchSortingStore, SearchQueryStore } from './Stores';
|
|
3
|
+
import { SearchMerchandisingStore, SearchFacetStore, SearchFilterStore, SearchResultStore, SearchPaginationStore, SearchSortingStore, SearchQueryStore, SearchHistoryStore } from './Stores';
|
|
4
4
|
import { AbstractStore } from '../Abstract/AbstractStore';
|
|
5
5
|
import { StorageStore } from '../Storage/StorageStore';
|
|
6
6
|
export declare class SearchStore extends AbstractStore {
|
|
@@ -14,6 +14,7 @@ export declare class SearchStore extends AbstractStore {
|
|
|
14
14
|
pagination: SearchPaginationStore;
|
|
15
15
|
sorting: SearchSortingStore;
|
|
16
16
|
storage: StorageStore;
|
|
17
|
+
history: SearchHistoryStore;
|
|
17
18
|
constructor(config: SearchStoreConfig, services: StoreServices);
|
|
18
19
|
reset(): void;
|
|
19
20
|
update(data?: SearchResponseModel & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchStore.d.ts","sourceRoot":"","sources":["../../../src/Search/SearchStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EACN,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchStore.d.ts","sourceRoot":"","sources":["../../../src/Search/SearchStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EACN,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,WAAY,SAAQ,aAAa;IACtC,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAG,iBAAiB,CAAC;IACzB,aAAa,EAAG,wBAAwB,CAAC;IACzC,MAAM,EAAG,gBAAgB,CAAC;IAC1B,MAAM,EAAG,gBAAgB,CAAC;IAC1B,OAAO,EAAG,iBAAiB,CAAC;IAC5B,OAAO,EAAG,iBAAiB,CAAC;IAC5B,UAAU,EAAG,qBAAqB,CAAC;IACnC,OAAO,EAAG,kBAAkB,CAAC;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,kBAAkB,CAAC;gBAEvB,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa;IAiDvD,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,IAAI,GAAE,mBAAmB,GAAG;QAAE,IAAI,CAAC,EAAE,iBAAiB,CAAA;KAAO,GAAG,IAAI;CAoBlF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeObservable, observable } from 'mobx';
|
|
2
|
-
import { SearchMerchandisingStore, SearchFacetStore, SearchFilterStore, SearchResultStore, SearchPaginationStore, SearchSortingStore, SearchQueryStore, } from './Stores';
|
|
2
|
+
import { SearchMerchandisingStore, SearchFacetStore, SearchFilterStore, SearchResultStore, SearchPaginationStore, SearchSortingStore, SearchQueryStore, SearchHistoryStore, } from './Stores';
|
|
3
3
|
import { AbstractStore } from '../Abstract/AbstractStore';
|
|
4
4
|
import { StorageStore } from '../Storage/StorageStore';
|
|
5
5
|
export class SearchStore extends AbstractStore {
|
|
@@ -10,6 +10,14 @@ export class SearchStore extends AbstractStore {
|
|
|
10
10
|
}
|
|
11
11
|
this.services = services;
|
|
12
12
|
this.storage = new StorageStore();
|
|
13
|
+
const historyConfig = {
|
|
14
|
+
url: this.config.settings?.history?.url,
|
|
15
|
+
max: this.config.settings?.history?.max,
|
|
16
|
+
};
|
|
17
|
+
if (this.config.globals?.siteId) {
|
|
18
|
+
historyConfig.siteId = this.config.globals?.siteId;
|
|
19
|
+
}
|
|
20
|
+
this.history = new SearchHistoryStore(historyConfig, this.services);
|
|
13
21
|
this.update();
|
|
14
22
|
makeObservable(this, {
|
|
15
23
|
search: observable,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoreServices } from '../../types';
|
|
2
|
+
import { Query } from './SearchQueryStore';
|
|
3
|
+
export declare type HistoryStoreConfig = {
|
|
4
|
+
siteId?: string;
|
|
5
|
+
max?: number;
|
|
6
|
+
url?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class SearchHistoryStore {
|
|
9
|
+
private config;
|
|
10
|
+
private storage;
|
|
11
|
+
private services;
|
|
12
|
+
constructor(config: HistoryStoreConfig, services: StoreServices);
|
|
13
|
+
get queries(): Query[];
|
|
14
|
+
save(term: string): void;
|
|
15
|
+
remove(term: string): void;
|
|
16
|
+
reset(): void;
|
|
17
|
+
getStoredData(limit?: number): string[];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=SearchHistoryStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchHistoryStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchHistoryStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,oBAAY,kBAAkB,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AACF,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,QAAQ,CAAgB;gBAEpB,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa;IAuB/D,IAAI,OAAO,IAAI,KAAK,EAAE,CAGrB;IAEM,IAAI,CAAC,IAAI,EAAE,MAAM;IAkBjB,MAAM,CAAC,IAAI,EAAE,MAAM;IAWnB,KAAK,IAAI,IAAI;IAIb,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;CAmB9C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { StorageStore, StorageType } from '../../Storage/StorageStore';
|
|
2
|
+
import { Query } from './SearchQueryStore';
|
|
3
|
+
export class SearchHistoryStore {
|
|
4
|
+
constructor(config, services) {
|
|
5
|
+
this.config = config;
|
|
6
|
+
this.services = services;
|
|
7
|
+
if (this.config.url) {
|
|
8
|
+
this.services.urlManager = this.services.urlManager.withConfig((translatorConfig) => {
|
|
9
|
+
return {
|
|
10
|
+
...translatorConfig,
|
|
11
|
+
urlRoot: this.config.url,
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
if (!Number.isInteger(this.config.max)) {
|
|
16
|
+
this.config.max = 25;
|
|
17
|
+
}
|
|
18
|
+
this.storage = new StorageStore({
|
|
19
|
+
type: StorageType.LOCAL,
|
|
20
|
+
key: `ss-history${this.config.siteId ? `-${this.config.siteId}` : ``}`,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
get queries() {
|
|
24
|
+
const queries = this.getStoredData();
|
|
25
|
+
return queries.map((query) => new Query(this.services, query));
|
|
26
|
+
}
|
|
27
|
+
save(term) {
|
|
28
|
+
const history = this.getStoredData();
|
|
29
|
+
// removing term if already present
|
|
30
|
+
const index = history.indexOf(term);
|
|
31
|
+
if (index != -1) {
|
|
32
|
+
history.splice(index, 1);
|
|
33
|
+
}
|
|
34
|
+
// adding term to array
|
|
35
|
+
history.unshift(term);
|
|
36
|
+
if (history.length > this.config.max) {
|
|
37
|
+
history.pop();
|
|
38
|
+
}
|
|
39
|
+
this.storage.set('history', JSON.stringify(history));
|
|
40
|
+
}
|
|
41
|
+
remove(term) {
|
|
42
|
+
const history = this.getStoredData();
|
|
43
|
+
// removing term if already present
|
|
44
|
+
const index = history.indexOf(term);
|
|
45
|
+
if (index != -1) {
|
|
46
|
+
history.splice(index, 1);
|
|
47
|
+
this.storage.set('history', JSON.stringify(history));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
reset() {
|
|
51
|
+
this.storage.clear();
|
|
52
|
+
}
|
|
53
|
+
getStoredData(limit) {
|
|
54
|
+
const storedHistory = this.storage.get('history');
|
|
55
|
+
if (storedHistory) {
|
|
56
|
+
try {
|
|
57
|
+
const history = JSON.parse(storedHistory);
|
|
58
|
+
if (Array.isArray(history)) {
|
|
59
|
+
if (limit && Number.isInteger(limit)) {
|
|
60
|
+
return history.slice(0, limit);
|
|
61
|
+
}
|
|
62
|
+
return history;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
// storage corrupted - resetting it
|
|
67
|
+
this.reset();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -13,6 +13,7 @@ export declare class SearchMerchandisingStore {
|
|
|
13
13
|
content: BannerContent;
|
|
14
14
|
campaigns: SearchResponseModelMerchandisingCampaigns[];
|
|
15
15
|
landingPage?: SearchResponseModelMerchandisingCampaigns;
|
|
16
|
+
personalized?: boolean;
|
|
16
17
|
constructor(services: StoreServices, merchData: SearchResponseModelMerchandising);
|
|
17
18
|
}
|
|
18
19
|
declare class Content extends Array<string | SearchResponseModelMerchandisingContentInline> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchMerchandisingStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchMerchandisingStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EACX,gCAAgC,EAChC,6CAA6C,EAC7C,yCAAyC,EACzC,MAAM,2BAA2B,CAAC;AAEnC,oBAAY,WAAW;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CACjB;AAED,oBAAY,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAElE,qBAAa,wBAAwB;IAC7B,QAAQ,SAAM;IACd,OAAO,EAAE,aAAa,CAAM;IAC5B,SAAS,EAAE,yCAAyC,EAAE,CAAM;IAC5D,WAAW,CAAC,EAAE,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchMerchandisingStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchMerchandisingStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EACX,gCAAgC,EAChC,6CAA6C,EAC7C,yCAAyC,EACzC,MAAM,2BAA2B,CAAC;AAEnC,oBAAY,WAAW;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CACjB;AAED,oBAAY,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAElE,qBAAa,wBAAwB;IAC7B,QAAQ,SAAM;IACd,OAAO,EAAE,aAAa,CAAM;IAC5B,SAAS,EAAE,yCAAyC,EAAE,CAAM;IAC5D,WAAW,CAAC,EAAE,yCAAyC,CAAC;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;gBAElB,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,gCAAgC;CAwBhF;AAED,cAAM,OAAQ,SAAQ,KAAK,CAAC,MAAM,GAAG,6CAA6C,CAAC;IAClF,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAE9C;gBAEW,OAAO,EAAE,MAAM,EAAE,GAAG,6CAA6C,EAAE;CAG/E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StoreConfigs, StoreServices } from '../../types';
|
|
2
2
|
import type { SearchResponseModelPagination, MetaResponseModel } from '@searchspring/snapi-types';
|
|
3
3
|
import type { UrlManager } from '@searchspring/snap-url-manager';
|
|
4
4
|
export declare class SearchPaginationStore {
|
|
@@ -12,8 +12,8 @@ export declare class SearchPaginationStore {
|
|
|
12
12
|
defaultPageSize: number;
|
|
13
13
|
totalResults: number;
|
|
14
14
|
totalPages: number;
|
|
15
|
-
controllerConfig:
|
|
16
|
-
constructor(config:
|
|
15
|
+
controllerConfig: StoreConfigs;
|
|
16
|
+
constructor(config: StoreConfigs, services: StoreServices, paginationData: SearchResponseModelPagination | undefined, meta: MetaResponseModel);
|
|
17
17
|
get begin(): number;
|
|
18
18
|
get end(): number;
|
|
19
19
|
get multiplePages(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchPaginationStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchPaginationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SearchPaginationStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchPaginationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,qBAAa,qBAAqB;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACG,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,YAAY,CAAC;gBAGrC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,aAAa,EACvB,cAAc,2CAKb,EACD,IAAI,EAAE,iBAAiB;IA4CxB,IAAW,KAAK,IAAI,MAAM,CAKzB;IAED,IAAW,GAAG,IAAI,MAAM,CAMvB;IAED,IAAW,aAAa,IAAI,OAAO,CAElC;IAED,IAAW,OAAO,IAAI,IAAI,CAKzB;IAED,IAAW,KAAK,IAAI,IAAI,CAKvB;IAED,IAAW,IAAI,IAAI,IAAI,CAKtB;IAED,IAAW,IAAI,IAAI,IAAI,GAAG,SAAS,CAMlC;IAED,IAAW,QAAQ,IAAI,IAAI,GAAG,SAAS,CAMtC;IAEM,QAAQ,CAAC,GAAG,GAAE,MAAU,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE;IAmD/C,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAKrC;AAED,qBAAa,IAAI;IACT,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;gBAGlB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;KACjB;CAQF"}
|
|
@@ -8,10 +8,9 @@ export declare class SearchQueryStore {
|
|
|
8
8
|
matchType?: SearchResponseModelSearchMatchTypeEnum;
|
|
9
9
|
constructor(services: StoreServices, search: SearchResponseModelSearch);
|
|
10
10
|
}
|
|
11
|
-
declare class Query {
|
|
11
|
+
export declare class Query {
|
|
12
12
|
string: string;
|
|
13
13
|
url: UrlManager;
|
|
14
14
|
constructor(services: StoreServices, query: string);
|
|
15
15
|
}
|
|
16
|
-
export {};
|
|
17
16
|
//# sourceMappingURL=SearchQueryStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchQueryStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchQueryStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,sCAAsC,EAAE,MAAM,2BAA2B,CAAC;AAEnH,qBAAa,gBAAgB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,SAAS,CAAC,EAAE,sCAAsC,CAAC;gBAE9C,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAyB;CAyBtE;AASD,
|
|
1
|
+
{"version":3,"file":"SearchQueryStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchQueryStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,sCAAsC,EAAE,MAAM,2BAA2B,CAAC;AAEnH,qBAAa,gBAAgB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,SAAS,CAAC,EAAE,sCAAsC,CAAC;gBAE9C,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAyB;CAyBtE;AASD,qBAAa,KAAK;IACV,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,UAAU,CAAC;gBAEX,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM;CASlD"}
|
|
@@ -21,10 +21,10 @@ export class SearchQueryStore {
|
|
|
21
21
|
makeObservable(this, observables);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class Query {
|
|
24
|
+
export class Query {
|
|
25
25
|
constructor(services, query) {
|
|
26
26
|
this.string = query;
|
|
27
|
-
this.url = services
|
|
27
|
+
this.url = services?.urlManager?.remove('page').remove('filter').set('query', this.string);
|
|
28
28
|
makeObservable(this, {
|
|
29
29
|
string: observable,
|
|
30
30
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StoreServices, StoreConfigs } from '../../types';
|
|
2
2
|
import type { SearchResponseModelResult, SearchResponseModelPagination, SearchResponseModelMerchandising, SearchResponseModelResultMappings, SearchResponseModelMerchandisingContentInline, SearchResponseModelMerchandisingContentConfig } from '@searchspring/snapi-types';
|
|
3
3
|
export declare class SearchResultStore extends Array<Product | Banner> {
|
|
4
4
|
static get [Symbol.species](): ArrayConstructor;
|
|
5
|
-
constructor(config:
|
|
5
|
+
constructor(config: StoreConfigs, services: StoreServices, resultData?: SearchResponseModelResult[], paginationData?: SearchResponseModelPagination, merchData?: SearchResponseModelMerchandising);
|
|
6
6
|
}
|
|
7
7
|
export declare class Banner {
|
|
8
8
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResultStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchResultStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SearchResultStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchResultStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqB,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EACX,yBAAyB,EACzB,6BAA6B,EAC7B,gCAAgC,EAChC,iCAAiC,EACjC,6CAA6C,EAC7C,6CAA6C,EAC7C,MAAM,2BAA2B,CAAC;AAEnC,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC7D,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAE9C;gBAGA,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,aAAa,EACvB,UAAU,CAAC,EAAE,yBAAyB,EAAE,EACxC,cAAc,CAAC,EAAE,6BAA6B,EAC9C,SAAS,CAAC,EAAE,gCAAgC;CAqB7C;AAED,qBAAa,MAAM;IACX,IAAI,SAAY;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IACzC,QAAQ,EAAE,iCAAiC,CAEhD;IACK,MAAM,KAAM;IACZ,MAAM,EAAE,6CAA6C,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;gBAET,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,6CAA6C;CAW1F;AAED,qBAAa,OAAO;IACZ,IAAI,SAAa;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IACzC,QAAQ,EAAE,iCAAiC,CAEhD;IACK,MAAM,KAAM;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAM;gBAExB,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAyB;CA8BtE;AAED,cAAM,KAAK;IACH,IAAI,SAAW;IACf,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IACzC,MAAM,KAAM;gBAEP,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,yBAAyB;CAUtE"}
|
|
@@ -5,4 +5,5 @@ export { SearchPaginationStore } from './SearchPaginationStore';
|
|
|
5
5
|
export { SearchResultStore, Product, Banner } from './SearchResultStore';
|
|
6
6
|
export { SearchSortingStore } from './SearchSortingStore';
|
|
7
7
|
export { SearchQueryStore } from './SearchQueryStore';
|
|
8
|
+
export { SearchHistoryStore } from './SearchHistoryStore';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChI,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChI,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -5,3 +5,4 @@ export { SearchPaginationStore } from './SearchPaginationStore';
|
|
|
5
5
|
export { SearchResultStore, Product, Banner } from './SearchResultStore';
|
|
6
6
|
export { SearchSortingStore } from './SearchSortingStore';
|
|
7
7
|
export { SearchQueryStore } from './SearchQueryStore';
|
|
8
|
+
export { SearchHistoryStore } from './SearchHistoryStore';
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ export declare type SearchStoreConfig = StoreConfig & {
|
|
|
20
20
|
backfill?: number;
|
|
21
21
|
restorePosition?: boolean;
|
|
22
22
|
};
|
|
23
|
+
history?: {
|
|
24
|
+
url?: string;
|
|
25
|
+
max?: number;
|
|
26
|
+
};
|
|
23
27
|
};
|
|
24
28
|
};
|
|
25
29
|
export declare type FacetStoreConfig = {
|
|
@@ -61,6 +65,10 @@ export declare type AutocompleteStoreConfig = StoreConfig & {
|
|
|
61
65
|
limit: number;
|
|
62
66
|
showResults?: boolean;
|
|
63
67
|
};
|
|
68
|
+
history?: {
|
|
69
|
+
limit: number;
|
|
70
|
+
showResults?: boolean;
|
|
71
|
+
};
|
|
64
72
|
};
|
|
65
73
|
};
|
|
66
74
|
export declare type RecommendationStoreConfig = StoreConfig & {
|
package/dist/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,wCAAwC,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAExI,oBAAY,WAAW,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB,CAAC;AAGF,oBAAY,iBAAiB,GAAG,WAAW,GAAG;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE;QACV,SAAS,CAAC,EAAE;YACX,aAAa,CAAC,EAAE,OAAO,CAAC;YACxB,YAAY,CAAC,EAAE,OAAO,CAAC;SACvB,CAAC;QACF,MAAM,CAAC,EAAE,gBAAgB,GAAG;YAC3B,MAAM,CA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AQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,wCAAwC,EAAE,CAAC;IACjD,KAAK,EAAE,GAAG,CAAC;CACX,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchspring/snap-store-mobx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Snap MobX Store",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"test:watch": "jest --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@searchspring/snap-toolbox": "^0.
|
|
23
|
+
"@searchspring/snap-toolbox": "^0.40.0",
|
|
24
24
|
"mobx": "^6.6.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@searchspring/snap-client": "^0.
|
|
28
|
-
"@searchspring/snap-url-manager": "^0.
|
|
27
|
+
"@searchspring/snap-client": "^0.40.0",
|
|
28
|
+
"@searchspring/snap-url-manager": "^0.40.0"
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"files": [
|
|
32
32
|
"dist/**/*"
|
|
33
33
|
],
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "ab543649e56e547374715ad0f018db29d72a0d8e"
|
|
35
35
|
}
|