@empathyco/x-components 3.0.0-alpha.163 → 3.0.0-alpha.166

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 (76) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/core/index.js.map +1 -1
  3. package/design-system/full-theme.css +13 -12
  4. package/docs/API-reference/api/x-components.clearquerypreviewwire.md +13 -0
  5. package/docs/API-reference/api/x-components.fetchandsavequerypreview.md +13 -0
  6. package/docs/API-reference/api/x-components.fetchandsavequerypreviewwire.md +13 -0
  7. package/docs/API-reference/api/x-components.fetchquerypreview.md +13 -0
  8. package/docs/API-reference/api/x-components.md +8 -0
  9. package/docs/API-reference/api/x-components.nextqueries.animation.md +1 -1
  10. package/docs/API-reference/api/x-components.nextqueries.highlightcurated.md +1 -1
  11. package/docs/API-reference/api/x-components.nextqueries.maxitemstorender.md +1 -1
  12. package/docs/API-reference/api/x-components.nextqueries.suggestions.md +13 -0
  13. package/docs/API-reference/api/x-components.queriespreviewactions.fetchandsavequerypreview.md +24 -0
  14. package/docs/API-reference/api/x-components.queriespreviewactions.fetchquerypreview.md +26 -0
  15. package/docs/API-reference/api/x-components.queriespreviewactions.md +8 -0
  16. package/docs/API-reference/api/x-components.queriespreviewconfig.maxitemstorequest.md +13 -0
  17. package/docs/API-reference/api/x-components.queriespreviewconfig.md +20 -0
  18. package/docs/API-reference/api/x-components.queriespreviewmutations.clearquerypreview.md +24 -0
  19. package/docs/API-reference/api/x-components.queriespreviewmutations.md +10 -0
  20. package/docs/API-reference/api/x-components.queriespreviewmutations.setparams.md +24 -0
  21. package/docs/API-reference/api/x-components.queriespreviewmutations.setquerypreview.md +24 -0
  22. package/docs/API-reference/api/x-components.queriespreviewmutations.setstatus.md +24 -0
  23. package/docs/API-reference/api/x-components.queriespreviewstate.config.md +13 -0
  24. package/docs/API-reference/api/x-components.queriespreviewstate.md +9 -0
  25. package/docs/API-reference/api/x-components.queriespreviewstate.params.md +13 -0
  26. package/docs/API-reference/api/x-components.queriespreviewstate.queriespreview.md +11 -0
  27. package/docs/API-reference/api/x-components.queriespreviewxevents.md +8 -0
  28. package/docs/API-reference/api/x-components.queriespreviewxevents.querypreviewremoved.md +13 -0
  29. package/docs/API-reference/api/x-components.queriespreviewxevents.querypreviewrequestchanged.md +13 -0
  30. package/docs/API-reference/api/x-components.querypreviewitem.md +23 -0
  31. package/docs/API-reference/api/x-components.querypreviewitem.request.md +13 -0
  32. package/docs/API-reference/api/x-components.querypreviewitem.results.md +13 -0
  33. package/docs/API-reference/api/x-components.querypreviewitem.totalresults.md +13 -0
  34. package/docs/API-reference/api/x-components.querypreviewstatuspayload.md +21 -0
  35. package/docs/API-reference/api/x-components.querypreviewstatuspayload.query.md +13 -0
  36. package/docs/API-reference/api/x-components.querypreviewstatuspayload.status.md +13 -0
  37. package/docs/API-reference/api/x-components.setqueriespreviewextraparamswire.md +13 -0
  38. package/docs/API-reference/components/next-queries/x-components.next-queries.md +1 -0
  39. package/js/index.js +3 -1
  40. package/js/index.js.map +1 -1
  41. package/js/x-modules/next-queries/components/next-queries.vue.js +1 -1
  42. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  43. package/js/x-modules/next-queries/components/next-queries.vue_rollup-plugin-vue_script.vue.js +14 -3
  44. package/js/x-modules/next-queries/components/next-queries.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  45. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js +40 -0
  46. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js.map +1 -0
  47. package/js/x-modules/queries-preview/store/actions/fetch-query-preview.action.js +24 -0
  48. package/js/x-modules/queries-preview/store/actions/fetch-query-preview.action.js.map +1 -0
  49. package/js/x-modules/queries-preview/store/module.js +30 -4
  50. package/js/x-modules/queries-preview/store/module.js.map +1 -1
  51. package/js/x-modules/queries-preview/wiring.js +49 -2
  52. package/js/x-modules/queries-preview/wiring.js.map +1 -1
  53. package/package.json +9 -5
  54. package/queries-preview/index.js +3 -1
  55. package/report/x-components.api.json +858 -8
  56. package/report/x-components.api.md +66 -9
  57. package/types/x-modules/next-queries/components/next-queries.vue.d.ts +19 -7
  58. package/types/x-modules/next-queries/components/next-queries.vue.d.ts.map +1 -1
  59. package/types/x-modules/queries-preview/config.types.d.ts +12 -0
  60. package/types/x-modules/queries-preview/config.types.d.ts.map +1 -0
  61. package/types/x-modules/queries-preview/events.types.d.ts +11 -0
  62. package/types/x-modules/queries-preview/events.types.d.ts.map +1 -1
  63. package/types/x-modules/queries-preview/index.d.ts +1 -0
  64. package/types/x-modules/queries-preview/index.d.ts.map +1 -1
  65. package/types/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.d.ts +13 -0
  66. package/types/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.d.ts.map +1 -0
  67. package/types/x-modules/queries-preview/store/actions/fetch-query-preview.action.d.ts +13 -0
  68. package/types/x-modules/queries-preview/store/actions/fetch-query-preview.action.d.ts.map +1 -0
  69. package/types/x-modules/queries-preview/store/index.d.ts +2 -0
  70. package/types/x-modules/queries-preview/store/index.d.ts.map +1 -1
  71. package/types/x-modules/queries-preview/store/module.d.ts +1 -1
  72. package/types/x-modules/queries-preview/store/module.d.ts.map +1 -1
  73. package/types/x-modules/queries-preview/store/types.d.ts +80 -1
  74. package/types/x-modules/queries-preview/store/types.d.ts.map +1 -1
  75. package/types/x-modules/queries-preview/wiring.d.ts +29 -1
  76. package/types/x-modules/queries-preview/wiring.d.ts.map +1 -1
