@athoscommerce/snap-store-mobx 1.2.3-beta.3 → 1.2.3-beta.5

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.
Files changed (91) hide show
  1. package/dist/cjs/Autocomplete/AutocompleteStore.d.ts +1 -1
  2. package/dist/cjs/Autocomplete/AutocompleteStore.d.ts.map +1 -1
  3. package/dist/cjs/Autocomplete/AutocompleteStore.js +8 -5
  4. package/dist/cjs/Autocomplete/Stores/AutocompleteFacetStore.js +2 -1
  5. package/dist/cjs/Chat/ChatStore.d.ts +36 -5
  6. package/dist/cjs/Chat/ChatStore.d.ts.map +1 -1
  7. package/dist/cjs/Chat/ChatStore.js +214 -54
  8. package/dist/cjs/Chat/Stores/ChatAttachmentStore.d.ts.map +1 -1
  9. package/dist/cjs/Chat/Stores/ChatAttachmentStore.js +4 -2
  10. package/dist/cjs/Chat/Stores/ChatCompareStore.d.ts +2 -0
  11. package/dist/cjs/Chat/Stores/ChatCompareStore.d.ts.map +1 -1
  12. package/dist/cjs/Chat/Stores/ChatCompareStore.js +4 -2
  13. package/dist/cjs/Chat/Stores/ChatSessionStore.d.ts +10 -7
  14. package/dist/cjs/Chat/Stores/ChatSessionStore.d.ts.map +1 -1
  15. package/dist/cjs/Chat/Stores/ChatSessionStore.js +34 -23
  16. package/dist/cjs/Finder/FinderStore.d.ts +1 -1
  17. package/dist/cjs/Finder/FinderStore.d.ts.map +1 -1
  18. package/dist/cjs/Finder/FinderStore.js +3 -3
  19. package/dist/cjs/Finder/Stores/FinderSelectionStore.d.ts +1 -1
  20. package/dist/cjs/Finder/Stores/FinderSelectionStore.d.ts.map +1 -1
  21. package/dist/cjs/ProductQuickView/ProductQuickViewStore.d.ts +21 -0
  22. package/dist/cjs/ProductQuickView/ProductQuickViewStore.d.ts.map +1 -0
  23. package/dist/cjs/ProductQuickView/ProductQuickViewStore.js +69 -0
  24. package/dist/cjs/ProductQuickView/cloneProductForQuickView.d.ts +7 -0
  25. package/dist/cjs/ProductQuickView/cloneProductForQuickView.d.ts.map +1 -0
  26. package/dist/cjs/ProductQuickView/cloneProductForQuickView.js +23 -0
  27. package/dist/cjs/Recommendation/RecommendationStore.d.ts +2 -0
  28. package/dist/cjs/Recommendation/RecommendationStore.d.ts.map +1 -1
  29. package/dist/cjs/Recommendation/RecommendationStore.js +3 -0
  30. package/dist/cjs/Recommendation/Stores/RecommendationProfileStore.js +1 -1
  31. package/dist/cjs/Search/SearchStore.d.ts +1 -1
  32. package/dist/cjs/Search/SearchStore.d.ts.map +1 -1
  33. package/dist/cjs/Search/SearchStore.js +2 -2
  34. package/dist/cjs/Search/Stores/SearchFacetStore.d.ts +1 -1
  35. package/dist/cjs/Search/Stores/SearchFacetStore.d.ts.map +1 -1
  36. package/dist/cjs/Search/Stores/SearchFacetStore.js +13 -10
  37. package/dist/cjs/Search/Stores/SearchHistoryStore.js +2 -2
  38. package/dist/cjs/index.d.ts +4 -2
  39. package/dist/cjs/index.d.ts.map +1 -1
  40. package/dist/cjs/index.js +8 -4
  41. package/dist/cjs/types.d.ts +8 -2
  42. package/dist/cjs/types.d.ts.map +1 -1
  43. package/dist/esm/Autocomplete/AutocompleteStore.d.ts +1 -1
  44. package/dist/esm/Autocomplete/AutocompleteStore.d.ts.map +1 -1
  45. package/dist/esm/Autocomplete/AutocompleteStore.js +5 -3
  46. package/dist/esm/Autocomplete/Stores/AutocompleteFacetStore.js +1 -1
  47. package/dist/esm/Chat/ChatStore.d.ts +36 -5
  48. package/dist/esm/Chat/ChatStore.d.ts.map +1 -1
  49. package/dist/esm/Chat/ChatStore.js +201 -43
  50. package/dist/esm/Chat/Stores/ChatAttachmentStore.d.ts.map +1 -1
  51. package/dist/esm/Chat/Stores/ChatAttachmentStore.js +4 -2
  52. package/dist/esm/Chat/Stores/ChatCompareStore.d.ts +2 -0
  53. package/dist/esm/Chat/Stores/ChatCompareStore.d.ts.map +1 -1
  54. package/dist/esm/Chat/Stores/ChatCompareStore.js +3 -1
  55. package/dist/esm/Chat/Stores/ChatSessionStore.d.ts +10 -7
  56. package/dist/esm/Chat/Stores/ChatSessionStore.d.ts.map +1 -1
  57. package/dist/esm/Chat/Stores/ChatSessionStore.js +26 -18
  58. package/dist/esm/Finder/FinderStore.d.ts +1 -1
  59. package/dist/esm/Finder/FinderStore.d.ts.map +1 -1
  60. package/dist/esm/Finder/FinderStore.js +1 -1
  61. package/dist/esm/Finder/Stores/FinderSelectionStore.d.ts +1 -1
  62. package/dist/esm/Finder/Stores/FinderSelectionStore.d.ts.map +1 -1
  63. package/dist/esm/ProductQuickView/ProductQuickViewStore.d.ts +21 -0
  64. package/dist/esm/ProductQuickView/ProductQuickViewStore.d.ts.map +1 -0
  65. package/dist/esm/ProductQuickView/ProductQuickViewStore.js +56 -0
  66. package/dist/esm/ProductQuickView/cloneProductForQuickView.d.ts +7 -0
  67. package/dist/esm/ProductQuickView/cloneProductForQuickView.d.ts.map +1 -0
  68. package/dist/esm/ProductQuickView/cloneProductForQuickView.js +19 -0
  69. package/dist/esm/Recommendation/RecommendationStore.d.ts +2 -0
  70. package/dist/esm/Recommendation/RecommendationStore.d.ts.map +1 -1
  71. package/dist/esm/Recommendation/RecommendationStore.js +3 -0
  72. package/dist/esm/Recommendation/Stores/RecommendationProfileStore.js +1 -1
  73. package/dist/esm/Search/SearchStore.d.ts +1 -1
  74. package/dist/esm/Search/SearchStore.d.ts.map +1 -1
  75. package/dist/esm/Search/SearchStore.js +1 -1
  76. package/dist/esm/Search/Stores/SearchFacetStore.d.ts +1 -1
  77. package/dist/esm/Search/Stores/SearchFacetStore.d.ts.map +1 -1
  78. package/dist/esm/Search/Stores/SearchFacetStore.js +13 -10
  79. package/dist/esm/Search/Stores/SearchHistoryStore.js +1 -1
  80. package/dist/esm/index.d.ts +4 -2
  81. package/dist/esm/index.d.ts.map +1 -1
  82. package/dist/esm/index.js +3 -1
  83. package/dist/esm/types.d.ts +8 -2
  84. package/dist/esm/types.d.ts.map +1 -1
  85. package/package.json +11 -6
  86. package/dist/cjs/Storage/StorageStore.d.ts +0 -27
  87. package/dist/cjs/Storage/StorageStore.d.ts.map +0 -1
  88. package/dist/cjs/Storage/StorageStore.js +0 -176
  89. package/dist/esm/Storage/StorageStore.d.ts +0 -27
  90. package/dist/esm/Storage/StorageStore.d.ts.map +0 -1
  91. package/dist/esm/Storage/StorageStore.js +0 -169
