@empathyco/x-components 7.4.1 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/core/index.js.map +1 -1
  3. package/docs/API-reference/api/x-components.baseaddtocart.md +1 -1
  4. package/docs/API-reference/api/x-components.hierarchicalfilter.md +1 -0
  5. package/docs/API-reference/api/x-components.md +124 -0
  6. package/docs/API-reference/api/x-components.setresults.md +13 -0
  7. package/docs/API-reference/api/x-components.simplefilter.md +1 -0
  8. package/docs/API-reference/api/x-components.snippetcallbacks.md +1 -0
  9. package/docs/API-reference/api/x-components.vendoractions.md +11 -0
  10. package/docs/API-reference/api/x-components.vendorgetters.md +11 -0
  11. package/docs/API-reference/api/x-components.vendormutations.md +54 -0
  12. package/docs/API-reference/api/x-components.vendormutations.setresults.md +11 -0
  13. package/docs/API-reference/api/x-components.vendorresult.md +57 -0
  14. package/docs/API-reference/api/x-components.vendorresult.position.md +11 -0
  15. package/docs/API-reference/api/x-components.vendorresultslist.md +31 -0
  16. package/docs/API-reference/api/x-components.vendorstate.md +54 -0
  17. package/docs/API-reference/api/x-components.vendorstate.results.md +11 -0
  18. package/docs/API-reference/api/x-components.vendorxevents.md +58 -0
  19. package/docs/API-reference/api/x-components.vendorxevents.vendorresultschanged.md +13 -0
  20. package/docs/API-reference/api/x-components.vendorxmodule.md +13 -0
  21. package/docs/API-reference/api/x-components.vendorxstoremodule.md +11 -0
  22. package/docs/API-reference/api/x-components.xeventstypes.md +2 -2
  23. package/docs/API-reference/api/x-components.xmodulestree.md +17 -0
  24. package/docs/API-reference/api/x-components.xmodulestree.vendor.md +11 -0
  25. package/docs/API-reference/api/x-types.result.md +2 -2
  26. package/docs/API-reference/components/vendor/x-components.vendor-results-list.md +21 -0
  27. package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
  28. package/js/components/result/base-result-add-to-cart.vue2.js +1 -1
  29. package/js/components/result/base-result-add-to-cart.vue2.js.map +1 -1
  30. package/js/components/result/base-result-link.vue.js +12 -8
  31. package/js/components/result/base-result-link.vue.js.map +1 -1
  32. package/js/components/result/base-result-link.vue2.js.map +1 -1
  33. package/js/index.js +5 -0
  34. package/js/index.js.map +1 -1
  35. package/js/x-modules/vendor/components/vendor-results-list.vue.js +81 -0
  36. package/js/x-modules/vendor/components/vendor-results-list.vue.js.map +1 -0
  37. package/js/x-modules/vendor/components/vendor-results-list.vue2.js +6 -0
  38. package/js/x-modules/vendor/components/vendor-results-list.vue2.js.map +1 -0
  39. package/js/x-modules/vendor/store/emitters.js +13 -0
  40. package/js/x-modules/vendor/store/emitters.js.map +1 -0
  41. package/js/x-modules/vendor/store/module.js +15 -0
  42. package/js/x-modules/vendor/store/module.js.map +1 -0
  43. package/js/x-modules/vendor/wiring.js +42 -0
  44. package/js/x-modules/vendor/wiring.js.map +1 -0
  45. package/js/x-modules/vendor/x-module.js +21 -0
  46. package/js/x-modules/vendor/x-module.js.map +1 -0
  47. package/package.json +4 -4
  48. package/report/x-components.api.json +783 -34
  49. package/report/x-components.api.md +83 -2
  50. package/report/x-types.api.json +1 -1
  51. package/types/src/components/result/base-result-add-to-cart.vue.d.ts +1 -2
  52. package/types/src/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
  53. package/types/src/components/snippet-callbacks.vue.d.ts +1 -0
  54. package/types/src/components/snippet-callbacks.vue.d.ts.map +1 -1
  55. package/types/src/index.d.ts +1 -0
  56. package/types/src/index.d.ts.map +1 -1
  57. package/types/src/wiring/events.types.d.ts +2 -1
  58. package/types/src/wiring/events.types.d.ts.map +1 -1
  59. package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +1 -0
  60. package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  61. package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts +1 -0
  62. package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  63. package/types/src/x-modules/vendor/components/index.d.ts +2 -0
  64. package/types/src/x-modules/vendor/components/index.d.ts.map +1 -0
  65. package/types/src/x-modules/vendor/components/vendor-results-list.vue.d.ts +30 -0
  66. package/types/src/x-modules/vendor/components/vendor-results-list.vue.d.ts.map +1 -0
  67. package/types/src/x-modules/vendor/events.types.d.ts +15 -0
  68. package/types/src/x-modules/vendor/events.types.d.ts.map +1 -0
  69. package/types/src/x-modules/vendor/index.d.ts +7 -0
  70. package/types/src/x-modules/vendor/index.d.ts.map +1 -0
  71. package/types/src/x-modules/vendor/store/emitters.d.ts +7 -0
  72. package/types/src/x-modules/vendor/store/emitters.d.ts.map +1 -0
  73. package/types/src/x-modules/vendor/store/index.d.ts +4 -0
  74. package/types/src/x-modules/vendor/store/index.d.ts.map +1 -0
  75. package/types/src/x-modules/vendor/store/module.d.ts +3 -0
  76. package/types/src/x-modules/vendor/store/module.d.ts.map +1 -0
  77. package/types/src/x-modules/vendor/store/types.d.ts +14 -0
  78. package/types/src/x-modules/vendor/store/types.d.ts.map +1 -0
  79. package/types/src/x-modules/vendor/types.d.ts +8 -0
  80. package/types/src/x-modules/vendor/types.d.ts.map +1 -0
  81. package/types/src/x-modules/vendor/wiring.d.ts +20 -0
  82. package/types/src/x-modules/vendor/wiring.d.ts.map +1 -0
  83. package/types/src/x-modules/vendor/x-module.d.ts +16 -0
  84. package/types/src/x-modules/vendor/x-module.d.ts.map +1 -0
  85. package/types/src/x-modules/x-modules.types.d.ts +2 -0
  86. package/types/src/x-modules/x-modules.types.d.ts.map +1 -1
  87. package/vendor/index.d.ts +1 -0
  88. package/vendor/index.js +5 -0
