@empathyco/x-components 6.0.0-alpha.36 → 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 (99) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/design-system/deprecated-full-theme.css +578 -578
  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 +7 -2
  21. package/docs/API-reference/api/x-components.queryfeature.md +1 -1
  22. package/docs/API-reference/api/x-components.relatedprompt.md +4 -25
  23. package/docs/API-reference/api/x-components.relatedpromptstaglist.md +40 -6
  24. package/docs/API-reference/api/x-components.relatedpromptsxevents.md +2 -0
  25. package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptadd2cart.md +13 -0
  26. package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptresult.md +13 -0
  27. package/docs/API-reference/api/x-components.simplefilter.md +2 -0
  28. package/docs/API-reference/api/x-components.snippetcallbacks.md +2 -0
  29. package/docs/API-reference/api/x-components.tracktoolingadd2cartwire.md +13 -0
  30. package/docs/API-reference/api/x-components.tracktoolingdisplayclickedwire.md +13 -0
  31. package/docs/API-reference/api/x-components.typingoptions.md +22 -0
  32. package/docs/API-reference/api/x-components.typingoptions.speed.md +13 -0
  33. package/docs/API-reference/api/x-components.typingoptions.targetattr.md +18 -0
  34. package/docs/API-reference/api/x-components.typingoptions.text.md +13 -0
  35. package/docs/API-reference/api/x-types.md +1 -0
  36. package/docs/API-reference/api/x-types.relatedprompt.md +2 -1
  37. package/docs/API-reference/api/x-types.relatedprompt.relatedpromptnextqueries.md +13 -0
  38. package/docs/API-reference/api/x-types.relatedprompt.toolingdisplaytagging.md +13 -0
  39. package/docs/API-reference/api/x-types.relatedpromptnextquery.md +23 -0
  40. package/docs/API-reference/api/x-types.relatedpromptnextquery.query.md +13 -0
  41. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayadd2carttagging.md +13 -0
  42. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayclicktagging.md +13 -0
  43. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplaytagging.md +13 -0
  44. package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +4 -14
  45. package/docs/API-reference/components/related-prompts/x-components.related-prompts-tag-list.md +16 -10
  46. package/js/components/result/base-result-add-to-cart.vue.js +2 -1
  47. package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
  48. package/js/components/result/base-result-add-to-cart.vue2.js +19 -5
  49. package/js/components/result/base-result-add-to-cart.vue2.js.map +1 -1
  50. package/js/directives/typing.js +52 -0
  51. package/js/directives/typing.js.map +1 -0
  52. package/js/index.js +1 -1
  53. package/js/x-modules/related-prompts/components/related-prompt.vue.js +16 -43
  54. package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -1
  55. package/js/x-modules/related-prompts/components/related-prompt.vue2.js +5 -36
  56. package/js/x-modules/related-prompts/components/related-prompt.vue2.js.map +1 -1
  57. package/js/x-modules/related-prompts/components/related-prompt.vue3.js +7 -0
  58. package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +1 -0
  59. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +76 -68
  60. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js.map +1 -1
  61. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js +176 -22
  62. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js.map +1 -1
  63. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js +1 -1
  64. package/js/x-modules/tagging/store/module.js +5 -1
  65. package/js/x-modules/tagging/store/module.js.map +1 -1
  66. package/js/x-modules/tagging/wiring.js +64 -1
  67. package/js/x-modules/tagging/wiring.js.map +1 -1
  68. package/package.json +4 -4
  69. package/report/x-adapter-platform.api.json +254 -0
  70. package/report/x-components.api.json +746 -64
  71. package/report/x-components.api.md +84 -34
  72. package/report/x-types.api.json +167 -5
  73. package/tagging/index.js +1 -1
  74. package/types/components/global-x-bus.vue.d.ts +4 -0
  75. package/types/components/global-x-bus.vue.d.ts.map +1 -1
  76. package/types/components/result/base-result-add-to-cart.vue.d.ts +2 -0
  77. package/types/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
  78. package/types/components/snippet-callbacks.vue.d.ts +2 -0
  79. package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
  80. package/types/directives/index.d.ts +1 -0
  81. package/types/directives/index.d.ts.map +1 -1
  82. package/types/directives/typing.d.ts +30 -0
  83. package/types/directives/typing.d.ts.map +1 -0
  84. package/types/types/origin.d.ts +2 -2
  85. package/types/types/origin.d.ts.map +1 -1
  86. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +2 -0
  87. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  88. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +2 -0
  89. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  90. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +4 -27
  91. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -1
  92. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts +87 -6
  93. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -1
  94. package/types/x-modules/related-prompts/events.types.d.ts +11 -1
  95. package/types/x-modules/related-prompts/events.types.d.ts.map +1 -1
  96. package/types/x-modules/tagging/store/module.d.ts.map +1 -1
  97. package/types/x-modules/tagging/wiring.d.ts +36 -2
  98. package/types/x-modules/tagging/wiring.d.ts.map +1 -1
  99. package/docs/API-reference/api/x-types.relatedprompt.nextqueries.md +0 -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
