@empathyco/x-components 6.0.0-alpha.37 → 6.0.0-alpha.38

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 (78) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/design-system/deprecated-full-theme.css +354 -354
  3. package/docs/API-reference/api/x-adapter-platform.md +3 -0
  4. package/docs/API-reference/api/x-adapter-platform.nextqueriesrelatedpromptsschema.md +11 -0
  5. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.md +1 -0
  6. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.tagging.md +11 -0
  7. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.md +22 -0
  8. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplay.md +11 -0
  9. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayadd2cart.md +11 -0
  10. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayclick.md +11 -0
  11. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.md +21 -0
  12. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.nextqueries.md +11 -0
  13. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.toolingdisplay.md +11 -0
  14. package/docs/API-reference/api/x-components.baseaddtocart.md +1 -0
  15. package/docs/API-reference/api/x-components.createtracktoolingadd2cartwire.md +19 -0
  16. package/docs/API-reference/api/x-components.createtracktoolingdisplaywire.md +19 -0
  17. package/docs/API-reference/api/x-components.featurelocation.md +1 -1
  18. package/docs/API-reference/api/x-components.globalxbus.md +4 -0
  19. package/docs/API-reference/api/x-components.hierarchicalfilter.md +2 -0
  20. package/docs/API-reference/api/x-components.md +4 -0
  21. package/docs/API-reference/api/x-components.queryfeature.md +1 -1
  22. package/docs/API-reference/api/x-components.relatedpromptstaglist.md +2 -1
  23. package/docs/API-reference/api/x-components.relatedpromptsxevents.md +2 -0
  24. package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptadd2cart.md +13 -0
  25. package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptresult.md +13 -0
  26. package/docs/API-reference/api/x-components.simplefilter.md +2 -0
  27. package/docs/API-reference/api/x-components.snippetcallbacks.md +2 -0
  28. package/docs/API-reference/api/x-components.tracktoolingadd2cartwire.md +13 -0
  29. package/docs/API-reference/api/x-components.tracktoolingdisplayclickedwire.md +13 -0
  30. package/docs/API-reference/api/x-types.md +1 -0
  31. package/docs/API-reference/api/x-types.relatedprompt.md +2 -1
  32. package/docs/API-reference/api/x-types.relatedprompt.relatedpromptnextqueries.md +13 -0
  33. package/docs/API-reference/api/x-types.relatedprompt.toolingdisplaytagging.md +13 -0
  34. package/docs/API-reference/api/x-types.relatedpromptnextquery.md +23 -0
  35. package/docs/API-reference/api/x-types.relatedpromptnextquery.query.md +13 -0
  36. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayadd2carttagging.md +13 -0
  37. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayclicktagging.md +13 -0
  38. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplaytagging.md +13 -0
  39. package/js/components/result/base-result-add-to-cart.vue.js +2 -1
  40. package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
  41. package/js/components/result/base-result-add-to-cart.vue2.js +19 -5
  42. package/js/components/result/base-result-add-to-cart.vue2.js.map +1 -1
  43. package/js/index.js +1 -1
  44. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +19 -5
  45. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js.map +1 -1
  46. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js +2 -1
  47. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js.map +1 -1
  48. package/js/x-modules/tagging/store/module.js +5 -1
  49. package/js/x-modules/tagging/store/module.js.map +1 -1
  50. package/js/x-modules/tagging/wiring.js +64 -1
  51. package/js/x-modules/tagging/wiring.js.map +1 -1
  52. package/package.json +4 -4
  53. package/report/x-adapter-platform.api.json +254 -0
  54. package/report/x-components.api.json +406 -12
  55. package/report/x-components.api.md +37 -4
  56. package/report/x-types.api.json +167 -5
  57. package/tagging/index.js +1 -1
  58. package/types/components/global-x-bus.vue.d.ts +4 -0
  59. package/types/components/global-x-bus.vue.d.ts.map +1 -1
  60. package/types/components/result/base-result-add-to-cart.vue.d.ts +2 -0
  61. package/types/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
  62. package/types/components/snippet-callbacks.vue.d.ts +2 -0
  63. package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
  64. package/types/types/origin.d.ts +2 -2
  65. package/types/types/origin.d.ts.map +1 -1
  66. package/types/views/adapter.d.ts.map +1 -1
  67. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +2 -0
  68. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  69. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +2 -0
  70. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  71. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts +2 -1
  72. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -1
  73. package/types/x-modules/related-prompts/events.types.d.ts +11 -1
  74. package/types/x-modules/related-prompts/events.types.d.ts.map +1 -1
  75. package/types/x-modules/tagging/store/module.d.ts.map +1 -1
  76. package/types/x-modules/tagging/wiring.d.ts +36 -2
  77. package/types/x-modules/tagging/wiring.d.ts.map +1 -1
  78. package/docs/API-reference/api/x-types.relatedprompt.nextqueries.md +0 -13
