@empathyco/x-components 6.0.0-alpha.16 → 6.0.0-alpha.18
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 +23 -0
- package/design-system/deprecated-full-theme.css +361 -361
- package/docs/API-reference/api/x-components.animationprop.md +6 -1
- package/docs/API-reference/api/x-components.bannerslist.md +3 -3
- package/docs/API-reference/api/x-components.basedropdown.md +3 -3
- package/docs/API-reference/api/x-components.baseeventsmodal.md +2 -2
- package/docs/API-reference/api/x-components.basegrid.md +3 -3
- package/docs/API-reference/api/x-components.baseheadertogglepanel.md +3 -3
- package/docs/API-reference/api/x-components.baseidmodal.md +2 -2
- package/docs/API-reference/api/x-components.baseidtogglepanel.md +3 -3
- package/docs/API-reference/api/x-components.basemodal.md +6 -6
- package/docs/API-reference/api/x-components.baseresultimage.md +9 -9
- package/docs/API-reference/api/x-components.basesuggestions.md +3 -3
- package/docs/API-reference/api/x-components.basetabspanel.md +6 -6
- package/docs/API-reference/api/x-components.basetogglepanel.md +3 -3
- package/docs/API-reference/api/x-components.basevariablecolumngrid.md +3 -3
- package/docs/API-reference/api/x-components.empathize.md +3 -3
- package/docs/API-reference/api/x-components.facets.md +3 -3
- package/docs/API-reference/api/x-components.filterslist.md +3 -3
- package/docs/API-reference/api/x-components.globalxbus.md +4 -0
- package/docs/API-reference/api/x-components.hierarchicalfilter.md +4 -2
- package/docs/API-reference/api/x-components.identifierresults.md +3 -3
- package/docs/API-reference/api/x-components.itemslist.md +3 -3
- package/docs/API-reference/api/x-components.mainmodal.md +2 -2
- package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +3 -3
- package/docs/API-reference/api/x-components.myhistory.md +3 -3
- package/docs/API-reference/api/x-components.nextquerieslist.md +3 -3
- package/docs/API-reference/api/x-components.partialresultslist.md +3 -3
- package/docs/API-reference/api/x-components.promotedslist.md +3 -3
- package/docs/API-reference/api/x-components.querypreviewlist.md +3 -3
- package/docs/API-reference/api/x-components.recommendations.md +3 -3
- package/docs/API-reference/api/x-components.relatedpromptslist.md +3 -3
- package/docs/API-reference/api/x-components.relatedpromptsmutations.md +2 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedprompt.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedquery.md +24 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.md +2 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.selectedprompt.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsstate.selectedquery.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.md +2 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedprompt.md +13 -0
- package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md +13 -0
- package/docs/API-reference/api/x-components.relatedtags.md +3 -3
- package/docs/API-reference/api/x-components.resultslist.md +3 -3
- package/docs/API-reference/api/x-components.scrolltotop.md +3 -3
- package/docs/API-reference/api/x-components.searchinputplaceholder.md +3 -3
- package/docs/API-reference/api/x-components.selectedfilterslist.md +3 -3
- package/docs/API-reference/api/x-components.simplefilter.md +2 -0
- package/docs/API-reference/api/x-components.singlecolumnlayout.md +3 -3
- package/docs/API-reference/api/x-components.snippetcallbacks.md +2 -0
- package/docs/API-reference/components/common/result/x-components.base-result-image.md +2 -2
- package/docs/API-reference/components/common/x-components.items-list.md +1 -1
- package/docs/API-reference/components/facets/x-components.facets/facets.md +1 -1
- package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +1 -1
- package/docs/API-reference/components/search/x-components.results-list.md +1 -1
- package/js/components/items-list.vue.js.map +1 -1
- package/js/components/items-list.vue2.js +2 -2
- package/js/components/items-list.vue2.js.map +1 -1
- package/js/components/result/base-result-image.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue2.js +3 -3
- package/js/components/result/base-result-image.vue2.js.map +1 -1
- package/js/types/animation-prop.js +5 -0
- package/js/types/animation-prop.js.map +1 -1
- package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
- package/js/x-modules/facets/components/facets/facets.vue2.js +2 -2
- package/js/x-modules/facets/components/facets/facets.vue2.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js +2 -2
- package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js.map +1 -1
- package/js/x-modules/related-prompts/store/module.js +10 -0
- package/js/x-modules/related-prompts/store/module.js.map +1 -1
- package/js/x-modules/related-prompts/wiring.js +14 -0
- package/js/x-modules/related-prompts/wiring.js.map +1 -1
- package/js/x-modules/search/components/results-list.vue.js +2 -2
- package/js/x-modules/search/components/results-list.vue.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +1904 -7485
- package/report/x-components.api.md +155 -133
- package/types/components/base-dropdown.vue.d.ts +3 -3
- package/types/components/base-grid.vue.d.ts +3 -3
- package/types/components/base-variable-column-grid.vue.d.ts +3 -3
- package/types/components/global-x-bus.vue.d.ts +4 -0
- package/types/components/global-x-bus.vue.d.ts.map +1 -1
- package/types/components/items-list.vue.d.ts +3 -3
- package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +3 -3
- package/types/components/layouts/single-column-layout.vue.d.ts +3 -3
- package/types/components/modals/base-events-modal.vue.d.ts +2 -2
- package/types/components/modals/base-id-modal.vue.d.ts +2 -2
- package/types/components/modals/base-modal.vue.d.ts +6 -6
- package/types/components/modals/main-modal.vue.d.ts +2 -2
- package/types/components/panels/base-header-toggle-panel.vue.d.ts +3 -3
- package/types/components/panels/base-id-toggle-panel.vue.d.ts +3 -3
- package/types/components/panels/base-tabs-panel.vue.d.ts +6 -6
- package/types/components/panels/base-toggle-panel.vue.d.ts +3 -3
- package/types/components/result/base-result-image.vue.d.ts +10 -10
- package/types/components/result/base-result-image.vue.d.ts.map +1 -1
- package/types/components/snippet-callbacks.vue.d.ts +2 -0
- package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
- package/types/components/suggestions/base-suggestions.vue.d.ts +3 -3
- package/types/types/animation-prop.d.ts +6 -2
- package/types/types/animation-prop.d.ts.map +1 -1
- package/types/x-modules/empathize/components/empathize.vue.d.ts +3 -3
- package/types/x-modules/facets/components/facets/facets.vue.d.ts +3 -3
- package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +4 -2
- package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
- package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +2 -0
- package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
- package/types/x-modules/facets/components/lists/filters-list.vue.d.ts +3 -3
- package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts +3 -3
- package/types/x-modules/history-queries/components/my-history.vue.d.ts +3 -3
- package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +3 -3
- package/types/x-modules/next-queries/components/next-queries-list.vue.d.ts +3 -3
- package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts +3 -3
- package/types/x-modules/recommendations/components/recommendations.vue.d.ts +3 -3
- package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts +3 -3
- package/types/x-modules/related-prompts/events.types.d.ts +10 -0
- package/types/x-modules/related-prompts/events.types.d.ts.map +1 -1
- package/types/x-modules/related-prompts/store/module.d.ts.map +1 -1
- package/types/x-modules/related-prompts/store/types.d.ts +16 -0
- package/types/x-modules/related-prompts/store/types.d.ts.map +1 -1
- package/types/x-modules/related-prompts/wiring.d.ts +6 -0
- package/types/x-modules/related-prompts/wiring.d.ts.map +1 -1
- package/types/x-modules/related-tags/components/related-tags.vue.d.ts +3 -3
- package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +3 -3
- package/types/x-modules/search/components/banners-list.vue.d.ts +3 -3
- package/types/x-modules/search/components/partial-results-list.vue.d.ts +3 -3
- package/types/x-modules/search/components/promoteds-list.vue.d.ts +3 -3
- package/types/x-modules/search/components/results-list.vue.d.ts +3 -3
- package/types/x-modules/search-box/components/search-input-placeholder.vue.d.ts +3 -3
- package/js/utils/options-api.js +0 -4
- package/js/utils/options-api.js.map +0 -1
- package/types/utils/options-api.d.ts +0 -3
- package/types/utils/options-api.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/related-prompts/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { RelatedPromptsXStoreModule } from './types';\nimport {\n cancelFetchAndSaveRelatedPrompts,\n fetchAndSaveRelatedPrompts\n} from './actions/fetch-and-save-related-prompts.action';\nimport { fetchRelatedPrompts } from './actions/fetch-related-prompts.action';\nimport { request } from './getters/request.getter';\n\n/**\n * {@link XStoreModule} For the related prompt module.\n *\n * @internal\n */\nexport const relatedPromptsXStoreModule: RelatedPromptsXStoreModule = {\n state: () => ({\n query: '',\n relatedPrompts: [],\n status: 'initial',\n params: {}\n }),\n getters: {\n request\n },\n mutations: {\n setStatus,\n setQuery,\n setParams(state, params) {\n state.params = params;\n },\n setRelatedPromptsProducts(state, products) {\n state.relatedPrompts = products;\n },\n resetRelatedPromptsState(state) {\n state.relatedPrompts = [];\n }\n },\n actions: {\n fetchRelatedPrompts,\n fetchAndSaveRelatedPrompts,\n cancelFetchAndSaveRelatedPrompts\n }\n};\n"],"names":[],"mappings":";;;;;;AAUA;;;;AAIG;AACU,MAAA,0BAA0B,GAA+B;AACpE,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,cAAc,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/related-prompts/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { RelatedPromptsXStoreModule } from './types';\nimport {\n cancelFetchAndSaveRelatedPrompts,\n fetchAndSaveRelatedPrompts\n} from './actions/fetch-and-save-related-prompts.action';\nimport { fetchRelatedPrompts } from './actions/fetch-related-prompts.action';\nimport { request } from './getters/request.getter';\n\n/**\n * {@link XStoreModule} For the related prompt module.\n *\n * @internal\n */\nexport const relatedPromptsXStoreModule: RelatedPromptsXStoreModule = {\n state: () => ({\n query: '',\n relatedPrompts: [],\n selectedPrompt: -1,\n selectedQuery: -1,\n status: 'initial',\n params: {}\n }),\n getters: {\n request\n },\n mutations: {\n setStatus,\n setQuery,\n setParams(state, params) {\n state.params = params;\n },\n setRelatedPromptsProducts(state, products) {\n state.relatedPrompts = products;\n },\n setSelectedPrompt(state, selectedPrompt) {\n state.selectedPrompt = selectedPrompt;\n },\n setSelectedQuery(state, selectedQuery) {\n state.selectedQuery = selectedQuery;\n },\n resetRelatedPromptsState(state) {\n state.selectedQuery = -1;\n state.selectedPrompt = -1;\n state.relatedPrompts = [];\n }\n },\n actions: {\n fetchRelatedPrompts,\n fetchAndSaveRelatedPrompts,\n cancelFetchAndSaveRelatedPrompts\n }\n};\n"],"names":[],"mappings":";;;;;;AAUA;;;;AAIG;AACU,MAAA,0BAA0B,GAA+B;AACpE,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,cAAc,EAAE,EAAE;QAClB,cAAc,EAAE,CAAC,CAAC;QAClB,aAAa,EAAE,CAAC,CAAC;AACjB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,MAAM,EAAE,EAAE;KACX,CAAC;AACF,IAAA,OAAO,EAAE;QACP,OAAO;AACR,KAAA;AACD,IAAA,SAAS,EAAE;QACT,SAAS;QACT,QAAQ;QACR,SAAS,CAAC,KAAK,EAAE,MAAM,EAAA;AACrB,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;QACD,yBAAyB,CAAC,KAAK,EAAE,QAAQ,EAAA;AACvC,YAAA,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC;SACjC;QACD,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAA;AACrC,YAAA,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;SACvC;QACD,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAA;AACnC,YAAA,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;SACrC;AACD,QAAA,wBAAwB,CAAC,KAAK,EAAA;AAC5B,YAAA,KAAK,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;AACzB,YAAA,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;AAC1B,YAAA,KAAK,CAAC,cAAc,GAAG,EAAE,CAAC;SAC3B;AACF,KAAA;AACD,IAAA,OAAO,EAAE;QACP,mBAAmB;QACnB,0BAA0B;QAC1B,gCAAgC;AACjC,KAAA;;;;;"}
|
|
@@ -25,6 +25,14 @@ const wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleNa
|
|
|
25
25
|
* Sets the related prompts state `query`.
|
|
26
26
|
*/
|
|
27
27
|
const setRelatedPromptsQuery = wireCommit('setQuery');
|
|
28
|
+
/**
|
|
29
|
+
* Sets the related prompts state `selectedPrompt`.
|
|
30
|
+
*/
|
|
31
|
+
const setSelectedPromptWire = wireCommit('setSelectedPrompt');
|
|
32
|
+
/**
|
|
33
|
+
* Sets the related prompts state `selectedQuery`.
|
|
34
|
+
*/
|
|
35
|
+
const setSelectedQueryWire = wireCommit('setSelectedQuery');
|
|
28
36
|
/**
|
|
29
37
|
* Sets the related prompts state `query` from url params.
|
|
30
38
|
*/
|
|
@@ -67,6 +75,12 @@ const relatedPromptsWiring = createWiring({
|
|
|
67
75
|
},
|
|
68
76
|
ExtraParamsChanged: {
|
|
69
77
|
setRelatedPromptsExtraParams
|
|
78
|
+
},
|
|
79
|
+
UserSelectedARelatedPrompt: {
|
|
80
|
+
setSelectedPromptWire
|
|
81
|
+
},
|
|
82
|
+
UserSelectedARelatedPromptQuery: {
|
|
83
|
+
setSelectedQueryWire
|
|
70
84
|
}
|
|
71
85
|
});
|
|
72
86
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/related-prompts/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport {\n NamespacedWireCommit,\n NamespacedWireCommitWithoutPayload\n} from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `relatedPrompts` {@link XModuleName | XModule name}.\n */\nconst moduleName = 'relatedPrompts';\n\n/**\n * WireCommit for {@link RelatedPromptsXModule}.\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n\n/**\n * WireCommitWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireCommitWithoutPayload: NamespacedWireCommitWithoutPayload<typeof moduleName> =\n namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link RelatedPromptsXModule}.\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Sets the related prompts state `query`.\n */\nconst setRelatedPromptsQuery = wireCommit('setQuery');\n\n/**\n * Sets the related prompts state `query` from url params.\n */\nconst setRelatedPromptsQueryFromUrl = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the related prompts state `params`.\n */\nconst setRelatedPromptsExtraParams = wireCommit('setParams');\n\n/**\n * Resets the related prompts state.\n */\nconst resetRelatedPromptsStateWire = wireCommitWithoutPayload('resetRelatedPromptsState');\n\n/**\n * Fetches and saves the related prompts response.\n */\nconst fetchAndSaveRelatedPromptsResponseWire = wireDispatch('fetchAndSaveRelatedPrompts');\n\n/**\n * Cancels the fetch and save related prompts response.\n */\nconst cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedPrompts'\n);\n\n/**\n * Wiring configuration for the {@link RelatedPromptsXModule | related prompts module}.\n *\n * @internal\n */\nexport const relatedPromptsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setRelatedPromptsQueryFromUrl\n },\n UserAcceptedAQuery: {\n setRelatedPromptsQuery\n },\n UserClearedQuery: {\n cancelFetchAndSaveSearchResponseWire,\n resetRelatedPromptsStateWire,\n setRelatedPromptsQuery\n },\n RelatedPromptsRequestUpdated: {\n fetchAndSaveRelatedPromptsResponseWire\n },\n ExtraParamsChanged: {\n setRelatedPromptsExtraParams\n }\n});\n"],"names":[],"mappings":";;;AAYA;;AAEG;AACH,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC;;AAEG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAE7F;;AAEG;AACH,MAAM,wBAAwB,GAC5B,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEjD;;AAEG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;AAEG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;AAEG;AACH,MAAM,sBAAsB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAEtD;;AAEG;AACH,MAAM,6BAA6B,GAAG,UAAU,CAC9C,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,CACvC,CAAC;AAEF;;AAEG;AACH,MAAM,4BAA4B,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAE7D;;AAEG;AACH,MAAM,4BAA4B,GAAG,wBAAwB,CAAC,0BAA0B,CAAC,CAAC;AAE1F;;AAEG;AACH,MAAM,sCAAsC,GAAG,YAAY,CAAC,4BAA4B,CAAC,CAAC;AAE1F;;AAEG;AACH,MAAM,oCAAoC,GAAG,0BAA0B,CACrE,kCAAkC,CACnC,CAAC;AAEF;;;;AAIG;AACI,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAC/C,IAAA,mBAAmB,EAAE;QACnB,6BAA6B;AAC9B,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,sBAAsB;AACvB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,oCAAoC;QACpC,4BAA4B;QAC5B,sBAAsB;AACvB,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,sCAAsC;AACvC,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,4BAA4B;AAC7B,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/related-prompts/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport {\n NamespacedWireCommit,\n NamespacedWireCommitWithoutPayload\n} from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `relatedPrompts` {@link XModuleName | XModule name}.\n */\nconst moduleName = 'relatedPrompts';\n\n/**\n * WireCommit for {@link RelatedPromptsXModule}.\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n\n/**\n * WireCommitWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireCommitWithoutPayload: NamespacedWireCommitWithoutPayload<typeof moduleName> =\n namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link RelatedPromptsXModule}.\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Sets the related prompts state `query`.\n */\nconst setRelatedPromptsQuery = wireCommit('setQuery');\n\n/**\n * Sets the related prompts state `selectedPrompt`.\n */\nconst setSelectedPromptWire = wireCommit('setSelectedPrompt');\n\n/**\n * Sets the related prompts state `selectedQuery`.\n */\nconst setSelectedQueryWire = wireCommit('setSelectedQuery');\n\n/**\n * Sets the related prompts state `query` from url params.\n */\nconst setRelatedPromptsQueryFromUrl = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the related prompts state `params`.\n */\nconst setRelatedPromptsExtraParams = wireCommit('setParams');\n\n/**\n * Resets the related prompts state.\n */\nconst resetRelatedPromptsStateWire = wireCommitWithoutPayload('resetRelatedPromptsState');\n\n/**\n * Fetches and saves the related prompts response.\n */\nconst fetchAndSaveRelatedPromptsResponseWire = wireDispatch('fetchAndSaveRelatedPrompts');\n\n/**\n * Cancels the fetch and save related prompts response.\n */\nconst cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedPrompts'\n);\n\n/**\n * Wiring configuration for the {@link RelatedPromptsXModule | related prompts module}.\n *\n * @internal\n */\nexport const relatedPromptsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setRelatedPromptsQueryFromUrl\n },\n UserAcceptedAQuery: {\n setRelatedPromptsQuery\n },\n UserClearedQuery: {\n cancelFetchAndSaveSearchResponseWire,\n resetRelatedPromptsStateWire,\n setRelatedPromptsQuery\n },\n RelatedPromptsRequestUpdated: {\n fetchAndSaveRelatedPromptsResponseWire\n },\n ExtraParamsChanged: {\n setRelatedPromptsExtraParams\n },\n UserSelectedARelatedPrompt: {\n setSelectedPromptWire\n },\n UserSelectedARelatedPromptQuery: {\n setSelectedQueryWire\n }\n});\n"],"names":[],"mappings":";;;AAYA;;AAEG;AACH,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC;;AAEG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAE7F;;AAEG;AACH,MAAM,wBAAwB,GAC5B,kCAAkC,CAAC,UAAU,CAAC,CAA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AAA;AACF,CAAA;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent, provide, ref, computed, watch, h } from 'vue';
|
|
2
2
|
import { LIST_ITEMS_KEY, QUERY_KEY, HAS_MORE_ITEMS_KEY } from '../../../components/decorators/injection.consts.js';
|
|
3
3
|
import ItemsList from '../../../components/items-list.vue.js';
|
|
4
|
-
import { animationProp } from '../../../utils/options-api.js';
|
|
5
4
|
import { useState } from '../../../composables/use-state.js';
|
|
6
5
|
import { searchXModule } from '../x-module.js';
|
|
6
|
+
import { AnimationProp } from '../../../types/animation-prop.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* It renders a {@link ItemsList} list with the results from {@link SearchState.results} by
|
|
@@ -22,7 +22,7 @@ var _sfc_main = defineComponent({
|
|
|
22
22
|
props: {
|
|
23
23
|
/** Animation component that will be used to animate the results. */
|
|
24
24
|
animation: {
|
|
25
|
-
type:
|
|
25
|
+
type: AnimationProp,
|
|
26
26
|
default: 'ul'
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results-list.vue.js","sources":["../../../../../src/x-modules/search/components/results-list.vue"],"sourcesContent":["<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent, h, provide, Ref, ref, watch } from 'vue';\n import { Result } from '@empathyco/x-types';\n import {\n HAS_MORE_ITEMS_KEY,\n LIST_ITEMS_KEY,\n QUERY_KEY\n } from '../../../components/decorators/injection.consts';\n import ItemsList from '../../../components/items-list.vue';\n import { RequestStatus } from '../../../store/utils/status-store.utils';\n import {
|
|
1
|
+
{"version":3,"file":"results-list.vue.js","sources":["../../../../../src/x-modules/search/components/results-list.vue"],"sourcesContent":["<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent, h, provide, Ref, ref, watch } from 'vue';\n import { Result } from '@empathyco/x-types';\n import {\n HAS_MORE_ITEMS_KEY,\n LIST_ITEMS_KEY,\n QUERY_KEY\n } from '../../../components/decorators/injection.consts';\n import ItemsList from '../../../components/items-list.vue';\n import { RequestStatus } from '../../../store/utils/status-store.utils';\n import { useState } from '../../../composables/use-state';\n import { searchXModule } from '../x-module';\n import { AnimationProp } from '../../../types';\n\n /**\n * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by\n * default.\n *\n * The component provides a default slot which wraps the whole component with the `results` bound.\n *\n * It also provides the slot result to customize the item, which is within the default slot, with\n * the result bound.\n *\n * @public\n */\n export default defineComponent({\n name: 'ResultsList',\n xModule: searchXModule.name,\n props: {\n /** Animation component that will be used to animate the results. */\n animation: {\n type: AnimationProp,\n default: 'ul'\n }\n },\n emits: ['UserReachedResultsListEnd'],\n setup(props, { slots }) {\n /**\n * The results to render from the state.\n *\n * @remarks The results list are provided with `items` key. It can be\n * concatenated with list items from components such as `BannersList`, `PromotedsList`,\n * `BaseGrid` or any component that injects the list.\n */\n const items: ComputedRef<Result[]> = useState('search', ['results']).results;\n provide<ComputedRef<Result[]>>(LIST_ITEMS_KEY as string, items);\n\n /** The total number of results, taken from the state. */\n const totalResults: ComputedRef<number> = useState('search', ['totalResults']).totalResults;\n\n /** This query is updated only when the search request has succeeded. */\n let providedQuery = ref('');\n provide<Ref<string>>(QUERY_KEY as string, providedQuery);\n\n /** Indicates if there are more available results that have not been injected. */\n const hasMoreItems = computed(() => items.value.length < totalResults.value);\n provide<ComputedRef<boolean>>(HAS_MORE_ITEMS_KEY as string, hasMoreItems);\n\n /** The status of the search request, taken from the state. */\n const searchStatus: ComputedRef<RequestStatus> = useState('search', ['status']).status;\n\n /** The query of the search request, taken from the state. */\n const searchQuery: ComputedRef<string> = useState('search', ['query']).query;\n\n /**\n * Updates the query to be provided to the child components\n * when the search request has succeeded.\n *\n * @param status - The status of the search request.\n */\n function updateQuery(status: RequestStatus) {\n if (status === 'success') {\n providedQuery.value = searchQuery.value;\n }\n }\n\n /**\n * Watches the searchStatus and triggers updateQuery as callback\n * when it changes.\n *\n * @param status - The status of the search request.\n */\n watch(searchStatus, () => updateQuery(searchStatus.value), { immediate: true });\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation };\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend service required\nTo use this component, the Search service must be implemented.\n:::\n<!-- prettier-ignore-end -->\n\nHere you have a basic example of how the ResultsList is rendered.\n\n_Type any term in the input field to try it out!_\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList :animation=\"fadeAndSlide\" />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { FadeAndSlide } from '@empathyco/x-components/animations';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n },\n data() {\n return {\n fadeAndSlide: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Overriding default content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #default=\"{ items, animation }\">\n <BaseGrid :items=\"items\" :animation=\"animation\">\n <template #result=\"{ item }\">\n <span>Result: {{ item.name }}</span>\n </template>\n <template #default=\"{ item }\">\n <span>Default: {{ item }}</span>\n </template>\n </BaseGrid>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { BaseGrid } from '@empathyco/x-components';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BaseGrid\n }\n };\n</script>\n```\n\n### Overriding result content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #result=\"{ item }\">\n <span class=\"result\">\n {{ item.name }}\n </span>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { SearchInput, ResultsList } from '@empathyco/x-components/search';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Data injection\n\nStarting with the `ResultsList` component as root element, you can concat the list of list items\nusing `BannersList`, `PromotedsList`, `BaseGrid` or any component that injects the `listItems`\nvalue.\n\nThe order in which elements are placed in the template will define the concat strategy of the items,\nso it is important to define it properly; for example, Promoteds will be usually before Banners so\nfirst promoted items are inserted within the results and then banner items are placed on top of\nthat, occupying the rows.\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList>\n <PromotedsList>\n <BannersList>\n <template #result=\"{ item }\">Result: {{ item.id }}</template>\n <template #banner=\"{ item }\">Banner: {{ item.id }}</template>\n <template #promoted=\"{ item }\">Promoted: {{ item.id }}</template>\n </BannersList>\n </PromotedsList>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList, BannersList, PromotedsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BannersList,\n PromotedsList\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;AAcE;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAG;AACd,SAAA;AACD,KAAA;IACD,KAAK,EAAE,CAAC,2BAA2B,CAAC;AACpC,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;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AAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAE,IAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;AAC1E,SAAC,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.18",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -138,5 +138,5 @@
|
|
|
138
138
|
"access": "public",
|
|
139
139
|
"directory": "dist"
|
|
140
140
|
},
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "662b9560a2a636aa5254f6d1bea3d4efc5270fa0"
|
|
142
142
|
}
|