@empathyco/x-components 10.10.0 → 10.12.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/CHANGELOG.md CHANGED
@@ -3,6 +3,39 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.12.0](https://github.com/empathyco/x/compare/@empathyco/x-components@10.3.0...@empathyco/x-components@10.12.0) (2026-11-23)
7
+
8
+ ### Features
9
+
10
+ * **base-modal:** add scrollLock prop to control page scroll behavior (#2200)
11
+ * **search:** add priceFacetId to SearchConfig and update request accordingly (#2194)
12
+ * **skills:** ship validated agent skills in every package (#2203)
13
+ * **x-components:** add responsive image props and loading events to BaseResultImage (#2195)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **ai:** set AI suggestions status to error when requests fail (ENG-2552) (#2204)
18
+ * change CSS selector for only child teleport (#2197)
19
+ * remove parent selector when BaseTeleport is unmounted (#2198)
20
+ * **vendor:** don't render the search results duplicated by vendor results (ENG-2618) (#2208)
21
+
22
+
23
+ ## [10.11.0](https://github.com/empathyco/x/compare/@empathyco/x-components@10.3.0...@empathyco/x-components@10.11.0) (2026-11-23)
24
+
25
+ ### Features
26
+
27
+ * **base-modal:** add scrollLock prop to control page scroll behavior (#2200)
28
+ * **search:** add priceFacetId to SearchConfig and update request accordingly (#2194)
29
+ * **skills:** ship validated agent skills in every package (#2203)
30
+ * **x-components:** add responsive image props and loading events to BaseResultImage (#2195)
31
+
32
+ ### Bug Fixes
33
+
34
+ * **ai:** set AI suggestions status to error when requests fail (ENG-2552) (#2204)
35
+ * change CSS selector for only child teleport (#2197)
36
+ * remove parent selector when BaseTeleport is unmounted (#2198)
37
+
38
+
6
39
  ## [10.10.0](https://github.com/empathyco/x/compare/@empathyco/x-components@10.3.0...@empathyco/x-components@10.10.0) (2026-11-23)
7
40
 
8
41
  ### Features
@@ -1,6 +1,7 @@
1
1
  import '../../../../plugins/x-bus.js';
2
2
  import '@empathyco/x-utils';
3
3
  import { XPlugin } from '../../../../plugins/x-plugin.js';
4
+ import { isAbortError } from '../utils.js';
4
5
 
5
6
  /**
6
7
  * Default implementation for the `AiActions.fetchAndSaveAiSuggestionsSearch`.
@@ -23,12 +24,15 @@ const fetchAndSaveAiSuggestionsSearch = async ({ commit, getters }) => {
23
24
  commit('setSuggestionsSearch', response.suggestions);
24
25
  commit('setSuggestionsSearchTagging', response.suggestionsTagging);
25
26
  }
27
+ commit('setSuggestionsSearchStatus', 'success');
26
28
  })
27
29
  .catch(error => {
30
+ // A newer request with the same id aborted this one, so it is in charge of the status.
31
+ if (isAbortError(error)) {
32
+ return;
33
+ }
34
+ commit('setSuggestionsSearchStatus', 'error');
28
35
  console.error(error);
29
- })
30
- .finally(() => {
31
- commit('setSuggestionsSearchStatus', 'success');
32
36
  });
33
37
  };
34
38
 
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-and-save-ai-suggestions-search.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.ts"],"sourcesContent":["import type { AiXStoreModule } from '../types'\nimport { XPlugin } from '../../../../plugins'\n\n/**\n * Default implementation for the `AiActions.fetchAndSaveAiSuggestionsSearch`.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the commits and\n * getters provided by Vuex.\n * @returns The AI search response.\n * @public\n */\nexport const fetchAndSaveAiSuggestionsSearch: AiXStoreModule['actions']['fetchAndSaveAiSuggestionsSearch'] =\n async ({ commit, getters }) => {\n const request = getters.suggestionsSearchRequest\n if (!request) {\n return\n }\n commit('setSuggestionsSearchStatus', 'loading')\n\n return XPlugin.adapter\n .aiSuggestionsSearch(request)\n .then(response => {\n if (response) {\n commit('setSuggestionsSearch', response.suggestions)\n commit('setSuggestionsSearchTagging', response.suggestionsTagging)\n }\n })\n .catch(error => {\n console.error(error)\n })\n .finally(() => {\n commit('setSuggestionsSearchStatus', 'success')\n })\n }\n"],"names":[],"mappings":";;;;AAGA;;;;;;;AAOG;AACI,MAAM,+BAA+B,GAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAI;AAC5B,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB;IAChD,IAAI,CAAC,OAAO,EAAE;QACZ;IACF;AACA,IAAA,MAAM,CAAC,4BAA4B,EAAE,SAAS,CAAC;IAE/C,OAAO,OAAO,CAAC;SACZ,mBAAmB,CAAC,OAAO;SAC3B,IAAI,CAAC,QAAQ,IAAG;QACf,IAAI,QAAQ,EAAE;AACZ,YAAA,MAAM,CAAC,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAAC;AACpD,YAAA,MAAM,CAAC,6BAA6B,EAAE,QAAQ,CAAC,kBAAkB,CAAC;QACpE;AACF,IAAA,CAAC;SACA,KAAK,CAAC,KAAK,IAAG;AACb,QAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACtB,IAAA,CAAC;SACA,OAAO,CAAC,MAAK;AACZ,QAAA,MAAM,CAAC,4BAA4B,EAAE,SAAS,CAAC;AACjD,IAAA,CAAC,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"fetch-and-save-ai-suggestions-search.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.ts"],"sourcesContent":["import type { AiXStoreModule } from '../types'\nimport { XPlugin } from '../../../../plugins'\nimport { isAbortError } from '../utils'\n\n/**\n * Default implementation for the `AiActions.fetchAndSaveAiSuggestionsSearch`.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the commits and\n * getters provided by Vuex.\n * @returns The AI search response.\n * @public\n */\nexport const fetchAndSaveAiSuggestionsSearch: AiXStoreModule['actions']['fetchAndSaveAiSuggestionsSearch'] =\n async ({ commit, getters }) => {\n const request = getters.suggestionsSearchRequest\n if (!request) {\n return\n }\n commit('setSuggestionsSearchStatus', 'loading')\n\n return XPlugin.adapter\n .aiSuggestionsSearch(request)\n .then(response => {\n if (response) {\n commit('setSuggestionsSearch', response.suggestions)\n commit('setSuggestionsSearchTagging', response.suggestionsTagging)\n }\n commit('setSuggestionsSearchStatus', 'success')\n })\n .catch(error => {\n // A newer request with the same id aborted this one, so it is in charge of the status.\n if (isAbortError(error)) {\n return\n }\n commit('setSuggestionsSearchStatus', 'error')\n console.error(error)\n })\n }\n"],"names":[],"mappings":";;;;;AAIA;;;;;;;AAOG;AACI,MAAM,+BAA+B,GAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAI;AAC5B,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB;IAChD,IAAI,CAAC,OAAO,EAAE;QACZ;IACF;AACA,IAAA,MAAM,CAAC,4BAA4B,EAAE,SAAS,CAAC;IAE/C,OAAO,OAAO,CAAC;SACZ,mBAAmB,CAAC,OAAO;SAC3B,IAAI,CAAC,QAAQ,IAAG;QACf,IAAI,QAAQ,EAAE;AACZ,YAAA,MAAM,CAAC,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAAC;AACpD,YAAA,MAAM,CAAC,6BAA6B,EAAE,QAAQ,CAAC,kBAAkB,CAAC;QACpE;AACA,QAAA,MAAM,CAAC,4BAA4B,EAAE,SAAS,CAAC;AACjD,IAAA,CAAC;SACA,KAAK,CAAC,KAAK,IAAG;;AAEb,QAAA,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;YACvB;QACF;AACA,QAAA,MAAM,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7C,QAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACtB,IAAA,CAAC,CAAC;AACN;;;;"}
@@ -2,6 +2,7 @@ import { getTaggingInfoFromUrl } from '@empathyco/x-adapter-platform';
2
2
  import '../../../../plugins/x-bus.js';
3
3
  import '@empathyco/x-utils';
4
4
  import { XPlugin } from '../../../../plugins/x-plugin.js';
5
+ import { isAbortError } from '../utils.js';
5
6
 
6
7
  /**
7
8
  * Default implementation for the {@link AiActions.fetchAndSaveAiSuggestions}.
@@ -17,16 +18,32 @@ const fetchAndSaveAiSuggestions = async ({ commit }, request) => {
17
18
  return;
18
19
  }
19
20
  commit('setSuggestionsStatus', 'loading');
20
- return XPlugin.adapter.aiSuggestions(request).then(({ body, status }) => {
21
- if (status !== 200) {
22
- return;
23
- }
24
- if (body) {
25
- const reader = body.getReader();
26
- readAnswer(reader, commit);
21
+ return XPlugin.adapter
22
+ .aiSuggestions(request)
23
+ .then(({ body, status }) => {
24
+ if (status !== 200 || !body) {
25
+ throw new Error(`AI suggestions request failed with status ${status}`);
27
26
  }
27
+ readAnswer(body.getReader(), commit);
28
+ })
29
+ .catch(error => {
30
+ handleError(error, commit);
28
31
  });
29
32
  };
33
+ /**
34
+ * Sets the suggestions status to `error` and logs the error, unless the request was aborted by a
35
+ * newer one.
36
+ *
37
+ * @param error - The error thrown by the request or while reading the response.
38
+ * @param commit - The commit function of the actions context.
39
+ */
40
+ function handleError(error, commit) {
41
+ if (isAbortError(error)) {
42
+ return;
43
+ }
44
+ commit('setSuggestionsStatus', 'error');
45
+ console.error(error);
46
+ }
30
47
  function mapTaggingData(taggingData) {
31
48
  const { toolingDisplay, toolingDisplayClick, searchQueries } = taggingData.tagging[0];
32
49
  // TODO: Using the getTaggingInfoFromUrl util here is a temporary solution.
@@ -72,12 +89,8 @@ function readAnswer(reader, commit) {
72
89
  }
73
90
  readAnswer(reader, commit);
74
91
  })
75
- .catch((error) => {
76
- commit('setSuggestionsStatus', 'error');
77
- // AbortError code === 20
78
- if (error.code !== 20) {
79
- console.error(error);
80
- }
92
+ .catch(error => {
93
+ handleError(error, commit);
81
94
  });
82
95
  }
83
96
 
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-and-save-ai-suggestions.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions.action.ts"],"sourcesContent":["import type { AiSuggestionQuery, AiSuggestionTagging } from '@empathyco/x-types'\nimport type { AiActionContext, AiXStoreModule } from '../types'\nimport { getTaggingInfoFromUrl } from '@empathyco/x-adapter-platform'\nimport { XPlugin } from '../../../../plugins'\n\ninterface TaggingData {\n tagging: {\n toolingDisplay: string\n toolingDisplayClick: string\n searchQueries: Record<\n string,\n {\n toolingDisplay: string\n toolingDisplayClick: string\n toolingDisplayAdd2Cart: string\n }\n >\n }[]\n}\n\ntype AnswerData = { queries: AiSuggestionQuery[] } | TaggingData\n\n/**\n * Default implementation for the {@link AiActions.fetchAndSaveAiSuggestions}.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param request - The AI request to make.\n * @returns The AI response.\n * @public\n */\nexport const fetchAndSaveAiSuggestions: AiXStoreModule['actions']['fetchAndSaveAiSuggestions'] =\n async ({ commit }, request) => {\n if (!request) {\n return\n }\n commit('setSuggestionsStatus', 'loading')\n\n return XPlugin.adapter.aiSuggestions(request).then(({ body, status }) => {\n if (status !== 200) {\n return\n }\n if (body) {\n const reader = body.getReader()\n readAnswer(reader, commit)\n }\n })\n }\n\nfunction mapTaggingData(taggingData: TaggingData): AiSuggestionTagging {\n const { toolingDisplay, toolingDisplayClick, searchQueries } = taggingData.tagging[0]\n // TODO: Using the getTaggingInfoFromUrl util here is a temporary solution.\n // It creates a dependency with the x-adapter-platform project that should be avoided.\n return {\n toolingDisplay: getTaggingInfoFromUrl(toolingDisplay),\n toolingDisplayClick: getTaggingInfoFromUrl(toolingDisplayClick),\n searchQueries: Object.fromEntries(\n Object.entries(searchQueries).map(\n ([query, { toolingDisplay, toolingDisplayClick, toolingDisplayAdd2Cart }]) => [\n query,\n {\n toolingDisplay: getTaggingInfoFromUrl(toolingDisplay),\n toolingDisplayClick: getTaggingInfoFromUrl(toolingDisplayClick),\n toolingDisplayAdd2Cart: getTaggingInfoFromUrl(toolingDisplayAdd2Cart),\n },\n ],\n ),\n ),\n }\n}\n\nfunction readAnswer(\n reader: ReadableStreamDefaultReader<Uint8Array>,\n commit: AiActionContext['commit'],\n): void {\n reader\n .read()\n .then(({ value, done }) => {\n if (done) {\n commit('setSuggestionsStatus', 'success')\n return\n }\n\n const result = new TextDecoder().decode(value, { stream: true })\n const parts = result.split('\\n\\n')\n for (const part of parts) {\n const lines = part.split('\\n')\n\n for (const line of lines) {\n // line.length check to avoid event lines or empty lines\n if (line.length <= 5 || line.startsWith('event:')) continue\n\n const raw = line.startsWith('data:') ? line.slice(5).trim() : line.trim()\n const data = JSON.parse(raw) as AnswerData\n\n if ('queries' in data) {\n commit('setQueries', data.queries)\n }\n if ('tagging' in data) {\n commit('setTagging', mapTaggingData(data))\n }\n }\n }\n readAnswer(reader, commit)\n })\n .catch((error: { code: number }) => {\n commit('setSuggestionsStatus', 'error')\n // AbortError code === 20\n if (error.code !== 20) {\n console.error(error)\n }\n })\n}\n"],"names":[],"mappings":";;;;;AAsBA;;;;;;;;AAQG;AACI,MAAM,yBAAyB,GACpC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,KAAI;IAC5B,IAAI,CAAC,OAAO,EAAE;QACZ;IACF;AACA,IAAA,MAAM,CAAC,sBAAsB,EAAE,SAAS,CAAC;AAEzC,IAAA,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAI;AACtE,QAAA,IAAI,MAAM,KAAK,GAAG,EAAE;YAClB;QACF;QACA,IAAI,IAAI,EAAE;AACR,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE;AAC/B,YAAA,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;QAC5B;AACF,IAAA,CAAC,CAAC;AACJ;AAEF,SAAS,cAAc,CAAC,WAAwB,EAAA;AAC9C,IAAA,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;;;IAGrF,OAAO;AACL,QAAA,cAAc,EAAE,qBAAqB,CAAC,c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CAAC,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;gBACzE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAe;AAE1C,gBAAA,IAAI,SAAS,IAAI,IAAI,EAAE;AACrB,oBAAA,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC;gBACpC;AACA,gBAAA,IAAI,SAAS,IAAI,IAAI,EAAE;oBACrB,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;gBAC5C;YACF;QACF;AACA,QAAA,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;AAC5B,IAAA,CAAC;AACA,SAAA,KAAK,CAAC,CAAC,KAAuB,KAAI;AACjC,QAAA,MAAM,CAAC,sBAAsB,EAAE,OAAO,CAAC;;AAEvC,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,EAAE,EAAE;AACrB,YAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;QACtB;AACF,IAAA,CAAC,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"fetch-and-save-ai-suggestions.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions.action.ts"],"sourcesContent":["import type { AiSuggestionQuery, AiSuggestionTagging } from '@empathyco/x-types'\nimport type { AiActionContext, AiXStoreModule } from '../types'\nimport { getTaggingInfoFromUrl } from '@empathyco/x-adapter-platform'\nimport { XPlugin } from '../../../../plugins'\nimport { isAbortError } from '../utils'\n\ninterface TaggingData {\n tagging: {\n toolingDisplay: string\n toolingDisplayClick: string\n searchQueries: Record<\n string,\n {\n toolingDisplay: string\n toolingDisplayClick: string\n toolingDisplayAdd2Cart: string\n }\n >\n }[]\n}\n\ntype AnswerData = { queries: AiSuggestionQuery[] } | TaggingData\n\n/**\n * Default implementation for the {@link AiActions.fetchAndSaveAiSuggestions}.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param request - The AI request to make.\n * @returns The AI response.\n * @public\n */\nexport const fetchAndSaveAiSuggestions: AiXStoreModule['actions']['fetchAndSaveAiSuggestions'] =\n async ({ commit }, request) => {\n if (!request) {\n return\n }\n commit('setSuggestionsStatus', 'loading')\n\n return XPlugin.adapter\n .aiSuggestions(request)\n .then(({ body, status }) => {\n if (status !== 200 || !body) {\n throw new Error(`AI suggestions request failed with status ${status}`)\n }\n readAnswer(body.getReader(), commit)\n })\n .catch(error => {\n handleError(error, commit)\n })\n }\n\n/**\n * Sets the suggestions status to `error` and logs the error, unless the request was aborted by a\n * newer one.\n *\n * @param error - The error thrown by the request or while reading the response.\n * @param commit - The commit function of the actions context.\n */\nfunction handleError(error: unknown, commit: AiActionContext['commit']) {\n if (isAbortError(error)) {\n return\n }\n commit('setSuggestionsStatus', 'error')\n console.error(error)\n}\n\nfunction mapTaggingData(taggingData: TaggingData): AiSuggestionTagging {\n const { toolingDisplay, toolingDisplayClick, searchQueries } = taggingData.tagging[0]\n // TODO: Using the getTaggingInfoFromUrl util here is a temporary solution.\n // It creates a dependency with the x-adapter-platform project that should be avoided.\n return {\n toolingDisplay: getTaggingInfoFromUrl(toolingDisplay),\n toolingDisplayClick: getTaggingInfoFromUrl(toolingDisplayClick),\n searchQueries: Object.fromEntries(\n Object.entries(searchQueries).map(\n ([query, { toolingDisplay, toolingDisplayClick, toolingDisplayAdd2Cart }]) => [\n query,\n {\n toolingDisplay: getTaggingInfoFromUrl(toolingDisplay),\n toolingDisplayClick: getTaggingInfoFromUrl(toolingDisplayClick),\n toolingDisplayAdd2Cart: getTaggingInfoFromUrl(toolingDisplayAdd2Cart),\n },\n ],\n ),\n ),\n }\n}\n\nfunction readAnswer(\n reader: ReadableStreamDefaultReader<Uint8Array>,\n commit: AiActionContext['commit'],\n): void {\n reader\n .read()\n .then(({ value, done }) => {\n if (done) {\n commit('setSuggestionsStatus', 'success')\n return\n }\n\n const result = new TextDecoder().decode(value, { stream: true })\n const parts = result.split('\\n\\n')\n for (const part of parts) {\n const lines = part.split('\\n')\n\n for (const line of lines) {\n // line.length check to avoid event lines or empty lines\n if (line.length <= 5 || line.startsWith('event:')) continue\n\n const raw = line.startsWith('data:') ? line.slice(5).trim() : line.trim()\n const data = JSON.parse(raw) as AnswerData\n\n if ('queries' in data) {\n commit('setQueries', data.queries)\n }\n if ('tagging' in data) {\n commit('setTagging', mapTaggingData(data))\n }\n }\n }\n readAnswer(reader, commit)\n })\n .catch(error => {\n handleError(error, commit)\n })\n}\n"],"names":[],"mappings":";;;;;;AAuBA;;;;;;;;AAQG;AACI,MAAM,yBAAyB,GACpC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,KAAI;IAC5B,IAAI,CAAC,OAAO,EAAE;QACZ;IACF;AACA,IAAA,MAAM,CAAC,sBAAsB,EAAE,SAAS,CAAC;IAEzC,OAAO,OAAO,CAAC;SACZ,aAAa,CAAC,OAAO;SACrB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAI;AACzB,QAAA,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE;AAC3B,YAAA,MAAM,IAAI,KAAK,CAAC,6CAA6C,MAAM,CAAA,CAAE,CAAC;QACxE;QACA,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC;AACtC,IAAA,CAAC;SACA,KAAK,CAAC,KAAK,IAAG;AACb,QAAA,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;AAC5B,IAAA,CAAC,CAAC;AACN;AAEF;;;;;;AAMG;AACH,SAAS,WAAW,CAAC,KAAc,EAAE,MAAiC,EAAA;AACpE,IAAA,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;QACvB;IACF;AACA,IAAA,MAAM,CAAC,sBAAsB,EAAE,OAAO,CAAC;AACvC,IAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACtB;AAEA,SAAS,cAAc,CAAC,WAAwB,EAAA;AAC9C,IAAA,MAAM,EAAE,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AC,UAAU,CAAC,QAAQ,CAAC;oBAAE;gBAEnD,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;gBACzE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAe;AAE1C,gBAAA,IAAI,SAAS,IAAI,IAAI,EAAE;AACrB,oBAAA,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC;gBACpC;AACA,gBAAA,IAAI,SAAS,IAAI,IAAI,EAAE;oBACrB,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;gBAC5C;YACF;QACF;AACA,QAAA,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;AAC5B,IAAA,CAAC;SACA,KAAK,CAAC,KAAK,IAAG;AACb,QAAA,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;AAC5B,IAAA,CAAC,CAAC;AACN;;;;"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Checks if the error was thrown because the request was aborted. This happens when a newer
3
+ * request with the same id is made, so that newer request is in charge of the status.
4
+ *
5
+ * @param error - The error to check.
6
+ * @returns True if the error is an `AbortError`.
7
+ * @internal
8
+ */
9
+ function isAbortError(error) {
10
+ if (typeof error !== 'object' || error === null) {
11
+ return false;
12
+ }
13
+ const { name, code } = error;
14
+ // AbortError code === 20
15
+ return name === 'AbortError' || code === 20;
16
+ }
17
+
18
+ export { isAbortError };
19
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../../../src/x-modules/ai/store/utils.ts"],"sourcesContent":["/**\n * Checks if the error was thrown because the request was aborted. This happens when a newer\n * request with the same id is made, so that newer request is in charge of the status.\n *\n * @param error - The error to check.\n * @returns True if the error is an `AbortError`.\n * @internal\n */\nexport function isAbortError(error: unknown): boolean {\n if (typeof error !== 'object' || error === null) {\n return false\n }\n const { name, code } = error as { name?: string; code?: number }\n // AbortError code === 20\n return name === 'AbortError' || code === 20\n}\n"],"names":[],"mappings":"AAAA;;;;;;;AAOG;AACG,SAAU,YAAY,CAAC,KAAc,EAAA;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;AAC/C,QAAA,OAAO,KAAK;IACd;AACA,IAAA,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,KAAyC;;AAEhE,IAAA,OAAO,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,EAAE;AAC7C;;;;"}
@@ -53,6 +53,17 @@ var _sfc_main = defineComponent({
53
53
  : vendorBanners.value);
54
54
  /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */
55
55
  const injectedListItems = inject(LIST_ITEMS_KEY);
56
+ /**
57
+ * The injected list items without the banners that are also provided as vendor banners
58
+ * (same id), so the same banner is not rendered twice.
59
+ *
60
+ * @remarks The vendor banner takes precedence over the indexed banner. The state is not
61
+ * modified, so the banner is rendered again if the vendor banner is removed.
62
+ */
63
+ const injectedItemsWithoutDuplicates = computed(() => {
64
+ const vendorBannerIds = new Set(stateItems.value.map(({ id }) => id));
65
+ return (injectedListItems?.value ?? []).filter(({ id, modelName }) => modelName !== 'Banner' || !vendorBannerIds.has(id));
66
+ });
56
67
  /**
57
68
  * Indicates if all the results of the current context have been loaded, to know if the
58
69
  * vendor banners can be inserted in positions of not yet loaded pages.
@@ -72,10 +83,10 @@ var _sfc_main = defineComponent({
72
83
  * @returns List of {@link ListItem}.
73
84
  */
74
85
  const items = computed(() => {
75
- if (!injectedListItems?.value.length) {
86
+ if (!injectedItemsWithoutDuplicates.value.length) {
76
87
  return stateItems.value;
77
88
  }
78
- const items = [...injectedListItems.value];
89
+ const items = [...injectedItemsWithoutDuplicates.value];
79
90
  const positionedBanners = stateItems.value.filter(item => item.position != null);
80
91
  const unpositionedBanners = stateItems.value.filter(item => item.position == null);
81
92
  for (const item of positionedBanners) {
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-banners-list.vue.js","sources":["../../../../../src/x-modules/vendor/components/vendor-banners-list.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { ListItem } from '../../../utils/types'\nimport { computed, defineComponent, h, inject, provide } from 'vue'\nimport { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts'\nimport ItemsList from '../../../components/items-list.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { vendorXModule } from '../x-module'\n\n/**\n * It renders a {@link ItemsList} list of vendor banners from {@link VendorState.banners}.\n *\n * The component provides a default slot which wraps the whole component with the `vendorBanners`\n * plus the `injectedListItems` which also contains the injected list items from\n * the ancestor.\n *\n * If the `queryPreviewHash` prop is provided, the vendor banners are retrieved from\n * {@link VendorState.queryPreviews}, scoped to the query preview.\n *\n * It also provides the parent slots to customize the items.\n *\n * @public\n */\nexport default defineComponent({\n name: 'VendorBannersList',\n xModule: vendorXModule.name,\n props: {\n /** Animation component that will be used to animate the vendor banners. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n /**\n * The hash of the query preview to render its vendor banners. If not provided,\n * the vendor banners from the root state are rendered.\n */\n queryPreviewHash: {\n type: String,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n /** The vendor banners to render from the vendor state. */\n const vendorBanners = useState('vendor').banners\n\n /** The vendor banners of the query previews, indexed by their query preview hash. */\n const vendorQueryPreviews = useState('vendor').queryPreviews\n\n /**\n * The vendor banners to render. They are read from the query preview state when the\n * `queryPreviewHash` prop is provided, or from the root vendor state otherwise.\n */\n const stateItems = computed(() =>\n props.queryPreviewHash\n ? (vendorQueryPreviews.value?.[props.queryPreviewHash]?.banners ?? [])\n : vendorBanners.value,\n )\n\n /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */\n const injectedListItems = inject<Ref<ListItem[]>>(LIST_ITEMS_KEY as string)\n\n /**\n * Indicates if all the results of the current context have been loaded, to know if the\n * vendor banners can be inserted in positions of not yet loaded pages.\n *\n * @remarks The query preview results are always considered as fully loaded, since they are\n * retrieved as a fixed batch.\n *\n * @returns Whether all the results are loaded.\n */\n const areAllPagesLoaded = computed(() =>\n props.queryPreviewHash ? true : $x.results.length === $x.totalResults,\n )\n\n /**\n * The `stateItems` concatenated with the `injectedListItems` if there are.\n *\n * @remarks This computed defines the merging strategy of the `stateItems` and the\n * `injectedListItems`.\n *\n * @returns List of {@link ListItem}.\n */\n const items = computed(() => {\n if (!injectedListItems?.value!.length) {\n return stateItems.value\n }\n const items = [...injectedListItems.value]\n const positionedBanners = stateItems.value.filter(item => item.position != null)\n const unpositionedBanners = stateItems.value.filter(item => item.position == null)\n for (const item of positionedBanners) {\n let index = item.position! - 1\n while (items.at(index)?.modelName === 'VendorBanner') {\n index++\n }\n const isIndexInLoadedPages = index <= items.length\n if (!isIndexInLoadedPages && !areAllPagesLoaded.value) {\n break\n }\n items.splice(index, 0, item)\n }\n items.unshift(...unpositionedBanners)\n return items\n })\n\n /**\n * The computed list items of the entity that uses the mixin.\n *\n * @remarks It should be overridden in the component that uses the mixin and it's intended to be\n * filled with items from the state. Vue doesn't allow mixins as abstract classes.\n * @returns An empty array as fallback in case it is not overridden.\n */\n provide(LIST_ITEMS_KEY as string, items)\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation }\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots)\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;AAWA;;;;;;;;;;;;;AAaE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aA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K,IAAI,CAAC,YAAY,IAAI,CAAA;AACjF,YAAA,KAAK,MAAM,IAAG,IAAK,iBAAiB,EAAE;AACpC,gBAAA,IAAI,KAAI,GAAI,IAAI,CAAC,QAAQ,GAAI,CAAA;gBAC7B,OAAO,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,cAAc,cAAc,EAAE;AACpD,oBAAA,KAAK,EAAC;gBACR;AACA,gBAAA,MAAM,uBAAuB,SAAS,KAAK,CAAC,MAAK;gBACjD,IAAI,CAAC,oBAAmB,IAAK,CAAC,iBAAiB,CAAC,KAAK,EAAE;oBACrD;gBACF;gBACA,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAA;YAC7B;AACA,YAAA,KAAK,CAAC,OAAO,CAAC,GAAG,mBAAmB,CAAA;AACpC,YAAA,OAAO,KAAI;AACb,QAAA,CAAC,CAAA;AAED;;;;;;AAME;AACF,QAAA,OAAO,CAAC,cAAwB,EAAE,KAAK,CAAA;AAEvC,QAAA,OAAO,MAAI;AACT,YAAA,MAAM,UAAS,GAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAE;;AAEpE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAA;AACzE,QAAA,CAAA;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"vendor-banners-list.vue.js","sources":["../../../../../src/x-modules/vendor/components/vendor-banners-list.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { ListItem } from '../../../utils/types'\nimport { computed, defineComponent, h, inject, provide } from 'vue'\nimport { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts'\nimport ItemsList from '../../../components/items-list.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { vendorXModule } from '../x-module'\n\n/**\n * It renders a {@link ItemsList} list of vendor banners from {@link VendorState.banners}.\n *\n * The component provides a default slot which wraps the whole component with the `vendorBanners`\n * plus the `injectedListItems` which also contains the injected list items from\n * the ancestor.\n *\n * If the `queryPreviewHash` prop is provided, the vendor banners are retrieved from\n * {@link VendorState.queryPreviews}, scoped to the query preview.\n *\n * It also provides the parent slots to customize the items.\n *\n * @public\n */\nexport default defineComponent({\n name: 'VendorBannersList',\n xModule: vendorXModule.name,\n props: {\n /** Animation component that will be used to animate the vendor banners. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n /**\n * The hash of the query preview to render its vendor banners. If not provided,\n * the vendor banners from the root state are rendered.\n */\n queryPreviewHash: {\n type: String,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n /** The vendor banners to render from the vendor state. */\n const vendorBanners = useState('vendor').banners\n\n /** The vendor banners of the query previews, indexed by their query preview hash. */\n const vendorQueryPreviews = useState('vendor').queryPreviews\n\n /**\n * The vendor banners to render. They are read from the query preview state when the\n * `queryPreviewHash` prop is provided, or from the root vendor state otherwise.\n */\n const stateItems = computed(() =>\n props.queryPreviewHash\n ? (vendorQueryPreviews.value?.[props.queryPreviewHash]?.banners ?? [])\n : vendorBanners.value,\n )\n\n /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */\n const injectedListItems = inject<Ref<ListItem[]>>(LIST_ITEMS_KEY as string)\n\n /**\n * The injected list items without the banners that are also provided as vendor banners\n * (same id), so the same banner is not rendered twice.\n *\n * @remarks The vendor banner takes precedence over the indexed banner. The state is not\n * modified, so the banner is rendered again if the vendor banner is removed.\n */\n const injectedItemsWithoutDuplicates = computed(() => {\n const vendorBannerIds = new Set(stateItems.value.map(({ id }) => id))\n return (injectedListItems?.value ?? []).filter(\n ({ id, modelName }) => modelName !== 'Banner' || !vendorBannerIds.has(id),\n )\n })\n\n /**\n * Indicates if all the results of the current context have been loaded, to know if the\n * vendor banners can be inserted in positions of not yet loaded pages.\n *\n * @remarks The query preview results are always considered as fully loaded, since they are\n * retrieved as a fixed batch.\n *\n * @returns Whether all the results are loaded.\n */\n const areAllPagesLoaded = computed(() =>\n props.queryPreviewHash ? true : $x.results.length === $x.totalResults,\n )\n\n /**\n * The `stateItems` concatenated with the `injectedListItems` if there are.\n *\n * @remarks This computed defines the merging strategy of the `stateItems` and the\n * `injectedListItems`.\n *\n * @returns List of {@link ListItem}.\n */\n const items = computed(() => {\n if (!injectedItemsWithoutDuplicates.value.length) {\n return stateItems.value\n }\n const items = [...injectedItemsWithoutDuplicates.value]\n const positionedBanners = stateItems.value.filter(item => item.position != null)\n const unpositionedBanners = stateItems.value.filter(item => item.position == null)\n for (const item of positionedBanners) {\n let index = item.position! - 1\n while (items.at(index)?.modelName === 'VendorBanner') {\n index++\n }\n const isIndexInLoadedPages = index <= items.length\n if (!isIndexInLoadedPages && !areAllPagesLoaded.value) {\n break\n }\n items.splice(index, 0, item)\n }\n items.unshift(...unpositionedBanners)\n return items\n })\n\n /**\n * The computed list items of the entity that uses the mixin.\n *\n * @remarks It should be overridden in the component that uses the mixin and it's intended to be\n * filled with items from the state. Vue doesn't allow mixins as abstract classes.\n * @returns An empty array as fallback in case it is not overridden.\n */\n provide(LIST_ITEMS_KEY as string, items)\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation }\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots)\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;AAWA;;;;;;;;;;;;;AAaE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SA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,EAAE,KAAK,CAAA;AACzE,QAAA,CAAA;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -53,6 +53,17 @@ var _sfc_main = defineComponent({
53
53
  : vendorResults.value);
54
54
  /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */
55
55
  const injectedListItems = inject(LIST_ITEMS_KEY);
56
+ /**
57
+ * The injected list items without the search results that are also provided as vendor results
58
+ * (same id), so the same product is not rendered twice.
59
+ *
60
+ * @remarks The vendor result takes precedence over the indexed search result. The state is not
61
+ * modified, so the search result is rendered again if the vendor result is removed.
62
+ */
63
+ const injectedItemsWithoutDuplicates = computed(() => {
64
+ const vendorResultIds = new Set(stateItems.value.map(({ id }) => id));
65
+ return (injectedListItems?.value ?? []).filter(({ id, modelName }) => modelName !== 'Result' || !vendorResultIds.has(id));
66
+ });
56
67
  /**
57
68
  * Indicates if all the results of the current context have been loaded, to know if the
58
69
  * vendor results can be inserted in positions of not yet loaded pages.
@@ -72,10 +83,10 @@ var _sfc_main = defineComponent({
72
83
  * @returns List of {@link ListItem}.
73
84
  */
74
85
  const items = computed(() => {
75
- if (!injectedListItems?.value.length) {
86
+ if (!injectedItemsWithoutDuplicates.value.length) {
76
87
  return stateItems.value;
77
88
  }
78
- const items = [...injectedListItems.value];
89
+ const items = [...injectedItemsWithoutDuplicates.value];
79
90
  for (const item of stateItems.value) {
80
91
  const position = item.position ?? 1;
81
92
  let index = position - 1;
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-results-list.vue.js","sources":["../../../../../src/x-modules/vendor/components/vendor-results-list.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { ListItem } from '../../../utils/types'\nimport { computed, defineComponent, h, inject, provide } from 'vue'\nimport { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts'\nimport ItemsList from '../../../components/items-list.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { vendorXModule } from '../x-module'\n\n/**\n * It renders a {@link ItemsList} of vendor results from {@link VendorState.results}.\n *\n * The component provides a default slot which wraps the whole component with the `vendorResults`\n * plus the `injectedListItems` which also contains the injected list items from\n * the ancestor.\n *\n * If the `queryPreviewHash` prop is provided, the vendor results are retrieved from\n * {@link VendorState.queryPreviews}, scoped to the query preview.\n *\n * It also provides the parent slots to customize the items.\n *\n * @public\n */\nexport default defineComponent({\n name: 'VendorResultsList',\n xModule: vendorXModule.name,\n props: {\n /** Animation component that will be used to animate the vendor results. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n /**\n * The hash of the query preview to render its vendor results. If not provided,\n * the vendor results from the root state are rendered.\n */\n queryPreviewHash: {\n type: String,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n /** The vendor results to render from the vendor state. */\n const vendorResults = useState('vendor').results\n\n /** The vendor results of the query previews, indexed by their query preview hash. */\n const vendorQueryPreviews = useState('vendor').queryPreviews\n\n /**\n * The vendor results to render. They are read from the query preview state when the\n * `queryPreviewHash` prop is provided, or from the root vendor state otherwise.\n */\n const stateItems = computed(() =>\n props.queryPreviewHash\n ? (vendorQueryPreviews.value?.[props.queryPreviewHash]?.results ?? [])\n : vendorResults.value,\n )\n\n /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */\n const injectedListItems = inject<Ref<ListItem[]>>(LIST_ITEMS_KEY as string)\n\n /**\n * Indicates if all the results of the current context have been loaded, to know if the\n * vendor results can be inserted in positions of not yet loaded pages.\n *\n * @remarks The query preview results are always considered as fully loaded, since they are\n * retrieved as a fixed batch.\n *\n * @returns Whether all the results are loaded.\n */\n const areAllPagesLoaded = computed(() =>\n props.queryPreviewHash ? true : $x.results.length === $x.totalResults,\n )\n\n /**\n * The `stateItems` concatenated with the `injectedListItems` if there are.\n *\n * @remarks This computed defines the merging strategy of the `stateItems` and the\n * `injectedListItems`.\n *\n * @returns List of {@link ListItem}.\n */\n const items = computed(() => {\n if (!injectedListItems?.value!.length) {\n return stateItems.value\n }\n const items = [...injectedListItems.value]\n for (const item of stateItems.value) {\n const position = item.position ?? 1\n let index = position - 1\n while (items.at(index)?.modelName === 'VendorResult') {\n index++\n }\n const isIndexInLoadedPages = index <= items.length\n if (!isIndexInLoadedPages && !areAllPagesLoaded.value) {\n break\n }\n items.splice(index, 0, item)\n }\n return items\n })\n\n /**\n * The computed list items of the entity that uses the mixin.\n *\n * @remarks It should be overridden in the component that uses the mixin and it's intended to be\n * filled with items from the state. Vue doesn't allow mixins as abstract classes.\n * @returns An empty array as fallback in case it is not overridden.\n */\n provide(LIST_ITEMS_KEY as string, items)\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation }\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots)\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;AAWA;;;;;;;;;;;;;AAaE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;;AAGE;AACF,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,SAAS;AACnB,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;;QAGjB,MAAM,aAAY,GAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAM;;QAG/C,MAAM,mBAAkB,GAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,aAAY;AAE3D;;;AAGE;QACF,MAAM,aAAa,QAAQ,CAAC,MAC1B,KAAK,CAAC;AACJ,eAAG,mBAAmB,C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E,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAE;;AAEpE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAA;AACzE,QAAA,CAAA;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"vendor-results-list.vue.js","sources":["../../../../../src/x-modules/vendor/components/vendor-results-list.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { ListItem } from '../../../utils/types'\nimport { computed, defineComponent, h, inject, provide } from 'vue'\nimport { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts'\nimport ItemsList from '../../../components/items-list.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { vendorXModule } from '../x-module'\n\n/**\n * It renders a {@link ItemsList} of vendor results from {@link VendorState.results}.\n *\n * The component provides a default slot which wraps the whole component with the `vendorResults`\n * plus the `injectedListItems` which also contains the injected list items from\n * the ancestor.\n *\n * If the `queryPreviewHash` prop is provided, the vendor results are retrieved from\n * {@link VendorState.queryPreviews}, scoped to the query preview.\n *\n * It also provides the parent slots to customize the items.\n *\n * @public\n */\nexport default defineComponent({\n name: 'VendorResultsList',\n xModule: vendorXModule.name,\n props: {\n /** Animation component that will be used to animate the vendor results. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n /**\n * The hash of the query preview to render its vendor results. If not provided,\n * the vendor results from the root state are rendered.\n */\n queryPreviewHash: {\n type: String,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n /** The vendor results to render from the vendor state. */\n const vendorResults = useState('vendor').results\n\n /** The vendor results of the query previews, indexed by their query preview hash. */\n const vendorQueryPreviews = useState('vendor').queryPreviews\n\n /**\n * The vendor results to render. They are read from the query preview state when the\n * `queryPreviewHash` prop is provided, or from the root vendor state otherwise.\n */\n const stateItems = computed(() =>\n props.queryPreviewHash\n ? (vendorQueryPreviews.value?.[props.queryPreviewHash]?.results ?? [])\n : vendorResults.value,\n )\n\n /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */\n const injectedListItems = inject<Ref<ListItem[]>>(LIST_ITEMS_KEY as string)\n\n /**\n * The injected list items without the search results that are also provided as vendor results\n * (same id), so the same product is not rendered twice.\n *\n * @remarks The vendor result takes precedence over the indexed search result. The state is not\n * modified, so the search result is rendered again if the vendor result is removed.\n */\n const injectedItemsWithoutDuplicates = computed(() => {\n const vendorResultIds = new Set(stateItems.value.map(({ id }) => id))\n return (injectedListItems?.value ?? []).filter(\n ({ id, modelName }) => modelName !== 'Result' || !vendorResultIds.has(id),\n )\n })\n\n /**\n * Indicates if all the results of the current context have been loaded, to know if the\n * vendor results can be inserted in positions of not yet loaded pages.\n *\n * @remarks The query preview results are always considered as fully loaded, since they are\n * retrieved as a fixed batch.\n *\n * @returns Whether all the results are loaded.\n */\n const areAllPagesLoaded = computed(() =>\n props.queryPreviewHash ? true : $x.results.length === $x.totalResults,\n )\n\n /**\n * The `stateItems` concatenated with the `injectedListItems` if there are.\n *\n * @remarks This computed defines the merging strategy of the `stateItems` and the\n * `injectedListItems`.\n *\n * @returns List of {@link ListItem}.\n */\n const items = computed(() => {\n if (!injectedItemsWithoutDuplicates.value.length) {\n return stateItems.value\n }\n const items = [...injectedItemsWithoutDuplicates.value]\n for (const item of stateItems.value) {\n const position = item.position ?? 1\n let index = position - 1\n while (items.at(index)?.modelName === 'VendorResult') {\n index++\n }\n const isIndexInLoadedPages = index <= items.length\n if (!isIndexInLoadedPages && !areAllPagesLoaded.value) {\n break\n }\n items.splice(index, 0, item)\n }\n return items\n })\n\n /**\n * The computed list items of the entity that uses the mixin.\n *\n * @remarks It should be overridden in the component that uses the mixin and it's intended to be\n * filled with items from the state. Vue doesn't allow mixins as abstract classes.\n * @returns An empty array as fallback in case it is not overridden.\n */\n provide(LIST_ITEMS_KEY as string, items)\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation }\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots)\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;AAWA;;;;;;;;;;;;;AAaE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;;AAGE;AACF,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,SAAS;AACnB,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;;QAGjB,MAAM,aAAY,GAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAM;;QAG/C,MAAM,mBAAkB,GAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,aAAY;AAE3D;;;AAGE;QACF,MAAM,aAAa,QAAQ,CAAC,MAC1B,KAAK,CAAC;AACJ,eAAG,mBAAmB,CAAC,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,EAAE,OAAM,IAAK,EAAE;AACrE,cAAE,aAAa,CAAC,KAAK,CACzB;;AAGA,QAAA,MAAM,iBAAgB,GAAI,MAAM,CAAkB,cAAwB,CAAA;AAE1E;;;;;;AAME;AACF,QAAA,MAAM,8BAA6B,GAAI,QAAQ,CAAC,MAAI;YAClD,MAAM,eAAc,GAAI,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAC,EAAG,KAAK,EAAE,CAAC,CAAA;AACpE,YAAA,OAAO,CAA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,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAE;;AAEpE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAA;AACzE,QAAA,CAAA;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "10.10.0",
3
+ "version": "10.12.0",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -67,10 +67,10 @@
67
67
  "vuex": "4.0.2"
68
68
  },
69
69
  "dependencies": {
70
- "@empathyco/x-adapter": "8.3.0",
71
- "@empathyco/x-adapter-platform": "2.1.0",
72
- "@empathyco/x-types": "11.1.0",
73
- "@empathyco/x-utils": "1.2.0",
70
+ "@empathyco/x-adapter": "8.5.0",
71
+ "@empathyco/x-adapter-platform": "2.3.0",
72
+ "@empathyco/x-types": "11.3.0",
73
+ "@empathyco/x-utils": "1.4.0",
74
74
  "@vue/devtools-api": "~6.6.4",
75
75
  "@vueuse/core": "~12.8.2",
76
76
  "js-md5": "~0.9.2",
@@ -82,7 +82,7 @@
82
82
  },
83
83
  "devDependencies": {
84
84
  "@babel/preset-env": "8.0.7",
85
- "@empathyco/x-design-system": "1.3.0",
85
+ "@empathyco/x-design-system": "1.5.0",
86
86
  "@microsoft/api-documenter": "7.30.20",
87
87
  "@microsoft/api-extractor": "7.60.1",
88
88
  "@tailwindcss/vite": "4.3.5",
@@ -117,5 +117,5 @@
117
117
  "access": "public",
118
118
  "directory": "dist"
119
119
  },
120
- "gitHead": "193fbc1c4fef9c7dcaa6060cd2331b66e1a551d2"
120
+ "gitHead": "4fec230caef3702924ebb2dbe80e4f8decb0b554"
121
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-and-save-ai-suggestions-search.action.d.ts","sourceRoot":"","sources":["../../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,iCAAiC,CAsBtG,CAAA"}
1
+ {"version":3,"file":"fetch-and-save-ai-suggestions-search.action.d.ts","sourceRoot":"","sources":["../../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,iCAAiC,CAyBtG,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-and-save-ai-suggestions.action.d.ts","sourceRoot":"","sources":["../../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions.action.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,UAAU,CAAA;AAqB/D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,2BAA2B,CAgB1F,CAAA"}
1
+ {"version":3,"file":"fetch-and-save-ai-suggestions.action.d.ts","sourceRoot":"","sources":["../../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions.action.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,UAAU,CAAA;AAsB/D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,2BAA2B,CAkB1F,CAAA"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Checks if the error was thrown because the request was aborted. This happens when a newer
3
+ * request with the same id is made, so that newer request is in charge of the status.
4
+ *
5
+ * @param error - The error to check.
6
+ * @returns True if the error is an `AbortError`.
7
+ * @internal
8
+ */
9
+ export declare function isAbortError(error: unknown): boolean;
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/ai/store/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-banners-list.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/vendor/components/vendor-banners-list.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;;IAKC,2EAA2E;;;;;IAK3E;;;OAGG;;;;;;;;IARH,2EAA2E;;;;;IAK3E;;;OAGG;;;;;;;;;AAZP,wBAkGE"}
1
+ {"version":3,"file":"vendor-banners-list.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/vendor/components/vendor-banners-list.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;;IAKC,2EAA2E;;;;;IAK3E;;;OAGG;;;;;;;;IARH,2EAA2E;;;;;IAK3E;;;OAGG;;;;;;;;;AAZP,wBAgHE"}
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-results-list.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/vendor/components/vendor-results-list.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;;IAKC,2EAA2E;;;;;IAK3E;;;OAGG;;;;;;;;IARH,2EAA2E;;;;;IAK3E;;;OAGG;;;;;;;;;AAZP,wBAgGE"}
1
+ {"version":3,"file":"vendor-results-list.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/vendor/components/vendor-results-list.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;;IAKC,2EAA2E;;;;;IAK3E;;;OAGG;;;;;;;;IARH,2EAA2E;;;;;IAK3E;;;OAGG;;;;;;;;;AAZP,wBA8GE"}