@@ -40,8 +40,10 @@
40
40
  | [PlatformRecommendationsResponse](./x-adapter-platform.platformrecommendationsresponse.md) | Response for the <code>recommendations</code> endpoint. |
41
41
  | [PlatformRedirection](./x-adapter-platform.platformredirection.md) | Redirection model for the <code>platform</code> API. |
42
42
  | [PlatformRelatedPrompt](./x-adapter-platform.platformrelatedprompt.md) | Related prompt model for the <code>platform</code> API. |
43
+ | [PlatformRelatedPromptNextQueriesTagging](./x-adapter-platform.platformrelatedpromptnextqueriestagging.md) | Related prompt model for the <code>platform</code> API. |
43
44
  | [PlatformRelatedPromptsRequest](./x-adapter-platform.platformrelatedpromptsrequest.md) | Request for the <code>related prompts</code> endpoint with <code>extra params</code>. |
44
45
  | [PlatformRelatedPromptsResponse](./x-adapter-platform.platformrelatedpromptsresponse.md) | Response for the <code>related prompts</code> endpoint. |
46
+ | [PlatformRelatedPromptTagging](./x-adapter-platform.platformrelatedprompttagging.md) | Related prompt model for the <code>platform</code> API. |
45
47
  | [PlatformRelatedTag](./x-adapter-platform.platformrelatedtag.md) | Related tag model for the <code>platform</code> API. |
46
48
  | [PlatformRelatedTagsRequest](./x-adapter-platform.platformrelatedtagsrequest.md) | Request for the <code>related tags</code> endpoint with <code>extra params</code>. |
47
49
  | [PlatformRelatedTagsResponse](./x-adapter-platform.platformrelatedtagsresponse.md) | Response for the <code>related tags</code> endpoint. |
@@ -72,6 +74,7 @@
72
74
  | [identifierResultsResponseMapper](./x-adapter-platform.identifierresultsresponsemapper.md) | Default implementation for the IdentifierResultsResponseMapper. |
73
75
  | [identifierResultsResponseSchema](./x-adapter-platform.identifierresultsresponseschema.md) | Default implementation for the IdentifierResultsResponseSchema. |
74
76
  | [nextQueriesEndpointAdapter](./x-adapter-platform.nextqueriesendpointadapter.md) | This endpoint does not support pagination in the request. |
77
+ | [nextQueriesRelatedPromptsSchema](./x-adapter-platform.nextqueriesrelatedpromptsschema.md) | |
75
78
  | [nextQueriesRequestMapper](./x-adapter-platform.nextqueriesrequestmapper.md) | Default implementation for the NextQueriesRequestMapper. |
76
79
  | [nextQueriesRequestSchema](./x-adapter-platform.nextqueriesrequestschema.md) | Default implementation for the NextQueriesRequestSchema. |