@@ -0,0 +1,21 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [QueryPreviewStatusPayload](./x-components.querypreviewstatuspayload.md)
4
+
5
+ ## QueryPreviewStatusPayload interface
6
+
7
+ Payload to use in the `setStatus` mutation.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ export interface QueryPreviewStatusPayload
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Property | Type | Description |
18
+ | --- | --- | --- |
19
+ | [query](./x-components.querypreviewstatuspayload.query.md) | string | The query whose request status to modify. |
20
+ | [status](./x-components.querypreviewstatuspayload.status.md) | [RequestStatus](./x-components.requeststatus.md) | The new request status. |
21
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [QueryPreviewStatusPayload](./x-components.querypreviewstatuspayload.md) &gt; [query](./x-components.querypreviewstatuspayload.query.md)
4
+
5
+ ## QueryPreviewStatusPayload.query property
6
+
7
+ The query whose request status to modify.
8
+
9
+ <b>Signature:</b>
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-components](./x-components.md) &gt; [QueryPreviewStatusPayload](./x-components.querypreviewstatuspayload.md) &gt; [status](./x-components.querypreviewstatuspayload.status.md)
4
+
5
+ ## QueryPreviewStatusPayload.status property
6
+
7
+ The new request status.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ status: RequestStatus;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [setQueriesPreviewExtraParamsWire](./x-components.setqueriespreviewextraparamswire.md)
4
+
5
+ ## setQueriesPreviewExtraParamsWire variable
6
+
7
+ Sets the queries preview state `params`<!-- -->.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ setQueriesPreviewExtraParamsWire: import("../..").Wire<import("@empathyco/x-utils").Dictionary<unknown>>
13
+ ```
@@ -19,6 +19,7 @@ of `shirts`.
19
19
  | <code>animation</code> | Animation component that will be used to animate the suggestions. | <code>Vue</code> | <code></code> |
20
20
  | <code>maxItemsToRender</code> | Number of next queries to be rendered. | <code>number</code> | <code></code> |
21
21
  | <code>highlightCurated</code> | Flag to indicate if the curated next queries should be displayed different. | <code>boolean</code> | <code>false</code> |
22
+ | <code>suggestions</code> | NextQueries list to be used instead of state NextQueries. | <code>Array</code> | <code></code> |
22
23
 
23
24
  ## Slots
24
25
 
package/js/index.js CHANGED
@@ -265,10 +265,12 @@ export { popularSearches } from './x-modules/popular-searches/store/getters/popu
265
265
  export { popularSearchesXStoreModule } from './x-modules/popular-searches/store/module.js';
266
266
  export { popularSearchesWiring, setPopularSearchesExtraParams, setSearchedQueriesInPopularSearches } from './x-modules/popular-searches/wiring.js';
267
267
  export { popularSearchesXModule } from './x-modules/popular-searches/x-module.js';
268
+ export { fetchQueryPreview } from './x-modules/queries-preview/store/actions/fetch-query-preview.action.js';
269
+ export { fetchAndSaveQueryPreview } from './x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js';
268
270
  export { queriesPreviewEmitters } from './x-modules/queries-preview/store/emitters.js';
269
271
  export { queriesPreviewXStoreModule } from './x-modules/queries-preview/store/module.js';
270
272
  export { queriesPreviewXModule } from './x-modules/queries-preview/x-module.js';
271
- export { queriesPreviewWiring } from './x-modules/queries-preview/wiring.js';
273
+ export { clearQueryPreviewWire, fetchAndSaveQueryPreviewWire, queriesPreviewWiring, setQueriesPreviewExtraParamsWire } from './x-modules/queries-preview/wiring.js';
272
274
  export { default as QuerySuggestion } from './x-modules/query-suggestions/components/query-suggestion.vue.js';
273
275
  export { default as QuerySuggestions } from './x-modules/query-suggestions/components/query-suggestions.vue.js';
274
276
  export { cancelFetchAndSaveSuggestions as cancelFetchAndSaveQuerySuggestions, fetchAndSaveSuggestions as fetchAndSaveQuerySuggestions } from './x-modules/query-suggestions/store/actions/fetch-and-save-suggestions.action.js';
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -12,7 +12,7 @@ var __vue_render__ = function () {
12
12
  return _c("BaseSuggestions", {
13
13
  staticClass: "x-next-queries",
14
14
  attrs: {
15
- suggestions: _vm.nextQueries,
15
+ suggestions: _vm.renderedNextQueries,
16
16
  "data-test": "next-queries",
17
17
  animation: _vm.animation,
18
18
  maxItemsToRender: _vm.maxItemsToRender,
@@ -1 +1 @@
1
- {"version":3,"file":"next-queries.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n :suggestions=\"nextQueries\"\n data-test=\"next-queries\"\n class=\"x-next-queries\"\n :animation=\"animation\"\n :maxItemsToRender=\"maxItemsToRender\"\n >\n <template #default=\"{ suggestion, index }\">\n <!--\n @slot Next Query item\n @binding {Suggestion} suggestion - Next Query suggestion data\n @binding {number} index - Next Query suggestion index\n @binding {boolean} highlightCurated - True if the curated NQs should be highlighted\n -->\n <slot name=\"suggestion\" v-bind=\"{ suggestion, highlightCurated, index }\">\n <NextQuery\n #default=\"{ suggestion, shouldHighlightCurated }\"\n :suggestion=\"suggestion\"\n :highlightCurated=\"highlightCurated\"\n class=\"x-next-queries__suggestion\"\n >\n <!--\n @slot Next Query content\n @binding {Suggestion} suggestion - Next Query suggestion data\n @binding {boolean} shouldHighlightCurated - True if the curated NQ should\n be highlighted\n @binding {number} index - Next Query suggestion index\n -->\n <slot name=\"suggestion-content\" v-bind=\"{ suggestion, shouldHighlightCurated, index }\" />\n </NextQuery>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { NextQuery as NextQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { Getter } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { nextQueriesXModule } from '../x-module';\n import NextQuery from './next-query.vue';\n\n /**\n * Simple next-queries component that renders a list of suggestions, allowing the user to\n * select one of them, and emitting the needed events.\n * A next query is a suggestion for a new search, related to your previous query. I.e. If\n * people normally search for `shirts`, and then `trousers`, `trousers` would be a next query\n * of `shirts`.\n *\n * @public\n */\n @Component({\n components: { NextQuery, BaseSuggestions },\n mixins: [xComponentMixin(nextQueriesXModule)]\n })\n export default class NextQueries extends Vue {\n /**\n * Animation component that will be used to animate the suggestions.\n *\n * @public\n */\n @Prop()\n protected animation!: Vue;\n\n /**\n * Number of next queries to be rendered.\n *\n * @public\n */\n @Prop()\n protected maxItemsToRender?: number;\n\n /**\n * The list of next queries.\n *\n * @internal\n */\n @Getter('nextQueries', 'nextQueries')\n public nextQueries!: NextQueryModel[];\n\n /**\n * Flag to indicate if the curated next queries should be displayed different.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n protected highlightCurated!: boolean;\n }\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nYou don't need to pass any props, or slots. Simply add the component, and when it has any next\nqueries it will show them\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries\n }\n };\n</script>\n```\n\nThe component has three optional props. `animation` to render the component with an animation,\n`maxItemToRender` to limit the number of next queries will be rendered (by default it is 5) and\n`highlightCurated` to indicate if the curated Next Queries inside the list should be highlighted.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" :highlightCurated=\"true\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries\n }\n };\n</script>\n```\n\n### Overriding Next Queries' Content\n\nYou can use your custom implementation of the Next Query's content. In the example below, instead of\nusing the default Next Query's content, an icon is added, as well as a span with the query of the\nNext Query suggestion.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries>\n <template #suggestion-content=\"{ suggestion }\">\n <Nq1Icon />\n <span class=\"x-next-query__query\">{{ suggestion.query }}</span>\n </template>\n </NextQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n import { Nq1Icon } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries,\n Nq1Icon\n }\n };\n</script>\n```\n\n### Adding a custom next query component\n\nYou can use your custom implementation of a next query component. To work correctly, it should use\nthe `emitNextQuerySelected` function when the next query is selected. In the example below, instead\nof using the default `button` tag for a next query, an icon is added, and the text of the next query\nis wrapped in a `span`\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries>\n <template #suggestion=\"{ suggestion }\">\n <NextQuery :suggestion=\"suggestion\" class=\"x-next-queries__suggestion\">\n <template #default=\"{ suggestion }\">\n <Nq1Icon />\n <span class=\"x-next-query__query\">{{ suggestion.query }}</span>\n </template>\n </NextQuery>\n <button>Custom Behaviour</button>\n </template>\n </NextQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries, NextQuery } from '@empathyco/x-components/next-queries';\n import { Nq1Icon } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries,\n NextQuery,\n Nq1Icon\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"next-queries.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n :suggestions=\"renderedNextQueries\"\n data-test=\"next-queries\"\n class=\"x-next-queries\"\n :animation=\"animation\"\n :maxItemsToRender=\"maxItemsToRender\"\n >\n <template #default=\"{ suggestion, index }\">\n <!--\n @slot Next Query item\n @binding {Suggestion} suggestion - Next Query suggestion data\n @binding {number} index - Next Query suggestion index\n @binding {boolean} highlightCurated - True if the curated NQs should be highlighted\n -->\n <slot name=\"suggestion\" v-bind=\"{ suggestion, highlightCurated, index }\">\n <NextQuery\n #default=\"{ suggestion, shouldHighlightCurated }\"\n :suggestion=\"suggestion\"\n :highlightCurated=\"highlightCurated\"\n class=\"x-next-queries__suggestion\"\n >\n <!--\n @slot Next Query content\n @binding {Suggestion} suggestion - Next Query suggestion data\n @binding {boolean} shouldHighlightCurated - True if the curated NQ should\n be highlighted\n @binding {number} index - Next Query suggestion index\n -->\n <slot name=\"suggestion-content\" v-bind=\"{ suggestion, shouldHighlightCurated, index }\" />\n </NextQuery>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { NextQuery as NextQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { Getter } from '../../../components/decorators/store.decorators';\n import { xComponentMixin } from '../../../components/x-component.mixin';\n import { nextQueriesXModule } from '../x-module';\n import NextQuery from './next-query.vue';\n\n /**\n * Simple next-queries component that renders a list of suggestions, allowing the user to\n * select one of them, and emitting the needed events.\n * A next query is a suggestion for a new search, related to your previous query. I.e. If\n * people normally search for `shirts`, and then `trousers`, `trousers` would be a next query\n * of `shirts`.\n *\n * @public\n */\n @Component({\n components: { NextQuery, BaseSuggestions },\n mixins: [xComponentMixin(nextQueriesXModule)]\n })\n export default class NextQueries extends Vue {\n /**\n * Animation component that will be used to animate the suggestions.\n *\n * @public\n */\n @Prop()\n public animation?: Vue;\n\n /**\n * Number of next queries to be rendered.\n *\n * @public\n */\n @Prop()\n public maxItemsToRender?: number;\n\n /**\n * Flag to indicate if the curated next queries should be displayed different.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n public highlightCurated!: boolean;\n\n /**\n * NextQueries list to be used instead of state NextQueries.\n *\n * @public\n */\n @Prop()\n public suggestions?: NextQueryModel[];\n\n /**\n * The list of next queries from the state.\n *\n * @internal\n */\n @Getter('nextQueries', 'nextQueries')\n public stateNextQueries!: NextQueryModel[];\n\n /**.\n * The list of next queries finally rendered\n *\n * @internal\n */\n protected get renderedNextQueries(): NextQueryModel[] {\n return this.suggestions ?? this.stateNextQueries;\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nYou don't need to pass any props, or slots. Simply add the component, and when it has any next\nqueries it will show them\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries\n }\n };\n</script>\n```\n\nThe component has three optional props. `animation` to render the component with an animation,\n`maxItemToRender` to limit the number of next queries will be rendered (by default it is 5) and\n`highlightCurated` to indicate if the curated Next Queries inside the list should be highlighted.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" :highlightCurated=\"true\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries\n }\n };\n</script>\n```\n\n### Overriding Next Queries' Content\n\nYou can use your custom implementation of the Next Query's content. In the example below, instead of\nusing the default Next Query's content, an icon is added, as well as a span with the query of the\nNext Query suggestion.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries>\n <template #suggestion-content=\"{ suggestion }\">\n <Nq1Icon />\n <span class=\"x-next-query__query\">{{ suggestion.query }}</span>\n </template>\n </NextQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries } from '@empathyco/x-components/next-queries';\n import { Nq1Icon } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries,\n Nq1Icon\n }\n };\n</script>\n```\n\n### Adding a custom next query component\n\nYou can use your custom implementation of a next query component. To work correctly, it should use\nthe `emitNextQuerySelected` function when the next query is selected. In the example below, instead\nof using the default `button` tag for a next query, an icon is added, and the text of the next query\nis wrapped in a `span`\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <NextQueries>\n <template #suggestion=\"{ suggestion }\">\n <NextQuery :suggestion=\"suggestion\" class=\"x-next-queries__suggestion\">\n <template #default=\"{ suggestion }\">\n <Nq1Icon />\n <span class=\"x-next-query__query\">{{ suggestion.query }}</span>\n </template>\n </NextQuery>\n <button>Custom Behaviour</button>\n </template>\n </NextQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { NextQueries, NextQuery } from '@empathyco/x-components/next-queries';\n import { Nq1Icon } from '@empathyco/x-components';\n\n export default {\n name: 'NextQueriesDemo',\n components: {\n SearchInput,\n NextQueries,\n NextQuery,\n Nq1Icon\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,6 +17,14 @@ import __vue_component__ from './next-query.vue.js';
17
17
  * @public