@@ -0,0 +1,21 @@
1
+ ---
2
+
3
+ title: VendorResultsList
4
+
5
+ ---
6
+
7
+ # VendorResultsList
8
+
9
+ It renders a ItemsList of vendor results from VendorState.results.
10
+
11
+ The component provides a default slot which wraps the whole component with the `vendorResults`
12
+ plus the `injectedListItems` which also contains the injected list items from
13
+ the ancestor.
14
+
15
+ It also provides the parent slots to customize the items.
16
+
17
+ ## Props
18
+
19
+ | Name | Description | Type | Default |
20
+ | ---------------------- | -------------------------------------------------------------------- | -------------------------- | ----------------- |
21
+ | <code>animation</code> | Animation component that will be used to animate the vendor results. | <code>AnimationProp</code> | <code>'ul'</code> |
@@ -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 :metadata=\"metadata\"\n class=\"x-result-add-to-cart xds: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\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/index'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport type { WireMetadata } from '../../wiring/index'\nimport { computed, defineComponent, inject } from 'vue'\nimport 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 */\nexport 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` when clicked by the user.\n\n```vue\n<template>\n <BaseResultAddToCart :result=\"result\">\n <img src=\"./add-to-cart.svg\" alt=\"Add to cart\" />\n <span>Add to cart</span>\n </BaseResultAddToCart>\n</template>\n\n<script setup>\nimport { BaseResultAddToCart } from '@empathyco/x-components'\nconst result = {\n id: '123',\n name: 'Product name',\n price: 19.99,\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":["_createBlock","_renderSlot"],"mappings":";;;;;;sBACEA,WAAA,CAQkB,0BAAA,EAAA;AAAA,IAPf,MAAA,EAAQ,IAAA,CAAA,MAAA;AAAA,IACR,QAAA,EAAU,IAAA,CAAA,QAAA;AAAA,IACX,KAAA,EAAM,iCAAA;AAAA,IACN,WAAA,EAAU;AAAA,GAAA,EAAA;qBAGV,MAAQ;AAAA,MAARC,UAAA,CAAQ,IAAA,CAAA,MAAA,EAAA,SAAA;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 xds: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\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/index'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport type { WireMetadata } from '../../wiring/index'\nimport { computed, defineComponent, inject } from 'vue'\nimport 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 */\nexport 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: props.result.modelName === 'Result' ? 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` when clicked by the user.\n\n```vue\n<template>\n <BaseResultAddToCart :result=\"result\">\n <img src=\"./add-to-cart.svg\" alt=\"Add to cart\" />\n <span>Add to cart</span>\n </BaseResultAddToCart>\n</template>\n\n<script setup>\nimport { BaseResultAddToCart } from '@empathyco/x-components'\nconst result = {\n id: '123',\n name: 'Product name',\n price: 19.99,\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":["_createBlock","_renderSlot"],"mappings":";;;;;;sBACEA,WAAA,CAQkB,0BAAA,EAAA;AAAA,IAPf,MAAA,EAAQ,IAAA,CAAA,MAAA;AAAA,IACR,QAAA,EAAU,IAAA,CAAA,QAAA;AAAA,IACX,KAAA,EAAM,iCAAA;AAAA,IACN,WAAA,EAAU;AAAA,GAAA,EAAA;qBAGV,MAAQ;AAAA,MAARC,UAAA,CAAQ,IAAA,CAAA,MAAA,EAAA,SAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
@@ -45,7 +45,7 @@ var _sfc_main = defineComponent({
45
45
  }, { UserClickedResultAddToCart: props.result });
46
46
  });
47
47
  return {
48
- events,
48
+ events: props.result.modelName === 'Result' ? events : {},
49
49
  metadata,
50
50
  };
51
51
  },
@@ -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 :metadata=\"metadata\"\n class=\"x-result-add-to-cart xds: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\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/index'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport type { WireMetadata } from '../../wiring/index'\nimport { computed, defineComponent, inject } from 'vue'\nimport 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 */\nexport 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` when clicked by the user.\n\n```vue\n<template>\n <BaseResultAddToCart :result=\"result\">\n <img src=\"./add-to-cart.svg\" alt=\"Add to cart\" />\n <span>Add to cart</span>\n </BaseResultAddToCart>\n</template>\n\n<script setup>\nimport { BaseResultAddToCart } from '@empathyco/x-components'\nconst result = {\n id: '123',\n name: 'Product name',\n price: 19.99,\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AAqBA;;;;;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,IAAI;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;AAIE;QACF,MAAM,6BAA6B,MAAM,CACvC,4BAA4B,EAC5B,EAAE,CACJ;AAEA;;AAEE;QACF,MAAM,QAAO,GAAI,MAAM,CACrB,oCAAoC,EACpC,EAAE,CACJ;AAEA;;;;;;AAME;AACF,QAAA,MAAM,MAAK,GAAI,QAAQ,CAAC,MAAI;YAC1B,OAAO,0BAA0B,CAAC,MAAM,CACtC,CAAC,GAAG,EAAE,KAAK,KAAG;AACZ,gBAAA,GAAG,CAAC,KAAK,CAAA,GAAI,KAAK,CAAC,MAAK;AACxB,gBAAA,OAAO,GAAE;YACX,CAAC,EACD,EAAE,0BAA0B,EAAE,KAAK,CAAC,MAAK,EAA4B,CACvE;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,MAAM;YACN,QAAQ;SACV;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
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 xds: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\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/index'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport type { WireMetadata } from '../../wiring/index'\nimport { computed, defineComponent, inject } from 'vue'\nimport 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 */\nexport 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: props.result.modelName === 'Result' ? 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` when clicked by the user.\n\n```vue\n<template>\n <BaseResultAddToCart :result=\"result\">\n <img src=\"./add-to-cart.svg\" alt=\"Add to cart\" />\n <span>Add to cart</span>\n </BaseResultAddToCart>\n</template>\n\n<script setup>\nimport { BaseResultAddToCart } from '@empathyco/x-components'\nconst result = {\n id: '123',\n name: 'Product name',\n price: 19.99,\n // ...other result properties\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AAqBA;;;;;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,IAAI;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;AAIE;QACF,MAAM,6BAA6B,MAAM,CACvC,4BAA4B,EAC5B,EAAE,CACJ;AAEA;;AAEE;QACF,MAAM,QAAO,GAAI,MAAM,CACrB,oCAAoC,EACpC,EAAE,CACJ;AAEA;;;;;;AAME;AACF,QAAA,MAAM,MAAK,GAAI,QAAQ,CAAC,MAAI;YAC1B,OAAO,0BAA0B,CAAC,MAAM,CACtC,CAAC,GAAG,EAAE,KAAK,KAAG;AACZ,gBAAA,GAAG,CAAC,KAAK,CAAA,GAAI,KAAK,CAAC,MAAK;AACxB,gBAAA,OAAO,GAAE;YACX,CAAC,EACD,EAAE,0BAA0B,EAAE,KAAK,CAAC,MAAK,EAA4B,CACvE;AACF,QAAA,CAAC,CAAA;QAED,OAAO;AACL,YAAA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,QAAO,GAAI,MAAK,GAAI,EAAE;YACzD,QAAQ;SACV;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -1,21 +1,25 @@
1
1
  import _sfc_main from './base-result-link.vue2.js';