77
80
  | [nextQueriesResponseMapper](./x-adapter-platform.nextqueriesresponsemapper.md) | Default implementation for the NextQueriesResponseMapper. |
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [nextQueriesRelatedPromptsSchema](./x-adapter-platform.nextqueriesrelatedpromptsschema.md)
4
+
5
+ ## nextQueriesRelatedPromptsSchema variable
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ nextQueriesRelatedPromptsSchema: import("@empathyco/x-adapter").MutableSchema<string, RelatedPromptNextQuery>
11
+ ```
@@ -18,5 +18,6 @@ export interface PlatformRelatedPrompt
18
18
  | --- | --- | --- | --- |
19
19
  | [nextQueries](./x-adapter-platform.platformrelatedprompt.nextqueries.md) | | string\[\] | |
20
20
  | [suggestionText](./x-adapter-platform.platformrelatedprompt.suggestiontext.md) | | string | |
21
+ | [tagging](./x-adapter-platform.platformrelatedprompt.tagging.md) | | [PlatformRelatedPromptTagging](./x-adapter-platform.platformrelatedprompttagging.md) | |
21
22
  | [type](./x-adapter-platform.platformrelatedprompt.type.md) | | 'SYNTHETIC' \| 'CURATED' | |
22
23
 
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [PlatformRelatedPrompt](./x-adapter-platform.platformrelatedprompt.md) &gt; [tagging](./x-adapter-platform.platformrelatedprompt.tagging.md)
4
+
5
+ ## PlatformRelatedPrompt.tagging property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ tagging: PlatformRelatedPromptTagging;
11
+ ```
@@ -0,0 +1,22 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [PlatformRelatedPromptNextQueriesTagging](./x-adapter-platform.platformrelatedpromptnextqueriestagging.md)
4
+
5
+ ## PlatformRelatedPromptNextQueriesTagging interface
6
+
7
+ Related prompt model for the `platform` API.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface PlatformRelatedPromptNextQueriesTagging
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Property | Modifiers | Type | Description |
18
+ | --- | --- | --- | --- |
19
+ | [toolingDisplay](./x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplay.md) | | string | |
20
+ | [toolingDisplayAdd2Cart](./x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayadd2cart.md) | | string | |
21
+ | [toolingDisplayClick](./x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayclick.md) | | string | |
22
+
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [PlatformRelatedPromptNextQueriesTagging](./x-adapter-platform.platformrelatedpromptnextqueriestagging.md) &gt; [toolingDisplay](./x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplay.md)
4
+
5
+ ## PlatformRelatedPromptNextQueriesTagging.toolingDisplay property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ toolingDisplay: string;
11
+ ```
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [PlatformRelatedPromptNextQueriesTagging](./x-adapter-platform.platformrelatedpromptnextqueriestagging.md) &gt; [toolingDisplayAdd2Cart](./x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayadd2cart.md)
4
+
5
+ ## PlatformRelatedPromptNextQueriesTagging.toolingDisplayAdd2Cart property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ toolingDisplayAdd2Cart: string;
11
+ ```
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [PlatformRelatedPromptNextQueriesTagging](./x-adapter-platform.platformrelatedpromptnextqueriestagging.md) &gt; [toolingDisplayClick](./x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayclick.md)
4
+
5
+ ## PlatformRelatedPromptNextQueriesTagging.toolingDisplayClick property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ toolingDisplayClick: string;
11
+ ```
@@ -0,0 +1,21 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [PlatformRelatedPromptTagging](./x-adapter-platform.platformrelatedprompttagging.md)
4
+
5
+ ## PlatformRelatedPromptTagging interface
6
+
7
+ Related prompt model for the `platform` API.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface PlatformRelatedPromptTagging
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Property | Modifiers | Type | Description |
18
+ | --- | --- | --- | --- |
19
+ | [nextQueries](./x-adapter-platform.platformrelatedprompttagging.nextqueries.md) | | Dictionary&lt;[PlatformRelatedPromptNextQueriesTagging](./x-adapter-platform.platformrelatedpromptnextqueriestagging.md)<!-- -->&gt; | |
20
+ | [toolingDisplay](./x-adapter-platform.platformrelatedprompttagging.toolingdisplay.md) | | string | |
21
+
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [PlatformRelatedPromptTagging](./x-adapter-platform.platformrelatedprompttagging.md) &gt; [nextQueries](./x-adapter-platform.platformrelatedprompttagging.nextqueries.md)
4
+
5
+ ## PlatformRelatedPromptTagging.nextQueries property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ nextQueries: Dictionary<PlatformRelatedPromptNextQueriesTagging>;
11
+ ```
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-adapter-platform](./x-adapter-platform.md) &gt; [PlatformRelatedPromptTagging](./x-adapter-platform.platformrelatedprompttagging.md) &gt; [toolingDisplay](./x-adapter-platform.platformrelatedprompttagging.toolingdisplay.md)
4
+
5
+ ## PlatformRelatedPromptTagging.toolingDisplay property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ toolingDisplay: string;
11
+ ```
@@ -16,6 +16,7 @@ _default: import("vue").DefineComponent<{
16
16
  };
17
17
  }, {
18
18
  events: import("vue").ComputedRef<Partial<XEventsTypes>>;
19
+ metadata: Omit<WireMetadata, "moduleName" | "origin" | "location">;
19
20
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
21
  result: {
21
22
  type: PropType<Result>;
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [createTrackToolingAdd2CartWire](./x-components.createtracktoolingadd2cartwire.md)
4
+
5
+ ## createTrackToolingAdd2CartWire() function
6
+
7
+ Factory helper to create a wire for the track of the tooling display click.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare function createTrackToolingAdd2CartWire(): Wire<Taggable>;
13
+ ```
14
+ **Returns:**
15
+
16
+ [Wire](./x-components.wire.md)<!-- -->&lt;Taggable&gt;
17
+
18
+ A new wire for the tooling display add to cart of the taggable element.
19
+
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [createTrackToolingDisplayWire](./x-components.createtracktoolingdisplaywire.md)
4
+
5
+ ## createTrackToolingDisplayWire() function
6
+
7
+ Factory helper to create a wire for the track of the tooling display click.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare function createTrackToolingDisplayWire(): Wire<Taggable>;
13
+ ```
14
+ **Returns:**
15
+
16
+ [Wire](./x-components.wire.md)<!-- -->&lt;Taggable&gt;
17
+
18
+ A new wire for the tooling display click of the taggable element.
19
+
@@ -9,7 +9,7 @@ Indicates where the feature is placed.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- export type FeatureLocation = 'external' | 'my_history' | 'no_query' | 'results' | 'no_results' | 'low_results' | 'none' | 'predictive_layer' | 'pdp' | 'url_history' | 'url_history_pdp';
12
+ export type FeatureLocation = 'external' | 'my_history' | 'no_query' | 'results' | 'no_results' | 'low_results' | 'none' | 'predictive_layer' | 'pdp' | 'url_history' | 'url_history_pdp' | 'related-prompts';
13
13
  ```
