@empathyco/x-components 6.0.0-alpha.23 → 6.0.0-alpha.25
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 +18 -0
- package/design-system/deprecated-full-theme.css +1943 -1943
- package/docs/API-reference/api/x-components.installxoptions.installextraplugins.md +2 -2
- package/js/components/animations/fade-and-slide.vue.js +1 -2
- package/js/components/animations/fade-and-slide.vue.js.map +1 -1
- package/js/components/base-dropdown.vue.js +1 -3
- package/js/components/base-dropdown.vue.js.map +1 -1
- package/js/components/base-event-button.vue.js +1 -2
- package/js/components/base-event-button.vue.js.map +1 -1
- package/js/components/base-grid.vue.js +11 -18
- package/js/components/base-grid.vue.js.map +1 -1
- package/js/components/base-keyboard-navigation.vue.js +1 -2
- package/js/components/base-keyboard-navigation.vue.js.map +1 -1
- package/js/components/base-rating.vue.js +1 -3
- package/js/components/base-rating.vue.js.map +1 -1
- package/js/components/base-slider.vue.js +1 -2
- package/js/components/base-slider.vue.js.map +1 -1
- package/js/components/base-variable-column-grid.vue.js +1 -2
- package/js/components/base-variable-column-grid.vue.js.map +1 -1
- package/js/components/column-picker/base-column-picker-dropdown.vue.js +1 -3
- package/js/components/column-picker/base-column-picker-dropdown.vue.js.map +1 -1
- package/js/components/column-picker/base-column-picker-list.vue.js +1 -3
- package/js/components/column-picker/base-column-picker-list.vue.js.map +1 -1
- package/js/components/filters/labels/base-rating-filter-label.vue.js +1 -3
- package/js/components/filters/labels/base-rating-filter-label.vue.js.map +1 -1
- package/js/components/items-list.vue.js +1 -2
- package/js/components/items-list.vue.js.map +1 -1
- package/js/components/layouts/fixed-header-and-asides-layout.vue.js +1 -7
- package/js/components/layouts/fixed-header-and-asides-layout.vue.js.map +1 -1
- package/js/components/layouts/multi-column-max-width-layout.vue.js +1 -9
- package/js/components/layouts/multi-column-max-width-layout.vue.js.map +1 -1
- package/js/components/layouts/single-column-layout.vue.js +1 -9
- package/js/components/layouts/single-column-layout.vue.js.map +1 -1
- package/js/components/modals/base-events-modal-close.vue.js +1 -2
- package/js/components/modals/base-events-modal-close.vue.js.map +1 -1
- package/js/components/modals/base-events-modal-open.vue.js +1 -2
- package/js/components/modals/base-events-modal-open.vue.js.map +1 -1
- package/js/components/modals/base-id-modal-close.vue.js +1 -2
- package/js/components/modals/base-id-modal-close.vue.js.map +1 -1
- package/js/components/modals/base-id-modal-open.vue.js +1 -2
- package/js/components/modals/base-id-modal-open.vue.js.map +1 -1
- package/js/components/modals/base-modal.vue.js +1 -2
- package/js/components/modals/base-modal.vue.js.map +1 -1
- package/js/components/page-loader-button.vue.js +1 -4
- package/js/components/page-loader-button.vue.js.map +1 -1
- package/js/components/panels/base-header-toggle-panel.vue.js +1 -5
- package/js/components/panels/base-header-toggle-panel.vue.js.map +1 -1
- package/js/components/panels/base-id-toggle-panel-button.vue.js +1 -2
- package/js/components/panels/base-id-toggle-panel-button.vue.js.map +1 -1
- package/js/components/panels/base-id-toggle-panel.vue.js +1 -2
- package/js/components/panels/base-id-toggle-panel.vue.js.map +1 -1
- package/js/components/panels/base-tabs-panel.vue.js +1 -4
- package/js/components/panels/base-tabs-panel.vue.js.map +1 -1
- package/js/components/panels/base-toggle-panel.vue.js +1 -2
- package/js/components/panels/base-toggle-panel.vue.js.map +1 -1
- package/js/components/result/base-result-add-to-cart.vue.js +1 -2
- package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
- package/js/components/result/base-result-current-price.vue.js +1 -2
- package/js/components/result/base-result-current-price.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue.js +39 -59
- package/js/components/result/base-result-image.vue.js.map +1 -1
- package/js/components/result/base-result-link.vue.js +1 -2
- package/js/components/result/base-result-link.vue.js.map +1 -1
- package/js/components/result/base-result-previous-price.vue.js +1 -2
- package/js/components/result/base-result-previous-price.vue.js.map +1 -1
- package/js/components/result/base-result-rating.vue.js +1 -4
- package/js/components/result/base-result-rating.vue.js.map +1 -1
- package/js/components/result/result-variant-selector.vue.js +1 -3
- package/js/components/result/result-variant-selector.vue.js.map +1 -1
- package/js/components/sliding-panel.vue.js +1 -4
- package/js/components/sliding-panel.vue.js.map +1 -1
- package/js/components/suggestions/base-suggestion.vue.js +1 -2
- package/js/components/suggestions/base-suggestion.vue.js.map +1 -1
- package/js/components/suggestions/base-suggestions.vue.js +1 -2
- package/js/components/suggestions/base-suggestions.vue.js.map +1 -1
- package/js/x-modules/empathize/components/empathize.vue.js +1 -2
- package/js/x-modules/empathize/components/empathize.vue.js.map +1 -1
- package/js/x-modules/facets/components/facets/facets.vue.js +20 -33
- package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/all-filter.vue.js +1 -2
- package/js/x-modules/facets/components/filters/all-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +1 -6
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js +1 -3
- package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/number-range-filter.vue.js +1 -3
- package/js/x-modules/facets/components/filters/number-range-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/simple-filter.vue.js +1 -3
- package/js/x-modules/facets/components/filters/simple-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-list.vue.js +1 -2
- package/js/x-modules/facets/components/lists/filters-list.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-search.vue.js +1 -3
- package/js/x-modules/facets/components/lists/filters-search.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters-list.vue.js +11 -18
- package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js +1 -4
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/clear-history-queries.vue.js +1 -2
- package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue.js +1 -10
- package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-query.vue.js +1 -6
- package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/my-history.vue.js +1 -4
- package/js/x-modules/history-queries/components/my-history.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/remove-history-query.vue.js +1 -2
- package/js/x-modules/history-queries/components/remove-history-query.vue.js.map +1 -1
- package/js/x-modules/identifier-results/components/identifier-results.vue.js +1 -2
- package/js/x-modules/identifier-results/components/identifier-results.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-queries.vue.js +1 -7
- package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query-preview.vue.js +1 -3
- package/js/x-modules/next-queries/components/next-query-preview.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-query.vue.js +1 -4
- package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
- package/js/x-modules/popular-searches/components/popular-search.vue.js +1 -4
- package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
- package/js/x-modules/popular-searches/components/popular-searches.vue.js +1 -7
- package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue.js +1 -2
- package/js/x-modules/queries-preview/components/query-preview-button.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview.vue.js +1 -2
- package/js/x-modules/queries-preview/components/query-preview.vue.js.map +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestion.vue.js +1 -4
- package/js/x-modules/query-suggestions/components/query-suggestion.vue.js.map +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestions.vue.js +1 -7
- package/js/x-modules/query-suggestions/components/query-suggestions.vue.js.map +1 -1
- package/js/x-modules/recommendations/components/recommendations.vue.js +1 -2
- package/js/x-modules/recommendations/components/recommendations.vue.js.map +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue.js +1 -2
- package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
- package/js/x-modules/related-tags/components/related-tags.vue.js +1 -4
- package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue.js +1 -2
- package/js/x-modules/scroll/components/scroll-to-top.vue.js.map +1 -1
- package/js/x-modules/search/components/partial-results-list.vue.js +1 -2
- package/js/x-modules/search/components/partial-results-list.vue.js.map +1 -1
- package/js/x-modules/search/components/sort-dropdown.vue.js +1 -3
- package/js/x-modules/search/components/sort-dropdown.vue.js.map +1 -1
- package/js/x-modules/search-box/components/clear-search-input.vue.js +1 -2
- package/js/x-modules/search-box/components/clear-search-input.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-button.vue.js +1 -2
- package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
- package/js/x-modules/semantic-queries/components/semantic-queries.vue.js +1 -3
- package/js/x-modules/semantic-queries/components/semantic-queries.vue.js.map +1 -1
- package/js/x-modules/semantic-queries/components/semantic-query.vue.js +1 -4
- package/js/x-modules/semantic-queries/components/semantic-query.vue.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +11 -2
- package/report/x-components.api.md +1 -1
- package/types/x-installer/x-installer/types.d.ts +1 -1
- package/types/x-installer/x-installer/types.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-queries.vue.js","sources":["../../../../../src/x-modules/semantic-queries/components/semantic-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-if=\"suggestions.length\"\n class=\"x-semantic-queries\"\n :suggestions=\"suggestions\"\n #default=\"baseSuggestionsScope\"\n >\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, index: number - Suggestion index}} v-bind\n BaseSuggestion bindings\n -->\n <slot name=\"suggestion\" v-bind=\"baseSuggestionsScope\">\n <SemanticQuery :suggestion=\"baseSuggestionsScope.suggestion\" #default=\"baseSuggestionScope\">\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the\n suggestion belongs to}} v-bind SemanticQuery bindings\n -->\n <slot name=\"suggestion-content\" v-bind=\"baseSuggestionScope\" />\n </SemanticQuery>\n </slot>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent } from 'vue';\n import { Suggestion } from '@empathyco/x-types';\n import { semanticQueriesXModule } from '../x-module';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { useState } from '../../../composables';\n import SemanticQuery from './semantic-query.vue';\n\n /**\n * Retrieves a list of semantic queries from the state and exposes them in the slots.\n *\n * @public\n */\n export default defineComponent({\n name: 'SemanticQueries',\n xModule: semanticQueriesXModule.name,\n components: { BaseSuggestions, SemanticQuery },\n setup(_, { slots }) {\n /** The semantic queries from the state. */\n const suggestions: ComputedRef<Suggestion[]> = useState('semanticQueries', [\n 'semanticQueries'\n ]).semanticQueries;\n\n /**\n * Maps the list of semantic queries to a list of queries, to make it compatible with\n * other components.\n */\n const queries = computed(() => suggestions.value.map(suggestion => suggestion.query));\n\n /**\n * Finds a {@link @empathyco/x-types#Suggestion} given a query.\n *\n * @param query - The query to search.\n * @returns The {@link @empathyco/x-types#Suggestion} or undefined if not found.\n */\n function findSemanticQuery(query: string) {\n return suggestions.value.find(suggestion => suggestion.query === query);\n }\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n * If there are no suggestions, nothing is rendered.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot or empty string if there are\n * no suggestions.\n */\n function renderDefaultSlot() {\n const slotProps = {\n suggestions: suggestions.value,\n queries: queries.value,\n findSemanticQuery\n };\n return suggestions.value.length ? slots.default?.(slotProps)[0] : '';\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { suggestions };\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps;\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\nBy default, the `SemanticQueries` component will render a list of semantic queries.\n\n```vue\n<template>\n <SemanticQueries />\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueriesDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n\n### Play with props\n\nThe component has the following props:\n\n- maxItemsToRender to limit the number of semantic queries to render.\n- animation to specify the animation to be used to animate the semantic queries.\n\n```vue live\n<template>\n <SemanticQueries :animation=\"animation\" :maxItemsToRender=\"3\" />\n</template>\n\n<script>\n import { FadeAndSlide } from '@empathyco/x-components';\n\n export default {\n name: 'SemanticQueriesPropsDemo',\n data() {\n return {\n animation: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nThe default slot is used to overwrite the whole content of the component.\n\n```vue live\n<template>\n <SemanticQueries #default=\"{ suggestions }\">\n <section>\n <SlidingPanel>\n <div v-for=\"suggestion in suggestions\">\n {{ suggestion.query }}\n {{ suggestion.distance }}\n </div>\n </SlidingPanel>\n </section>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SemanticQueriesDefaultSlotDemo',\n components: {\n SemanticQueries,\n SlidingPanel\n }\n };\n</script>\n```\n\nThe default slot also exposes an array of semantic queries mapped to strings, and a method to find a\nsemantic query given a string query.\n\nThis is useful if you need an array of string queries, but also need to retrieve the original\nsemantic query to use it in another element.\n\n```vue live\n<template>\n <SemanticQueries #default=\"{ queries, findSemanticQuery }\">\n <section>\n <QueryPreviewList :queries=\"queries\" #slot=\"{ query, results }\">\n <div>\n <SemanticQuery :semanticQuery=\"findSemanticQuery(query)\" #default=\"{ query }\">\n {{ query.query }} ({{ query.distance }})\n </SemanticQuery>\n <ul>\n <li v-for=\"result in results\" :key=\"result.id\">\n {{ result.name }}\n </li>\n </ul>\n </div>\n </QueryPreviewList>\n </section>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries, SemanticQuery } from '@empathyco/x-components/semantic-queries';\n import { QueryPreviewList } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'SemanticQueriesDefaultSlotDemo2',\n components: {\n SemanticQueries,\n SemanticQuery,\n QueryPreviewList\n }\n };\n</script>\n```\n\n### Play with the suggestion slot\n\nThe suggestion slot can be used to override each semantic query item.\n\nIn this example, the query will be rendered along with the distance.\n\n```vue live\n<template>\n <SemanticQueries #suggestion=\"{ suggestion: { query, distance } }\">\n <span>\n ({{ distance }})\n {{ query }}\n </span>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n export default {\n name: 'SemanticQueriesItemSlotDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n\n### Play with the suggestion content slot\n\nThe suggsetion content slot can be used to override only the content, but keep using the\nSemanticQuery component internally.\n\n```vue live\n<template>\n <SemanticQueries #suggestion-content=\"{ suggestion: { query, distance } }\">\n <span>\n ({{ distance }})\n {{ query }}\n </span>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n export default {\n name: 'SemanticQueriesItemSlotDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","
|
|
1
|
+
{"version":3,"file":"semantic-queries.vue.js","sources":["../../../../../src/x-modules/semantic-queries/components/semantic-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-if=\"suggestions.length\"\n class=\"x-semantic-queries\"\n :suggestions=\"suggestions\"\n #default=\"baseSuggestionsScope\"\n >\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, index: number - Suggestion index}} v-bind\n BaseSuggestion bindings\n -->\n <slot name=\"suggestion\" v-bind=\"baseSuggestionsScope\">\n <SemanticQuery :suggestion=\"baseSuggestionsScope.suggestion\" #default=\"baseSuggestionScope\">\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the\n suggestion belongs to}} v-bind SemanticQuery bindings\n -->\n <slot name=\"suggestion-content\" v-bind=\"baseSuggestionScope\" />\n </SemanticQuery>\n </slot>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent } from 'vue';\n import { Suggestion } from '@empathyco/x-types';\n import { semanticQueriesXModule } from '../x-module';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { useState } from '../../../composables';\n import SemanticQuery from './semantic-query.vue';\n\n /**\n * Retrieves a list of semantic queries from the state and exposes them in the slots.\n *\n * @public\n */\n export default defineComponent({\n name: 'SemanticQueries',\n xModule: semanticQueriesXModule.name,\n components: { BaseSuggestions, SemanticQuery },\n setup(_, { slots }) {\n /** The semantic queries from the state. */\n const suggestions: ComputedRef<Suggestion[]> = useState('semanticQueries', [\n 'semanticQueries'\n ]).semanticQueries;\n\n /**\n * Maps the list of semantic queries to a list of queries, to make it compatible with\n * other components.\n */\n const queries = computed(() => suggestions.value.map(suggestion => suggestion.query));\n\n /**\n * Finds a {@link @empathyco/x-types#Suggestion} given a query.\n *\n * @param query - The query to search.\n * @returns The {@link @empathyco/x-types#Suggestion} or undefined if not found.\n */\n function findSemanticQuery(query: string) {\n return suggestions.value.find(suggestion => suggestion.query === query);\n }\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n * If there are no suggestions, nothing is rendered.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot or empty string if there are\n * no suggestions.\n */\n function renderDefaultSlot() {\n const slotProps = {\n suggestions: suggestions.value,\n queries: queries.value,\n findSemanticQuery\n };\n return suggestions.value.length ? slots.default?.(slotProps)[0] : '';\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { suggestions };\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps;\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\nBy default, the `SemanticQueries` component will render a list of semantic queries.\n\n```vue\n<template>\n <SemanticQueries />\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueriesDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n\n### Play with props\n\nThe component has the following props:\n\n- maxItemsToRender to limit the number of semantic queries to render.\n- animation to specify the animation to be used to animate the semantic queries.\n\n```vue live\n<template>\n <SemanticQueries :animation=\"animation\" :maxItemsToRender=\"3\" />\n</template>\n\n<script>\n import { FadeAndSlide } from '@empathyco/x-components';\n\n export default {\n name: 'SemanticQueriesPropsDemo',\n data() {\n return {\n animation: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nThe default slot is used to overwrite the whole content of the component.\n\n```vue live\n<template>\n <SemanticQueries #default=\"{ suggestions }\">\n <section>\n <SlidingPanel>\n <div v-for=\"suggestion in suggestions\">\n {{ suggestion.query }}\n {{ suggestion.distance }}\n </div>\n </SlidingPanel>\n </section>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SemanticQueriesDefaultSlotDemo',\n components: {\n SemanticQueries,\n SlidingPanel\n }\n };\n</script>\n```\n\nThe default slot also exposes an array of semantic queries mapped to strings, and a method to find a\nsemantic query given a string query.\n\nThis is useful if you need an array of string queries, but also need to retrieve the original\nsemantic query to use it in another element.\n\n```vue live\n<template>\n <SemanticQueries #default=\"{ queries, findSemanticQuery }\">\n <section>\n <QueryPreviewList :queries=\"queries\" #slot=\"{ query, results }\">\n <div>\n <SemanticQuery :semanticQuery=\"findSemanticQuery(query)\" #default=\"{ query }\">\n {{ query.query }} ({{ query.distance }})\n </SemanticQuery>\n <ul>\n <li v-for=\"result in results\" :key=\"result.id\">\n {{ result.name }}\n </li>\n </ul>\n </div>\n </QueryPreviewList>\n </section>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries, SemanticQuery } from '@empathyco/x-components/semantic-queries';\n import { QueryPreviewList } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'SemanticQueriesDefaultSlotDemo2',\n components: {\n SemanticQueries,\n SemanticQuery,\n QueryPreviewList\n }\n };\n</script>\n```\n\n### Play with the suggestion slot\n\nThe suggestion slot can be used to override each semantic query item.\n\nIn this example, the query will be rendered along with the distance.\n\n```vue live\n<template>\n <SemanticQueries #suggestion=\"{ suggestion: { query, distance } }\">\n <span>\n ({{ distance }})\n {{ query }}\n </span>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n export default {\n name: 'SemanticQueriesItemSlotDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n\n### Play with the suggestion content slot\n\nThe suggsetion content slot can be used to override only the content, but keep using the\nSemanticQuery component internally.\n\n```vue live\n<template>\n <SemanticQueries #suggestion-content=\"{ suggestion: { query, distance } }\">\n <span>\n ({{ distance }})\n {{ query }}\n </span>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n export default {\n name: 'SemanticQueriesItemSlotDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createVNode","_createCommentVNode"],"mappings":";;;;;;AAE4B,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AAF5B,EAAA,OAAA,IAAA,CAAA,WAAA,CAAA,MAAA,IAAAC,SAAA,EAG8B,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IACzB,GAAA,EAAA,CAAA;AAAA,IAAA,KAAA,EAAA,oBAAA;AACA,IAAA,WAAA,EAAO,IAOR,CAAA,WAAA;AAAA,GAAA,EAAA;aACEC,OAOgB,CAAA,CAAA,oBAAA,KAAA;AAAA,MAPAC,UAAA,CAAA,IAAA,CAAY,sBAAqBC,cAAU,CAAAC,kBAAA,CAAA,oBAAA,CAAA,CAAA,EAAA,MAAA;AAAA,QAAAC,WAAA,CAAA,wBAAA,EAAA;AAAG,UAAA,UAAA,EAAO,oBAAE,CAAA,UAAA;AAAA,SAAA,EAAA;;AAb7E,YAAAH,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,oBAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,mBAAA,CAAA,CAAA,CAAA;AAAA,WAAA,CAAA;;;;AAAA,OAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,EAAA,CAAA,EAAA,CAAA,aAAA,CAAA,CAAA,IAAAE,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './semantic-query.vue2.js';
|
|
2
|
-
import { resolveComponent, openBlock, createBlock, withCtx,
|
|
2
|
+
import { resolveComponent, openBlock, createBlock, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
3
3
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -12,9 +12,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
12
12
|
"data-test": "semantic-query"
|
|
13
13
|
}, {
|
|
14
14
|
default: withCtx((baseScope) => [
|
|
15
|
-
createCommentVNode(" eslint-disable max-len "),
|
|
16
|
-
createCommentVNode("\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the suggestion belongs to}} v-bind BaseSuggestion bindings\n "),
|
|
17
|
-
createCommentVNode(" eslint-enable max-len "),
|
|
18
15
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ ...baseScope })))
|
|
19
16
|
]),
|
|
20
17
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-query.vue.js","sources":["../../../../../src/x-modules/semantic-queries/components/semantic-query.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n :query=\"query\"\n :suggestion=\"suggestion\"\n :suggestionSelectedEvents=\"suggestionSelectedEvents\"\n feature=\"semantics\"\n data-test=\"semantic-query\"\n #default=\"baseScope\"\n >\n <!-- eslint-disable max-len -->\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the suggestion belongs to}} v-bind BaseSuggestion bindings\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ ...baseScope }\" />\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { SemanticQuery } from '@empathyco/x-types';\n import { semanticQueriesXModule } from '../x-module';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { useGetter } from '../../../composables/use-getter';\n\n /**\n * This component renders a semantic query. A semantic query is a recommended query\n * that is similar in its meaning to another one.\n * It contains the query and the distance, which indicates how similar the query is\n * compared to the searched query.\n *\n * @public\n */\n export default defineComponent({\n name: 'SemanticQuery',\n xModule: semanticQueriesXModule.name,\n components: { BaseSuggestion },\n props: {\n /** The {@link @empathyco/x-types#SemanticQuery} to render. */\n suggestion: {\n type: Object as PropType<SemanticQuery>,\n required: true\n }\n },\n setup(props) {\n /** The normalized query of the semantic queries module. */\n const query = useGetter('semanticQueries', ['normalizedQuery']).normalizedQuery;\n\n /** The list of events that are going to be emitted when the button is pressed. */\n const suggestionSelectedEvents = {\n UserSelectedASemanticQuery: props.suggestion\n };\n\n return {\n query,\n suggestionSelectedEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserSelectedASemanticQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the semantic query button. The event payload is the\n semantic query data.\n\n## See it in action\n\nHere you can see that the semantic query query is rendered.\n\n```vue live\n<template>\n <SemanticQuery :suggestion=\"semanticQuery\" />\n</template>\n\n<script>\n import { SemanticQuery } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueryDemo',\n components: {\n SemanticQuery\n },\n data() {\n return {\n semanticQuery: {\n modelName: 'SemanticQuery',\n query: 'jacket',\n distance: 2\n }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, we add the distance of the semantic query next to the query.\n\n```vue live\n<template>\n <SemanticQuery :suggestion=\"semanticQuery\" #default=\"{ suggestion, query }\">\n <div>Original query: {{ query }}</div>\n <div>Suggested semantic query: {{ suggestion.query }} - {{ suggestion.distance }}</div>\n </SemanticQuery>\n</template>\n\n<script>\n import { SemanticQuery } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueryDemoDefaultSlot',\n components: {\n SemanticQuery\n },\n data() {\n return {\n semanticQuery: {\n modelName: 'SemanticQuery',\n query: 'jacket',\n distance: 2\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","
|
|
1
|
+
{"version":3,"file":"semantic-query.vue.js","sources":["../../../../../src/x-modules/semantic-queries/components/semantic-query.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n :query=\"query\"\n :suggestion=\"suggestion\"\n :suggestionSelectedEvents=\"suggestionSelectedEvents\"\n feature=\"semantics\"\n data-test=\"semantic-query\"\n #default=\"baseScope\"\n >\n <!-- eslint-disable max-len -->\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the suggestion belongs to}} v-bind BaseSuggestion bindings\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ ...baseScope }\" />\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { SemanticQuery } from '@empathyco/x-types';\n import { semanticQueriesXModule } from '../x-module';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { useGetter } from '../../../composables/use-getter';\n\n /**\n * This component renders a semantic query. A semantic query is a recommended query\n * that is similar in its meaning to another one.\n * It contains the query and the distance, which indicates how similar the query is\n * compared to the searched query.\n *\n * @public\n */\n export default defineComponent({\n name: 'SemanticQuery',\n xModule: semanticQueriesXModule.name,\n components: { BaseSuggestion },\n props: {\n /** The {@link @empathyco/x-types#SemanticQuery} to render. */\n suggestion: {\n type: Object as PropType<SemanticQuery>,\n required: true\n }\n },\n setup(props) {\n /** The normalized query of the semantic queries module. */\n const query = useGetter('semanticQueries', ['normalizedQuery']).normalizedQuery;\n\n /** The list of events that are going to be emitted when the button is pressed. */\n const suggestionSelectedEvents = {\n UserSelectedASemanticQuery: props.suggestion\n };\n\n return {\n query,\n suggestionSelectedEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserSelectedASemanticQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the semantic query button. The event payload is the\n semantic query data.\n\n## See it in action\n\nHere you can see that the semantic query query is rendered.\n\n```vue live\n<template>\n <SemanticQuery :suggestion=\"semanticQuery\" />\n</template>\n\n<script>\n import { SemanticQuery } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueryDemo',\n components: {\n SemanticQuery\n },\n data() {\n return {\n semanticQuery: {\n modelName: 'SemanticQuery',\n query: 'jacket',\n distance: 2\n }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, we add the distance of the semantic query next to the query.\n\n```vue live\n<template>\n <SemanticQuery :suggestion=\"semanticQuery\" #default=\"{ suggestion, query }\">\n <div>Original query: {{ query }}</div>\n <div>Suggested semantic query: {{ suggestion.query }} - {{ suggestion.distance }}</div>\n </SemanticQuery>\n</template>\n\n<script>\n import { SemanticQuery } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueryDemoDefaultSlot',\n components: {\n SemanticQuery\n },\n data() {\n return {\n semanticQuery: {\n modelName: 'SemanticQuery',\n query: 'jacket',\n distance: 2\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;oCACEA,gBAeiB,CAAA,gBAAA,CAAA,CAAA;AAbd,EAAA,OAAAC,SAAA,EAAsB,EAAAC,WAAA,CAAA,yBAAA,EAAA;AAAA,IACtB,KAAA,EAAA,IAAA,CAAA,KAAA;AAAA,IACD,UAAQ,EAAA,IAAA,CAAA,UAAA;AAAA,IACR,0BAAU,IAAgB,CAAA,wBAAA;AAAA,IAAA,OAAA,EAAA,WAAA;IACzB,WAAO,EAAA,gBAAA;AAAA,GAAA,EAAA;;AAPZ,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,GAAA,SAAA,EAAA,CAAA,CAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
|
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.25",
|
|
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": "68a9cd09f37965b33ca0c35380e7a3335f845a5f"
|
|
142
142
|
}
|
|
@@ -36059,7 +36059,16 @@
|
|
|
36059
36059
|
},
|
|
36060
36060
|
{
|
|
36061
36061
|
"kind": "Content",
|
|
36062
|
-
"text": "void"
|
|
36062
|
+
"text": "void | "
|
|
36063
|
+
},
|
|
36064
|
+
{
|
|
36065
|
+
"kind": "Reference",
|
|
36066
|
+
"text": "Promise",
|
|
36067
|
+
"canonicalReference": "!Promise:interface"
|
|
36068
|
+
},
|
|
36069
|
+
{
|
|
36070
|
+
"kind": "Content",
|
|
36071
|
+
"text": "<void>"
|
|
36063
36072
|
},
|
|
36064
36073
|
{
|
|
36065
36074
|
"kind": "Content",
|
|
@@ -36069,7 +36078,7 @@
|
|
|
36069
36078
|
"isOptional": true,
|
|
36070
36079
|
"returnTypeTokenRange": {
|
|
36071
36080
|
"startIndex": 3,
|
|
36072
|
-
"endIndex":
|
|
36081
|
+
"endIndex": 6
|
|
36073
36082
|
},
|
|
36074
36083
|
"releaseTag": "Public",
|
|
36075
36084
|
"overloadIndex": 1,
|
|
@@ -4038,7 +4038,7 @@ export interface InstallXOptions<API extends XAPI = XAPI> extends XPluginOptions
|
|
|
4038
4038
|
api?: API | false;
|
|
4039
4039
|
bus?: XBus<XEventsTypes, WireMetadata>;
|
|
4040
4040
|
domElement?: Element | ShadowRoot | string | ((snippetConfig: NormalisedSnippetConfig) => Element | ShadowRoot | string);
|
|
4041
|
-
installExtraPlugins?(options: ExtraPluginsOptions): void
|
|
4041
|
+
installExtraPlugins?(options: ExtraPluginsOptions): void | Promise<void>;
|
|
4042
4042
|
onCreateApp?: (app: App_2) => void;
|
|
4043
4043
|
plugin?: Plugin_2<XPluginOptions>;
|
|
4044
4044
|
rootComponent?: Component;
|
|
@@ -48,7 +48,7 @@ export interface InstallXOptions<API extends XAPI = XAPI> extends XPluginOptions
|
|
|
48
48
|
* @param options - An object that contains utilities that might be helpful for installing Vue
|
|
49
49
|
* plugins.
|
|
50
50
|
*/
|
|
51
|
-
installExtraPlugins?(options: ExtraPluginsOptions): void
|
|
51
|
+
installExtraPlugins?(options: ExtraPluginsOptions): void | Promise<void>;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Options to install more Vue plugins with.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/x-installer/x-installer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,GAAG,SAAS,IAAI,GAAG,IAAI,CAAE,SAAQ,cAAc;IAC9E;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;OAGG;IACH,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC;IAClB;;;OAGG;IACH,GAAG,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACvC;;;OAGG;IACH,UAAU,CAAC,EACP,OAAO,GACP,UAAU,GACV,MAAM,GACN,CAAC,CAAC,aAAa,EAAE,uBAAuB,KAAK,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;IAChF;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAChC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC;;;;;;OAMG;IACH,mBAAmB,CAAC,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/x-installer/x-installer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,GAAG,SAAS,IAAI,GAAG,IAAI,CAAE,SAAQ,cAAc;IAC9E;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;OAGG;IACH,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC;IAClB;;;OAGG;IACH,GAAG,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACvC;;;OAGG;IACH,UAAU,CAAC,EACP,OAAO,GACP,UAAU,GACV,MAAM,GACN,CAAC,CAAC,aAAa,EAAE,uBAAuB,KAAK,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;IAChF;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAChC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC;;;;;;OAMG;IACH,mBAAmB,CAAC,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1E;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,GAAG,EAAE,GAAG,CAAC;IACT,sFAAsF;IACtF,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACtC;;;OAGG;IACH,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,2CAA2C;IAC3C,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,qEAAqE;IACrE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACtC,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;CAChC"}
|