@@ -2,6 +2,7 @@
2
2
  // how should localStorage be handled for attachments?
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
  import { makeObservable, observable, computed } from 'mobx';
5
+ import { CHAT_COMPARISON_MAX } from './ChatCompareStore';
5
6
  export class ChatAttachmentStore {
6
7
  constructor() {
7
8
  this.items = [];
@@ -58,9 +59,10 @@ export class ChatAttachmentStore {
58
59
  existingProductAttachment.requestType = attachment.requestType; // changes existing attachments to the incoming requestType
59
60
  return existingProductAttachment;
60
61
  }
61
- // if there are already two product attachments, remove until only one remains
62
+ // productComparison supports up to CHAT_COMPARISON_MAX products (matches ChatCompareStore.maxItems);
63
+ // trim oldest active/attached product attachments to keep total below the cap.
62
64
  const productAttachments = this.items.filter((item) => item.type === 'product' && (item.state === 'active' || item.state === 'attached'));
63
- while (productAttachments.length >= 2) {
65
+ while (productAttachments.length >= CHAT_COMPARISON_MAX) {
64
66
  const toRemove = productAttachments.pop();
65
67
  if (toRemove) {
66
68
  this.remove(toRemove.id);
@@ -1,3 +1,5 @@
1
+ /** Maximum number of products that can be added to a chat comparison. */
2
+ export declare const CHAT_COMPARISON_MAX = 4;
1
3
  export declare class ChatCompareStore {
2
4
  items: any[];
3
5
  committedItems: any[];
@@ -1 +1 @@
1
- {"version":3,"file":"ChatCompareStore.d.ts","sourceRoot":"","sources":["../../../../src/Chat/Stores/ChatCompareStore.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB;IACrB,KAAK,EAAE,GAAG,EAAE,CAAM;IAClB,cAAc,EAAE,GAAG,EAAE,CAAM;IAC3B,QAAQ,EAAE,MAAM,CAAK;;IAa5B,GAAG,CAAC,IAAI,EAAE,GAAG;IAYb,MAAM,CAAC,MAAM,EAAE,MAAM;IAIrB,KAAK;IAIL,cAAc;IAKd,MAAM;IAON,IAAI,QAAQ,UAEX;IAED,IAAI,SAAS,UAEZ;CACD"}
1
+ {"version":3,"file":"ChatCompareStore.d.ts","sourceRoot":"","sources":["../../../../src/Chat/Stores/ChatCompareStore.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,qBAAa,gBAAgB;IACrB,KAAK,EAAE,GAAG,EAAE,CAAM;IAClB,cAAc,EAAE,GAAG,EAAE,CAAM;IAC3B,QAAQ,EAAE,MAAM,CAAuB;;IAa9C,GAAG,CAAC,IAAI,EAAE,GAAG;IAYb,MAAM,CAAC,MAAM,EAAE,MAAM;IAIrB,KAAK;IAIL,cAAc;IAKd,MAAM;IAON,IAAI,QAAQ,UAEX;IAED,IAAI,SAAS,UAEZ;CACD"}
@@ -1,9 +1,11 @@
1
1
  import { computed, makeObservable, observable } from 'mobx';
2
+ /** Maximum number of products that can be added to a chat comparison. */
3
+ export const CHAT_COMPARISON_MAX = 4;
2
4
  export class ChatCompareStore {
3
5
  constructor() {
4
6
  this.items = [];
5
7
  this.committedItems = [];
6
- this.maxItems = 4;
8
+ this.maxItems = CHAT_COMPARISON_MAX;
7
9
  makeObservable(this, {
8
10
  items: observable,
9
11
  committedItems: observable,
@@ -1,6 +1,6 @@
1
1
  import type { ChatResponseModel, ChatRequestModel, ChatResponseTextData, ChatResponseProductSearchResultData, ChatResponseInspirationResultData, ChatResponseContentData, ChatResponseProductAnswerData, ChatResponseProductComparisonData, ChatResponseProductRecommendationData, ChatResponseErrorData, ChatResponseTopicDriftData } from '@athoscommerce/snap-client';
2
2
  import { ChatAttachmentAddAttachment, ChatAttachmentStore } from '../Stores/ChatAttachmentStore';
3
- import type { StorageStore } from '../../Storage/StorageStore';
3
+ import type { StorageStore } from '@athoscommerce/snap-toolbox';
4
4
  import { MetaResponseModel } from '@athoscommerce/snapi-types';
5
5
  import { ChatCompareStore } from './ChatCompareStore';
6
6
  export type ChatFeedbacks = {
@@ -37,21 +37,23 @@ type ChatSessionStoreConfig = {
37
37
  sessionFeedback?: ChatSessionFeedback | null;
38
38
  feedbackDismissed?: boolean;
39
39
  createdAt?: Date;
40
+ sessionEndTime?: Date;
40
41
  committedComparisons?: any[];
41
42
  };
42
43
  stores: {
43
44
  storage: StorageStore;
44
45
  };
45
46
  };
46
- export type FacetsData = {
47
- type: 'facets';
48
- data: any;
49
- };
50
47
  export type ActionsData = {
51
48
  type: 'actions';
52
49
  data: any;
53
50
  };
54
- export type ChatActions = (FacetsData | ActionsData)[];
51
+ export type ChatActions = ActionsData[];
52
+ /** Snapshot of facet labels keyed by field — used to render the user message text for a productSearch request. */
53
+ export type FilterLabelMap = Record<string, {
54
+ facetLabel: string;
55
+ values: Record<string, string>;
56
+ }>;
55
57
  export declare class ChatSessionStore {
56
58
  chat: ChatMessage[];
57
59
  actions: ChatActions;
@@ -65,6 +67,7 @@ export declare class ChatSessionStore {
65
67
  feedbackDismissed: boolean;
66
68
  feedbackJustGiven: boolean;
67
69
  createdAt: Date;
70
+ sessionEndTime?: Date;
68
71
  requestType: string;
69
72
  dismissedSideChatMessageId: string | null;
70
73
  activeMessageId: string | null;
@@ -94,7 +97,7 @@ export declare class ChatSessionStore {
94
97
  static pruneStoredSessions(storage: StorageStore, maxSessions?: number): void;
95
98
  /** Re-wrap raw stored results as Product / SearchResultStore instances. */
96
99
  hydrateResults(meta: MetaResponseModel): void;
97
- request(request: ChatRequestModel): void;
100
+ request(request: ChatRequestModel, filterLabels?: FilterLabelMap): void;
98
101
  update(data: {
99
102
  chat: ChatResponseModel;
100
103
  meta: MetaResponseModel;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatSessionStore.d.ts","sourceRoot":"","sources":["../../../../src/Chat/Stores/ChatSessionStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,iBA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OAAO,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAAE,cAAc,GAAG,IAAI;IA6IvE,MAAM,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,iBAAiB,CAAC;QAAC,IAAI,EAAE,iBAAiB,CAAA;KAAE,GAAG,IAAI;CAyC/E"}
@@ -30,6 +30,7 @@ function serializeProduct(product) {
30
30
  responseId: product.responseId,
31
31
  mappings: product.mappings,
32
32
  attributes: product.attributes,
33
+ badges: product.badges?.all?.map((b) => ({ tag: b.tag })) || [],
33
34
  };
34
35
  if (product.variants) {
35
36
  raw.variants = {
@@ -147,20 +148,21 @@ export class ChatSessionStore {
147
148
  /** Whether raw stored results have been hydrated into Product/SearchResultStore instances. */
148
149
  this.hydrated = true;
149
150
  this.saveTimerId = null;
150
- const { id, sessionId, chat, attachments, actions, feedbacks, sessionFeedback, feedbackDismissed, createdAt, committedComparisons } = params.data || {};
151
+ const { id, sessionId, chat, attachments, actions, feedbacks, sessionFeedback, feedbackDismissed, createdAt, sessionEndTime, committedComparisons, } = params.data || {};
151
152
  const { stores } = params;
152
153
  this.id = id || uuidv4();
153
154
  this.sessionId = sessionId;
154
155
  this.storage = stores.storage;
155
156
  this.actions = actions || [];
156
157
  this.createdAt = createdAt ? new Date(createdAt) : new Date();
158
+ this.sessionEndTime = sessionEndTime ? new Date(sessionEndTime) : undefined;
157
159
  this.feedbacks = feedbacks || [];
158
160
  this.sessionFeedback = sessionFeedback || null;
159
161
  this.feedbackDismissed = feedbackDismissed || false;
160
162
  // if chat and attachments are passed, load them
161
163
  if (chat && chat.length > 0) {
162
164
  // productQuery messages only exist to drive the side-chat panel for an
163
- // in-flight discussProduct click; they must not be rehydrated on reload
165
+ // in-flight productQuery click; they must not be rehydrated on reload
164
166
  // or the side chat would re-open without the matching primary-chat state
165
167
  this.chat = chat.filter((message) => message.messageType !== 'productQuery');
166
168
  }
@@ -227,7 +229,7 @@ export class ChatSessionStore {
227
229
  // capture the side-chat message that was active at click time so a back action
228
230
  // can restore it even when it's not the last message in the chat
229
231
  const sourceMessageId = this.activeMessage?.id;
230
- // drop any trailing productQuery so a fresh discussProduct click replaces
232
+ // drop any trailing productQuery so a fresh productQuery click replaces
231
233
  // the side-chat target rather than stacking up
232
234
  while (this.chat.length > 0 && this.chat[this.chat.length - 1]?.messageType === 'productQuery') {
233
235
  this.chat.pop();
@@ -251,10 +253,13 @@ export class ChatSessionStore {
251
253
  this.save();
252
254
  }
253
255
  get isExpired() {
256
+ // Prefer the server-provided end time (returned by chatInit); fall back to a
257
+ // 24-hour window from createdAt for sessions persisted before that field existed.
258
+ if (this.sessionEndTime) {
259
+ return Date.now() > this.sessionEndTime.getTime();
260
+ }
254
261
  const ONE_DAY = 24 * 60 * 60 * 1000;
255
- const now = new Date();
256
- const diff = now.getTime() - this.createdAt.getTime();
257
- return diff > ONE_DAY;
262
+ return Date.now() - this.createdAt.getTime() > ONE_DAY;
258
263
  }
259
264
  get topicDrift() {
260
265
  const lastMessage = this.chat[this.chat.length - 1];
@@ -339,6 +344,7 @@ export class ChatSessionStore {
339
344
  sessionFeedback: this.sessionFeedback,
340
345
  feedbackDismissed: this.feedbackDismissed,
341
346
  createdAt: this.createdAt,
347
+ sessionEndTime: this.sessionEndTime,
342
348
  committedComparisons: this.comparisons.committedItems,
343
349
  });
344
350
  }
@@ -413,7 +419,7 @@ export class ChatSessionStore {
413
419
  }
414
420
  });
415
421
  }
416
- request(request) {
422
+ request(request, filterLabels) {
417
423
  // clear the questions on new request
418
424
  this.actions = [];
419
425
  this.requestType = request.data.requestType;
@@ -427,11 +433,19 @@ export class ChatSessionStore {
427
433
  if (searchFilters && searchFilters.length > 0) {
428
434
  const filterTextArray = [];
429
435
  searchFilters.forEach((filter) => {
430
- const attachedFacets = this.attachments.attached.filter((item) => item.type == 'facet' && item.key == filter.key);
431
- attachedFacets.forEach((attachedFacet) => {
432
- attachments.push(attachedFacet.id);
433
- attachedFacet.activate();
434
- filterTextArray.push(`${attachedFacet.facetLabel} ${attachedFacet.label}`);
436
+ const labelEntry = filterLabels?.[filter.key];
437
+ filter.options?.forEach((option) => {
438
+ const facetLabel = labelEntry?.facetLabel || filter.key;
439
+ if ('low' in option || 'high' in option) {
440
+ const low = option.low ?? '*';
441
+ const high = option.high ?? '*';
442
+ filterTextArray.push(`${facetLabel} ${low}-${high}`);
443
+ }
444
+ else {
445
+ const key = option.key;
446
+ const optionLabel = labelEntry?.values[key] || key;
447
+ filterTextArray.push(`${facetLabel} ${optionLabel}`);
448
+ }
435
449
  });
436
450
  });
437
451
  this.chat.push({
@@ -555,12 +569,6 @@ export class ChatSessionStore {
555
569
  });
556
570
  return;
557
571
  }
558
- if (messageData.messageType === 'productSearchResult' && messageData.facets?.length > 0) {
559
- this.actions.push({
560
- type: 'facets',
561
- data: messageData.facets,
562
- });
563
- }
564
572
  // convert raw results to Product instances (via SearchResultStore) so
565
573
  // display components can use result.display for mask-aware rendering
566
574
  if (messageData.messageType === 'productSearchResult' && messageData.results?.length) {
@@ -1,7 +1,7 @@
1
1
  import type { SearchResponseModel, MetaResponseModel } from '@athoscommerce/snapi-types';
2
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
2
3
  import { AbstractStore } from '../Abstract/AbstractStore';
3
4
  import { SearchPaginationStore } from '../Search/Stores';
4
- import { StorageStore } from '../Storage/StorageStore';
5
5
  import { FinderSelectionStore } from './Stores';
6
6
  import type { FinderStoreConfig, StoreServices, SelectedSelection } from '../types';
7
7
  import { UrlManager } from '@athoscommerce/snap-url-manager';
@@ -1 +1 @@
1
- {"version":3,"file":"FinderStore.d.ts","sourceRoot":"","sources":["../../../src/Finder/FinderStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,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B,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,qBAAa,WAAY,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IACzD,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,YAAY,CAAC;IACtB,gBAAgB,EAAG,YAAY,CAAC;IAChC,UAAU,EAAG,qBAAqB,CAAC;IACnC,UAAU,EAAG,oBAAoB,CAAC;IAClC,SAAS,EAAE,OAAO,CAAS;gBAEtB,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa;IA0BvD,UAAU,CAAC,IAAI,EAAE,MAAM,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;IAQhE,IAAI,EAAE,MAAM,IAAI,CAAY;IAE5B,KAAK,QAAO,IAAI,CAWrB;IAEK,aAAa,IAAI,IAAI;IAyBrB,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,iBAAiB,CAAC;QAAC,MAAM,CAAC,EAAE,mBAAmB,CAAA;KAAE,EAAE,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,GAAG,IAAI;CAsDhI"}
@@ -1,7 +1,7 @@
1
1
  import { makeObservable, observable } from 'mobx';
2
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
2
3
  import { AbstractStore } from '../Abstract/AbstractStore';
3
4
  import { SearchPaginationStore } from '../Search/Stores';
4
- import { StorageStore } from '../Storage/StorageStore';
5
5
  import { FinderSelectionStore } from './Stores';
6
6
  import { MetaStore } from '../Meta/MetaStore';
7
7
  export class FinderStore extends AbstractStore {
@@ -1,5 +1,5 @@
1
1
  import type { FinderStoreConfig, FinderFieldConfig, StoreServices, SelectedSelection } from '../../types';
2
- import type { StorageStore } from '../../Storage/StorageStore';
2
+ import type { StorageStore } from '@athoscommerce/snap-toolbox';
3
3
  import type { MetaResponseModel, MetaResponseModelFacetGrid, MetaResponseModelFacetHierarchy, MetaResponseModelFacetList, MetaResponseModelFacetPalette, MetaResponseModelFacetSlider, SearchResponseModel, SearchResponseModelFacetRange, SearchResponseModelFacetRangeBuckets, SearchResponseModelFacetValue, SearchResponseModelFacetValueAllOfValues } from '@athoscommerce/snapi-types';
4
4
  type FacetWithMeta = MetaResponseModelFacetGrid & MetaResponseModelFacetHierarchy & MetaResponseModelFacetList & MetaResponseModelFacetPalette & MetaResponseModelFacetSlider & SearchResponseModelFacetValue & SearchResponseModelFacetRange & SearchResponseModelFacetRangeBuckets;
5
5
  type FinderSelectionStoreConfig = {
@@ -1 +1 @@
1
- {"version":3,"file":"FinderSelectionStore.d.ts","sourceRoot":"","sources":["../../../../src/Finder/Stores/FinderSelectionStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EACX,iBAAiB,EACjB,0BAA0B,EAC1B,+BAA+B,EAC/B,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,mBAAmB,EACnB,6BAA6B,EAC7B,oCAAoC,EACpC,6BAA6B,EAC7B,wCAAwC,EACxC,MAAM,4BAA4B,CAAC;AAEpC,KAAK,aAAa,GAAG,0BAA0B,GAC9C,+BAA+B,GAC/B,0BAA0B,GAC1B,6BAA6B,GAC7B,4BAA4B,GAC5B,6BAA6B,GAC7B,6BAA6B,GAC7B,oCAAoC,CAAC;AAEtC,KAAK,0BAA0B,GAAG;IACjC,MAAM,EA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C;gBAEtB,aAAa,EAAE,aAAa;IAejC,MAAM,CAAC,KAAK,SAAK;CAWxB;AAED,cAAM,kBAAmB,SAAQ,aAAa;IACtC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAG,WAAW,CAAC;gBAEhB,aAAa,EAAE,aAAa;IAuCjC,MAAM,CAAC,KAAK,SAAK;CA2BxB;AAED,KAAK,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { MetaResponseModel } from '@athoscommerce/snapi-types';
2
+ import type { ProductsResponseModel } from '@athoscommerce/snap-client';
3
+ import { Product } from '../Search/Stores/SearchResultStore';
4
+ /** Composable store holding the currently-displayed quickview product, plus the
5
+ * fetch/error state used by a ProductQuickView UI. Any results-bearing store
6
+ * (Recommendation, Search, Autocomplete, Chat) can hold one as a property. */
7
+ export declare class ProductQuickViewStore {
8
+ product: Product | null;
9
+ error: string | null;
10
+ loading: boolean;
11
+ constructor();
12
+ /** Clone the supplied product and stash it as the quickview target. The clone
13
+ * isolates variant selections and mapping merges from the originating result. */
14
+ set(product: Product, meta?: MetaResponseModel): void;
15
+ /** Merge the parent-level products API response into the cloned product —
16
+ * core mappings get merged in and Variants are created or updated in place. */
17
+ update(response: ProductsResponseModel, meta?: MetaResponseModel): void;
18
+ setError(message: string): void;
19
+ clear(): void;
20
+ }
21
+ //# sourceMappingURL=ProductQuickViewStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductQuickViewStore.d.ts","sourceRoot":"","sources":["../../../src/ProductQuickView/ProductQuickViewStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAY,MAAM,oCAAoC,CAAC;AAGvE;;8EAE8E;AAC9E,qBAAa,qBAAqB;IAC1B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAQ;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC5B,OAAO,EAAE,OAAO,CAAS;;IAUhC;qFACiF;IAC1E,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAK5D;mFAC+E;IACxE,MAAM,CAAC,QAAQ,EAAE,qBAAqB,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAuBvE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI/B,KAAK,IAAI,IAAI;CAKpB"}
@@ -0,0 +1,56 @@
1
+ import { makeObservable, observable } from 'mobx';
2
+ import { Variants } from '../Search/Stores/SearchResultStore';
3
+ import { cloneProductForQuickView } from './cloneProductForQuickView';
4
+ /** Composable store holding the currently-displayed quickview product, plus the
5
+ * fetch/error state used by a ProductQuickView UI. Any results-bearing store
6
+ * (Recommendation, Search, Autocomplete, Chat) can hold one as a property. */
7
+ export class ProductQuickViewStore {
8
+ constructor() {
9
+ this.product = null;
10
+ this.error = null;
11
+ this.loading = false;
12
+ makeObservable(this, {
13
+ product: observable,
14
+ error: observable,
15
+ loading: observable,
16
+ });
17
+ }
18
+ /** Clone the supplied product and stash it as the quickview target. The clone
19
+ * isolates variant selections and mapping merges from the originating result. */
20
+ set(product, meta) {
21
+ this.product = cloneProductForQuickView(product, meta);
22
+ this.error = null;
23
+ }
24
+ /** Merge the parent-level products API response into the cloned product —
25
+ * core mappings get merged in and Variants are created or updated in place. */
26
+ update(response, meta) {
27
+ if (!this.product)
28
+ return;
29
+ this.product.mappings = {
30
+ ...this.product.mappings,
31
+ core: { ...this.product.mappings.core, ...response.mappings.core },
32
+ };
33
+ if (this.product.variants) {
34
+ this.product.variants.optionConfig = response.variants.optionConfig;
35
+ this.product.variants.update(response.variants.data);
36
+ }
37
+ else {
38
+ this.product.variants = new Variants({
39
+ data: {
40
+ mask: this.product.mask,
41
+ variants: response.variants.data,
42
+ optionConfig: response.variants.optionConfig,
43
+ meta: meta || {},
44
+ },
45
+ });
46
+ }
47
+ }
48
+ setError(message) {
49
+ this.error = message;
50
+ }
51
+ clear() {
52
+ this.product = null;
53
+ this.error = null;
54
+ this.loading = false;
55
+ }
56
+ }
@@ -0,0 +1,7 @@
1
+ import type { MetaResponseModel } from '@athoscommerce/snapi-types';
2
+ import { Product } from '../Search/Stores/SearchResultStore';
3
+ /** Build a fresh observable Product from an existing one. Variants are intentionally
4
+ * omitted — they're populated from the products API response after the clone is set
5
+ * on the quickview store. */
6
+ export declare function cloneProductForQuickView(product: Product, meta: MetaResponseModel | undefined): Product;
7
+ //# sourceMappingURL=cloneProductForQuickView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloneProductForQuickView.d.ts","sourceRoot":"","sources":["../../../src/ProductQuickView/cloneProductForQuickView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAE7D;;6BAE6B;AAC7B,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAcvG"}
@@ -0,0 +1,19 @@
1
+ import { Product } from '../Search/Stores/SearchResultStore';
2
+ /** Build a fresh observable Product from an existing one. Variants are intentionally
3
+ * omitted — they're populated from the products API response after the clone is set
4
+ * on the quickview store. */
5
+ export function cloneProductForQuickView(product, meta) {
6
+ const result = {
7
+ id: product.id,
8
+ responseId: product.responseId,
9
+ mappings: JSON.parse(JSON.stringify(product.mappings || {})),
10
+ attributes: JSON.parse(JSON.stringify(product.attributes || {})),
11
+ badges: product.badges?.all?.map((b) => ({ tag: b.tag })) || [],
12
+ };
13
+ return new Product({
14
+ config: {},
15
+ data: { result, meta: meta || {} },
16
+ position: product.position ?? 0,
17
+ responseId: product.responseId,
18
+ });
19
+ }
@@ -5,6 +5,7 @@ import { RecommendationProfileStore } from './Stores';
5
5
  import type { RecommendationStoreConfig, StoreServices } from '../types';
6
6
  import type { RecommendCombinedResponseModel } from '@athoscommerce/snap-client';
7
7
  import { MetaStore } from '../Meta/MetaStore';
8
+ import { ProductQuickViewStore } from '../ProductQuickView/ProductQuickViewStore';
8
9
  export declare class RecommendationStore extends AbstractStore<RecommendationStoreConfig> {
9
10
  services: StoreServices;
10
11
  meta?: MetaStore;
@@ -12,6 +13,7 @@ export declare class RecommendationStore extends AbstractStore<RecommendationSto
12
13
  profile: RecommendationProfileStore | Record<string, any>;
13
14
  results: Product[];
14
15
  cart?: CartStore;
16
+ productQuickView: ProductQuickViewStore;
15
17
  constructor(config: RecommendationStoreConfig, services: StoreServices);
16
18
  reset(): void;
17
19
  update(data: RecommendCombinedResponseModel): void;
@@ -1 +1 @@
1
- {"version":3,"file":"RecommendationStore.d.ts","sourceRoot":"","sources":["../../../src/Recommendation/RecommendationStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAqB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,qBAAa,mBAAoB,SAAQ,aAAa,CAAC,yBAAyB,CAAC;IACzE,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,UAAS;IACf,OA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AAI,EAAE,8BAA8B,GAAG,IAAI;CA+CzD"}
@@ -5,12 +5,14 @@ import { SearchResultStore } from '../Search/Stores';
5
5
  import { CartStore } from '../Cart/CartStore';
6
6
  import { RecommendationProfileStore } from './Stores';
7
7
  import { MetaStore } from '../Meta/MetaStore';
8
+ import { ProductQuickViewStore } from '../ProductQuickView/ProductQuickViewStore';
8
9
  export class RecommendationStore extends AbstractStore {
9
10
  constructor(config, services) {
10
11
  super(config);
11
12
  this.loaded = false;
12
13
  this.profile = {};
13
14
  this.results = [];
15
+ this.productQuickView = new ProductQuickViewStore();
14
16
  if (typeof services != 'object' || typeof services.urlManager?.subscribe != 'function') {
15
17
  throw new Error(`Invalid service 'urlManager' passed to AutocompleteStore. Missing "subscribe" function.`);
16
18
  }
@@ -18,6 +20,7 @@ export class RecommendationStore extends AbstractStore {
18
20
  makeObservable(this, {
19
21
  profile: observable,
20
22
  results: observable,
23
+ productQuickView: observable,
21
24
  });
22
25
  }
23
26
  reset() {
@@ -14,7 +14,7 @@ export class RecommendationProfileStore {
14
14
  this.tag = profile.tag;
15
15
  this.placement = profile.placement;
16
16
  this.display = profile.display;
17
- this.type = profile.display.template.type;
17
+ this.type = profile.isBundle ? 'bundle' : 'default';
18
18
  makeObservable(this, {
19
19
  tag: observable,
20
20
  placement: observable,
@@ -1,8 +1,8 @@
1
1
  import type { SearchResponseModel, MetaResponseModel } from '@athoscommerce/snapi-types';
2
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
2
3
  import type { SearchStoreConfig, StoreServices } from '../types';
3
4
  import { SearchMerchandisingStore, SearchFacetStore, SearchFilterStore, SearchResultStore, SearchPaginationStore, SearchSortingStore, SearchQueryStore, SearchHistoryStore } from './Stores';
4
5
  import { AbstractStore } from '../Abstract/AbstractStore';
5
- import { StorageStore } from '../Storage/StorageStore';
6
6
  import { MetaStore } from '../Meta/MetaStore';
7
7
  export declare class SearchStore extends AbstractStore<SearchStoreConfig> {
8
8
  private previousSearch?;
@@ -1 +1 @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ourceRoot":"","sources":["../../../src/Search/SearchStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,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;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,qBAAa,WAAY,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IAChE,QAAgB,cAAc,CAAC,CAAsB;IAC9C,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,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;IA6BvD,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,iBAAiB,CAAC;QAAC,MAAM,CAAC,EAAE,mBAAmB,CAAA;KAAE,GAAG,IAAI;CA6EtF"}
@@ -1,7 +1,7 @@
1
1
  import { makeObservable, observable } from 'mobx';
2
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
2
3
  import { SearchMerchandisingStore, SearchFacetStore, SearchFilterStore, SearchResultStore, SearchPaginationStore, SearchSortingStore, SearchQueryStore, SearchHistoryStore, } from './Stores';
3
4
  import { AbstractStore } from '../Abstract/AbstractStore';
4
- import { StorageStore } from '../Storage/StorageStore';
5
5
  import { MetaStore } from '../Meta/MetaStore';
6
6
  export class SearchStore extends AbstractStore {
7
7
  constructor(config, services) {
@@ -1,5 +1,5 @@
1
1
  import type { UrlManager } from '@athoscommerce/snap-url-manager';
2
- import type { StorageStore } from '../../Storage/StorageStore';
2
+ import type { StorageStore } from '@athoscommerce/snap-toolbox';
3
3
  import type { AutocompleteStoreConfig, SearchStoreConfig, StoreServices, FacetStoreConfig } from '../../types';
4
4
  import type { MetaResponseModelFacet, MetaResponseModelFacetSlider, MetaResponseModelFacetValueMultipleEnum, MetaResponseModelFacetHierarchyAllOf, SearchResponseModelFacetRange, SearchResponseModelFacetValue, SearchResponseModelFacetValueAllOfValues, SearchRequestModelFilterRangeAllOfValue, SearchResponseModel, MetaResponseModel } from '@athoscommerce/snapi-types';
5
5
  export type SearchFacetStoreConfig = {
@@ -1 +1 @@
1
- {"version":3,"file":"SearchFacetStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchFacetStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/G,OAAO,KAAK,EACX,sBAAsB,EAEtB,4BAA4B,EAC5B,uCAAuC,EACvC,oCAAoC,EAEpC,6BAA6B,EAC7B,6BAA6B,EAE7B,wCAAwC,EACxC,uCAAuC,EACvC,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,4BAA4B,CAAC;AAE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KAAK,IAAI,CAAC;QAChC,SAAS,EAAE,MAAM,IAAI,CAAC;KACtB,CAwCC;gBAGD,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,6BAA6B,EACpC,SAAS,EAAE,sBAAsB,EACjC,MAAM,EAAE,gBAAgB;IAmDzB,IAAW,aAAa,WAEvB;IAED,IAAW,aAAa,uEAavB;CACD;AAED,qBAAa,UAAU;IACf,KAAK,EAAG,MAAM,CAAC;IACf,KAAK,EAAG,MAAM,CAAC;IACf,QAAQ,EAAG,OAAO,CAAC;IACnB,KAAK,EAAG,MAAM,CAAC;IACf,MAAM,EAAG,MAAM,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;gBAEhB,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,wCAAwC;CAcvG;AAED,qBAAa,mBAAoB,SAAQ,UAAU;IAC3C,KAAK,SAAK;IACV,OAAO,UAAS;gBAGtB,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,UAAU,GAAG,oCAAoC,EACxD,KAAK,EAAE,wCAAwC,EAC/C,cAAc,EAAE,wCAAwC,EAAE;CAsB3D;AAED,qBAAa,eAAe;IACpB,KAAK,EAAG,MAAM,CAAC;IACf,KAAK,EAAG,MAAM,CAAC;IACf,QAAQ,EAAG,OAAO,CAAC;IACnB,GAAG,EAAG,MAAM,CAAC;IACb,IAAI,EAAG,MAAM,CAAC;IACd,MAAM,EAAG,MAAM,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;gBAEX,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,wCAAwC;CAgBvG"}
@@ -238,15 +238,16 @@ export class ValueFacet extends Facet {
238
238
  export class FacetValue {
239
239
  constructor(services, facet, value) {
240
240
  Object.assign(this, value);
241
+ const urlManager = services.urlManager;
241
242
  if (this.filtered) {
242
- this.url = services.urlManager.remove('page').remove(`filter.${facet.field}`, value.value);
243
+ this.url = urlManager.remove('page').remove(`filter.${facet.field}`, value.value);
243
244
  }
244
245
  else {
245
- let valueUrl = services.urlManager.remove('page');
246
+ let valueUrl = urlManager.remove('page');
246
247
  if (facet.multiple == 'single') {
247
- valueUrl = valueUrl?.remove(`filter.${facet.field}`);
248
+ valueUrl = valueUrl.remove(`filter.${facet.field}`);
248
249
  }
249
- this.url = valueUrl?.merge(`filter.${facet.field}`, value.value);
250
+ this.url = valueUrl.merge(`filter.${facet.field}`, value.value);
250
251
  }
251
252
  }
252
253
  }
@@ -264,26 +265,28 @@ export class FacetHierarchyValue extends FacetValue {
264
265
  this.history = true;
265
266
  }
266
267
  }
268
+ const urlManager = services.urlManager;
267
269
  if (value.value) {
268
- this.url = services.urlManager.remove('page').set(`filter.${facet.field}`, value.value);
270
+ this.url = urlManager.remove('page').set(`filter.${facet.field}`, value.value);
269
271
  }
270
272
  else {
271
- this.url = services.urlManager.remove('page').remove(`filter.${facet.field}`);
273
+ this.url = urlManager.remove('page').remove(`filter.${facet.field}`);
272
274
  }
273
275
  }
274
276
  }
275
277
  export class FacetRangeValue {
276
278
  constructor(services, facet, value) {
277
279
  Object.assign(this, value);
280
+ const urlManager = services.urlManager;
278
281
  if (this.filtered) {
279
- this.url = services.urlManager.remove('page').remove(`filter.${facet.field}`, [{ low: this.low, high: this.high }]);
282
+ this.url = urlManager.remove('page').remove(`filter.${facet.field}`, [{ low: this.low, high: this.high }]);
280
283
  }
281
284
  else {
282
- let valueUrl = services.urlManager.remove('page');
285
+ let valueUrl = urlManager.remove('page');
283
286
  if (facet.multiple == 'single') {
284
- valueUrl = valueUrl?.remove(`filter.${facet.field}`);
287
+ valueUrl = valueUrl.remove(`filter.${facet.field}`);
285
288
  }
286
- this.url = valueUrl?.merge(`filter.${facet.field}`, [{ low: this.low, high: this.high }]);
289
+ this.url = valueUrl.merge(`filter.${facet.field}`, [{ low: this.low, high: this.high }]);
287
290
  }
288
291
  }
289
292
  }
@@ -1,4 +1,4 @@
1
- import { StorageStore } from '../../Storage/StorageStore';
1
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
2
2
  import { Query } from './SearchQueryStore';
3
3
  export class SearchHistoryStore {
4
4
  constructor(params) {
@@ -4,13 +4,15 @@ export { FinderStore } from './Finder/FinderStore';
4
4
  export { SearchStore } from './Search/SearchStore';
5
5
  export { ChatStore } from './Chat/ChatStore';
6
6
  export type { ChatAttachmentImage, ChatAttachmentProduct, ChatAttachmentFacet } from './Chat/Stores/ChatAttachmentStore';
7
- export type { ChatActions, ActionsData, FacetsData, ChatMessage, ChatSessionFeedback } from './Chat/Stores/ChatSessionStore';
7
+ export type { ChatActions, ActionsData, ChatMessage, ChatSessionFeedback } from './Chat/Stores/ChatSessionStore';
8
8
  export * from './Search/Stores/';
9
9
  export * from './Autocomplete/Stores/';
10
10
  export { RecommendationStore } from './Recommendation/RecommendationStore';
11
11
  export { CartStore } from './Cart/CartStore';
12
- export { StorageStore, StorageConfig, StorageType } from './Storage/StorageStore';
12
+ export { StorageStore, StorageConfig, StorageType } from '@athoscommerce/snap-toolbox';
13
13
  export { MetaStore } from './Meta/MetaStore';
14
+ export { ProductQuickViewStore } from './ProductQuickView/ProductQuickViewStore';
15
+ export { cloneProductForQuickView } from './ProductQuickView/cloneProductForQuickView';
14
16
  export * from './types';
15
17
  export { ChatSessionStore } from './Chat/Stores/ChatSessionStore';
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,E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C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC"}
package/dist/esm/index.js CHANGED
@@ -7,7 +7,9 @@ export * from './Search/Stores/';
7
7
  export * from './Autocomplete/Stores/';
8
8
  export { RecommendationStore } from './Recommendation/RecommendationStore';
9
9
  export { CartStore } from './Cart/CartStore';
10
- export { StorageStore, StorageType } from './Storage/StorageStore';
10
+ export { StorageStore, StorageType } from '@athoscommerce/snap-toolbox';
11
11
  export { MetaStore } from './Meta/MetaStore';
12
+ export { ProductQuickViewStore } from './ProductQuickView/ProductQuickViewStore';
13
+ export { cloneProductForQuickView } from './ProductQuickView/cloneProductForQuickView';
12
14
  export * from './types';
13
15
  export { ChatSessionStore } from './Chat/Stores/ChatSessionStore';