14
14
 
15
15
  ## Example 1
@@ -175,6 +175,8 @@ _default: import("vue").DefineComponent<{
175
175
  RelatedPromptsRequestUpdated: (payload: import("@empathyco/x-types").RelatedPromptsRequest | null, metadata: import("..").WireMetadata) => unknown;
176
176
  UserSelectedARelatedPrompt: (payload: number, metadata: import("..").WireMetadata) => unknown;
177
177
  UserSelectedARelatedPromptQuery: (payload: number, metadata: import("..").WireMetadata) => unknown;
178
+ UserClickedARelatedPromptResult: (payload: import("@empathyco/x-types").Result, metadata: import("..").WireMetadata) => unknown;
179
+ UserClickedARelatedPromptAdd2Cart: (payload: import("@empathyco/x-types").Result, metadata: import("..").WireMetadata) => unknown;
178
180
  }>>;
179
181
  required: true;
180
182
  };
@@ -344,6 +346,8 @@ _default: import("vue").DefineComponent<{
344
346
  RelatedPromptsRequestUpdated: (payload: import("@empathyco/x-types").RelatedPromptsRequest | null, metadata: import("..").WireMetadata) => unknown;
345
347
  UserSelectedARelatedPrompt: (payload: number, metadata: import("..").WireMetadata) => unknown;
346
348
  UserSelectedARelatedPromptQuery: (payload: number, metadata: import("..").WireMetadata) => unknown;
349
+ UserClickedARelatedPromptResult: (payload: import("@empathyco/x-types").Result, metadata: import("..").WireMetadata) => unknown;
350
+ UserClickedARelatedPromptAdd2Cart: (payload: import("@empathyco/x-types").Result, metadata: import("..").WireMetadata) => unknown;
347
351
  }>>;
348
352
  required: true;
349
353
  };
@@ -187,6 +187,8 @@ _default: import("vue").DefineComponent<{
187
187
  RelatedPromptsRequestUpdated?: import("@empathyco/x-types").RelatedPromptsRequest | null | undefined;
188
188
  UserSelectedARelatedPrompt?: number | undefined;
189
189
  UserSelectedARelatedPromptQuery?: number | undefined;
190
+ UserClickedARelatedPromptResult?: import("@empathyco/x-types").Result | undefined;
191
+ UserClickedARelatedPromptAdd2Cart?: import("@empathyco/x-types").Result | undefined;
190
192
  }>;
191
193
  innerCssClasses: import("vue").ComputedRef<(string | Dictionary<boolean>)[]>;
192
194
  renderedChildrenFilters: import("vue").ComputedRef<HierarchicalFilterModel[]>;
@@ -36,6 +36,8 @@ X-Components is a library usable everywhere not only for search experiences.
36
36
  | [createSetQueryTaggingFromQueryPreview()](./x-components.createsetquerytaggingfromquerypreview.md) | Factory helper to create a wire to set the queryTagging. |
37
37
  | [createStoreEmitters(storeModule, emitters)](./x-components.createstoreemitters.md) | Helper function for creating type-safe [StoreEmitters](./x-components.storeemitters.md)<!-- -->. |
38
38
  | [createTrackDisplayWire(property)](./x-components.createtrackdisplaywire.md) | Factory helper to create a wire for the track of the display click. |
39
+ | [createTrackToolingAdd2CartWire()](./x-components.createtracktoolingadd2cartwire.md) | Factory helper to create a wire for the track of the tooling display click. |
40
+ | [createTrackToolingDisplayWire()](./x-components.createtracktoolingdisplaywire.md) | Factory helper to create a wire for the track of the tooling display click. |
39
41
  | [createTrackWire(property)](./x-components.createtrackwire.md) | Factory helper to create a wire for the track of a taggable element. |
40
42
  | [createUseDevice(devices)](./x-components.createusedevice.md) | Factory function that creates a composable for device detection using the devices parameter to configure breakpoints. |
41
43
  | [createWireFromFunction(fn)](./x-components.createwirefromfunction.md) | Creates a wire that executes the function passed. This function will receive a [WireParams](./x-components.wireparams.md) object. |
@@ -645,6 +647,8 @@ X-Components is a library usable everywhere not only for search experiences.
645
647
  | [trackNoResultsQueryWithSemanticsWireDebounced](./x-components.tracknoresultsquerywithsemanticswiredebounced.md) | . Debounced version of [trackNoResultsQueryWithSemanticsWire](./x-components.tracknoresultsquerywithsemanticswire.md) |
646
648
  | [trackQueryWire](./x-components.trackquerywire.md) | Tracks the tagging of the query. |
647
649
  | [trackResultClickedWire](./x-components.trackresultclickedwire.md) | Tracks the tagging of the result. |