2
- import { openBlock, createElementBlock, withModifiers, renderSlot } from 'vue';
2
+ import { openBlock, createElementBlock, mergeProps, toHandlers, renderSlot } from 'vue';
3
3
  import './base-result-link.vue3.js';
4
4
  import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
5
5
 
6
6
  const _hoisted_1 = ["href"];
7
7
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8
- return openBlock(), createElementBlock("a", {
8
+ return openBlock(), createElementBlock("a", mergeProps({
9
9
  ref: _ctx.el,
10
10
  href: _ctx.result.url,
11
11
  class: "x-result-link",
12
- "data-test": "result-link",
13
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.emitUserClickedAResult && _ctx.emitUserClickedAResult(...args)),
14
- onContextmenu: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.emitUserClickedAResult && _ctx.emitUserClickedAResult(...args), ["right"])),
15
- onMouseup: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.emitUserClickedAResult && _ctx.emitUserClickedAResult(...args), ["middle"]))
16
- }, [
12
+ "data-test": "result-link"
13
+ }, toHandlers(
14
+ _ctx.result.modelName === "Result" ? {
15
+ click: _ctx.emitUserClickedAResult,
16
+ contextmenu: _ctx.emitUserClickedAResult,
17
+ auxclick: (event) => event.button === 1 && _ctx.emitUserClickedAResult()
18
+ } : {},
19
+ true
20
+ )), [
17
21
  renderSlot(_ctx.$slots, "default", { result: _ctx.result }, void 0, true)
18
- ], 40, _hoisted_1);
22
+ ], 16, _hoisted_1);
19
23
  }
20
24
  var baseResultLink = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4d589f60"]]);
