@empathyco/x-components 3.0.0-alpha.239 → 3.0.0-alpha.240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/design-system/full-theme.css +16 -15
- package/docs/API-reference/api/x-components.historyqueriesactions.md +1 -0
- package/docs/API-reference/api/x-components.historyqueriesactions.updatehistoryquerieswithsearchresponse.md +24 -0
- package/docs/API-reference/api/x-components.historyqueriesgetters.historyquerieswithresults.md +13 -0
- package/docs/API-reference/api/x-components.historyqueriesgetters.md +1 -0
- package/docs/API-reference/api/x-components.md +1 -0
- package/docs/API-reference/api/x-components.updatehistoryquerieswithsearchresponse.md +13 -0
- package/history-queries/index.js +1 -1
- package/js/index.js +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue_rollup-plugin-vue_script.vue.js +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.js +42 -0
- package/js/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.js.map +1 -0
- package/js/x-modules/history-queries/store/getters/history-queries-with-results.getter.js +18 -0
- package/js/x-modules/history-queries/store/getters/history-queries-with-results.getter.js.map +1 -0
- package/js/x-modules/history-queries/store/module.js +5 -1
- package/js/x-modules/history-queries/store/module.js.map +1 -1
- package/js/x-modules/history-queries/wiring.js +10 -1
- package/js/x-modules/history-queries/wiring.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +115 -0
- package/report/x-components.api.md +8 -0
- package/types/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.d.ts +22 -0
- package/types/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.d.ts.map +1 -0
- package/types/x-modules/history-queries/store/getters/history-queries-with-results.getter.d.ts +16 -0
- package/types/x-modules/history-queries/store/getters/history-queries-with-results.getter.d.ts.map +1 -0
- package/types/x-modules/history-queries/store/module.d.ts.map +1 -1
- package/types/x-modules/history-queries/store/types.d.ts +12 -0
- package/types/x-modules/history-queries/store/types.d.ts.map +1 -1
- package/types/x-modules/history-queries/wiring.d.ts +9 -0
- package/types/x-modules/history-queries/wiring.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.0-alpha.240](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.239...@empathyco/x-components@3.0.0-alpha.240) (2022-12-02)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **history-queries:** Hide history queries with no results (#865)
|
|
11
|
+
([58f155d](https://github.com/empathyco/x/commit/58f155d2eefe1676646d320c9f310ad1d28aab5e))
|
|
12
|
+
|
|
13
|
+
# Change Log
|
|
14
|
+
|
|
15
|
+
All notable changes to this project will be documented in this file. See
|
|
16
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
17
|
+
|
|
6
18
|
## [3.0.0-alpha.239](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.238...@empathyco/x-components@3.0.0-alpha.239) (2022-12-01)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @empathyco/x-components
|
|
@@ -2840,21 +2840,6 @@
|
|
|
2840
2840
|
--x-number-zoom-scale-picture: 1.1;
|
|
2841
2841
|
--x-number-zoom-duration-picture: 0.3s;
|
|
2842
2842
|
}
|
|
2843
|
-
.x-progress-bar {
|
|
2844
|
-
display: inline-block;
|
|
2845
|
-
overflow: hidden;
|
|
2846
|
-
background-color: var(--x-color-background-progress-bar-default);
|
|
2847
|
-
border-color: var(--x-color-border-progress-bar-default);
|
|
2848
|
-
border-style: solid;
|
|
2849
|
-
border-width: var(--x-size-border-width-progress-bar-default);
|
|
2850
|
-
border-radius: var(--x-size-border-radius-progress-bar-default);
|
|
2851
|
-
}
|
|
2852
|
-
.x-progress-bar__line {
|
|
2853
|
-
height: var(--x-size-height-progress-bar-line-default);
|
|
2854
|
-
width: var(--x-size-width-progress-bar-line-default);
|
|
2855
|
-
border-radius: var(--x-size-border-radius-progress-bar-default);
|
|
2856
|
-
background-color: var(--x-color-background-progress-bar-line-default);
|
|
2857
|
-
}
|
|
2858
2843
|
:root {
|
|
2859
2844
|
--x-size-height-progress-bar-line-default: var(--x-size-base-02);
|
|
2860
2845
|
--x-size-width-progress-bar-line-default: var(--x-size-base-20);
|
|
@@ -7236,3 +7221,19 @@
|
|
|
7236
7221
|
.x-normal-case {
|
|
7237
7222
|
text-transform: none;
|
|
7238
7223
|
}
|
|
7224
|
+
|
|
7225
|
+
.x-progress-bar {
|
|
7226
|
+
display: inline-block;
|
|
7227
|
+
overflow: hidden;
|
|
7228
|
+
background-color: var(--x-color-background-progress-bar-default);
|
|
7229
|
+
border-color: var(--x-color-border-progress-bar-default);
|
|
7230
|
+
border-style: solid;
|
|
7231
|
+
border-width: var(--x-size-border-width-progress-bar-default);
|
|
7232
|
+
border-radius: var(--x-size-border-radius-progress-bar-default);
|
|
7233
|
+
}
|
|
7234
|
+
.x-progress-bar__line {
|
|
7235
|
+
height: var(--x-size-height-progress-bar-line-default);
|
|
7236
|
+
width: var(--x-size-width-progress-bar-line-default);
|
|
7237
|
+
border-radius: var(--x-size-border-radius-progress-bar-default);
|
|
7238
|
+
background-color: var(--x-color-background-progress-bar-line-default);
|
|
7239
|
+
}
|
|
@@ -23,4 +23,5 @@ export interface HistoryQueriesActions
|
|
|
23
23
|
| [setHistoryQueries(historyQueries)](./x-components.historyqueriesactions.sethistoryqueries.md) | Sets the history queries, synchronizing them with the browser storage. It also removes the oldest query if the history queries length is bigger than the [HistoryQueriesConfig.maxItemsToStore](./x-components.historyqueriesconfig.maxitemstostore.md)<!-- -->. |
|
|
24
24
|
| [setUrlParams(urlParams)](./x-components.historyqueriesactions.seturlparams.md) | Checks if the url has a query on it and then updates the state with that value. |
|
|
25
25
|
| [toggleHistoryQueries(isEnabled)](./x-components.historyqueriesactions.togglehistoryqueries.md) | Toggles the history queries and stores the state in the browser storage. It also cleans the history queries when disabling them. |
|
|
26
|
+
| [updateHistoryQueriesWithSearchResponse(searchResponse)](./x-components.historyqueriesactions.updatehistoryquerieswithsearchresponse.md) | Updates the history queries with the relevant info included in a search response. |
|
|
26
27
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [HistoryQueriesActions](./x-components.historyqueriesactions.md) > [updateHistoryQueriesWithSearchResponse](./x-components.historyqueriesactions.updatehistoryquerieswithsearchresponse.md)
|
|
4
|
+
|
|
5
|
+
## HistoryQueriesActions.updateHistoryQueriesWithSearchResponse() method
|
|
6
|
+
|
|
7
|
+
Updates the history queries with the relevant info included in a search response.
|
|
8
|
+
|
|
9
|
+
<b>Signature:</b>
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
updateHistoryQueriesWithSearchResponse(searchResponse: InternalSearchResponse): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| searchResponse | [InternalSearchResponse](./x-components.internalsearchresponse.md) | The search response to update history queries with. |
|
|
20
|
+
|
|
21
|
+
<b>Returns:</b>
|
|
22
|
+
|
|
23
|
+
void
|
|
24
|
+
|
package/docs/API-reference/api/x-components.historyqueriesgetters.historyquerieswithresults.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [HistoryQueriesGetters](./x-components.historyqueriesgetters.md) > [historyQueriesWithResults](./x-components.historyqueriesgetters.historyquerieswithresults.md)
|
|
4
|
+
|
|
5
|
+
## HistoryQueriesGetters.historyQueriesWithResults property
|
|
6
|
+
|
|
7
|
+
A sub-set of the [HistoryQueriesGetters.historyQueries](./x-components.historyqueriesgetters.historyqueries.md) including only the queries with results at the moment they were requested.
|
|
8
|
+
|
|
9
|
+
<b>Signature:</b>
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
historyQueriesWithResults: HistoryQuery[];
|
|
13
|
+
```
|
|
@@ -17,6 +17,7 @@ export interface HistoryQueriesGetters
|
|
|
17
17
|
| Property | Type | Description |
|
|
18
18
|
| --- | --- | --- |
|
|
19
19
|
| [historyQueries](./x-components.historyqueriesgetters.historyqueries.md) | HistoryQuery\[\] | A sub-set of the [HistoryQueriesState.historyQueries](./x-components.historyqueriesstate.historyqueries.md)<!-- -->. If the [HistoryQueriesState.query](./x-components.historyqueriesstate.query.md) property is not empty, this list will only contain suggestions whose query matches with it. |
|
|
20
|
+
| [historyQueriesWithResults](./x-components.historyqueriesgetters.historyquerieswithresults.md) | HistoryQuery\[\] | A sub-set of the [HistoryQueriesGetters.historyQueries](./x-components.historyqueriesgetters.historyqueries.md) including only the queries with results at the moment they were requested. |
|
|
20
21
|
| [normalizedQuery](./x-components.historyqueriesgetters.normalizedquery.md) | string | The normalized module's query. |
|
|
21
22
|
| [sessionHistoryQueries](./x-components.historyqueriesgetters.sessionhistoryqueries.md) | HistoryQuery\[\] | A list of the queries that have been made in the last period of time specified by [HistoryQueriesConfig.sessionTTLInMs](./x-components.historyqueriesconfig.sessionttlinms.md)<!-- -->. |
|
|
22
23
|
| [storageKey](./x-components.historyqueriesgetters.storagekey.md) | string | The key for saving the [HistoryQueriesState.historyQueries](./x-components.historyqueriesstate.historyqueries.md) in the browser storage. |
|
|
@@ -598,6 +598,7 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
598
598
|
| [TrashOpenIcon](./x-components.trashopenicon.md) | |
|
|
599
599
|
| [TrendingIcon](./x-components.trendingicon.md) | |
|
|
600
600
|
| [TrendingTinyIcon](./x-components.trendingtinyicon.md) | |
|
|
601
|
+
| [updateHistoryQueriesWithSearchResponse](./x-components.updatehistoryquerieswithsearchresponse.md) | Updates the history queries with the relevant info included in a search response. |
|
|
601
602
|
| [urlXModule](./x-components.urlxmodule.md) | URL [XModule](./x-components.xmodule.md) implementation. This module is auto-registered as soon as you import any component from the <code>url</code> entry point. |
|
|
602
603
|
| [UserIcon](./x-components.usericon.md) | |
|
|
603
604
|
| [xPlugin](./x-components.xplugin.md) | Vue plugin that modifies each component instance, extending them with the [X Component API](./x-components.xcomponentapi.md)<!-- -->. |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [updateHistoryQueriesWithSearchResponse](./x-components.updatehistoryquerieswithsearchresponse.md)
|
|
4
|
+
|
|
5
|
+
## updateHistoryQueriesWithSearchResponse variable
|
|
6
|
+
|
|
7
|
+
Updates the history queries with the relevant info included in a search response.
|
|
8
|
+
|
|
9
|
+
<b>Signature:</b>
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
updateHistoryQueriesWithSearchResponse: import("../..").Wire<import("../search").InternalSearchResponse>
|
|
13
|
+
```
|
package/history-queries/index.js
CHANGED
|
@@ -14,5 +14,5 @@ export { HistoryQueriesGetter, historyQueries } from '../js/x-modules/history-qu
|
|
|
14
14
|
export { sessionHistoryQueries } from '../js/x-modules/history-queries/store/getters/session-history-queries.getter.js';
|
|
15
15
|
export { storageKey } from '../js/x-modules/history-queries/store/getters/storage-key.getter.js';
|
|
16
16
|
export { historyQueriesXStoreModule } from '../js/x-modules/history-queries/store/module.js';
|
|
17
|
-
export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery } from '../js/x-modules/history-queries/wiring.js';
|
|
17
|
+
export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, updateHistoryQueriesWithSearchResponse } from '../js/x-modules/history-queries/wiring.js';
|
|
18
18
|
export { historyQueriesXModule } from '../js/x-modules/history-queries/x-module.js';
|
package/js/index.js
CHANGED
|
@@ -232,7 +232,7 @@ export { HistoryQueriesGetter, historyQueries } from './x-modules/history-querie
|
|
|
232
232
|
export { sessionHistoryQueries } from './x-modules/history-queries/store/getters/session-history-queries.getter.js';
|
|
233
233
|
export { storageKey } from './x-modules/history-queries/store/getters/storage-key.getter.js';
|
|
234
234
|
export { historyQueriesXStoreModule } from './x-modules/history-queries/store/module.js';
|
|
235
|
-
export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery } from './x-modules/history-queries/wiring.js';
|
|
235
|
+
export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, updateHistoryQueriesWithSearchResponse } from './x-modules/history-queries/wiring.js';
|
|
236
236
|
export { historyQueriesXModule } from './x-modules/history-queries/x-module.js';
|
|
237
237
|
export { default as IdentifierResult } from './x-modules/identifier-results/components/identifier-result.vue.js';
|
|
238
238
|
export { default as IdentifierResults } from './x-modules/identifier-results/components/identifier-results.vue.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-queries.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-bind=\"$attrs\"\n :suggestions=\"historyQueries\"\n class=\"x-history-queries\"\n data-test=\"history-queries\"\n >\n <template #default=\"props\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query item\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion\" v-bind=\"{ ...props }\">\n <HistoryQuery\n :suggestion=\"props.suggestion\"\n data-test=\"history-query-item\"\n class=\"x-history-queries__item\"\n >\n <template #default=\"{ queryHTML }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n @binding {string} queryHTML - Suggestion's query with the matching part inside a span tag\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-content\" v-bind=\"{ ...props, queryHTML }\" />\n </template>\n <template #remove-button-content=\"{ ...props }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query remove button content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-remove-content\" v-bind=\"{ ...props }\" />\n </template>\n </HistoryQuery>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component } 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 { historyQueriesXModule } from '../x-module';\n import HistoryQuery from './history-query.vue';\n\n /**\n * This component renders a list of suggestions coming from the user queries history.\n * Allows the user to select one of them, emitting the needed events. A history query is just\n * another type of suggestion that contains a query that the user has made in the past.\n *\n * @public\n */\n @Component({\n components: { BaseSuggestions, HistoryQuery },\n mixins: [xComponentMixin(historyQueriesXModule)]\n })\n export default class HistoryQueries extends Vue {\n /**\n * The filtered list of history queries.\n *\n * @internal\n */\n @Getter('historyQueries', '
|
|
1
|
+
{"version":3,"file":"history-queries.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-bind=\"$attrs\"\n :suggestions=\"historyQueries\"\n class=\"x-history-queries\"\n data-test=\"history-queries\"\n >\n <template #default=\"props\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query item\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion\" v-bind=\"{ ...props }\">\n <HistoryQuery\n :suggestion=\"props.suggestion\"\n data-test=\"history-query-item\"\n class=\"x-history-queries__item\"\n >\n <template #default=\"{ queryHTML }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n @binding {string} queryHTML - Suggestion's query with the matching part inside a span tag\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-content\" v-bind=\"{ ...props, queryHTML }\" />\n </template>\n <template #remove-button-content=\"{ ...props }\">\n <!-- eslint-disable max-len -->\n <!--\n @slot History Query remove button content\n @binding {Object} v-bind - History Query suggestion attributes:<br /> - **suggestion** <code>Suggestion</code> - History Query suggestion data<br /> - **index** <code>number</code> - History Query suggestion index\n -->\n <!-- eslint-enable max-len -->\n <slot name=\"suggestion-remove-content\" v-bind=\"{ ...props }\" />\n </template>\n </HistoryQuery>\n </slot>\n </template>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\n import Vue from 'vue';\n import { Component } 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 { historyQueriesXModule } from '../x-module';\n import HistoryQuery from './history-query.vue';\n\n /**\n * This component renders a list of suggestions coming from the user queries history.\n * Allows the user to select one of them, emitting the needed events. A history query is just\n * another type of suggestion that contains a query that the user has made in the past.\n *\n * @public\n */\n @Component({\n components: { BaseSuggestions, HistoryQuery },\n mixins: [xComponentMixin(historyQueriesXModule)]\n })\n export default class HistoryQueries extends Vue {\n /**\n * The filtered list of history queries.\n *\n * @internal\n */\n @Getter('historyQueries', 'historyQueriesWithResults')\n public historyQueries!: HistoryQueryModel[];\n }\n</script>\n\n<!--eslint-disable max-len -->\n<docs lang=\"mdx\">\n## Inherited props\n\nThis component inherits the [`BaseSuggestions`](../base-components/x-components.base-suggestions.md)\nprops.\n\n| Name | Description | Type | Default |\n| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- | --------------- |\n| <code>animation</code> | Animation component that will be used to animate the suggestions. | <code>Vue</code> | <code>ul</code> |\n| <code>maxItemsToRender</code> | Maximum number of history queries to show. It should be a lower number than the<br />{@link HistoryQueriesConfig.maxItemsToStore}. If it is not provided, it will show<br />all the stored `HistoryQueries`. | <code>number</code> | <code></code> |\n\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nHere you have a basic example of how the HistoryQueries is rendered.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the history queries have been limited to render a maximum of 10 queries (by default\nit is 5).\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries :maxItemsToRender=\"10\" />\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries :animation=\"'FadeAndSlide'\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-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: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with suggestion slot\n\nIn this example, the [`HistoryQuery`](./x-components.history-query.md) component is passed in the\n`suggestion` slot (although any other component could potentially be passed).\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion=\"{ suggestion }\">\n <HistoryQuery :suggestion=\"suggestion\" />\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries, HistoryQuery } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n HistoryQuery\n }\n };\n</script>\n```\n\n### Play with suggestion-content slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, an HTML span tag for the text are also\npassed.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion-content=\"{ suggestion }\">\n <span>{{ suggestion.query }}</span>\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries\n }\n };\n</script>\n```\n\n### Play with suggestion-content-remove slot\n\nTo continue the previous example, the [`HistoryQuery`](./x-components.history-query.md) component is\npassed in the `suggestion-content` slot, but in addition, a cross icon is also passed to change the\nicon to remove the history query.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <HistoryQueries #suggestion-remove-content=\"{ suggestion }\">\n <CrossIcon />\n </HistoryQueries>\n </div>\n</template>\n\n<script>\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries } from '@empathyco/x-components/history-queries';\n import { CrossIcon } from '@empathyco/x-components';\n\n export default {\n name: 'HistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n CrossIcon\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/js/x-modules/history-queries/components/history-queries.vue_rollup-plugin-vue_script.vue.js
CHANGED
|
@@ -17,7 +17,7 @@ import __vue_component__$1 from './history-query.vue.js';
|
|
|
17
17
|
let HistoryQueries = class HistoryQueries extends Vue {
|
|
18
18
|
};
|
|
19
19
|
__decorate([
|
|
20
|
-
Getter('historyQueries', '
|
|
20
|
+
Getter('historyQueries', 'historyQueriesWithResults')
|
|
21
21
|
], HistoryQueries.prototype, "historyQueries", void 0);
|
|
22
22
|
HistoryQueries = __decorate([
|
|
23
23
|
Component({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-queries.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-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\n\n\n\n\n\n\n\n\n\nimport { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component } 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 { historyQueriesXModule } from '../x-module';\nimport HistoryQuery from './history-query.vue';\n\n/**\n * This component renders a list of suggestions coming from the user queries history.\n * Allows the user to select one of them, emitting the needed events. A history query is just\n * another type of suggestion that contains a query that the user has made in the past.\n *\n * @public\n */\n@Component({\n components: { BaseSuggestions, HistoryQuery },\n mixins: [xComponentMixin(historyQueriesXModule)]\n})\nexport default class HistoryQueries extends Vue {\n /**\n * The filtered list of history queries.\n *\n * @internal\n */\n @Getter('historyQueries', '
|
|
1
|
+
{"version":3,"file":"history-queries.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/history-queries/components/history-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\n\n\n\n\n\n\n\n\n\nimport { HistoryQuery as HistoryQueryModel } from '@empathyco/x-types';\nimport Vue from 'vue';\nimport { Component } 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 { historyQueriesXModule } from '../x-module';\nimport HistoryQuery from './history-query.vue';\n\n/**\n * This component renders a list of suggestions coming from the user queries history.\n * Allows the user to select one of them, emitting the needed events. A history query is just\n * another type of suggestion that contains a query that the user has made in the past.\n *\n * @public\n */\n@Component({\n components: { BaseSuggestions, HistoryQuery },\n mixins: [xComponentMixin(historyQueriesXModule)]\n})\nexport default class HistoryQueries extends Vue {\n /**\n * The filtered list of history queries.\n *\n * @internal\n */\n @Getter('historyQueries', 'historyQueriesWithResults')\n public historyQueries!: HistoryQueryModel[];\n}\n"],"names":["BaseSuggestions","HistoryQuery"],"mappings":";;;;;;;;;AAuDA;;;;;;;AAWA,IAAqB,cAAc,GAAnC,MAAqB,cAAe,SAAQ,GAAG;CAQ9C,CAAA;AADC;IADC,MAAM,CAAC,gBAAgB,EAAE,2BAA2B,CAAC;sDACV;AAPzB,cAAc;IAJlC,SAAS,CAAC;QACT,UAAU,EAAE,mBAAEA,iBAAe,gBAAEC,mBAAY,EAAE;QAC7C,MAAM,EAAE,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;KACjD,CAAC;GACmB,cAAc,CAQlC;aARoB,cAAc;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default implementation for the
|
|
3
|
+
* {@link HistoryQueriesActions.updateHistoryQueriesWithSearchResponse} action.
|
|
4
|
+
*
|
|
5
|
+
* The matching history query will only be updated on the following scenarios:
|
|
6
|
+
* 1. If it is part of a previous session, not the current one.
|
|
7
|
+
* 2. If its total results count has not been registered yet.
|
|
8
|
+
* 3. If its total results count registered is less than the one specified on the search response,
|
|
9
|
+
* meaning that the previous update was part of a filtered request.
|
|
10
|
+
*
|
|
11
|
+
* @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
|
|
12
|
+
* provided by Vuex.
|
|
13
|
+
*
|
|
14
|
+
* @param searchResponse - The search response to update history queries with.
|
|
15
|
+
*
|
|
16
|
+
* @returns A `void` promise that resolves when the history query finishes updating.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
// eslint-disable-next-line max-len
|
|
21
|
+
const updateHistoryQueriesWithSearchResponse = ({ state, dispatch }, searchResponse) => {
|
|
22
|
+
if (searchResponse.status === 'success') {
|
|
23
|
+
const indexOfHistoryQuery = state.historyQueries.findIndex(({ query }) => query === searchResponse.request.query);
|
|
24
|
+
if (indexOfHistoryQuery >= 0) {
|
|
25
|
+
const historyQuery = state.historyQueries[indexOfHistoryQuery];
|
|
26
|
+
const isCurrentSessionHistoryQuery = historyQuery.timestamp > state.sessionTimeStampInMs;
|
|
27
|
+
if (!isCurrentSessionHistoryQuery ||
|
|
28
|
+
historyQuery.totalResults == null ||
|
|
29
|
+
historyQuery.totalResults < searchResponse.totalResults) {
|
|
30
|
+
const newHistoryQueries = state.historyQueries.slice();
|
|
31
|
+
newHistoryQueries[indexOfHistoryQuery] = {
|
|
32
|
+
...historyQuery,
|
|
33
|
+
totalResults: searchResponse.totalResults
|
|
34
|
+
};
|
|
35
|
+
return dispatch('setHistoryQueries', newHistoryQueries);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { updateHistoryQueriesWithSearchResponse };
|
|
42
|
+
//# sourceMappingURL=update-history-queries-with-search-response.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-history-queries-with-search-response.action.js","sources":["../../../../../../src/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.ts"],"sourcesContent":["import { HistoryQueriesXStoreModule } from '../types';\n\n/**\n * Default implementation for the\n * {@link HistoryQueriesActions.updateHistoryQueriesWithSearchResponse} action.\n *\n * The matching history query will only be updated on the following scenarios:\n * 1. If it is part of a previous session, not the current one.\n * 2. If its total results count has not been registered yet.\n * 3. If its total results count registered is less than the one specified on the search response,\n * meaning that the previous update was part of a filtered request.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n *\n * @param searchResponse - The search response to update history queries with.\n *\n * @returns A `void` promise that resolves when the history query finishes updating.\n *\n * @public\n */\n// eslint-disable-next-line max-len\nexport const updateHistoryQueriesWithSearchResponse: HistoryQueriesXStoreModule['actions']['updateHistoryQueriesWithSearchResponse'] =\n ({ state, dispatch }, searchResponse) => {\n if (searchResponse.status === 'success') {\n const indexOfHistoryQuery = state.historyQueries.findIndex(\n ({ query }) => query === searchResponse.request.query\n );\n if (indexOfHistoryQuery >= 0) {\n const historyQuery = state.historyQueries[indexOfHistoryQuery];\n const isCurrentSessionHistoryQuery = historyQuery.timestamp > state.sessionTimeStampInMs;\n if (\n !isCurrentSessionHistoryQuery ||\n historyQuery.totalResults == null ||\n historyQuery.totalResults < searchResponse.totalResults\n ) {\n const newHistoryQueries = state.historyQueries.slice();\n newHistoryQueries[indexOfHistoryQuery] = {\n ...historyQuery,\n totalResults: searchResponse.totalResults\n };\n return dispatch('setHistoryQueries', newHistoryQueries);\n }\n }\n }\n };\n"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;AAmBA;MACa,sCAAsC,GACjD,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,cAAc;IAClC,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,EAAE;QACvC,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CACxD,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,KAAK,cAAc,CAAC,OAAO,CAAC,KAAK,CACtD,CAAC;QACF,IAAI,mBAAmB,IAAI,CAAC,EAAE;YAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;YAC/D,MAAM,4BAA4B,GAAG,YAAY,CAAC,SAAS,GAAG,KAAK,CAAC,oBAAoB,CAAC;YACzF,IACE,CAAC,4BAA4B;gBAC7B,YAAY,CAAC,YAAY,IAAI,IAAI;gBACjC,YAAY,CAAC,YAAY,GAAG,cAAc,CAAC,YAAY,EACvD;gBACA,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;gBACvD,iBAAiB,CAAC,mBAAmB,CAAC,GAAG;oBACvC,GAAG,YAAY;oBACf,YAAY,EAAE,cAAc,CAAC,YAAY;iBAC1C,CAAC;gBACF,OAAO,QAAQ,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;aACzD;SACF;KACF;AACH;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default implementation for the {@link HistoryQueriesGetters.historyQueriesWithResults} getter.
|
|
3
|
+
*
|
|
4
|
+
* @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the history
|
|
5
|
+
* queries module.
|
|
6
|
+
*
|
|
7
|
+
* @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the
|
|
8
|
+
* history queries module.
|
|
9
|
+
*
|
|
10
|
+
* @returns The history queries that have results at the moment they were requested.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
// eslint-disable-next-line max-len
|
|
15
|
+
const historyQueriesWithResults = (state, { historyQueries }) => historyQueries.filter(({ totalResults }) => !!totalResults);
|
|
16
|
+
|
|
17
|
+
export { historyQueriesWithResults };
|
|
18
|
+
//# sourceMappingURL=history-queries-with-results.getter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-queries-with-results.getter.js","sources":["../../../../../../src/x-modules/history-queries/store/getters/history-queries-with-results.getter.ts"],"sourcesContent":["import { HistoryQueriesXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link HistoryQueriesGetters.historyQueriesWithResults} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the history\n * queries module.\n *\n * @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the\n * history queries module.\n *\n * @returns The history queries that have results at the moment they were requested.\n *\n * @public\n */\n// eslint-disable-next-line max-len\nexport const historyQueriesWithResults: HistoryQueriesXStoreModule['getters']['historyQueriesWithResults'] =\n (state, { historyQueries }) => historyQueries.filter(({ totalResults }) => !!totalResults);\n"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;AAaA;MACa,yBAAyB,GACpC,CAAC,KAAK,EAAE,EAAE,cAAc,EAAE,KAAK,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,YAAY;;;;"}
|
|
@@ -7,9 +7,11 @@ import { removeFromHistory } from './actions/remove-query-from-history.action.js
|
|
|
7
7
|
import { setHistoryQueries } from './actions/set-history-queries.action.js';
|
|
8
8
|
import { setUrlParams } from './actions/set-url-params.action.js';
|
|
9
9
|
import { toggleHistoryQueries } from './actions/toggle-history-queries.action.js';
|
|
10
|
+
import { updateHistoryQueriesWithSearchResponse } from './actions/update-history-queries-with-search-response.action.js';
|
|
10
11
|
import { HISTORY_QUERIES_ENABLED_KEY } from './constants.js';
|
|
11
12
|
import { historyQueries } from './getters/history-queries.getter.js';
|
|
12
13
|
import { normalizedQuery } from './getters/normalized-query.getter.js';
|
|
14
|
+
import { historyQueriesWithResults } from './getters/history-queries-with-results.getter.js';
|
|
13
15
|
import { sessionHistoryQueries } from './getters/session-history-queries.getter.js';
|
|
14
16
|
import { storageKey } from './getters/storage-key.getter.js';
|
|
15
17
|
|
|
@@ -34,6 +36,7 @@ const historyQueriesXStoreModule = {
|
|
|
34
36
|
getters: {
|
|
35
37
|
historyQueries,
|
|
36
38
|
normalizedQuery,
|
|
39
|
+
historyQueriesWithResults,
|
|
37
40
|
sessionHistoryQueries,
|
|
38
41
|
storageKey
|
|
39
42
|
},
|
|
@@ -56,7 +59,8 @@ const historyQueriesXStoreModule = {
|
|
|
56
59
|
removeFromHistory,
|
|
57
60
|
setHistoryQueries,
|
|
58
61
|
setUrlParams,
|
|
59
|
-
toggleHistoryQueries
|
|
62
|
+
toggleHistoryQueries,
|
|
63
|
+
updateHistoryQueriesWithSearchResponse
|
|
60
64
|
}
|
|
61
65
|
};
|
|
62
66
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/history-queries/store/module.ts"],"sourcesContent":["import { setQuery } from '../../../store/utils/query.utils';\nimport { localStorageService } from '../../../utils/storage';\nimport { addQueryToHistory } from './actions/add-query-to-history.action';\n// eslint-disable-next-line max-len\nimport { loadHistoryQueriesFromBrowserStorage } from './actions/load-history-queries-from-browser-storage.action';\nimport { refreshSession } from './actions/refresh-session.action';\nimport { removeFromHistory } from './actions/remove-query-from-history.action';\nimport { setHistoryQueries } from './actions/set-history-queries.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { toggleHistoryQueries } from './actions/toggle-history-queries.action';\nimport { HISTORY_QUERIES_ENABLED_KEY } from './constants';\nimport { historyQueries } from './getters/history-queries.getter';\nimport { normalizedQuery } from './getters/normalized-query.getter';\nimport { sessionHistoryQueries } from './getters/session-history-queries.getter';\nimport { storageKey } from './getters/storage-key.getter';\nimport { HistoryQueriesXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the history-queries module.\n *\n * @internal\n */\nexport const historyQueriesXStoreModule: HistoryQueriesXStoreModule = {\n state: () => ({\n config: {\n debounceInMs: 150,\n maxItemsToStore: 50,\n hideIfEqualsQuery: true,\n sessionTTLInMs: 30 * 60 * 1000\n },\n query: '',\n historyQueries: [],\n sessionTimeStampInMs: Date.now(),\n isEnabled: localStorageService.getItem<boolean>(HISTORY_QUERIES_ENABLED_KEY) ?? true\n }),\n getters: {\n historyQueries,\n normalizedQuery,\n sessionHistoryQueries,\n storageKey\n },\n mutations: {\n setHistoryQueries(state, historyQueries) {\n state.historyQueries = historyQueries;\n },\n setSessionTimeStamp(state, sessionTimeStamp) {\n state.sessionTimeStampInMs = sessionTimeStamp;\n },\n setQuery,\n setIsEnabled(state, isEnabled) {\n state.isEnabled = isEnabled;\n }\n },\n actions: {\n addQueryToHistory,\n loadHistoryQueriesFromBrowserStorage,\n refreshSession,\n removeFromHistory,\n setHistoryQueries,\n setUrlParams,\n toggleHistoryQueries\n }\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/history-queries/store/module.ts"],"sourcesContent":["import { setQuery } from '../../../store/utils/query.utils';\nimport { localStorageService } from '../../../utils/storage';\nimport { addQueryToHistory } from './actions/add-query-to-history.action';\n// eslint-disable-next-line max-len\nimport { loadHistoryQueriesFromBrowserStorage } from './actions/load-history-queries-from-browser-storage.action';\nimport { refreshSession } from './actions/refresh-session.action';\nimport { removeFromHistory } from './actions/remove-query-from-history.action';\nimport { setHistoryQueries } from './actions/set-history-queries.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { toggleHistoryQueries } from './actions/toggle-history-queries.action';\n// eslint-disable-next-line max-len\nimport { updateHistoryQueriesWithSearchResponse } from './actions/update-history-queries-with-search-response.action';\nimport { HISTORY_QUERIES_ENABLED_KEY } from './constants';\nimport { historyQueries } from './getters/history-queries.getter';\nimport { normalizedQuery } from './getters/normalized-query.getter';\nimport { historyQueriesWithResults } from './getters/history-queries-with-results.getter';\nimport { sessionHistoryQueries } from './getters/session-history-queries.getter';\nimport { storageKey } from './getters/storage-key.getter';\nimport { HistoryQueriesXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the history-queries module.\n *\n * @internal\n */\nexport const historyQueriesXStoreModule: HistoryQueriesXStoreModule = {\n state: () => ({\n config: {\n debounceInMs: 150,\n maxItemsToStore: 50,\n hideIfEqualsQuery: true,\n sessionTTLInMs: 30 * 60 * 1000\n },\n query: '',\n historyQueries: [],\n sessionTimeStampInMs: Date.now(),\n isEnabled: localStorageService.getItem<boolean>(HISTORY_QUERIES_ENABLED_KEY) ?? true\n }),\n getters: {\n historyQueries,\n normalizedQuery,\n historyQueriesWithResults,\n sessionHistoryQueries,\n storageKey\n },\n mutations: {\n setHistoryQueries(state, historyQueries) {\n state.historyQueries = historyQueries;\n },\n setSessionTimeStamp(state, sessionTimeStamp) {\n state.sessionTimeStampInMs = sessionTimeStamp;\n },\n setQuery,\n setIsEnabled(state, isEnabled) {\n state.isEnabled = isEnabled;\n }\n },\n actions: {\n addQueryToHistory,\n loadHistoryQueriesFromBrowserStorage,\n refreshSession,\n removeFromHistory,\n setHistoryQueries,\n setUrlParams,\n toggleHistoryQueries,\n updateHistoryQueriesWithSearchResponse\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAoBA;;;;;MAKa,0BAA0B,GAA+B;IACpE,KAAK,EAAE,OAAO;QACZ,MAAM,EAAE;YACN,YAAY,EAAE,GAAG;YACjB,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,IAAI;YACvB,cAAc,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;SAC/B;QACD,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,EAAE;QAClB,oBAAoB,EAAE,IAAI,CAAC,GAAG,EAAE;QAChC,SAAS,EAAE,mBAAmB,CAAC,OAAO,CAAU,2BAA2B,CAAC,IAAI,IAAI;KACrF,CAAC;IACF,OAAO,EAAE;QACP,cAAc;QACd,eAAe;QACf,yBAAyB;QACzB,qBAAqB;QACrB,UAAU;KACX;IACD,SAAS,EAAE;QACT,iBAAiB,CAAC,KAAK,EAAE,cAAc;YACrC,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;SACvC;QACD,mBAAmB,CAAC,KAAK,EAAE,gBAAgB;YACzC,KAAK,CAAC,oBAAoB,GAAG,gBAAgB,CAAC;SAC/C;QACD,QAAQ;QACR,YAAY,CAAC,KAAK,EAAE,SAAS;YAC3B,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;SAC7B;KACF;IACD,OAAO,EAAE;QACP,iBAAiB;QACjB,oCAAoC;QACpC,cAAc;QACd,iBAAiB;QACjB,iBAAiB;QACjB,YAAY;QACZ,oBAAoB;QACpB,sCAAsC;KACvC;;;;;"}
|
|
@@ -88,6 +88,12 @@ const setHistoryQueriesEnabled = wireDispatch('toggleHistoryQueries', true);
|
|
|
88
88
|
* @public
|
|
89
89
|
*/
|
|
90
90
|
const setHistoryQueriesDisabled = wireDispatch('toggleHistoryQueries', false);
|
|
91
|
+
/**
|
|
92
|
+
* Updates the history queries with the relevant info included in a search response.
|
|
93
|
+
*
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
const updateHistoryQueriesWithSearchResponse = wireDispatch('updateHistoryQueriesWithSearchResponse');
|
|
91
97
|
/**
|
|
92
98
|
* Debounce function for the module.
|
|
93
99
|
*/
|
|
@@ -134,8 +140,11 @@ const historyQueriesWiring = createWiring({
|
|
|
134
140
|
},
|
|
135
141
|
UserClickedOutOfMainModal: {
|
|
136
142
|
clearHistoryQueriesQuery
|
|
143
|
+
},
|
|
144
|
+
SearchResponseProvided: {
|
|
145
|
+
updateHistoryQueriesWithSearchResponse
|
|
137
146
|
}
|
|
138
147
|
});
|
|
139
148
|
|
|
140
|
-
export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery };
|
|
149
|
+
export { addQueryToHistoryQueries, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, updateHistoryQueriesWithSearchResponse };
|
|
141
150
|
//# sourceMappingURL=wiring.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators';\nimport { NamespacedWireCommit, NamespacedWireDispatch } from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `historyQueries` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'historyQueries';\n/**\n * WireCommit for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n/**\n * WireDispatch for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName);\n/**\n * WireDispatchWithoutPayload for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Saves a new query into the history queries.\n *\n * @public\n */\nexport const addQueryToHistoryQueries = wireDispatch('addQueryToHistory');\n\n/**\n * Sets the query of the history queries module. Used for searching into the history queries.\n *\n * @public\n */\nexport const setHistoryQueriesQuery = wireCommit('setQuery');\n\n/**\n * Sets the history queries state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the query of the history queries module to an empty string.\n *\n * @public\n */\nexport const clearHistoryQueriesQuery = wireCommit('setQuery', '');\n\n/**\n * Triggers a session refresh, extending its validity for the time configured in the\n * {@link HistoryQueriesConfig.sessionTTLInMs}.\n *\n * @public\n */\nexport const refreshHistoryQueriesSession = wireDispatchWithoutPayload('refreshSession');\n\n/**\n * Loads the history queries from the browser storage, saving them to the\n * {@link HistoryQueriesState.historyQueries}.\n *\n * @public\n */\nexport const loadHistoryQueriesFromBrowserStorageWire = wireDispatchWithoutPayload(\n 'loadHistoryQueriesFromBrowserStorage'\n);\n\n/**\n * Clears the history queries.\n *\n * @public\n */\nexport const clearHistoryQueries = wireDispatch('setHistoryQueries', []);\n\n/**\n * Removes a single history query from the history queries.\n *\n * @public\n */\nexport const removeHistoryQuery = wireDispatch('removeFromHistory');\n\n/**\n * Enables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesEnabled = wireDispatch('toggleHistoryQueries', true);\n\n/**\n * Disables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesDisabled = wireDispatch('toggleHistoryQueries', false);\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName);\n\n/**\n * Default wiring for the {@link HistoryQueries} module.\n *\n * @internal\n */\nexport const historyQueriesWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams\n },\n HistoryQueriesQueryChanged: {\n refreshHistoryQueriesSession\n },\n HistoryQueriesStorageKeyChanged: {\n loadHistoryQueriesFromBrowserStorageWire\n },\n UserClearedQuery: {\n clearHistoryQueriesQuery\n },\n UserAcceptedAQuery: {\n setHistoryQueriesQuery,\n addQueryToHistoryQueries\n },\n UserIsTypingAQuery: {\n setHistoryQueriesQueryDebounce: moduleDebounce(\n setHistoryQueriesQuery,\n ({ state }) => state.config.debounceInMs,\n { cancelOn: 'UserAcceptedAQuery' }\n )\n },\n UserPressedClearHistoryQueries: {\n clearHistoryQueries\n },\n UserPressedRemoveHistoryQuery: {\n removeHistoryQuery\n },\n UserClickedEnableHistoryQueries: {\n setHistoryQueriesEnabled\n },\n UserClickedConfirmDisableHistoryQueries: {\n setHistoryQueriesDisabled\n },\n UserClickedCloseX: {\n clearHistoryQueriesQuery\n },\n UserClickedOutOfMainModal: {\n clearHistoryQueriesQuery\n }\n});\n"],"names":[],"mappings":";;;;AASA;;;;;AAKA,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC;;;;;AAKA,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC7F;;;;;AAKA,MAAM,YAAY,GAA8C,sBAAsB,CAAC,UAAU,CAAC,CAAC;AACnG;;;;;AAKA,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;;;;MAKa,wBAAwB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AAE1E;;;;;MAKa,sBAAsB,GAAG,UAAU,CAAC,UAAU,EAAE;AAE7D;;;;;AAKA,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;AAElD;;;;;MAKa,wBAAwB,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,EAAE;AAEnE;;;;;;MAMa,4BAA4B,GAAG,0BAA0B,CAAC,gBAAgB,EAAE;AAEzF;;;;;;MAMa,wCAAwC,GAAG,0BAA0B,CAChF,sCAAsC,EACtC;AAEF;;;;;MAKa,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,EAAE,EAAE,EAAE;AAEzE;;;;;MAKa,kBAAkB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AAEpE;;;;;MAKa,wBAAwB,GAAG,YAAY,CAAC,sBAAsB,EAAE,IAAI,EAAE;AAEnF;;;;;MAKa,yBAAyB,GAAG,YAAY,CAAC,sBAAsB,EAAE,KAAK,EAAE;AAErF;;;AAGA,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAEtD;;;;;MAKa,oBAAoB,GAAG,YAAY,CAAC;IAC/C,mBAAmB,EAAE;QACnB,YAAY;KACb;IACD,0BAA0B,EAAE;QAC1B,4BAA4B;KAC7B;IACD,+BAA+B,EAAE;QAC/B,wCAAwC;KACzC;IACD,gBAAgB,EAAE;QAChB,wBAAwB;KACzB;IACD,kBAAkB,EAAE;QAClB,sBAAsB;QACtB,wBAAwB;KACzB;IACD,kBAAkB,EAAE;QAClB,8BAA8B,EAAE,cAAc,CAC5C,sBAAsB,EACtB,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,YAAY,EACxC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CACnC;KACF;IACD,8BAA8B,EAAE;QAC9B,mBAAmB;KACpB;IACD,6BAA6B,EAAE;QAC7B,kBAAkB;KACnB;IACD,+BAA+B,EAAE;QAC/B,wBAAwB;KACzB;IACD,uCAAuC,EAAE;QACvC,yBAAyB;KAC1B;IACD,iBAAiB,EAAE;QACjB,wBAAwB;KACzB;IACD,yBAAyB,EAAE;QACzB,wBAAwB;KACzB;CACF;;;;"}
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators';\nimport { NamespacedWireCommit, NamespacedWireDispatch } from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `historyQueries` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'historyQueries';\n/**\n * WireCommit for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n/**\n * WireDispatch for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName);\n/**\n * WireDispatchWithoutPayload for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Saves a new query into the history queries.\n *\n * @public\n */\nexport const addQueryToHistoryQueries = wireDispatch('addQueryToHistory');\n\n/**\n * Sets the query of the history queries module. Used for searching into the history queries.\n *\n * @public\n */\nexport const setHistoryQueriesQuery = wireCommit('setQuery');\n\n/**\n * Sets the history queries state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the query of the history queries module to an empty string.\n *\n * @public\n */\nexport const clearHistoryQueriesQuery = wireCommit('setQuery', '');\n\n/**\n * Triggers a session refresh, extending its validity for the time configured in the\n * {@link HistoryQueriesConfig.sessionTTLInMs}.\n *\n * @public\n */\nexport const refreshHistoryQueriesSession = wireDispatchWithoutPayload('refreshSession');\n\n/**\n * Loads the history queries from the browser storage, saving them to the\n * {@link HistoryQueriesState.historyQueries}.\n *\n * @public\n */\nexport const loadHistoryQueriesFromBrowserStorageWire = wireDispatchWithoutPayload(\n 'loadHistoryQueriesFromBrowserStorage'\n);\n\n/**\n * Clears the history queries.\n *\n * @public\n */\nexport const clearHistoryQueries = wireDispatch('setHistoryQueries', []);\n\n/**\n * Removes a single history query from the history queries.\n *\n * @public\n */\nexport const removeHistoryQuery = wireDispatch('removeFromHistory');\n\n/**\n * Enables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesEnabled = wireDispatch('toggleHistoryQueries', true);\n\n/**\n * Disables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesDisabled = wireDispatch('toggleHistoryQueries', false);\n\n/**\n * Updates the history queries with the relevant info included in a search response.\n *\n * @public\n */\nexport const updateHistoryQueriesWithSearchResponse = wireDispatch(\n 'updateHistoryQueriesWithSearchResponse'\n);\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName);\n\n/**\n * Default wiring for the {@link HistoryQueries} module.\n *\n * @internal\n */\nexport const historyQueriesWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams\n },\n HistoryQueriesQueryChanged: {\n refreshHistoryQueriesSession\n },\n HistoryQueriesStorageKeyChanged: {\n loadHistoryQueriesFromBrowserStorageWire\n },\n UserClearedQuery: {\n clearHistoryQueriesQuery\n },\n UserAcceptedAQuery: {\n setHistoryQueriesQuery,\n addQueryToHistoryQueries\n },\n UserIsTypingAQuery: {\n setHistoryQueriesQueryDebounce: moduleDebounce(\n setHistoryQueriesQuery,\n ({ state }) => state.config.debounceInMs,\n { cancelOn: 'UserAcceptedAQuery' }\n )\n },\n UserPressedClearHistoryQueries: {\n clearHistoryQueries\n },\n UserPressedRemoveHistoryQuery: {\n removeHistoryQuery\n },\n UserClickedEnableHistoryQueries: {\n setHistoryQueriesEnabled\n },\n UserClickedConfirmDisableHistoryQueries: {\n setHistoryQueriesDisabled\n },\n UserClickedCloseX: {\n clearHistoryQueriesQuery\n },\n UserClickedOutOfMainModal: {\n clearHistoryQueriesQuery\n },\n SearchResponseProvided: {\n updateHistoryQueriesWithSearchResponse\n }\n});\n"],"names":[],"mappings":";;;;AASA;;;;;AAKA,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC;;;;;AAKA,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC7F;;;;;AAKA,MAAM,YAAY,GAA8C,sBAAsB,CAAC,UAAU,CAAC,CAAC;AACnG;;;;;AAKA,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;;;;MAKa,wBAAwB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AAE1E;;;;;MAKa,sBAAsB,GAAG,UAAU,CAAC,UAAU,EAAE;AAE7D;;;;;AAKA,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;AAElD;;;;;MAKa,wBAAwB,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,EAAE;AAEnE;;;;;;MAMa,4BAA4B,GAAG,0BAA0B,CAAC,gBAAgB,EAAE;AAEzF;;;;;;MAMa,wCAAwC,GAAG,0BAA0B,CAChF,sCAAsC,EACtC;AAEF;;;;;MAKa,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,EAAE,EAAE,EAAE;AAEzE;;;;;MAKa,kBAAkB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AAEpE;;;;;MAKa,wBAAwB,GAAG,YAAY,CAAC,sBAAsB,EAAE,IAAI,EAAE;AAEnF;;;;;MAKa,yBAAyB,GAAG,YAAY,CAAC,sBAAsB,EAAE,KAAK,EAAE;AAErF;;;;;MAKa,sCAAsC,GAAG,YAAY,CAChE,wCAAwC,EACxC;AAEF;;;AAGA,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAEtD;;;;;MAKa,oBAAoB,GAAG,YAAY,CAAC;IAC/C,mBAAmB,EAAE;QACnB,YAAY;KACb;IACD,0BAA0B,EAAE;QAC1B,4BAA4B;KAC7B;IACD,+BAA+B,EAAE;QAC/B,wCAAwC;KACzC;IACD,gBAAgB,EAAE;QAChB,wBAAwB;KACzB;IACD,kBAAkB,EAAE;QAClB,sBAAsB;QACtB,wBAAwB;KACzB;IACD,kBAAkB,EAAE;QAClB,8BAA8B,EAAE,cAAc,CAC5C,sBAAsB,EACtB,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,YAAY,EACxC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CACnC;KACF;IACD,8BAA8B,EAAE;QAC9B,mBAAmB;KACpB;IACD,6BAA6B,EAAE;QAC7B,kBAAkB;KACnB;IACD,+BAA+B,EAAE;QAC/B,wBAAwB;KACzB;IACD,uCAAuC,EAAE;QACvC,yBAAyB;KAC1B;IACD,iBAAiB,EAAE;QACjB,wBAAwB;KACzB;IACD,yBAAyB,EAAE;QACzB,wBAAwB;KACzB;IACD,sBAAsB,EAAE;QACtB,sCAAsC;KACvC;CACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.240",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"access": "public",
|
|
136
136
|
"directory": "dist"
|
|
137
137
|
},
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "3fce04695e047232690f3cff8cb4e310ec7e6447"
|
|
139
139
|
}
|
|
@@ -20188,6 +20188,51 @@
|
|
|
20188
20188
|
}
|
|
20189
20189
|
],
|
|
20190
20190
|
"name": "toggleHistoryQueries"
|
|
20191
|
+
},
|
|
20192
|
+
{
|
|
20193
|
+
"kind": "MethodSignature",
|
|
20194
|
+
"canonicalReference": "@empathyco/x-components!HistoryQueriesActions#updateHistoryQueriesWithSearchResponse:member(1)",
|
|
20195
|
+
"docComment": "/**\n * Updates the history queries with the relevant info included in a search response.\n *\n * @param searchResponse - The search response to update history queries with.\n */\n",
|
|
20196
|
+
"excerptTokens": [
|
|
20197
|
+
{
|
|
20198
|
+
"kind": "Content",
|
|
20199
|
+
"text": "updateHistoryQueriesWithSearchResponse(searchResponse: "
|
|
20200
|
+
},
|
|
20201
|
+
{
|
|
20202
|
+
"kind": "Reference",
|
|
20203
|
+
"text": "InternalSearchResponse",
|
|
20204
|
+
"canonicalReference": "@empathyco/x-components!InternalSearchResponse:interface"
|
|
20205
|
+
},
|
|
20206
|
+
{
|
|
20207
|
+
"kind": "Content",
|
|
20208
|
+
"text": "): "
|
|
20209
|
+
},
|
|
20210
|
+
{
|
|
20211
|
+
"kind": "Content",
|
|
20212
|
+
"text": "void"
|
|
20213
|
+
},
|
|
20214
|
+
{
|
|
20215
|
+
"kind": "Content",
|
|
20216
|
+
"text": ";"
|
|
20217
|
+
}
|
|
20218
|
+
],
|
|
20219
|
+
"isOptional": false,
|
|
20220
|
+
"returnTypeTokenRange": {
|
|
20221
|
+
"startIndex": 3,
|
|
20222
|
+
"endIndex": 4
|
|
20223
|
+
},
|
|
20224
|
+
"releaseTag": "Public",
|
|
20225
|
+
"overloadIndex": 1,
|
|
20226
|
+
"parameters": [
|
|
20227
|
+
{
|
|
20228
|
+
"parameterName": "searchResponse",
|
|
20229
|
+
"parameterTypeTokenRange": {
|
|
20230
|
+
"startIndex": 1,
|
|
20231
|
+
"endIndex": 2
|
|
20232
|
+
}
|
|
20233
|
+
}
|
|
20234
|
+
],
|
|
20235
|
+
"name": "updateHistoryQueriesWithSearchResponse"
|
|
20191
20236
|
}
|
|
20192
20237
|
],
|
|
20193
20238
|
"extendsTokenRanges": []
|
|
@@ -20446,6 +20491,37 @@
|
|
|
20446
20491
|
"endIndex": 3
|
|
20447
20492
|
}
|
|
20448
20493
|
},
|
|
20494
|
+
{
|
|
20495
|
+
"kind": "PropertySignature",
|
|
20496
|
+
"canonicalReference": "@empathyco/x-components!HistoryQueriesGetters#historyQueriesWithResults:member",
|
|
20497
|
+
"docComment": "/**\n * A sub-set of the {@link HistoryQueriesGetters.historyQueries} including only the queries with results at the moment they were requested.\n */\n",
|
|
20498
|
+
"excerptTokens": [
|
|
20499
|
+
{
|
|
20500
|
+
"kind": "Content",
|
|
20501
|
+
"text": "historyQueriesWithResults: "
|
|
20502
|
+
},
|
|
20503
|
+
{
|
|
20504
|
+
"kind": "Reference",
|
|
20505
|
+
"text": "HistoryQuery",
|
|
20506
|
+
"canonicalReference": "@empathyco/x-components!HistoryQuery:interface"
|
|
20507
|
+
},
|
|
20508
|
+
{
|
|
20509
|
+
"kind": "Content",
|
|
20510
|
+
"text": "[]"
|
|
20511
|
+
},
|
|
20512
|
+
{
|
|
20513
|
+
"kind": "Content",
|
|
20514
|
+
"text": ";"
|
|
20515
|
+
}
|
|
20516
|
+
],
|
|
20517
|
+
"isOptional": false,
|
|
20518
|
+
"releaseTag": "Public",
|
|
20519
|
+
"name": "historyQueriesWithResults",
|
|
20520
|
+
"propertyTypeTokenRange": {
|
|
20521
|
+
"startIndex": 1,
|
|
20522
|
+
"endIndex": 3
|
|
20523
|
+
}
|
|
20524
|
+
},
|
|
20449
20525
|
{
|
|
20450
20526
|
"kind": "PropertySignature",
|
|
20451
20527
|
"canonicalReference": "@empathyco/x-components!HistoryQueriesGetters#normalizedQuery:member",
|
|
@@ -50724,6 +50800,45 @@
|
|
|
50724
50800
|
"endIndex": 2
|
|
50725
50801
|
}
|
|
50726
50802
|
},
|
|
50803
|
+
{
|
|
50804
|
+
"kind": "Variable",
|
|
50805
|
+
"canonicalReference": "@empathyco/x-components!updateHistoryQueriesWithSearchResponse:var",
|
|
50806
|
+
"docComment": "/**\n * Updates the history queries with the relevant info included in a search response.\n *\n * @public\n */\n",
|
|
50807
|
+
"excerptTokens": [
|
|
50808
|
+
{
|
|
50809
|
+
"kind": "Content",
|
|
50810
|
+
"text": "updateHistoryQueriesWithSearchResponse: "
|
|
50811
|
+
},
|
|
50812
|
+
{
|
|
50813
|
+
"kind": "Content",
|
|
50814
|
+
"text": "import(\"../..\")."
|
|
50815
|
+
},
|
|
50816
|
+
{
|
|
50817
|
+
"kind": "Reference",
|
|
50818
|
+
"text": "Wire",
|
|
50819
|
+
"canonicalReference": "@empathyco/x-components!Wire:type"
|
|
50820
|
+
},
|
|
50821
|
+
{
|
|
50822
|
+
"kind": "Content",
|
|
50823
|
+
"text": "<import(\"../search\")."
|
|
50824
|
+
},
|
|
50825
|
+
{
|
|
50826
|
+
"kind": "Reference",
|
|
50827
|
+
"text": "InternalSearchResponse",
|
|
50828
|
+
"canonicalReference": "@empathyco/x-components!InternalSearchResponse:interface"
|
|
50829
|
+
},
|
|
50830
|
+
{
|
|
50831
|
+
"kind": "Content",
|
|
50832
|
+
"text": ">"
|
|
50833
|
+
}
|
|
50834
|
+
],
|
|
50835
|
+
"releaseTag": "Public",
|
|
50836
|
+
"name": "updateHistoryQueriesWithSearchResponse",
|
|
50837
|
+
"variableTypeTokenRange": {
|
|
50838
|
+
"startIndex": 1,
|
|
50839
|
+
"endIndex": 6
|
|
50840
|
+
}
|
|
50841
|
+
},
|
|
50727
50842
|
{
|
|
50728
50843
|
"kind": "TypeAlias",
|
|
50729
50844
|
"canonicalReference": "@empathyco/x-components!UrlActionContext:type",
|
|
@@ -1987,6 +1987,7 @@ export interface HistoryQueriesActions {
|
|
|
1987
1987
|
setHistoryQueries(historyQueries: HistoryQuery_2[]): void;
|
|
1988
1988
|
setUrlParams(urlParams: UrlParams): void;
|
|
1989
1989
|
toggleHistoryQueries(isEnabled: boolean): void;
|
|
1990
|
+
updateHistoryQueriesWithSearchResponse(searchResponse: InternalSearchResponse): void;
|
|
1990
1991
|
}
|
|
1991
1992
|
|
|
1992
1993
|
// @public
|
|
@@ -2020,6 +2021,7 @@ export class HistoryQueriesGetter implements GettersClass<HistoryQueriesXStoreMo
|
|
|
2020
2021
|
// @public
|
|
2021
2022
|
export interface HistoryQueriesGetters {
|
|
2022
2023
|
historyQueries: HistoryQuery_2[];
|
|
2024
|
+
historyQueriesWithResults: HistoryQuery_2[];
|
|
2023
2025
|
normalizedQuery: string;
|
|
2024
2026
|
sessionHistoryQueries: HistoryQuery_2[];
|
|
2025
2027
|
storageKey: string;
|
|
@@ -2095,6 +2097,9 @@ export const historyQueriesWiring: {
|
|
|
2095
2097
|
UserClickedOutOfMainModal: {
|
|
2096
2098
|
clearHistoryQueriesQuery: AnyWire;
|
|
2097
2099
|
};
|
|
2100
|
+
SearchResponseProvided: {
|
|
2101
|
+
updateHistoryQueriesWithSearchResponse: Wire<InternalSearchResponse>;
|
|
2102
|
+
};
|
|
2098
2103
|
};
|
|
2099
2104
|
|
|
2100
2105
|
// @public
|
|
@@ -4950,6 +4955,9 @@ export const TrendingIcon: {};
|
|
|
4950
4955
|
// @public (undocumented)
|
|
4951
4956
|
export const TrendingTinyIcon: {};
|
|
4952
4957
|
|
|
4958
|
+
// @public
|
|
4959
|
+
export const updateHistoryQueriesWithSearchResponse: Wire<InternalSearchResponse>;
|
|
4960
|
+
|
|
4953
4961
|
// @public
|
|
4954
4962
|
export type UrlActionContext = XActionContext<UrlState, UrlGetters, UrlMutations, UrlActions>;
|
|
4955
4963
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HistoryQueriesXStoreModule } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Default implementation for the
|
|
4
|
+
* {@link HistoryQueriesActions.updateHistoryQueriesWithSearchResponse} action.
|
|
5
|
+
*
|
|
6
|
+
* The matching history query will only be updated on the following scenarios:
|
|
7
|
+
* 1. If it is part of a previous session, not the current one.
|
|
8
|
+
* 2. If its total results count has not been registered yet.
|
|
9
|
+
* 3. If its total results count registered is less than the one specified on the search response,
|
|
10
|
+
* meaning that the previous update was part of a filtered request.
|
|
11
|
+
*
|
|
12
|
+
* @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
|
|
13
|
+
* provided by Vuex.
|
|
14
|
+
*
|
|
15
|
+
* @param searchResponse - The search response to update history queries with.
|
|
16
|
+
*
|
|
17
|
+
* @returns A `void` promise that resolves when the history query finishes updating.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare const updateHistoryQueriesWithSearchResponse: HistoryQueriesXStoreModule['actions']['updateHistoryQueriesWithSearchResponse'];
|
|
22
|
+
//# sourceMappingURL=update-history-queries-with-search-response.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-history-queries-with-search-response.action.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAEtD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,sCAAsC,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC,wCAAwC,CAuBhI,CAAC"}
|
package/types/x-modules/history-queries/store/getters/history-queries-with-results.getter.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HistoryQueriesXStoreModule } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Default implementation for the {@link HistoryQueriesGetters.historyQueriesWithResults} getter.
|
|
4
|
+
*
|
|
5
|
+
* @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the history
|
|
6
|
+
* queries module.
|
|
7
|
+
*
|
|
8
|
+
* @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the
|
|
9
|
+
* history queries module.
|
|
10
|
+
*
|
|
11
|
+
* @returns The history queries that have results at the moment they were requested.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare const historyQueriesWithResults: HistoryQueriesXStoreModule['getters']['historyQueriesWithResults'];
|
|
16
|
+
//# sourceMappingURL=history-queries-with-results.getter.d.ts.map
|
package/types/x-modules/history-queries/store/getters/history-queries-with-results.getter.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-queries-with-results.getter.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/history-queries/store/getters/history-queries-with-results.getter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAEtD;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,yBAAyB,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC,2BAA2B,CACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/store/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/store/module.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,0BA0CxC,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { XActionContext, XStoreModule } from '../../../store';
|
|
|
3
3
|
import { QueryMutations, QueryState } from '../../../store/utils/query.utils';
|
|
4
4
|
import { UrlParams } from '../../../types/url-params';
|
|
5
5
|
import { HistoryQueriesConfig } from '../config.types';
|
|
6
|
+
import { InternalSearchResponse } from '../../search/index';
|
|
6
7
|
/**
|
|
7
8
|
* HistoryQueries store state.
|
|
8
9
|
*
|
|
@@ -45,6 +46,11 @@ export interface HistoryQueriesGetters {
|
|
|
45
46
|
historyQueries: HistoryQuery[];
|
|
46
47
|
/** The normalized module's query. */
|
|
47
48
|
normalizedQuery: string;
|
|
49
|
+
/**
|
|
50
|
+
* A sub-set of the {@link HistoryQueriesGetters.historyQueries} including only the queries with
|
|
51
|
+
* results at the moment they were requested.
|
|
52
|
+
*/
|
|
53
|
+
historyQueriesWithResults: HistoryQuery[];
|
|
48
54
|
/**
|
|
49
55
|
* A list of the queries that have been made in the last period of time specified by
|
|
50
56
|
* {@link HistoryQueriesConfig.sessionTTLInMs}.
|
|
@@ -173,6 +179,12 @@ export interface HistoryQueriesActions {
|
|
|
173
179
|
* @param isEnabled - Whether to enable or disable the history queries.
|
|
174
180
|
*/
|
|
175
181
|
toggleHistoryQueries(isEnabled: boolean): void;
|
|
182
|
+
/**
|
|
183
|
+
* Updates the history queries with the relevant info included in a search response.
|
|
184
|
+
*
|
|
185
|
+
* @param searchResponse - The search response to update history queries with.
|
|
186
|
+
*/
|
|
187
|
+
updateHistoryQueriesWithSearchResponse(searchResponse: InternalSearchResponse): void;
|
|
176
188
|
}
|
|
177
189
|
/**
|
|
178
190
|
* HistoryQueries type safe store module.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/store/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/store/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD;;OAEG;IACH,MAAM,EAAE,oBAAoB,CAAC;IAC7B;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,yBAAyB,EAAE,YAAY,EAAE,CAAC;IAC1C;;;OAGG;IACH,qBAAqB,EAAE,YAAY,EAAE,CAAC;IACtC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AACD;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACxD;;;;OAIG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AACD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC;;;OAGG;IACH,oCAAoC,IAAI,IAAI,CAAC;IAC7C;;OAEG;IACH,cAAc,IAAI,IAAI,CAAC;IACvB;;;;OAIG;IACH,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IACpD;;;;;;OAMG;IACH,iBAAiB,CAAC,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACxD;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IACzC;;;;;OAKG;IACH,oBAAoB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C;;;;OAIG;IACH,sCAAsC,CAAC,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACtF;AACD;;;;GAIG;AACH,oBAAY,0BAA0B,GAAG,YAAY,CACnD,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,CACtB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,2BAA2B,GAAG,cAAc,CACtD,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,CACtB,CAAC"}
|
|
@@ -54,6 +54,12 @@ export declare const setHistoryQueriesEnabled: import("../..").AnyWire;
|
|
|
54
54
|
* @public
|
|
55
55
|
*/
|
|
56
56
|
export declare const setHistoryQueriesDisabled: import("../..").AnyWire;
|
|
57
|
+
/**
|
|
58
|
+
* Updates the history queries with the relevant info included in a search response.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export declare const updateHistoryQueriesWithSearchResponse: import("../..").Wire<import("../search").InternalSearchResponse>;
|
|
57
63
|
/**
|
|
58
64
|
* Default wiring for the {@link HistoryQueries} module.
|
|
59
65
|
*
|
|
@@ -97,5 +103,8 @@ export declare const historyQueriesWiring: {
|
|
|
97
103
|
UserClickedOutOfMainModal: {
|
|
98
104
|
clearHistoryQueriesQuery: import("../..").AnyWire;
|
|
99
105
|
};
|
|
106
|
+
SearchResponseProvided: {
|
|
107
|
+
updateHistoryQueriesWithSearchResponse: import("../..").Wire<import("../search").InternalSearchResponse>;
|
|
108
|
+
};
|
|
100
109
|
};
|
|
101
110
|
//# sourceMappingURL=wiring.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,8BAAoC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,8BAAyB,CAAC;AAS7D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,yBAA+C,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,yBAEpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,yBAAwC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iEAAoC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6C,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yBAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,8BAAoC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,8BAAyB,CAAC;AAS7D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,yBAA+C,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,yBAEpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,yBAAwC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iEAAoC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6C,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yBAA8C,CAAC;AAErF;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,kEAElD,CAAC;AAOF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C/B,CAAC"}
|