650
+ | [trackToolingAdd2CartWire](./x-components.tracktoolingadd2cartwire.md) | Performs a track of a display result being clicked. |
651
+ | [trackToolingDisplayClickedWire](./x-components.tracktoolingdisplayclickedwire.md) | Performs a track of a display result being clicked. |
648
652
  | [updateHistoryQueriesWithSearchResponse](./x-components.updatehistoryquerieswithsearchresponse.md) | Updates the history queries with the relevant info included in a search response. |
649
653
  | [UrlHandler](./x-components.urlhandler.md) | This component manages the browser URL parameters to preserve them through reloads and browser history navigation. It allow to configure the default url parameter names using its attributes. This component doesn't render elements to the DOM. |
650
654
  | [urlXModule](./x-components.urlxmodule.md) | URL [XModule](./x-components.xmodule.md) implementation. This module is auto-registered as soon as you import any component from the <code>url</code> entry point. |
@@ -9,5 +9,5 @@ The name of the tool that generated the query.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- export type QueryFeature = 'search_box' | 'url' | 'query_suggestion' | 'next_query' | 'popular_search' | 'history_query' | 'partial_result' | 'related_tag' | 'spellcheck' | 'customer' | 'semantics';
12
+ export type QueryFeature = 'search_box' | 'url' | 'query_suggestion' | 'next_query' | 'popular_search' | 'history_query' | 'partial_result' | 'related_tag' | 'spellcheck' | 'customer' | 'semantics' | 'related-prompts';
13
13
  ```
@@ -28,9 +28,10 @@ _default: import("vue").DefineComponent<{
28
28
  selectedPromptIndex: import("vue").ComputedRef<any>;
29
29
  visibleRelatedPrompts: import("vue").ComputedRef<{
30
30
  index: number;
31
- nextQueries: string[];
31
+ relatedPromptNextQueries: import("@empathyco/x-types").RelatedPromptNextQuery[];
32
32
  suggestionText: string;
33
33
  type: string;
34
+ toolingDisplayTagging: import("@empathyco/x-types").TaggingRequest;
34
35
  modelName: "RelatedPrompt";
35
36
  }[]>;
36
37
  listItems: import("vue").Ref<HTMLElement[]>;
@@ -17,6 +17,8 @@ export interface RelatedPromptsXEvents
17
17
  | Property | Modifiers | Type | Description |
18
18
  | --- | --- | --- | --- |
19
19
  | [RelatedPromptsRequestUpdated](./x-components.relatedpromptsxevents.relatedpromptsrequestupdated.md) | | RelatedPromptsRequest \| null | Any property of the related-prompts request has changed Payload: The new related-prompts request or <code>null</code> if there is not enough data in the state to conform a valid request. |
20
+ | [UserClickedARelatedPromptAdd2Cart](./x-components.relatedpromptsxevents.userclickedarelatedpromptadd2cart.md) | | Result | The user has clicked one add to cart from a prompt. Payload: The result that the user clicked. |
21
+ | [UserClickedARelatedPromptResult](./x-components.relatedpromptsxevents.userclickedarelatedpromptresult.md) | | Result | The user has clicked one prompt. Payload: The result that the user clicked. |
20
22
  | [UserSelectedARelatedPrompt](./x-components.relatedpromptsxevents.userselectedarelatedprompt.md) | | number | The selected prompt has changed. Payload: The index of the prompt in the RelatedPrompts list or -1 to remove selection. |
21
23
  | [UserSelectedARelatedPromptQuery](./x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md) | | number | The selected next query of the selected prompt has changed. Payload: The index of the next query in the NextQueries list or -1 to remove selection. |
22
24
 
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [RelatedPromptsXEvents](./x-components.relatedpromptsxevents.md) &gt; [UserClickedARelatedPromptAdd2Cart](./x-components.relatedpromptsxevents.userclickedarelatedpromptadd2cart.md)
4
+
5
+ ## RelatedPromptsXEvents.UserClickedARelatedPromptAdd2Cart property
6
+
7
+ The user has clicked one add to cart from a prompt. Payload: The result that the user clicked.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ UserClickedARelatedPromptAdd2Cart: Result;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [RelatedPromptsXEvents](./x-components.relatedpromptsxevents.md) &gt; [UserClickedARelatedPromptResult](./x-components.relatedpromptsxevents.userclickedarelatedpromptresult.md)
4
+
5
+ ## RelatedPromptsXEvents.UserClickedARelatedPromptResult property
6
+
7
+ The user has clicked one prompt. Payload: The result that the user clicked.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ UserClickedARelatedPromptResult: Result;
13
+ ```
@@ -184,6 +184,8 @@ _default: import("vue").DefineComponent<{
184
184
  RelatedPromptsRequestUpdated?: import("@empathyco/x-types").RelatedPromptsRequest | null | undefined;
185
185
  UserSelectedARelatedPrompt?: number | undefined;
186
186
  UserSelectedARelatedPromptQuery?: number | undefined;
187
+ UserClickedARelatedPromptResult?: import("@empathyco/x-types").Result | undefined;
188
+ UserClickedARelatedPromptAdd2Cart?: import("@empathyco/x-types").Result | undefined;
187
189
  }>;