21
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-link.vue.js","sources":["../../../../src/components/result/base-result-link.vue"],"sourcesContent":["<template>\n <a\n :ref=\"el\"\n :href=\"result.url\"\n class=\"x-result-link\"\n data-test=\"result-link\"\n @click=\"emitUserClickedAResult\"\n @click.right=\"emitUserClickedAResult\"\n @click.middle=\"emitUserClickedAResult\"\n >\n <!--\n @slot (Required) Link content with a text, an image, another component or both\n @binding {Result} result - Result data\n -->\n <slot :result=\"result\" />\n </a>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/types'\nimport type { WireMetadata } from '../../wiring'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport { defineComponent, inject, ref } from 'vue'\nimport { use$x } from '../../composables/index'\n\n/**\n * Component to be reused that renders an `<a>` wrapping the result contents.\n *\n * @remarks\n * It has the logic to emit {@link XEventsTypes.UserClickedAResult} to the bus on click mouse\n * events. Additionally, this component may be injected other events to be emitted on click\n * event, so, depending on where it's used its father component may provide this events.\n *\n * @public\n */\nexport default defineComponent({\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 const $x = use$x()\n\n /**\n * The rendered DOM element.\n *\n * @internal\n */\n const el = ref()\n\n /**\n * The list of additional events to be emitted by the component when user clicks the link.\n *\n * @internal\n */\n const resultClickExtraEvents = inject<PropsWithType<XEventsTypes, Result>[]>(\n 'resultClickExtraEvents',\n [],\n )\n\n /**\n * The metadata to be injected in the events emitted by the component. This component can emit\n * have extra events so this record pairs each event to its metadata.\n */\n const resultLinkMetadataPerEvent = inject<\n // TODO: Refactor this inject key to the constants when doing EMP-909\n Partial<\n Record<\n PropsWithType<XEventsTypes, Result>,\n Omit<WireMetadata, 'moduleName' | 'origin' | 'location'>\n >\n >\n >('resultLinkMetadataPerEvent', {})\n\n /**\n * Emits the {@link XEventsTypes.UserClickedAResult} when user clicks on the result, and also\n * additional events if have been injected in the component.\n *\n * @internal\n */\n const emitUserClickedAResult = (): void => {\n $x.emit('UserClickedAResult', props.result, {\n target: el.value!,\n ...resultLinkMetadataPerEvent.UserClickedAResult,\n })\n resultClickExtraEvents.forEach(event => {\n $x.emit(event, props.result, { target: el.value!, ...resultLinkMetadataPerEvent[event] })\n })\n }\n\n return {\n el,\n emitUserClickedAResult,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-link {\n text-decoration: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following event:\n\n- [`UserClickedAResult`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\nThe component can emit more events on click using the `resultClickExtraEvents` prop.\n\n## Examples\n\nThis component is a wrapper for the result contents (images, name, price...). It may be part of the\nsearch result page, recommendations or other section which needs to include results.\n\nAdditionally, this component may be injected other events to be emitted on click event, so,\ndepending where it's used its father component may provide these events.\n\nThe result prop is required. It will render an anchor element with the href to the result URL:\n\n```vue\n<template>\n <BaseResultLink :result=\"result\">\n <template #default=\"{ result }\">\n <img :src=\"result.images[0]\" alt=\"Result image\" />\n <span>{{ result.name }}</span>\n </template>\n </BaseResultLink>\n</template>\n\n<script setup>\nimport { BaseResultLink } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n url: 'https://shop.com/jacket',\n images: ['https://shop.com/jacket.jpg'],\n}\n</script>\n```\n</docs>\n"],"names":["_createElementBlock","_withModifiers","_renderSlot"],"mappings":";;;;;;;sBACEA,kBAAA,CAcI,GAAA,EAAA;AAAA,IAbD,GAAA,EAAK,IAAA,CAAA,EAAA;AAAA,IACL,MAAM,IAAA,CAAA,MAAA,CAAO,GAAA;AAAA,IACd,KAAA,EAAM,eAAA;AAAA,IACN,WAAA,EAAU,aAAA;AAAA,IACT,SAAK,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAE,IAAA,CAAA,sBAAA,IAAA,IAAA,CAAA,sBAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,IAAA,aAAA,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAAC,aAAA,CAAA,CAAA,GAAA,IAAA,KACM,IAAA,CAAA,sBAAA,IAAA,IAAA,CAAA,sBAAA,CAAA,GAAA,IAAA,CAAA,EAAsB,CAAA,OAAA,CAAA,CAAA,CAAA;AAAA,IAAA,SAAA,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAAA,aAAA,CAAA,CAAA,GAAA,IAAA,KACrB,IAAA,CAAA,sBAAA,IAAA,IAAA,CAAA,sBAAA,CAAA,GAAA,IAAA,CAAA,EAAsB,CAAA,QAAA,CAAA,CAAA;AAAA,GAAA,EAAA;IAMrCC,UAAA,CAAyB,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAlB,QAAQ,IAAA,CAAA,MAAA,EAAM,EAAA,MAAA,EAAA,IAAA;AAAA,GAAA,EAAA,EAAA,EAAA,UAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"base-result-link.vue.js","sources":["../../../../src/components/result/base-result-link.vue"],"sourcesContent":["<template>\n <a\n :ref=\"el\"\n :href=\"result.url\"\n class=\"x-result-link\"\n data-test=\"result-link\"\n v-on=\"\n result.modelName === 'Result'\n ? {\n click: emitUserClickedAResult,\n contextmenu: emitUserClickedAResult,\n auxclick: (event: { button: number }) => event.button === 1 && emitUserClickedAResult(),\n }\n : {}\n \"\n >\n <!--\n @slot (Required) Link content with a text, an image, another component or both\n @binding {Result} result - Result data\n -->\n <slot :result=\"result\" />\n </a>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/types'\nimport type { WireMetadata } from '../../wiring'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport { defineComponent, inject, ref } from 'vue'\nimport { use$x } from '../../composables/index'\n\n/**\n * Component to be reused that renders an `<a>` wrapping the result contents.\n *\n * @remarks\n * It has the logic to emit {@link XEventsTypes.UserClickedAResult} to the bus on click mouse\n * events. Additionally, this component may be injected other events to be emitted on click\n * event, so, depending on where it's used its father component may provide this events.\n *\n * @public\n */\nexport default defineComponent({\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 const $x = use$x()\n\n /**\n * The rendered DOM element.\n *\n * @internal\n */\n const el = ref()\n\n /**\n * The list of additional events to be emitted by the component when user clicks the link.\n *\n * @internal\n */\n const resultClickExtraEvents = inject<PropsWithType<XEventsTypes, Result>[]>(\n 'resultClickExtraEvents',\n [],\n )\n\n /**\n * The metadata to be injected in the events emitted by the component. This component can emit\n * have extra events so this record pairs each event to its metadata.\n */\n const resultLinkMetadataPerEvent = inject<\n // TODO: Refactor this inject key to the constants when doing EMP-909\n Partial<\n Record<\n PropsWithType<XEventsTypes, Result>,\n Omit<WireMetadata, 'moduleName' | 'origin' | 'location'>\n >\n >\n >('resultLinkMetadataPerEvent', {})\n\n /**\n * Emits the {@link XEventsTypes.UserClickedAResult} when user clicks on the result, and also\n * additional events if have been injected in the component.\n *\n * @internal\n */\n const emitUserClickedAResult = (): void => {\n $x.emit('UserClickedAResult', props.result, {\n target: el.value!,\n ...resultLinkMetadataPerEvent.UserClickedAResult,\n })\n resultClickExtraEvents.forEach(event => {\n $x.emit(event, props.result, { target: el.value!, ...resultLinkMetadataPerEvent[event] })\n })\n }\n\n return {\n el,\n emitUserClickedAResult,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-link {\n text-decoration: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following event:\n\n- [`UserClickedAResult`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\nThe component can emit more events on click using the `resultClickExtraEvents` prop.\n\n## Examples\n\nThis component is a wrapper for the result contents (images, name, price...). It may be part of the\nsearch result page, recommendations or other section which needs to include results.\n\nAdditionally, this component may be injected other events to be emitted on click event, so,\ndepending where it's used its father component may provide these events.\n\nThe result prop is required. It will render an anchor element with the href to the result URL:\n\n```vue\n<template>\n <BaseResultLink :result=\"result\">\n <template #default=\"{ result }\">\n <img :src=\"result.images[0]\" alt=\"Result image\" />\n <span>{{ result.name }}</span>\n </template>\n </BaseResultLink>\n</template>\n\n<script setup>\nimport { BaseResultLink } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n url: 'https://shop.com/jacket',\n images: ['https://shop.com/jacket.jpg'],\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_toHandlers","_renderSlot"],"mappings":";;;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAoBI,KApBJC,UAAA,CAoBI;AAAA,IAnBD,GAAA,EAAK,IAAA,CAAA,EAAA;AAAA,IACL,MAAM,IAAA,CAAA,MAAA,CAAO,GAAA;AAAA,IACd,KAAA,EAAM,eAAA;AAAA,IACN,WAAA,EAAU;AAAA,GAAA,EACVC,UAAA;AAAA,IAAa,YAAO,SAAA,KAAS,QAAA,GAAA;AAA6C,MAAA,KAAA,EAAA,IAAA,CAAA,sBAAA;AAAA,MAAA,WAAA,EAAiD,IAAA,CAAA,sBAAA;AAAA,MAAA,QAAA,EAAA,CAA+C,KAAA,KAA8B,KAAA,CAAM,MAAA,KAAM,CAAA,IAAU,IAAA,CAAA,sBAAA;AAAsB,KAAA,GAAA,EAAA;;;IAcpPC,UAAA,CAAyB,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAlB,QAAQ,IAAA,CAAA,MAAA,EAAM,EAAA,MAAA,EAAA,IAAA;AAAA,GAAA,EAAA,EAAA,EAAA,UAAA,CAAA;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-link.vue2.js","sources":["../../../../src/components/result/base-result-link.vue"],"sourcesContent":["<template>\n <a\n :ref=\"el\"\n :href=\"result.url\"\n class=\"x-result-link\"\n data-test=\"result-link\"\n @click=\"emitUserClickedAResult\"\n @click.right=\"emitUserClickedAResult\"\n @click.middle=\"emitUserClickedAResult\"\n >\n <!--\n @slot (Required) Link content with a text, an image, another component or both\n @binding {Result} result - Result data\n -->\n <slot :result=\"result\" />\n </a>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/types'\nimport type { WireMetadata } from '../../wiring'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport { defineComponent, inject, ref } from 'vue'\nimport { use$x } from '../../composables/index'\n\n/**\n * Component to be reused that renders an `<a>` wrapping the result contents.\n *\n * @remarks\n * It has the logic to emit {@link XEventsTypes.UserClickedAResult} to the bus on click mouse\n * events. Additionally, this component may be injected other events to be emitted on click\n * event, so, depending on where it's used its father component may provide this events.\n *\n * @public\n */\nexport default defineComponent({\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 const $x = use$x()\n\n /**\n * The rendered DOM element.\n *\n * @internal\n */\n const el = ref()\n\n /**\n * The list of additional events to be emitted by the component when user clicks the link.\n *\n * @internal\n */\n const resultClickExtraEvents = inject<PropsWithType<XEventsTypes, Result>[]>(\n 'resultClickExtraEvents',\n [],\n )\n\n /**\n * The metadata to be injected in the events emitted by the component. This component can emit\n * have extra events so this record pairs each event to its metadata.\n */\n const resultLinkMetadataPerEvent = inject<\n // TODO: Refactor this inject key to the constants when doing EMP-909\n Partial<\n Record<\n PropsWithType<XEventsTypes, Result>,\n Omit<WireMetadata, 'moduleName' | 'origin' | 'location'>\n >\n >\n >('resultLinkMetadataPerEvent', {})\n\n /**\n * Emits the {@link XEventsTypes.UserClickedAResult} when user clicks on the result, and also\n * additional events if have been injected in the component.\n *\n * @internal\n */\n const emitUserClickedAResult = (): void => {\n $x.emit('UserClickedAResult', props.result, {\n target: el.value!,\n ...resultLinkMetadataPerEvent.UserClickedAResult,\n })\n resultClickExtraEvents.forEach(event => {\n $x.emit(event, props.result, { target: el.value!, ...resultLinkMetadataPerEvent[event] })\n })\n }\n\n return {\n el,\n emitUserClickedAResult,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-link {\n text-decoration: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following event:\n\n- [`UserClickedAResult`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\nThe component can emit more events on click using the `resultClickExtraEvents` prop.\n\n## Examples\n\nThis component is a wrapper for the result contents (images, name, price...). It may be part of the\nsearch result page, recommendations or other section which needs to include results.\n\nAdditionally, this component may be injected other events to be emitted on click event, so,\ndepending where it's used its father component may provide these events.\n\nThe result prop is required. It will render an anchor element with the href to the result URL:\n\n```vue\n<template>\n <BaseResultLink :result=\"result\">\n <template #default=\"{ result }\">\n <img :src=\"result.images[0]\" alt=\"Result image\" />\n <span>{{ result.name }}</span>\n </template>\n </BaseResultLink>\n</template>\n\n<script setup>\nimport { BaseResultLink } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n url: 'https://shop.com/jacket',\n images: ['https://shop.com/jacket.jpg'],\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;;;;AA2BA;;;;;;;;;AASE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;AAEjB;;;;AAIE;AACF,QAAA,MAAM,KAAK,GAAG,EAAC;AAEf;;;;AAIE;QACF,MAAM,sBAAqB,GAAI,MAAM,CACnC,wBAAwB,EACxB,EAAE,CACJ;AAEA;;;AAGE;QACF,MAAM,0BAAyB,GAAI,MAAM,CAQvC,4BAA4B,EAAE,EAAE,CAAA;AAElC;;;;;AAKE;QACF,MAAM,sBAAqB,GAAI,MAAU;YACvC,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,MAAM,EAAE;gBAC1C,MAAM,EAAE,EAAE,CAAC,KAAM;gBACjB,GAAG,0BAA0B,CAAC,kBAAkB;AACjD,aAAA,CAAA;AACD,YAAA,sBAAsB,CAAC,OAAO,CAAC,KAAI,IAAG;gBACpC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,KAAM,EAAE,GAAG,0BAA0B,CAAC,KAAK,GAAG,CAAA;AAC1F,YAAA,CAAC,CAAA;AACH,QAAA,CAAA;QAEA,OAAO;YACL,EAAE;YACF,sBAAsB;SACxB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"base-result-link.vue2.js","sources":["../../../../src/components/result/base-result-link.vue"],"sourcesContent":["<template>\n <a\n :ref=\"el\"\n :href=\"result.url\"\n class=\"x-result-link\"\n data-test=\"result-link\"\n v-on=\"\n result.modelName === 'Result'\n ? {\n click: emitUserClickedAResult,\n contextmenu: emitUserClickedAResult,\n auxclick: (event: { button: number }) => event.button === 1 && emitUserClickedAResult(),\n }\n : {}\n \"\n >\n <!--\n @slot (Required) Link content with a text, an image, another component or both\n @binding {Result} result - Result data\n -->\n <slot :result=\"result\" />\n </a>\n</template>\n\n<script lang=\"ts\">\nimport type { Result } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { PropsWithType } from '../../utils/types'\nimport type { WireMetadata } from '../../wiring'\nimport type { XEventsTypes } from '../../wiring/events.types'\nimport { defineComponent, inject, ref } from 'vue'\nimport { use$x } from '../../composables/index'\n\n/**\n * Component to be reused that renders an `<a>` wrapping the result contents.\n *\n * @remarks\n * It has the logic to emit {@link XEventsTypes.UserClickedAResult} to the bus on click mouse\n * events. Additionally, this component may be injected other events to be emitted on click\n * event, so, depending on where it's used its father component may provide this events.\n *\n * @public\n */\nexport default defineComponent({\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 const $x = use$x()\n\n /**\n * The rendered DOM element.\n *\n * @internal\n */\n const el = ref()\n\n /**\n * The list of additional events to be emitted by the component when user clicks the link.\n *\n * @internal\n */\n const resultClickExtraEvents = inject<PropsWithType<XEventsTypes, Result>[]>(\n 'resultClickExtraEvents',\n [],\n )\n\n /**\n * The metadata to be injected in the events emitted by the component. This component can emit\n * have extra events so this record pairs each event to its metadata.\n */\n const resultLinkMetadataPerEvent = inject<\n // TODO: Refactor this inject key to the constants when doing EMP-909\n Partial<\n Record<\n PropsWithType<XEventsTypes, Result>,\n Omit<WireMetadata, 'moduleName' | 'origin' | 'location'>\n >\n >\n >('resultLinkMetadataPerEvent', {})\n\n /**\n * Emits the {@link XEventsTypes.UserClickedAResult} when user clicks on the result, and also\n * additional events if have been injected in the component.\n *\n * @internal\n */\n const emitUserClickedAResult = (): void => {\n $x.emit('UserClickedAResult', props.result, {\n target: el.value!,\n ...resultLinkMetadataPerEvent.UserClickedAResult,\n })\n resultClickExtraEvents.forEach(event => {\n $x.emit(event, props.result, { target: el.value!, ...resultLinkMetadataPerEvent[event] })\n })\n }\n\n return {\n el,\n emitUserClickedAResult,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-result-link {\n text-decoration: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following event:\n\n- [`UserClickedAResult`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\nThe component can emit more events on click using the `resultClickExtraEvents` prop.\n\n## Examples\n\nThis component is a wrapper for the result contents (images, name, price...). It may be part of the\nsearch result page, recommendations or other section which needs to include results.\n\nAdditionally, this component may be injected other events to be emitted on click event, so,\ndepending where it's used its father component may provide these events.\n\nThe result prop is required. It will render an anchor element with the href to the result URL:\n\n```vue\n<template>\n <BaseResultLink :result=\"result\">\n <template #default=\"{ result }\">\n <img :src=\"result.images[0]\" alt=\"Result image\" />\n <span>{{ result.name }}</span>\n </template>\n </BaseResultLink>\n</template>\n\n<script setup>\nimport { BaseResultLink } from '@empathyco/x-components'\nconst result = {\n name: 'Jacket',\n url: 'https://shop.com/jacket',\n images: ['https://shop.com/jacket.jpg'],\n}\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;;;;AAiCA;;;;;;;;;AASE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;AAEjB;;;;AAIE;AACF,QAAA,MAAM,KAAK,GAAG,EAAC;AAEf;;;;AAIE;QACF,MAAM,sBAAqB,GAAI,MAAM,CACnC,wBAAwB,EACxB,EAAE,CACJ;AAEA;;;AAGE;QACF,MAAM,0BAAyB,GAAI,MAAM,CAQvC,4BAA4B,EAAE,EAAE,CAAA;AAElC;;;;;AAKE;QACF,MAAM,sBAAqB,GAAI,MAAU;YACvC,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,MAAM,EAAE;gBAC1C,MAAM,EAAE,EAAE,CAAC,KAAM;gBACjB,GAAG,0BAA0B,CAAC,kBAAkB;AACjD,aAAA,CAAA;AACD,YAAA,sBAAsB,CAAC,OAAO,CAAC,KAAI,IAAG;gBACpC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,KAAM,EAAE,GAAG,0BAA0B,CAAC,KAAK,GAAG,CAAA;AAC1F,YAAA,CAAC,CAAA;AACH,QAAA,CAAA;QAEA,OAAO;YACL,EAAE;YACF,sBAAsB;SACxB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
package/js/index.js CHANGED
@@ -459,4 +459,9 @@ export { replaceableParams, urlEmitters } from './x-modules/url/store/emitters.j
459
459
  export { urlXStoreModule } from './x-modules/url/store/module.js';
460
460
  export { resetUrlBrowseCategory, setInitialExtraParams, setParams, setUrlBrowseCategory, setUrlFilters, setUrlPage, setUrlParamsFromPreview, setUrlPrompt, setUrlQuery, setUrlQueryFromPreview, setUrlRelatedTags, setUrlScroll, setUrlSelectedFiltersFromPreview, setUrlSort, urlWiring } from './x-modules/url/wiring.js';
461
461
  export { urlXModule } from './x-modules/url/x-module.js';
462
+ export { default as VendorResultsList } from './x-modules/vendor/components/vendor-results-list.vue.js';
463
+ export { vendorEmitters } from './x-modules/vendor/store/emitters.js';
464
+ export { vendorXStoreModule } from './x-modules/vendor/store/module.js';
465
+ export { setResults, vendorWiring } from './x-modules/vendor/wiring.js';
466
+ export { vendorXModule } from './x-modules/vendor/x-module.js';
462
467
  //# sourceMappingURL=index.js.map
package/js/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,81 @@
1
+ import { defineComponent, inject, computed, provide, h } from 'vue';
2
+ import { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts.js';
3
+ import ItemsList from '../../../components/items-list.vue.js';
4
+ import { use$x } from '../../../composables/use-_x.js';
5
+ import { useState } from '../../../composables/use-state.js';
6
+ import { AnimationProp } from '../../../types/animation-prop.js';
7
+ import { vendorXModule } from '../x-module.js';
8
+
9
+ /**
10
+ * It renders a {@link ItemsList} of vendor results from {@link VendorState.results}.
11
+ *
12
+ * The component provides a default slot which wraps the whole component with the `vendorResults`
13
+ * plus the `injectedListItems` which also contains the injected list items from
14
+ * the ancestor.
15
+ *
16
+ * It also provides the parent slots to customize the items.
17
+ *
18
+ * @public
19
+ */
20
+ var _sfc_main = defineComponent({
21
+ name: 'VendorResultsList',
22
+ xModule: vendorXModule.name,
23
+ props: {
24
+ /** Animation component that will be used to animate the vendor results. */
25
+ animation: {
26
+ type: AnimationProp,
27
+ default: 'ul',
28
+ },
29
+ },
30
+ setup(props, { slots }) {
31
+ const $x = use$x();
32
+ /** The vendor results to render from the state. */
33
+ const stateItems = useState('vendor').results;
34
+ /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */
35
+ const injectedListItems = inject(LIST_ITEMS_KEY);
36
+ /**
37
+ * The `stateItems` concatenated with the `injectedListItems` if there are.
38
+ *
39
+ * @remarks This computed defines the merging strategy of the `stateItems` and the
40
+ * `injectedListItems`.
41
+ *
42
+ * @returns List of {@link ListItem}.
43
+ */
44
+ const items = computed(() => {
45
+ if (!injectedListItems?.value.length) {
46
+ return stateItems.value;
47
+ }
48
+ const items = [...injectedListItems.value];
49
+ for (const item of stateItems.value) {
50
+ const position = item.position ?? 1;
51
+ let index = position - 1;
52
+ while (items.at(index)?.modelName === 'VendorResult') {
53
+ index++;
54
+ }
55
+ const isIndexInLoadedPages = index <= items.length;
56
+ const areAllPagesLoaded = $x.results.length === $x.totalResults;
57
+ if (!isIndexInLoadedPages && !areAllPagesLoaded) {
58
+ break;
59
+ }
60
+ items.splice(index, 0, item);
61
+ }
62
+ return items;
63
+ });
64
+ /**
65
+ * The computed list items of the entity that uses the mixin.
66
+ *
67
+ * @remarks It should be overridden in the component that uses the mixin and it's intended to be
68
+ * filled with items from the state. Vue doesn't allow mixins as abstract classes.
69
+ * @returns An empty array as fallback in case it is not overridden.
70
+ */
71
+ provide(LIST_ITEMS_KEY, items);
72
+ return () => {
73
+ const innerProps = { items: items.value, animation: props.animation };
74
+ // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots
75
+ return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);
76
+ };
77
+ },
78
+ });
79
+
80
+ export { _sfc_main as default };
81
+ //# sourceMappingURL=vendor-results-list.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendor-results-list.vue.js","sources":["../../../../../src/x-modules/vendor/components/vendor-results-list.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { ListItem } from '../../../utils/types'\nimport { computed, defineComponent, h, inject, provide } from 'vue'\nimport { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts'\nimport ItemsList from '../../../components/items-list.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { vendorXModule } from '../x-module'\n\n/**\n * It renders a {@link ItemsList} of vendor results from {@link VendorState.results}.\n *\n * The component provides a default slot which wraps the whole component with the `vendorResults`\n * plus the `injectedListItems` which also contains the injected list items from\n * the ancestor.\n *\n * It also provides the parent slots to customize the items.\n *\n * @public\n */\nexport default defineComponent({\n name: 'VendorResultsList',\n xModule: vendorXModule.name,\n props: {\n /** Animation component that will be used to animate the vendor results. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n /** The vendor results to render from the state. */\n const stateItems = useState('vendor').results\n\n /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */\n const injectedListItems = inject<Ref<ListItem[]>>(LIST_ITEMS_KEY as string)\n\n /**\n * The `stateItems` concatenated with the `injectedListItems` if there are.\n *\n * @remarks This computed defines the merging strategy of the `stateItems` and the\n * `injectedListItems`.\n *\n * @returns List of {@link ListItem}.\n */\n const items = computed(() => {\n if (!injectedListItems?.value!.length) {\n return stateItems.value\n }\n const items = [...injectedListItems.value]\n for (const item of stateItems.value) {\n const position = item.position ?? 1\n let index = position - 1\n while (items.at(index)?.modelName === 'VendorResult') {\n index++\n }\n const isIndexInLoadedPages = index <= items.length\n const areAllPagesLoaded = $x.results.length === $x.totalResults\n if (!isIndexInLoadedPages && !areAllPagesLoaded) {\n break\n }\n items.splice(index, 0, item)\n }\n return items\n })\n\n /**\n * The computed list items of the entity that uses the mixin.\n *\n * @remarks It should be overridden in the component that uses the mixin and it's intended to be\n * filled with items from the state. Vue doesn't allow mixins as abstract classes.\n * @returns An empty array as fallback in case it is not overridden.\n */\n provide(LIST_ITEMS_KEY as string, items)\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation }\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots)\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;AAWA;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;;QAGjB,MAAM,aAAa,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAM;;AAG5C,QAAA,MAAM,iBAAgB,GAAI,MAAM,CAAkB,cAAwB,CAAA;AAE1E;;;;;;;AAOE;AACF,QAAA,MAAM,KAAI,GAAI,QAAQ,CAAC,MAAI;AACzB,YAAA,IAAI,CAAC,iBAAiB,EAAE,KAAM,CAAC,MAAM,EAAE;gBACrC,OAAO,UAAU,CAAC,KAAI;YACxB;YACA,MAAM,KAAI,GAAI,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAA;AACzC,YAAA,KAAK,MAAM,IAAG,IAAK,UAAU,CAAC,KAAK,EAAE;AACnC,gBAAA,MAAM,QAAO,GAAI,IAAI,CAAC,QAAO,IAAK,CAAA;AAClC,gBAAA,IAAI,KAAI,GAAI,WAAW,CAAA;gBACvB,OAAO,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,cAAc,cAAc,EAAE;AACpD,oBAAA,KAAK,EAAC;gBACR;AACA,gBAAA,MAAM,uBAAuB,SAAS,KAAK,CAAC,MAAK;gBACjD,MAAM,iBAAgB,GAAI,EAAE,CAAC,OAAO,CAAC,MAAK,KAAM,EAAE,CAAC,YAAW;AAC9D,gBAAA,IAAI,CAAC,oBAAmB,IAAK,CAAC,iBAAiB,EAAE;oBAC/C;gBACF;gBACA,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAA;YAC7B;AACA,YAAA,OAAO,KAAI;AACb,QAAA,CAAC,CAAA;AAED;;;;;;AAME;AACF,QAAA,OAAO,CAAC,cAAwB,EAAE,KAAK,CAAA;AAEvC,QAAA,OAAO,MAAI;AACT,YAAA,MAAM,UAAS,GAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAE;;AAEpE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAA;AACzE,QAAA,CAAA;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './vendor-results-list.vue.js';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
6
+ //# sourceMappingURL=vendor-results-list.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendor-results-list.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,13 @@
1
+ import '@empathyco/x-utils';
2
+ import { createStoreEmitters } from '../../../store/utils/store-emitters.utils.js';
3
+ import { vendorXStoreModule } from './module.js';
4
+
5
+ /**
6
+ * {@link StoreEmitters} For the vendor module.
7
+ *
8
+ * @internal
9
+ */
10
+ const vendorEmitters = createStoreEmitters(vendorXStoreModule, {});
11
+
12
+ export { vendorEmitters };
13
+ //# sourceMappingURL=emitters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/vendor/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store'\nimport { vendorXStoreModule } from './module'\n\n/**\n * {@link StoreEmitters} For the vendor module.\n *\n * @internal\n */\nexport const vendorEmitters = createStoreEmitters(vendorXStoreModule, {})\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;AACI,MAAM,cAAc,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,EAAE;;;;"}
@@ -0,0 +1,15 @@
1
+ const vendorXStoreModule = {
2
+ state: () => ({
3
+ results: [],
4
+ }),
5
+ getters: {},
6
+ mutations: {
7
+ setResults(state, results) {
8
+ state.results = results;
9
+ },
10
+ },
11
+ actions: {},
12
+ };
13
+
14
+ export { vendorXStoreModule };
15
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/vendor/store/module.ts"],"sourcesContent":["import type { VendorXStoreModule } from './types'\n\nexport const vendorXStoreModule: VendorXStoreModule = {\n state: () => ({\n results: [],\n }),\n getters: {},\n mutations: {\n setResults(state, results) {\n state.results = results\n },\n },\n actions: {},\n}\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAuB;AACpD,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,OAAO,EAAE,EAAE;KACZ,CAAC;AACF,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,SAAS,EAAE;QACT,UAAU,CAAC,KAAK,EAAE,OAAO,EAAA;AACvB,YAAA,KAAK,CAAC,OAAO,GAAG,OAAO;QACzB,CAAC;AACF,KAAA;AACD,IAAA,OAAO,EAAE,EAAE;;;;;"}
@@ -0,0 +1,42 @@
1
+ import { namespacedWireCommit } from '../../wiring/namespaced-wires.factory.js';
2
+ import 'rxjs/operators';
3
+ import 'rxjs';
4
+ import { createWiring } from '../../wiring/wiring.utils.js';
5
+
6
+ /**
7
+ * WireCommit for {@link VendorXModule}.
8
+ *
9
+ * @internal
10
+ */
11
+ const wireCommit = namespacedWireCommit('vendor');
12
+ /**
13
+ * Sets the vendor results of the {@link VendorXModule}.
14
+ *
15
+ * @public
16
+ */
17
+ const setResults = wireCommit('setResults', ({ eventPayload }) => eventPayload.map(vendorResult => ({
18
+ ...vendorResult,
19
+ modelName: 'VendorResult',
20
+ })));
21
+ /**
22
+ * Resets the vendor results of the {@link VendorXModule}.
23
+ *
24
+ * @public
25
+ */
26
+ const resetResults = wireCommit('setResults', []);
27
+ /**
28
+ * Wiring configuration for the {@link VendorXModule | vendor module}.
29
+ *
30
+ * @internal
31
+ */
32
+ const vendorWiring = createWiring({
33
+ VendorResultsChanged: {
34
+ setResults,
35
+ },
36
+ SearchRequestChanged: {
37
+ resetResults,
38
+ },
39
+ });
40
+
41
+ export { setResults, vendorWiring };
42
+ //# sourceMappingURL=wiring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/vendor/wiring.ts"],"sourcesContent":["import type { WirePayload, XEventPayload } from '../../wiring'\nimport { createWiring, namespacedWireCommit } from '../../wiring'\n\n/**\n * WireCommit for {@link VendorXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('vendor')\n\n/**\n * Sets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nexport const setResults = wireCommit(\n 'setResults',\n ({ eventPayload }: WirePayload<XEventPayload<'VendorResultsChanged'>>) =>\n eventPayload.map(vendorResult => ({\n ...vendorResult,\n modelName: 'VendorResult' as const,\n })),\n)\n\n/**\n * Resets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nconst resetResults = wireCommit('setResults', [])\n\n/**\n * Wiring configuration for the {@link VendorXModule | vendor module}.\n *\n * @internal\n */\nexport const vendorWiring = createWiring({\n VendorResultsChanged: {\n setResults,\n },\n SearchRequestChanged: {\n resetResults,\n },\n})\n"],"names":[],"mappings":";;;;;AAGA;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,QAAQ,CAAC;AAEjD;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAClC,YAAY,EACZ,CAAC,EAAE,YAAY,EAAsD,KACnE,YAAY,CAAC,GAAG,CAAC,YAAY,KAAK;AAChC,IAAA,GAAG,YAAY;AACf,IAAA,SAAS,EAAE,cAAuB;CACnC,CAAC,CAAC;AAGP;;;;AAIG;AACH,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;AAEjD;;;;AAIG;AACI,MAAM,YAAY,GAAG,YAAY,CAAC;AACvC,IAAA,oBAAoB,EAAE;QACpB,UAAU;AACX,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,YAAY;AACb,KAAA;AACF,CAAA;;;;"}
@@ -0,0 +1,21 @@
1
+ import { XPlugin } from '../../plugins/x-plugin.js';
2
+ import { vendorEmitters } from './store/emitters.js';
3
+ import { vendorXStoreModule } from './store/module.js';
4
+ import { vendorWiring } from './wiring.js';
5
+
6
+ /**
7
+ * Vendor {@link XModule} implementation. This module is auto-registered as soon as you
8
+ * import any component from the `vendor` entry point.
9
+ *
10
+ * @public
11
+ */
12
+ const vendorXModule = {
13
+ name: 'vendor',
14
+ storeModule: vendorXStoreModule,
15
+ storeEmitters: vendorEmitters,
16
+ wiring: vendorWiring,
17
+ };
18
+ XPlugin.registerXModule(vendorXModule);
19
+
20
+ export { vendorXModule };
21
+ //# sourceMappingURL=x-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-module.js","sources":["../../../../src/x-modules/vendor/x-module.ts"],"sourcesContent":["import type { XModule } from '../x-modules.types'\nimport type { VendorXStoreModule } from './store/types'\nimport { XPlugin } from '../../plugins/x-plugin'\nimport { vendorEmitters } from './store/emitters'\nimport { vendorXStoreModule } from './store/module'\nimport { vendorWiring } from './wiring'\n\n/**\n * Vendor {@link XModule} alias.\n *\n * @public\n */\nexport type VendorXModule = XModule<VendorXStoreModule>\n\n/**\n * Vendor {@link XModule} implementation. This module is auto-registered as soon as you\n * import any component from the `vendor` entry point.\n *\n * @public\n */\nexport const vendorXModule: VendorXModule = {\n name: 'vendor',\n storeModule: vendorXStoreModule,\n storeEmitters: vendorEmitters,\n wiring: vendorWiring,\n}\n\nXPlugin.registerXModule(vendorXModule)\n"],"names":[],"mappings":";;;;;AAcA;;;;;AAKG;AACI,MAAM,aAAa,GAAkB;AAC1C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,WAAW,EAAE,kBAAkB;AAC/B,IAAA,aAAa,EAAE,cAAc;AAC7B,IAAA,MAAM,EAAE,YAAY;;AAGtB,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "7.4.1",
3
+ "version": "7.5.0",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -68,8 +68,8 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@empathyco/x-adapter": "8.1.8",
71
- "@empathyco/x-adapter-platform": "1.7.0",
72
- "@empathyco/x-types": "10.5.0",
71
+ "@empathyco/x-adapter-platform": "1.7.1",
72
+ "@empathyco/x-types": "10.6.0",
73
73
  "@empathyco/x-utils": "1.0.9",
74
74
  "@vue/devtools-api": "~6.6.4",
75
75
  "@vueuse/core": "~12.8.2",
@@ -117,5 +117,5 @@
117
117
  "access": "public",
118
118
  "directory": "dist"
119
119
  },
120
- "gitHead": "8f8a31d876ab437d908676e13e623497c6cca7ae"
120
+ "gitHead": "60f292946050b2be4384d28ce746481e55ebbeec"
121
121
  }