18
18
  */
19
19
  let NextQueries = class NextQueries extends Vue {
20
+ /**.
21
+ * The list of next queries finally rendered
22
+ *
23
+ * @internal
24
+ */
25
+ get renderedNextQueries() {
26
+ return this.suggestions ?? this.stateNextQueries;
27
+ }
20
28
  };
21
29
  __decorate([
22
30
  Prop()
@@ -24,12 +32,15 @@ __decorate([
24
32
  __decorate([
25
33
  Prop()
26
34
  ], NextQueries.prototype, "maxItemsToRender", void 0);
27
- __decorate([
28
- Getter('nextQueries', 'nextQueries')
29
- ], NextQueries.prototype, "nextQueries", void 0);
30
35
  __decorate([
31
36
  Prop({ default: false, type: Boolean })
32
37
  ], NextQueries.prototype, "highlightCurated", void 0);
38
+ __decorate([
39
+ Prop()
40
+ ], NextQueries.prototype, "suggestions", void 0);
41
+ __decorate([
42
+ Getter('nextQueries', 'nextQueries')
43
+ ], NextQueries.prototype, "stateNextQueries", void 0);
33
44
  NextQueries = __decorate([
34
45
  Component({
35
46
  components: { NextQuery: __vue_component__, BaseSuggestions: __vue_component__$1 },
@@ -1 +1 @@
1
- {"version":3,"file":"next-queries.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-queries.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { NextQuery as NextQueryModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\nimport { Getter } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { nextQueriesXModule } from '../x-module';\nimport NextQuery from './next-query.vue';\n\n/**\n * Simple next-queries component that renders a list of suggestions, allowing the user to\n * select one of them, and emitting the needed events.\n * A next query is a suggestion for a new search, related to your previous query. I.e. If\n * people normally search for `shirts`, and then `trousers`, `trousers` would be a next query\n * of `shirts`.\n *\n * @public\n */\n@Component({\n components: { NextQuery, BaseSuggestions },\n mixins: [xComponentMixin(nextQueriesXModule)]\n})\nexport default class NextQueries extends Vue {\n /**\n * Animation component that will be used to animate the suggestions.\n *\n * @public\n */\n @Prop()\n protected animation!: Vue;\n\n /**\n * Number of next queries to be rendered.\n *\n * @public\n */\n @Prop()\n protected maxItemsToRender?: number;\n\n /**\n * The list of next queries.\n *\n * @internal\n */\n @Getter('nextQueries', 'nextQueries')\n public nextQueries!: NextQueryModel[];\n\n /**\n * Flag to indicate if the curated next queries should be displayed different.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n protected highlightCurated!: boolean;\n}\n"],"names":["NextQuery","BaseSuggestions"],"mappings":";;;;;;;;;AA8CA;;;;;;;;;AAaA,IAAqB,WAAW,GAAhC,MAAqB,WAAY,SAAQ,GAAG;CAgC3C,CAAA;AAzBC;IADC,IAAI,EAAE;8CACmB;AAQ1B;IADC,IAAI,EAAE;qDAC6B;AAQpC;IADC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC;gDACC;AAQtC;IADC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACH;AA/BlB,WAAW;IAJ/B,SAAS,CAAC;QACT,UAAU,EAAE,aAAEA,iBAAS,mBAAEC,mBAAe,EAAE;QAC1C,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;KAC9C,CAAC;GACmB,WAAW,CAgC/B;aAhCoB,WAAW;;;;"}
1
+ {"version":3,"file":"next-queries.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/next-queries/components/next-queries.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { NextQuery as NextQueryModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\nimport { Getter } from '../../../components/decorators/store.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { nextQueriesXModule } from '../x-module';\nimport NextQuery from './next-query.vue';\n\n/**\n * Simple next-queries component that renders a list of suggestions, allowing the user to\n * select one of them, and emitting the needed events.\n * A next query is a suggestion for a new search, related to your previous query. I.e. If\n * people normally search for `shirts`, and then `trousers`, `trousers` would be a next query\n * of `shirts`.\n *\n * @public\n */\n@Component({\n components: { NextQuery, BaseSuggestions },\n mixins: [xComponentMixin(nextQueriesXModule)]\n})\nexport default class NextQueries extends Vue {\n /**\n * Animation component that will be used to animate the suggestions.\n *\n * @public\n */\n @Prop()\n public animation?: Vue;\n\n /**\n * Number of next queries to be rendered.\n *\n * @public\n */\n @Prop()\n public maxItemsToRender?: number;\n\n /**\n * Flag to indicate if the curated next queries should be displayed different.\n *\n * @public\n */\n @Prop({ default: false, type: Boolean })\n public highlightCurated!: boolean;\n\n /**\n * NextQueries list to be used instead of state NextQueries.\n *\n * @public\n */\n @Prop()\n public suggestions?: NextQueryModel[];\n\n /**\n * The list of next queries from the state.\n *\n * @internal\n */\n @Getter('nextQueries', 'nextQueries')\n public stateNextQueries!: NextQueryModel[];\n\n /**.\n * The list of next queries finally rendered\n *\n * @internal\n */\n protected get renderedNextQueries(): NextQueryModel[] {\n return this.suggestions ?? this.stateNextQueries;\n }\n}\n"],"names":["NextQuery","BaseSuggestions"],"mappings":";;;;;;;;;AA8CA;;;;;;;;;AAaA,IAAqB,WAAW,GAAhC,MAAqB,WAAY,SAAQ,GAAG;;;;;;IA8C1C,IAAc,mBAAmB;QAC/B,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,gBAAgB,CAAC;KAClD;CACF,CAAA;AA1CC;IADC,IAAI,EAAE;8CACgB;AAQvB;IADC,IAAI,EAAE;qDAC0B;AAQjC;IADC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACN;AAQlC;IADC,IAAI,EAAE;gDAC+B;AAQtC;IADC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC;qDACM;AAvCxB,WAAW;IAJ/B,SAAS,CAAC;QACT,UAAU,EAAE,aAAEA,iBAAS,mBAAEC,mBAAe,EAAE;QAC1C,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;KAC9C,CAAC;GACmB,WAAW,CAiD/B;aAjDoB,WAAW;;;;"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Default implementation for the {@link QueriesPreviewActions.fetchAndSaveQueryPreview}.
3
+ *
4
+ * @param _context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
5
+ * provided by Vuex.
6
+ * @param request - The query preview request to make.
7
+ * @returns A Promise of a SearchResponse when it fetches the results.
8
+ *
9
+ * @public
10
+ */
11
+ // eslint-disable-next-line max-len
12
+ const fetchAndSaveQueryPreview = ({ dispatch, commit }, request) => {
13
+ const { query } = request;
14
+ if (!query) {
15
+ return;
16
+ }
17
+ commit('setQueryPreview', {
18
+ request,
19
+ results: [],
20
+ status: 'loading',
21
+ totalResults: 0
22
+ });
23
+ return dispatch('fetchQueryPreview', request)
24
+ .then(response => {
25
+ commit('setQueryPreview', {
26
+ request,
27
+ results: response?.results ?? [],
28
+ status: 'success',
29
+ totalResults: response?.totalResults ?? 0
30
+ });
31
+ })
32
+ .catch(error => {
33
+ // eslint-disable-next-line no-console
34
+ console.error(error);
35
+ commit('setStatus', { query, status: 'error' });
36
+ });
37
+ };
38
+
39
+ export { fetchAndSaveQueryPreview };
40
+ //# sourceMappingURL=fetch-and-save-query-preview.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-and-save-query-preview.action.js","sources":["../../../../../../src/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.ts"],"sourcesContent":["import { QueriesPreviewXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link QueriesPreviewActions.fetchAndSaveQueryPreview}.\n *\n * @param _context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param request - The query preview request to make.\n * @returns A Promise of a SearchResponse when it fetches the results.\n *\n * @public\n */\n// eslint-disable-next-line max-len\nexport const fetchAndSaveQueryPreview: QueriesPreviewXStoreModule['actions']['fetchAndSaveQueryPreview'] =\n ({ dispatch, commit }, request) => {\n const { query } = request;\n if (!query) {\n return;\n }\n commit('setQueryPreview', {\n request,\n results: [],\n status: 'loading',\n totalResults: 0\n });\n return dispatch('fetchQueryPreview', request)\n .then(response => {\n commit('setQueryPreview', {\n request,\n results: response?.results ?? [],\n status: 'success',\n totalResults: response?.totalResults ?? 0\n });\n })\n .catch(error => {\n // eslint-disable-next-line no-console\n console.error(error);\n commit('setStatus', { query, status: 'error' });\n });\n };\n"],"names":[],"mappings":"AAEA;;;;;;;;;;AAUA;MACa,wBAAwB,GACnC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO;IAC5B,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,IAAI,CAAC,KAAK,EAAE;QACV,OAAO;KACR;IACD,MAAM,CAAC,iBAAiB,EAAE;QACxB,OAAO;QACP,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE,CAAC;KAChB,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;SAC1C,IAAI,CAAC,QAAQ;QACZ,MAAM,CAAC,iBAAiB,EAAE;YACxB,OAAO;YACP,OAAO,EAAE,QAAQ,EAAE,OAAO,IAAI,EAAE;YAChC,MAAM,EAAE,SAAS;YACjB,YAAY,EAAE,QAAQ,EAAE,YAAY,IAAI,CAAC;SAC1C,CAAC,CAAC;KACJ,CAAC;SACD,KAAK,CAAC,KAAK;;QAEV,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;KACjD,CAAC,CAAC;AACP;;;;"}
@@ -0,0 +1,24 @@
1
+ import { XPlugin } from '../../../../plugins/x-plugin.js';
2
+
3
+ /**
4
+ * Default implementation for the {@link QueriesPreviewActions.fetchQueryPreview}.
5
+ *
6
+ * @param _context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
7
+ * provided by Vuex.
8
+ * @param request - The query preview request to make.
9
+ * @returns A Promise of a SearchResponse when it fetches the results.
10
+ *
11
+ * @public
12
+ */
13
+ const fetchQueryPreview = (_context, request) => {
14
+ const { query } = request;
15
+ if (!query) {
16
+ return null;
17
+ }
18
+ return XPlugin.adapter.search(request, {
19
+ id: `fetchQueryPreview-${query}`
20
+ });
21
+ };
22
+
23
+ export { fetchQueryPreview };
24
+ //# sourceMappingURL=fetch-query-preview.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-query-preview.action.js","sources":["../../../../../../src/x-modules/queries-preview/store/actions/fetch-query-preview.action.ts"],"sourcesContent":["import { XPlugin } from '../../../../plugins/x-plugin';\nimport { QueriesPreviewXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link QueriesPreviewActions.fetchQueryPreview}.\n *\n * @param _context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param request - The query preview request to make.\n * @returns A Promise of a SearchResponse when it fetches the results.\n *\n * @public\n */\nexport const fetchQueryPreview: QueriesPreviewXStoreModule['actions']['fetchQueryPreview'] = (\n _context,\n request\n) => {\n const { query } = request;\n if (!query) {\n return null;\n }\n return XPlugin.adapter.search(request, {\n id: `fetchQueryPreview-${query}`\n });\n};\n"],"names":[],"mappings":";;AAGA;;;;;;;;;;MAUa,iBAAiB,GAA+D,CAC3F,QAAQ,EACR,OAAO;IAEP,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE;QACrC,EAAE,EAAE,qBAAqB,KAAK,EAAE;KACjC,CAAC,CAAC;AACL;;;;"}
@@ -1,13 +1,39 @@
1
+ import Vue from 'vue';
2
+ import { fetchQueryPreview } from './actions/fetch-query-preview.action.js';
3
+ import { fetchAndSaveQueryPreview } from './actions/fetch-and-save-query-preview.action.js';
4
+
1
5
  /**
2
- * {@link XStoreModule} For the queries-preview module.
6
+ * {@link XStoreModule} For the `queries-preview` module.
3
7
  *
4
8
  * @internal
5
9
  */
6
10
  const queriesPreviewXStoreModule = {
7
- state: () => ({}),
11
+ state: () => ({
12
+ config: {
13
+ maxItemsToRequest: 24
14
+ },
15
+ queriesPreview: {},
16
+ params: {}
17
+ }),
8
18
  getters: {},
9
- mutations: {},
10
- actions: {}
19
+ mutations: {
20
+ clearQueryPreview(state, query) {
21
+ Vue.delete(state.queriesPreview, query);
22
+ },
23
+ setParams(state, params) {
24
+ state.params = params;
25
+ },
26
+ setQueryPreview(state, queryPreview) {
27
+ Vue.set(state.queriesPreview, queryPreview.request.query, queryPreview);
28
+ },
29
+ setStatus(state, { query, status }) {
30
+ state.queriesPreview[query].status = status;
31
+ }
32
+ },
33
+ actions: {
34
+ fetchQueryPreview,
35
+ fetchAndSaveQueryPreview
36
+ }
11
37
  };
12
38
 
13
39
  export { queriesPreviewXStoreModule };
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/queries-preview/store/module.ts"],"sourcesContent":["import { QueriesPreviewXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the queries-preview module.\n *\n * @internal\n */\nexport const queriesPreviewXStoreModule: QueriesPreviewXStoreModule = {\n state: () => ({}),\n getters: {},\n mutations: {},\n actions: {}\n};\n"],"names":[],"mappings":"AAEA;;;;;MAKa,0BAA0B,GAA+B;IACpE,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,OAAO,EAAE,EAAE;IACX,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/queries-preview/store/module.ts"],"sourcesContent":["import Vue from 'vue';\nimport { QueriesPreviewXStoreModule } from './types';\nimport { fetchQueryPreview } from './actions/fetch-query-preview.action';\nimport { fetchAndSaveQueryPreview } from './actions/fetch-and-save-query-preview.action';\n\n/**\n * {@link XStoreModule} For the `queries-preview` module.\n *\n * @internal\n */\nexport const queriesPreviewXStoreModule: QueriesPreviewXStoreModule = {\n state: () => ({\n config: {\n maxItemsToRequest: 24\n },\n queriesPreview: {},\n params: {}\n }),\n getters: {},\n mutations: {\n clearQueryPreview(state, query) {\n Vue.delete(state.queriesPreview, query);\n },\n setParams(state, params) {\n state.params = params;\n },\n setQueryPreview(state, queryPreview) {\n Vue.set(state.queriesPreview, queryPreview.request.query, queryPreview);\n },\n setStatus(state, { query, status }) {\n state.queriesPreview[query].status = status;\n }\n },\n actions: {\n fetchQueryPreview,\n fetchAndSaveQueryPreview\n }\n};\n"],"names":[],"mappings":";;;;AAKA;;;;;MAKa,0BAA0B,GAA+B;IACpE,KAAK,EAAE,OAAO;QACZ,MAAM,EAAE;YACN,iBAAiB,EAAE,EAAE;SACtB;QACD,cAAc,EAAE,EAAE;QAClB,MAAM,EAAE,EAAE;KACX,CAAC;IACF,OAAO,EAAE,EAAE;IACX,SAAS,EAAE;QACT,iBAAiB,CAAC,KAAK,EAAE,KAAK;YAC5B,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;SACzC;QACD,SAAS,CAAC,KAAK,EAAE,MAAM;YACrB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;QACD,eAAe,CAAC,KAAK,EAAE,YAAY;YACjC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;SACzE;QACD,SAAS,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YAChC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;SAC7C;KACF;IACD,OAAO,EAAE;QACP,iBAAiB;QACjB,wBAAwB;KACzB;;;;;"}
@@ -1,11 +1,58 @@
1
+ import { namespacedWireCommit, namespacedWireDispatch } from '../../wiring/namespaced-wires.factory.js';
1
2
  import { createWiring } from '../../wiring/wiring.utils.js';
2
3
 
4
+ /**
5
+ * `queriesPreview` {@link XModuleName | XModule name}.
6
+ *
7
+ * @internal
8
+ */
9
+ const moduleName = 'queriesPreview';
10
+ /**
11
+ * WireCommit for {@link QueriesPreviewXModule}.
12
+ *
13
+ * @internal
14
+ */
15
+ const wireCommit = namespacedWireCommit(moduleName);
16
+ /**
17
+ * WireDispatch for {@link QueriesPreviewXModule}.
18
+ *
19
+ * @internal
20
+ */
21
+ const wireDispatch = namespacedWireDispatch(moduleName);
22
+ /**
23
+ * Requests and stores the query preview results.
24
+ *
25
+ * @public
26
+ */
27
+ const fetchAndSaveQueryPreviewWire = wireDispatch('fetchAndSaveQueryPreview');
28
+ /**
29
+ * Clears a query preview from queries preview module.
30
+ *
31
+ * @public
32
+ */
33
+ const clearQueryPreviewWire = wireCommit('clearQueryPreview');
34
+ /**
35
+ * Sets the queries preview state `params`.
36
+ *
37
+ * @public
38
+ */
39
+ const setQueriesPreviewExtraParamsWire = wireCommit('setParams');
3
40
  /**
4
41
  * Wiring configuration for the {@link QueriesPreviewXModule | queriesPreview module}.
5
42
  *
6
43
  * @internal
7
44
  */
8
- const queriesPreviewWiring = createWiring({});
45
+ const queriesPreviewWiring = createWiring({
46
+ QueryPreviewRequestChanged: {
47
+ fetchAndSaveQueryPreviewWire
48
+ },
49
+ QueryPreviewRemoved: {
50
+ clearQueryPreviewWire
51
+ },
52
+ ExtraParamsChanged: {
53
+ setQueriesPreviewExtraParamsWire
54
+ }
55
+ });
9
56
 
10
- export { queriesPreviewWiring };
57
+ export { clearQueryPreviewWire, fetchAndSaveQueryPreviewWire, queriesPreviewWiring, setQueriesPreviewExtraParamsWire };
11
58
  //# sourceMappingURL=wiring.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/queries-preview/wiring.ts"],"sourcesContent":["import { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * Wiring configuration for the {@link QueriesPreviewXModule | queriesPreview module}.\n *\n * @internal\n */\nexport const queriesPreviewWiring = createWiring({});\n"],"names":[],"mappings":";;AAEA;;;;;MAKa,oBAAoB,GAAG,YAAY,CAAC,EAAE;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/queries-preview/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireDispatch\n} from '../../wiring/namespaced-wires.factory';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `queriesPreview` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'queriesPreview';\n\n/**\n * WireCommit for {@link QueriesPreviewXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName);\n\n/**\n * WireDispatch for {@link QueriesPreviewXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * Requests and stores the query preview results.\n *\n * @public\n */\nexport const fetchAndSaveQueryPreviewWire = wireDispatch('fetchAndSaveQueryPreview');\n\n/**\n * Clears a query preview from queries preview module.\n *\n * @public\n */\n\nexport const clearQueryPreviewWire = wireCommit('clearQueryPreview');\n/**\n * Sets the queries preview state `params`.\n *\n * @public\n */\nexport const setQueriesPreviewExtraParamsWire = wireCommit('setParams');\n\n/**\n * Wiring configuration for the {@link QueriesPreviewXModule | queriesPreview module}.\n *\n * @internal\n */\nexport const queriesPreviewWiring = createWiring({\n QueryPreviewRequestChanged: {\n fetchAndSaveQueryPreviewWire\n },\n QueryPreviewRemoved: {\n clearQueryPreviewWire\n },\n ExtraParamsChanged: {\n setQueriesPreviewExtraParamsWire\n }\n});\n"],"names":[],"mappings":";;;AAMA;;;;;AAKA,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC;;;;;AAKA,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAEpD;;;;;AAKA,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;;;;MAKa,4BAA4B,GAAG,YAAY,CAAC,0BAA0B,EAAE;AAErF;;;;;MAMa,qBAAqB,GAAG,UAAU,CAAC,mBAAmB,EAAE;AACrE;;;;;MAKa,gCAAgC,GAAG,UAAU,CAAC,WAAW,EAAE;AAExE;;;;;MAKa,oBAAoB,GAAG,YAAY,CAAC;IAC/C,0BAA0B,EAAE;QAC1B,4BAA4B;KAC7B;IACD,mBAAmB,EAAE;QACnB,qBAAqB;KACtB;IACD,kBAAkB,EAAE;QAClB,gCAAgC;KACjC;CACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "3.0.0-alpha.163",
3
+ "version": "3.0.0-alpha.166",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -69,11 +69,13 @@
69
69
  "@types/resize-observer-browser": "~0.1.5",
70
70
  "rxjs": "~7.4.0",
71
71
  "tslib": "~2.3.0",
72
- "vue": "^2.6.0",
73
72
  "vue-class-component": "~7.1.0",
74
73
  "vue-global-events": "~1.2.1",
75
74
  "vue-property-decorator": "~8.3.0",
76
- "vue-runtime-helpers": "~1.1.2",
75
+ "vue-runtime-helpers": "~1.1.2"
76
+ },
77
+ "peerDependencies": {
78
+ "vue": "~2.6.0",
77
79
  "vuex": "^3.0.0"
78
80
  },
79
81
  "devDependencies": {
@@ -121,13 +123,15 @@
121
123
  "ts-jest": "~27.0.7",
122
124
  "ts-node": "~8.9.1",
123
125
  "typescript": "~4.6.2",
126
+ "vue": "~2.6.14",
124
127
  "vue-docgen-cli": "~4.13.1",
125
128
  "vue-router": "~3.4.3",
126
- "vue-template-compiler": "^2.6.0"
129
+ "vue-template-compiler": "~2.6.14",
130
+ "vuex": "~3.6.2"
127
131
  },
128
132
  "publishConfig": {
129
133
  "access": "public",
130
134
  "directory": "dist"
131
135
  },
132
- "gitHead": "9c380f74addca0329886e8fa1eb8369c88f06a03"
136
+ "gitHead": "b7ece15f9e9f0586221ed12a904f00def2d1a321"
133
137
  }
@@ -1,4 +1,6 @@
1
+ export { fetchQueryPreview } from '../js/x-modules/queries-preview/store/actions/fetch-query-preview.action.js';
2
+ export { fetchAndSaveQueryPreview } from '../js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js';
1
3
  export { queriesPreviewEmitters } from '../js/x-modules/queries-preview/store/emitters.js';
2
4
  export { queriesPreviewXStoreModule } from '../js/x-modules/queries-preview/store/module.js';
3
5
  export { queriesPreviewXModule } from '../js/x-modules/queries-preview/x-module.js';
4
- export { queriesPreviewWiring } from '../js/x-modules/queries-preview/wiring.js';
6
+ export { clearQueryPreviewWire, fetchAndSaveQueryPreviewWire, queriesPreviewWiring, setQueriesPreviewExtraParamsWire } from '../js/x-modules/queries-preview/wiring.js';