+ ```
@@ -8,19 +8,9 @@ title: RelatedPrompt
8
8
 
9
9
  This component shows a suggested related prompt.
10
10
 
11
- It provides a slot to customize the related prompt button information.
12
-
13
11
  ## Props
14
12
 
15
- | Name | Description | Type | Default |
16
- | ---------------------------- | ----------- | -------------------------- | ------------------ |
17
- | <code>relatedPrompt</code> | | <code>RelatedPrompt</code> | <code></code> |
18
- | <code>isPromptVisible</code> | | <code>boolean</code> | <code>false</code> |
19
- | <code>isSelected</code> | | <code>boolean</code> | <code>false</code> |
20
- | <code>index</code> | | <code>number</code> | <code></code> |
21
-
22
- ## Slots
23
-
24
- | Name | Description | Bindings<br />(name - type - description) |
25
- | --------------------------------------- | ----------- | ----------------------------------------- |
26
- | <code>related-prompt-button-info</code> | | None |
13
+ | Name | Description | Type | Default |
14
+ | -------------------------- | ----------- | -------------------------- | ------------------ |
15
+ | <code>relatedPrompt</code> | | <code>RelatedPrompt</code> | <code></code> |
16
+ | <code>selected</code> | | <code>boolean</code> | <code>false</code> |
@@ -6,18 +6,24 @@ title: RelatedPromptsTagList
6
6
 
7
7
  # RelatedPromptsTagList
8
8
 
9
+ This component shows the list of `RelatedPrompts` components.
10
+
11
+ If the default slot is reimplemented in the consumer, `onSelect` function will be necessary to
12
+ handle the selection of the related prompt and to trigger the stagger-fade-slide animation.
13
+
9
14
  ## Props
10
15
 
11
- | Name | Description | Type | Default |
12
- | ------------------------ | ----------- | ------------------- | ------------- |
13
- | <code>buttonClass</code> | | <code>string</code> | <code></code> |
16
+ | Name | Description | Type | Default |
17
+ | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ---------------- |
18
+ | <code>buttonClass</code> | The CSS class for the left and right button of the sliding panel. | <code>string</code> | <code></code> |
19
+ | <code>tagClass</code> | The CSS class for all the related prompt wrapper elements. | <code>string</code> | <code></code> |
20
+ | <code>tagColors</code> | Array of colors to apply to the related prompts. It will be applied to tag<br />elements cyclically according to their index in the nex way: `tagColors[index % tagColors.length]`. | <code>string[]</code> | <code></code> |
21
+ | <code>animationDurationInMs</code> | The duration of the total animation in milliseconds. | <code>number</code> | <code>700</code> |
14
22
 
15
23
  ## Slots
16
24
 
17
- | Name | Description | Bindings<br />(name - type - description) |
18
- | --------------------------------------- | ----------- | ----------------------------------------- |
19
- | <code>header</code> | | None |
20
- | <code>sliding-panel-left-button</code> | | None |
21
- | <code>sliding-panel-content</code> | | None |
22
- | <code>related-prompt-button</code> | | <br /><br /><br /> |
23
- | <code>sliding-panel-right-button</code> | | None |
25
+ | Name | Description | Bindings<br />(name - type - description) |
26
+ | --------------------------------------- | ------------------------------------------------------------------ | ----------------------------------------- |
27
+ | <code>sliding-panel-left-button</code> | The button to be displayed on the left side of the sliding panel. | None |
28
+ | <code>default</code> | - The slot to render related prompt information. | <br /><br /> |
29
+ | <code>sliding-panel-right-button</code> | The button to be displayed on the right side of the sliding panel. | None |
@@ -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
  });
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-add-to-cart.vue2.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":[],"mappings":";;;AAiBE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAG;AACf,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;AAME;AACF,QAAA,MAAM,MAAK,GAAI,QAAQ,CAAwB,OAAO;YACpD,0BAA0B,EAAE,KAAK,CAAC,MAAK;AACxC,SAAA,CAAC,CAAC,CAAA;QAEH,OAAO;YACL,MAAK;SACN,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"base-result-add-to-cart.vue2.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":[],"mappings":";;;AAoBE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;IAC7B,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAG;AACf,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;AAIE;QACF,MAAM,6BAA6B,MAAM,CACvC,4BAA4B,EAC5B,EAAC,CACF,CAAA;AAED;;AAEE;QACF,MAAM,QAAS,GAAE,MAAM,CACrB,oCAAoC,EACpC,EAAC,CACF,CAAA;AAED;;;;;;AAME;AACF,QAAA,MAAM,MAAO,GAAE,QAAQ,CAAC,MAAM;YAC5B,OAAO,0BAA0B,CAAC,MAAM,CACtC,CAAC,GAAG,EAAE,KAAK,KAAK;AACd,gBAAA,GAAG,CAAC,KAAK,CAAE,GAAE,KAAK,CAAC,MAAM,CAAA;AACzB,gBAAA,OAAO,GAAG,CAAA;aACX,EACD,EAAE,0BAA0B,EAAE,KAAK,CAAC,MAAO,EAAyB,CACrE,CAAA;AACH,SAAC,CAAC,CAAA;QAEF,OAAO;YACL,MAAM;YACN,QAAO;SACR,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -0,0 +1,52 @@
1
+ const typingDirective = {
2
+ mounted(el, binding) {
3
+ execute(el, binding.value);
4
+ },
5
+ updated(el, binding) {
6
+ if (binding.value.text !== binding.oldValue?.text) {
7
+ clearTimeout(el.__timeoutId);
8
+ execute(el, binding.value);
9
+ }
10
+ },
11
+ unmounted(el) {
12
+ clearTimeout(el.__timeoutId);
13
+ }
14
+ };
15
+ /**
16
+ * Execute a typing animation in an HTML element.
17
+ *
18
+ * @param el - The HTML element where the typing animation will be displayed.
19
+ * @param options - Options for the behavior of the animation.
20
+ */
21
+ function execute(el, options) {
22
+ const { text, speed = 1, targetAttr = '' } = options;
23
+ if (!text) {
24
+ console.error('v-typing: "text" is required.');
25
+ return;
26
+ }
27
+ let index = 0;
28
+ const updateContent = (value) => {
29
+ if (targetAttr) {
30
+ el.setAttribute(targetAttr, value);
31
+ }
32
+ else {
33
+ el.innerHTML = value;
34
+ }
35
+ };
36
+ const type = () => {
37
+ if (index < text.length) {
38
+ updateContent(text.slice(0, index + 1));
39
+ index++;
40
+ el.__timeoutId = setTimeout(type, speed);
41
+ }
42
+ else {
43
+ updateContent(text);
44
+ clearTimeout(el.__timeoutId);
45
+ el.__timeoutId = undefined;
46
+ }
47
+ };
48
+ type();
49
+ }
50
+
51
+ export { typingDirective as default };
52
+ //# sourceMappingURL=typing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typing.js","sources":["../../../src/directives/typing.ts"],"sourcesContent":["import type { Directive } from 'vue';\n\n/**\n * TypingOptions interface.\n *\n * @public\n */\nexport interface TypingOptions {\n /**\n * The text (plain or html) that will be typed into the target element.\n */\n text: string;\n /**\n * The typing speed in milliseconds per character.\n *\n */\n speed?: number;\n /**\n * The attribute of the HTML element where the typed text will be placed.\n * If not specified, the text will be set as content (innerHTML).\n *\n * @example 'placeholder'\n */\n targetAttr?: string;\n}\n\ninterface TypingHTMLElement extends HTMLElement {\n __timeoutId?: number;\n}\n\nconst typingDirective: Directive<TypingHTMLElement, TypingOptions> = {\n mounted(el, binding) {\n execute(el, binding.value);\n },\n\n updated(el, binding) {\n if (binding.value.text !== binding.oldValue?.text) {\n clearTimeout(el.__timeoutId);\n execute(el, binding.value);\n }\n },\n\n unmounted(el) {\n clearTimeout(el.__timeoutId);\n }\n};\n\n/**\n * Execute a typing animation in an HTML element.\n *\n * @param el - The HTML element where the typing animation will be displayed.\n * @param options - Options for the behavior of the animation.\n */\nfunction execute(el: TypingHTMLElement, options: TypingOptions) {\n const { text, speed = 1, targetAttr = '' } = options;\n\n if (!text) {\n console.error('v-typing: \"text\" is required.');\n return;\n }\n\n let index = 0;\n\n const updateContent = (value: string) => {\n if (targetAttr) {\n el.setAttribute(targetAttr, value);\n } else {\n el.innerHTML = value;\n }\n };\n\n const type = () => {\n if (index < text.length) {\n updateContent(text.slice(0, index + 1));\n index++;\n el.__timeoutId = setTimeout(type, speed) as unknown as number;\n } else {\n updateContent(text);\n clearTimeout(el.__timeoutId);\n el.__timeoutId = undefined;\n }\n };\n\n type();\n}\n\nexport default typingDirective;\n"],"names":[],"mappings":"AA8BA,MAAM,eAAe,GAAgD;IACnE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAA;AACjB,QAAA,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;KAC5B;IAED,OAAO,CAAC,EAAE,EAAE,OAAO,EAAA;QACjB,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE;AACjD,YAAA,YAAY,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AAC7B,YAAA,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5B,SAAA;KACF;AAED,IAAA,SAAS,CAAC,EAAE,EAAA;AACV,QAAA,YAAY,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;KAC9B;EACD;AAEF;;;;;AAKG;AACH,SAAS,OAAO,CAAC,EAAqB,EAAE,OAAsB,EAAA;AAC5D,IAAA,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAErD,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC/C,OAAO;AACR,KAAA;IAED,IAAI,KAAK,GAAG,CAAC,CAAC;AAEd,IAAA,MAAM,aAAa,GAAG,CAAC,KAAa,KAAI;AACtC,QAAA,IAAI,UAAU,EAAE;AACd,YAAA,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACpC,SAAA;AAAM,aAAA;AACL,YAAA,EAAE,CAAC,SAAS,GAAG,KAAK,CAAC;AACtB,SAAA;AACH,KAAC,CAAC;IAEF,MAAM,IAAI,GAAG,MAAK;AAChB,QAAA,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE;AACvB,YAAA,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AACxC,YAAA,KAAK,EAAE,CAAC;YACR,EAAE,CAAC,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,KAAK,CAAsB,CAAC;AAC/D,SAAA;AAAM,aAAA;YACL,aAAa,CAAC,IAAI,CAAC,CAAC;AACpB,YAAA,YAAY,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AAC7B,YAAA,EAAE,CAAC,WAAW,GAAG,SAAS,CAAC;AAC5B,SAAA;AACH,KAAC,CAAC;AAEF,IAAA,IAAI,EAAE,CAAC;AACT;;;;"}
package/js/index.js CHANGED
@@ -409,7 +409,7 @@ export { DefaultPDPAddToCartService } from './x-modules/tagging/service/pdp-add-
409
409
  export { track } from './x-modules/tagging/store/actions/track.action.js';
410
410
  export { taggingEmitters } from './x-modules/tagging/store/emitters.js';
411
411
  export { taggingXStoreModule } from './x-modules/tagging/store/module.js';
412
- export { createSetQueryTaggingFromQueryPreview, createTrackDisplayWire, createTrackWire, setConsent, setNoResultsTaggingEnabledWire, setQueryTaggingFromQueryPreview, setQueryTaggingInfo, setTaggingConfig, taggingWiring, trackAddToCartWire, trackBannerClickedWire, trackDisplayClickedWire, trackElementDisplayedWire, trackNoResultsQueryWithSemanticsWire, trackNoResultsQueryWithSemanticsWireDebounced, trackQueryWire, trackResultClickedWire } from './x-modules/tagging/wiring.js';
412
+ export { createSetQueryTaggingFromQueryPreview, createTrackDisplayWire, createTrackToolingAdd2CartWire, createTrackToolingDisplayWire, createTrackWire, setConsent, setNoResultsTaggingEnabledWire, setQueryTaggingFromQueryPreview, setQueryTaggingInfo, setTaggingConfig, taggingWiring, trackAddToCartWire, trackBannerClickedWire, trackDisplayClickedWire, trackElementDisplayedWire, trackNoResultsQueryWithSemanticsWire, trackNoResultsQueryWithSemanticsWireDebounced, trackQueryWire, trackResultClickedWire, trackToolingAdd2CartWire, trackToolingDisplayClickedWire } from './x-modules/tagging/wiring.js';
413
413
  export { taggingXModule } from './x-modules/tagging/x-module.js';
414
414
  export { default as UrlHandler } from './x-modules/url/components/url-handler.vue.js';
415
415
  export { replaceableParams, urlEmitters } from './x-modules/url/store/emitters.js';
@@ -1,50 +1,23 @@
1
1
  import _sfc_main from './related-prompt.vue2.js';
2
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, createElementVNode, normalizeStyle, toDisplayString, createBlock } from 'vue';
2
+ import { resolveDirective, openBlock, createElementBlock, withDirectives, createElementVNode, createBlock, resolveDynamicComponent } from 'vue';
3
+ import './related-prompt.vue3.js';
3
4
  import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
4
5
 
5
- const _hoisted_1 = { class: "x-related-prompt__button-info" };
6
+ const _hoisted_1 = { class: "x-related-prompt" };
6
7
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
7
- const _component_CrossTinyIcon = resolveComponent("CrossTinyIcon");
8
- const _component_PlusIcon = resolveComponent("PlusIcon");
9
- return openBlock(), createElementBlock(
10
- "div",
11
- {
12
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.toggleSuggestion(_ctx.index)),
13
- onKeydown: _cache[1] || (_cache[1] = ($event) => _ctx.toggleSuggestion(_ctx.index)),
14
- class: normalizeClass(["x-related-prompt__button", [{ "x-related-prompt-selected__button": _ctx.isSelected }]]),
15
- role: "button",
16
- "aria-pressed": "true",
17
- tabindex: "0"
18
- },
19
- [
20
- renderSlot(_ctx.$slots, "related-prompt-button-info", {}, () => [
21
- createElementVNode("div", _hoisted_1, [
22
- createElementVNode(
23
- "span",
24
- {
25
- class: normalizeClass(["x-typewritter-initial", [{ "x-typewritter-animation": _ctx.isPromptVisible }]]),
26
- style: normalizeStyle({
27
- animationDelay: `${_ctx.index * 0.4 + 0.05}s`,
28
- "--suggestion-text-length": _ctx.relatedPrompt.suggestionText.length
29
- })
30
- },
31
- toDisplayString(_ctx.relatedPrompt.suggestionText),
32
- 7
33
- /* TEXT, CLASS, STYLE */
34
- )
35
- ]),
36
- _ctx.isSelected ? (openBlock(), createBlock(_component_CrossTinyIcon, {
37
- key: 0,
38
- class: "x-icon-lg"
39
- })) : (openBlock(), createBlock(_component_PlusIcon, {
40
- key: 1,
41
- class: "x-icon-lg"
42
- }))
43
- ])
44
- ],
45
- 34
46
- /* CLASS, NEED_HYDRATION */
47
- );
8
+ const _directive_typing = resolveDirective("typing");
9
+ return openBlock(), createElementBlock("button", _hoisted_1, [
10
+ withDirectives(createElementVNode(
11
+ "span",
12
+ null,
13
+ null,
14
+ 512
15
+ /* NEED_PATCH */
16
+ ), [
17
+ [_directive_typing, { text: _ctx.relatedPrompt.suggestionText, speed: 50 }]
18
+ ]),
19
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.selected ? "CrossTinyIcon" : "PlusIcon"), { class: "x-icon-lg x-related-prompt-icon" }))
20
+ ]);
48
21
  }
49
22
  var RelatedPrompt = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
50
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"related-prompt.vue.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <div\n @click=\"toggleSuggestion(index)\"\n @keydown=\"toggleSuggestion(index)\"\n class=\"x-related-prompt__button\"\n :class=\"[{ 'x-related-prompt-selected__button': isSelected }]\"\n role=\"button\"\n aria-pressed=\"true\"\n tabindex=\"0\"\n >\n <slot name=\"related-prompt-button-info\">\n <div class=\"x-related-prompt__button-info\">\n <span\n class=\"x-typewritter-initial\"\n :class=\"[{ 'x-typewritter-animation': isPromptVisible }]\"\n :style=\"{\n animationDelay: `${index * 0.4 + 0.05}s`,\n '--suggestion-text-length': relatedPrompt.suggestionText.length\n }\"\n >\n {{ relatedPrompt.suggestionText }}\n </span>\n </div>\n <CrossTinyIcon v-if=\"isSelected\" class=\"x-icon-lg\" />\n <PlusIcon v-else class=\"x-icon-lg\" />\n </slot>\n </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { RelatedPrompt } from '@empathyco/x-types';\n import { relatedPromptsXModule } from '../x-module';\n import CrossTinyIcon from '../../../components/icons/cross-tiny.vue';\n import PlusIcon from '../../../components/icons/plus.vue';\n import { use$x } from '../../../composables/index';\n\n /**\n * This component shows a suggested related prompt.\n *\n * It provides a slot to customize the related prompt button information.\n *\n * @public\n */\n export default defineComponent({\n name: 'RelatedPrompt',\n components: {\n CrossTinyIcon,\n PlusIcon\n },\n xModule: relatedPromptsXModule.name,\n props: {\n relatedPrompt: {\n type: Object as PropType<RelatedPrompt>,\n required: true\n },\n isPromptVisible: {\n type: Boolean,\n default: false\n },\n isSelected: {\n type: Boolean,\n default: false\n },\n index: {\n type: Number,\n required: true\n }\n },\n setup() {\n const x = use$x();\n\n const toggleSuggestion = (index: number): void => {\n x.emit('UserSelectedARelatedPrompt', index);\n };\n\n return {\n toggleSuggestion\n };\n }\n });\n</script>\n"],"names":["_resolveComponent","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","index","_normalizeStyle","relatedPrompt","isSelected","_toDisplayString","_createBlock"],"mappings":";;;;;;;8BACEA,gBAyBM,CAAA,UAAA,CAAA,CAAA;SAvBHC,SAAO,EAAA,EAAAC,kBAAA;AAAA,IAAA,KAAA;AAAA,IAAA;AAAA,MACR,OAAA,EAJJ,qBAIU,CAA0B,CAAA,GAAA,CAAA,MAAA,KAAA,IAAA,CAAA,gBAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AAAA,MAEhC,WAAK,MAAQ,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,MAAA,KAAA,IAAA,CAAA,gBAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AAAA,MACb,KAAmB,EAAAC,cAAA,CAAA,CAAA,0BAAA,EAAA,CAAA,EAAA,mCAAA,EAAA,IAAA,CAAA,UAAA,EAAA,CAAA,CAAA,CAAA;AAAA,MACnB,IAAA,EAAA,QAAA;AAAA,MAAA,cAAA,EAAA,MAAA;AAEA,MAAA,QAAA,EAAA,GAAA;AAAA,KAAA;;iBAEI,IASO,CAAA,MAAA,EAAA,4BAAA,EAAA,EAAA,EAAA,MAAA;AAAA,QAAAC,kBAAA,CArBf,KAagB,EAAA,UAAA,EAAA;AAAA,UAAAA,kBAAA;AAbhB,YAAA,MAAA;AAAA,YAAA;AAAA,cAAA,KAAA,EAAAD,cAAA,CAemDE,CAAK,uBAAA,EAAA,CAAA,EAAA,yBAAA,EAAA,IAAA,CAAA,eAAA,EAAA,CAAA,CAAA,CAAA;AAAA,cAAA,KAAA,EAAAC,cAAA,CAAA;;AAK3CC,gBAAAA,0BAAAA,EAAAA,IAAAA,CAAAA,aAAAA,CAAc,cAAc,CAAA,MAAA;AAAA,eAAA,CAAA;AAGdC,aAAAA;AAAAA,YAAUC,eAAA,CAAA,IAAA,CAAA,aAAA,CAAA,cAAA,CAAA;AAAA,YAAA,CAAA;AAAA;AAAA,WAAA;AAAA,SAAA,CAAA;AAvBrC,QAAA,IAAA,CAAA,UAAA,IAAAR,SAAA,EAuBwD,EAAAS,WAAA,CAAA,wBAAA,EAAA;AAAA,UAAA,GAAA,EAAA,CAAA;;0BAChB,EAAAA,WAAA,CAAA,mBAAA,EAAA;AAAA,UAAA,GAAA,EAAA,CAAA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"related-prompt.vue.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <button class=\"x-related-prompt\">\n <span v-typing=\"{ text: relatedPrompt.suggestionText, speed: 50 }\" />\n <component\n :is=\"selected ? 'CrossTinyIcon' : 'PlusIcon'\"\n class=\"x-icon-lg x-related-prompt-icon\"\n />\n </button>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { RelatedPrompt } from '@empathyco/x-types';\n import CrossTinyIcon from '../../../components/icons/cross-tiny.vue';\n import PlusIcon from '../../../components/icons/plus.vue';\n import vTyping from '../../../directives/typing';\n\n /**\n * This component shows a suggested related prompt.\n */\n export default defineComponent({\n name: 'RelatedPrompt',\n directives: {\n typing: vTyping\n },\n components: {\n CrossTinyIcon,\n PlusIcon\n },\n props: {\n relatedPrompt: {\n type: Object as PropType<RelatedPrompt>,\n required: true\n },\n selected: {\n type: Boolean,\n default: false\n }\n }\n });\n</script>\n<style lang=\"css\">\n .x-related-prompt {\n display: flex;\n align-items: center;\n justify-content: space-between;\n text-align: start;\n padding: 8px;\n height: 100%;\n width: 100%;\n }\n .x-related-prompt-icon {\n align-self: start;\n }\n</style>\n"],"names":["_resolveDirective","relatedPrompt","_withDirectives","_createElementVNode","selected"],"mappings":";;;;;;;AACE,EAAA,MAAA,iBAAA,GAAAA,gBAAA,CAMS,QANT,CAAA,CAAA;yCAC0BC,QAAc,EAAA,UAAA,EAAA;AAAA,IAAAC,cAAA,CAAAC,kBAAA;;;;;;;AACtC,MAAA,CAAA,iBAAA,EAAA,EAAA,IAAA,EAHJ,mCAIWC,KAAQ,EAAA,EAAA,EAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;"}
@@ -1,60 +1,29 @@
1
1
  import { defineComponent } from 'vue';
2
- import { relatedPromptsXModule } from '../x-module.js';
3
2
  import CrossTinyIcon from '../../../components/icons/cross-tiny.vue.js';
4
3
  import PlusIcon from '../../../components/icons/plus.vue.js';
5
- import '../../../composables/create-use-device.js';
6
- import { use$x } from '../../../composables/use-_x.js';
7
- import '@vue/devtools-api';
8
- import '../../../plugins/devtools/timeline.devtools.js';
9
- import '@empathyco/x-utils';
10
- import 'rxjs/operators';
11
- import 'rxjs';
12
- import '../../../plugins/devtools/colors.utils.js';
13
- import '../../../plugins/x-bus.js';
14
- import '../../../plugins/x-plugin.js';
15
- import 'vuex';
16
- import '@vueuse/core';
4
+ import typingDirective from '../../../directives/typing.js';
17
5
 
18
6
  /**
19
7
  * This component shows a suggested related prompt.
20
- *
21
- * It provides a slot to customize the related prompt button information.
22
- *
23
- * @public
24
8
  */
25
9
  var _sfc_main = defineComponent({
26
10
  name: 'RelatedPrompt',
11
+ directives: {
12
+ typing: typingDirective
13
+ },
27
14
  components: {
28
15
  CrossTinyIcon,
29
16
  PlusIcon
30
17
  },
31
- xModule: relatedPromptsXModule.name,
32
18
  props: {
33
19
  relatedPrompt: {
34
20
  type: Object,
35
21
  required: true
36
22
  },
37
- isPromptVisible: {
38
- type: Boolean,
39
- default: false
40
- },
41
- isSelected: {
23
+ selected: {
42
24
  type: Boolean,
43
25
  default: false
44
- },
45
- index: {
46
- type: Number,
47
- required: true
48
26
  }
49
- },
50
- setup() {
51
- const x = use$x();
52
- const toggleSuggestion = (index) => {
53
- x.emit('UserSelectedARelatedPrompt', index);
54
- };
55
- return {
56
- toggleSuggestion
57
- };
58
27
  }
59
28
  });
60
29
 
@@ -1 +1 @@
1
- {"version":3,"file":"related-prompt.vue2.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <div\n @click=\"toggleSuggestion(index)\"\n @keydown=\"toggleSuggestion(index)\"\n class=\"x-related-prompt__button\"\n :class=\"[{ 'x-related-prompt-selected__button': isSelected }]\"\n role=\"button\"\n aria-pressed=\"true\"\n tabindex=\"0\"\n >\n <slot name=\"related-prompt-button-info\">\n <div class=\"x-related-prompt__button-info\">\n <span\n class=\"x-typewritter-initial\"\n :class=\"[{ 'x-typewritter-animation': isPromptVisible }]\"\n :style=\"{\n animationDelay: `${index * 0.4 + 0.05}s`,\n '--suggestion-text-length': relatedPrompt.suggestionText.length\n }\"\n >\n {{ relatedPrompt.suggestionText }}\n </span>\n </div>\n <CrossTinyIcon v-if=\"isSelected\" class=\"x-icon-lg\" />\n <PlusIcon v-else class=\"x-icon-lg\" />\n </slot>\n </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { RelatedPrompt } from '@empathyco/x-types';\n import { relatedPromptsXModule } from '../x-module';\n import CrossTinyIcon from '../../../components/icons/cross-tiny.vue';\n import PlusIcon from '../../../components/icons/plus.vue';\n import { use$x } from '../../../composables/index';\n\n /**\n * This component shows a suggested related prompt.\n *\n * It provides a slot to customize the related prompt button information.\n *\n * @public\n */\n export default defineComponent({\n name: 'RelatedPrompt',\n components: {\n CrossTinyIcon,\n PlusIcon\n },\n xModule: relatedPromptsXModule.name,\n props: {\n relatedPrompt: {\n type: Object as PropType<RelatedPrompt>,\n required: true\n },\n isPromptVisible: {\n type: Boolean,\n default: false\n },\n isSelected: {\n type: Boolean,\n default: false\n },\n index: {\n type: Number,\n required: true\n }\n },\n setup() {\n const x = use$x();\n\n const toggleSuggestion = (index: number): void => {\n x.emit('UserSelectedARelatedPrompt', index);\n };\n\n return {\n toggleSuggestion\n };\n }\n });\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAoCE;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,UAAU,EAAE;QACV,aAAa;QACb,QAAO;AACR,KAAA;IACD,OAAO,EAAE,qBAAqB,CAAC,IAAI;AACnC,IAAA,KAAK,EAAE;AACL,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,MAAiC;AACvC,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;AACD,QAAA,eAAe,EAAE;AACf,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAI;AACd,SAAA;AACD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAI;AACd,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,QAAQ,EAAE,IAAG;AACf,SAAA;AACD,KAAA;IACD,KAAK,GAAA;AACH,QAAA,MAAM,CAAE,GAAE,KAAK,EAAE,CAAA;AAEjB,QAAA,MAAM,gBAAe,GAAI,CAAC,KAAa,KAAW;AAChD,YAAA,CAAC,CAAC,IAAI,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAA;AAC7C,SAAC,CAAA;QAED,OAAO;YACL,gBAAe;SAChB,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"related-prompt.vue2.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <button class=\"x-related-prompt\">\n <span v-typing=\"{ text: relatedPrompt.suggestionText, speed: 50 }\" />\n <component\n :is=\"selected ? 'CrossTinyIcon' : 'PlusIcon'\"\n class=\"x-icon-lg x-related-prompt-icon\"\n />\n </button>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { RelatedPrompt } from '@empathyco/x-types';\n import CrossTinyIcon from '../../../components/icons/cross-tiny.vue';\n import PlusIcon from '../../../components/icons/plus.vue';\n import vTyping from '../../../directives/typing';\n\n /**\n * This component shows a suggested related prompt.\n */\n export default defineComponent({\n name: 'RelatedPrompt',\n directives: {\n typing: vTyping\n },\n components: {\n CrossTinyIcon,\n PlusIcon\n },\n props: {\n relatedPrompt: {\n type: Object as PropType<RelatedPrompt>,\n required: true\n },\n selected: {\n type: Boolean,\n default: false\n }\n }\n });\n</script>\n<style lang=\"css\">\n .x-related-prompt {\n display: flex;\n align-items: center;\n justify-content: space-between;\n text-align: start;\n padding: 8px;\n height: 100%;\n width: 100%;\n }\n .x-related-prompt-icon {\n align-self: start;\n }\n</style>\n"],"names":["vTyping"],"mappings":";;;;;AAgBE;;AAEE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,UAAU,EAAE;AACV,QAAA,MAAM,EAAEA,eAAM;AACf,KAAA;AACD,IAAA,UAAU,EAAE;QACV,aAAa;QACb,QAAO;AACR,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,MAAiC;AACvC,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAI;AACf,SAAA;AACF,KAAA;AACD,CAAA,CAAC;;;;"}
@@ -0,0 +1,7 @@
1
+ import injectCss from '../../../../tools/inject-css.js';
2
+
3
+ var css = "[dir=ltr] .x-related-prompt{text-align:left}[dir=rtl] .x-related-prompt{text-align:right}.x-related-prompt{align-items:center;display:flex;height:100%;justify-content:space-between;padding:8px;width:100%}.x-related-prompt-icon{align-self:start}";
4
+ injectCss(css);
5
+
6
+ export { css, css as default };
7
+ //# sourceMappingURL=related-prompt.vue3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"related-prompt.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}