188
190
  innerCssClasses: import("vue").ComputedRef<(string | Dictionary<boolean>)[]>;
189
191
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -174,6 +174,8 @@ _default: import("vue").DefineComponent<{}, {
174
174
  RelatedPromptsRequestUpdated: (payload: import("@empathyco/x-types").RelatedPromptsRequest | null, metadata: WireMetadata) => unknown;
175
175
  UserSelectedARelatedPrompt: (payload: number, metadata: WireMetadata) => unknown;
176
176
  UserSelectedARelatedPromptQuery: (payload: number, metadata: WireMetadata) => unknown;
177
+ UserClickedARelatedPromptResult: (payload: import("@empathyco/x-types").Result, metadata: WireMetadata) => unknown;
178
+ UserClickedARelatedPromptAdd2Cart: (payload: import("@empathyco/x-types").Result, metadata: WireMetadata) => unknown;
177
179
  }>>;
178
180
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>
179
181
  ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [trackToolingAdd2CartWire](./x-components.tracktoolingadd2cartwire.md)
4
+
5
+ ## trackToolingAdd2CartWire variable
6
+
7
+ Performs a track of a display result being clicked.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ trackToolingAdd2CartWire: Wire<Taggable>
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [trackToolingDisplayClickedWire](./x-components.tracktoolingdisplayclickedwire.md)
4
+
5
+ ## trackToolingDisplayClickedWire variable
6
+
7
+ Performs a track of a display result being clicked.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ trackToolingDisplayClickedWire: Wire<Taggable>
13
+ ```
@@ -70,6 +70,7 @@ Entry point to export search-type models and testing schemas in a unified api-ex
70
70
  | [RecommendationsResponse](./x-types.recommendationsresponse.md) | Response for the recommendations endpoint. |
71
71
  | [Redirection](./x-types.redirection.md) | A redirection (AKA Direct Link) is simply a URL. Normally, the user is just redirected to it after making a query that matches the configuration of this URL. In other cases it is shown as a button that the user can click, and which will trigger the redirect action. |
72
72
  | [RelatedPrompt](./x-types.relatedprompt.md) | Represents a related prompt. |
73
+ | [RelatedPromptNextQuery](./x-types.relatedpromptnextquery.md) | Represents a related prompt nextQuery. |
73
74
  | [RelatedPromptsRequest](./x-types.relatedpromptsrequest.md) | Request for Related Prompts endpoint. |
74
75
  | [RelatedPromptsResponse](./x-types.relatedpromptsresponse.md) | Response for the related prompts endpoint. |
75
76
  | [RelatedTag](./x-types.relatedtag.md) | A related tag is just a term that refines the current query. |
@@ -17,7 +17,8 @@ export interface RelatedPrompt extends NamedModel<'RelatedPrompt'>
17
17
 
18
18
  | Property | Modifiers | Type | Description |
19
19
  | --- | --- | --- | --- |
20
- | [nextQueries](./x-types.relatedprompt.nextqueries.md) | | string\[\] | The next queries related to the prompt. |
20
+ | [relatedPromptNextQueries](./x-types.relatedprompt.relatedpromptnextqueries.md) | | [RelatedPromptNextQuery](./x-types.relatedpromptnextquery.md)<!-- -->\[\] | The next queries related to the prompt. |
21
21
  | [suggestionText](./x-types.relatedprompt.suggestiontext.md) | | string | The prompt. |
22
+ | [toolingDisplayTagging](./x-types.relatedprompt.toolingdisplaytagging.md) | | [TaggingRequest](./x-types.taggingrequest.md) | The tooling display tagging of the prompt. |
22
23
  | [type](./x-types.relatedprompt.type.md) | | string | The type of the prompt. |
23
24
 
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-types](./x-types.md) &gt; [RelatedPrompt](./x-types.relatedprompt.md) &gt; [relatedPromptNextQueries](./x-types.relatedprompt.relatedpromptnextqueries.md)
4
+
5
+ ## RelatedPrompt.relatedPromptNextQueries property
6
+
7
+ The next queries related to the prompt.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ relatedPromptNextQueries: RelatedPromptNextQuery[];
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-types](./x-types.md) &gt; [RelatedPrompt](./x-types.relatedprompt.md) &gt; [toolingDisplayTagging](./x-types.relatedprompt.toolingdisplaytagging.md)
4
+
5
+ ## RelatedPrompt.toolingDisplayTagging property
6
+
7
+ The tooling display tagging of the prompt.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ toolingDisplayTagging: TaggingRequest;
13
+ ```
@@ -0,0 +1,23 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-types](./x-types.md) &gt; [RelatedPromptNextQuery](./x-types.relatedpromptnextquery.md)
4
+
5
+ ## RelatedPromptNextQuery interface
6
+
7
+ Represents a related prompt nextQuery.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface RelatedPromptNextQuery
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Property | Modifiers | Type | Description |
18
+ | --- | --- | --- | --- |
19
+ | [query](./x-types.relatedpromptnextquery.query.md) | | string | The query of the next query. |
20
+ | [toolingDisplayAdd2CartTagging](./x-types.relatedpromptnextquery.toolingdisplayadd2carttagging.md) | | [TaggingRequest](./x-types.taggingrequest.md) | The tooling display add2cart tagging of the next query. |
21
+ | [toolingDisplayClickTagging](./x-types.relatedpromptnextquery.toolingdisplayclicktagging.md) | | [TaggingRequest](./x-types.taggingrequest.md) | The tooling display click tagging of the next query. |
22
+ | [toolingDisplayTagging](./x-types.relatedpromptnextquery.toolingdisplaytagging.md) | | [TaggingRequest](./x-types.taggingrequest.md) | The tooling display tagging of the next query. |
23
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-types](./x-types.md) &gt; [RelatedPromptNextQuery](./x-types.relatedpromptnextquery.md) &gt; [query](./x-types.relatedpromptnextquery.query.md)
4
+
5
+ ## RelatedPromptNextQuery.query property
6
+
7
+ The query of the next query.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ query: string;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-types](./x-types.md) &gt; [RelatedPromptNextQuery](./x-types.relatedpromptnextquery.md) &gt; [toolingDisplayAdd2CartTagging](./x-types.relatedpromptnextquery.toolingdisplayadd2carttagging.md)
4
+
5
+ ## RelatedPromptNextQuery.toolingDisplayAdd2CartTagging property
6
+
7
+ The tooling display add2cart tagging of the next query.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ toolingDisplayAdd2CartTagging: TaggingRequest;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-types](./x-types.md) &gt; [RelatedPromptNextQuery](./x-types.relatedpromptnextquery.md) &gt; [toolingDisplayClickTagging](./x-types.relatedpromptnextquery.toolingdisplayclicktagging.md)
4
+
5
+ ## RelatedPromptNextQuery.toolingDisplayClickTagging property
6
+
7
+ The tooling display click tagging of the next query.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ toolingDisplayClickTagging: TaggingRequest;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-types](./x-types.md) &gt; [RelatedPromptNextQuery](./x-types.relatedpromptnextquery.md) &gt; [toolingDisplayTagging](./x-types.relatedpromptnextquery.toolingdisplaytagging.md)
4
+
5
+ ## RelatedPromptNextQuery.toolingDisplayTagging property
6
+
7
+ The tooling display tagging of the next query.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ toolingDisplayTagging: TaggingRequest;
13
+ ```
@@ -6,6 +6,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
6
6
  const _component_BaseEventButton = resolveComponent("BaseEventButton");
7
7
  return openBlock(), createBlock(_component_BaseEventButton, {
8
8
  events: _ctx.events,
9
+ metadata: _ctx.metadata,
9
10
  class: "x-result-add-to-cart x-button",
10
11
  "data-test": "result-add-to-cart"
11
12
  }, {
@@ -14,7 +15,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
14
15
  ]),
15
16
  _: 3
16
17
  /* FORWARDED */
17
- }, 8, ["events"]);
18
+ }, 8, ["events", "metadata"]);
18
19
  }
19
20
  var baseResultAddToCart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
20
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-add-to-cart.vue.js","sources":["../../../../src/components/result/base-result-add-to-cart.vue"],"sourcesContent":["<template>\n <BaseEventButton\n :events=\"events\"\n class=\"x-result-add-to-cart x-button\"\n data-test=\"result-add-to-cart\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { computed, defineComponent, PropType } from 'vue';\n import { XEventsTypes } from '../../wiring/events.types';\n import BaseEventButton from '../base-event-button.vue';\n\n /**\n * Renders a button with a default slot. It receives the result with the data and emits\n * {@link XEventsTypes.UserClickedResultAddToCart} to the bus on click mouse event.\n *\n * @public\n */\n export default defineComponent({\n components: { BaseEventButton },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true\n }\n },\n setup(props) {\n /**\n * The events to be emitted by the button.\n *\n * @returns Events {@link XEventsTypes} to emit.\n *\n * @public\n */\n const events = computed<Partial<XEventsTypes>>(() => ({\n UserClickedResultAddToCart: props.result\n }));\n\n return {\n events\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedResultAddToCart`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the result data.\n\n## Examples\n\nRenders a button with a default slot. It receives the result with the data and emits an event\n`UserClickedResultAddToCart` to the bus on click mouse event.\n\n### Basic example\n\nThis component is a button to emit `UserClickedResultAddToCart` whe clicked by the user\n\n```vue\n<BaseResultAddToCart :result=\"result\">\n <img src=\"./add-to-cart.svg\" />\n <span>Add to cart</span>\n</BaseResultAddToCart>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_renderSlot"],"mappings":";;;;;AAQoB,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AALX,EAAA,OAAAC,SAAA,EAAgC,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IACrC,MAAU,EAAA,IAAA,CAAA,MAAA;AAAA,IAAA,KAAA,EAAA,+BAAA;AAJd,IAAA,WAAA,EAAA,oBAAA;AAAA,GAAA,EAAA;;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
1
+ {"version":3,"file":"base-result-add-to-cart.vue.js","sources":["../../../../src/components/result/base-result-add-to-cart.vue"],"sourcesContent":["<template>\n <BaseEventButton\n :events=\"events\"\n :metadata=\"metadata\"\n class=\"x-result-add-to-cart x-button\"\n data-test=\"result-add-to-cart\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { computed, defineComponent, PropType, inject } from 'vue';\n import { XEventsTypes } from '../../wiring/events.types';\n import BaseEventButton from '../base-event-button.vue';\n import { PropsWithType } from '../../utils/index';\n import { WireMetadata } from '../../wiring/index';\n\n /**\n * Renders a button with a default slot. It receives the result with the data and emits\n * {@link XEventsTypes.UserClickedResultAddToCart} to the bus on click mouse event.\n *\n * @public\n */\n export default defineComponent({\n components: { BaseEventButton },\n props: {\n /**\n * (Required) The {@link @empathyco/x-types#Result} information.\n *\n * @public\n */\n result: {\n type: Object as PropType<Result>,\n required: true\n }\n },\n setup(props) {\n /**\n * The list of additional events to be emitted by the component when user clicks the add2cart button.\n *\n * @internal\n */\n const resultAddToCartExtraEvents = inject<PropsWithType<XEventsTypes, Result>[]>(\n 'resultAddToCartExtraEvents',\n []\n );\n\n /**\n * The metadata to be injected in the events emitted by the component.\n */\n const metadata = inject<Omit<WireMetadata, 'moduleName' | 'origin' | 'location'>>(\n 'resultAddToCartExtraEventsMetadata',\n {}\n );\n\n /**\n * The events to be emitted by the button.\n *\n * @returns Events {@link XEventsTypes} to emit.\n *\n * @public\n */\n const events = computed(() => {\n return resultAddToCartExtraEvents.reduce(\n (acc, event) => {\n acc[event] = props.result;\n return acc;\n },\n { UserClickedResultAddToCart: props.result } as Partial<XEventsTypes>\n );\n });\n\n return {\n events,\n metadata\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedResultAddToCart`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the result data.\n\n## Examples\n\nRenders a button with a default slot. It receives the result with the data and emits an event\n`UserClickedResultAddToCart` to the bus on click mouse event.\n\n### Basic example\n\nThis component is a button to emit `UserClickedResultAddToCart` whe clicked by the user\n\n```vue\n<BaseResultAddToCart :result=\"result\">\n <img src=\"./add-to-cart.svg\" />\n <span>Add to cart</span>\n</BaseResultAddToCart>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_renderSlot"],"mappings":";;;;;AASoB,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AANf,EAAA,OAAAC,SAAA,EAAkB,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IACnB,MAAM,EAAA,IAAA,CAAA,MAAA;AAAA,IACN,QAAU,EAAA,IAAA,CAAA,QAAA;AAAA,IAAA,KAAA,EAAA,+BAAA;AALd,IAAA,WAAA,EAAA,oBAAA;AAAA,GAAA,EAAA;;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed } from 'vue';
1
+ import { defineComponent, inject, computed } from 'vue';
2
2
  import BaseEventButton from '../base-event-button.vue.js';
3
3
 
4
4
  /**
@@ -21,6 +21,16 @@ var _sfc_main = defineComponent({
21
21
  }
22
22
  },
23
23
  setup(props) {
24
+ /**
25
+ * The list of additional events to be emitted by the component when user clicks the add2cart button.
26
+ *
27
+ * @internal
28
+ */
29
+ const resultAddToCartExtraEvents = inject('resultAddToCartExtraEvents', []);
30
+ /**
31
+ * The metadata to be injected in the events emitted by the component.
32
+ */
33
+ const metadata = inject('resultAddToCartExtraEventsMetadata', {});
24
34
  /**
25
35
  * The events to be emitted by the button.
26
36
  *
@@ -28,11 +38,15 @@ var _sfc_main = defineComponent({
28
38
  *
29
39
  * @public
30
40
  */
31
- const events = computed(() => ({
32
- UserClickedResultAddToCart: props.result
33
- }));
41
+ const events = computed(() => {
42
+ return resultAddToCartExtraEvents.reduce((acc, event) => {
43
+ acc[event] = props.result;
44
+ return acc;
45
+ }, { UserClickedResultAddToCart: props.result });
46
+ });
34
47
  return {
35
- events
48
+ events,
49
+ metadata
36
50
  };
37
51
  }
38
52
  });