@empathyco/x-components 6.0.0-alpha.35 → 6.0.0-alpha.37
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 +717 -717
- package/docs/API-reference/api/x-components.md +3 -2
- package/docs/API-reference/api/x-components.relatedprompt.md +4 -25
- package/docs/API-reference/api/x-components.relatedpromptstaglist.md +39 -6
- package/docs/API-reference/api/x-components.typingoptions.md +22 -0
- package/docs/API-reference/api/x-components.typingoptions.speed.md +13 -0
- package/docs/API-reference/api/x-components.typingoptions.targetattr.md +18 -0
- package/docs/API-reference/api/x-components.typingoptions.text.md +13 -0
- package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +4 -14
- package/docs/API-reference/components/related-prompts/x-components.related-prompts-tag-list.md +16 -10
- package/js/components/page-loader-button.vue.js +7 -6
- package/js/components/page-loader-button.vue.js.map +1 -1
- package/js/components/page-loader-button.vue2.js.map +1 -1
- package/js/components/page-loader-button.vue3.js +7 -0
- package/js/components/page-loader-button.vue3.js.map +1 -0
- package/js/directives/typing.js +52 -0
- package/js/directives/typing.js.map +1 -0
- package/js/x-modules/empathize/components/empathize.vue2.js +1 -0
- package/js/x-modules/empathize/components/empathize.vue2.js.map +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue.js +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue2.js +1 -0
- package/js/x-modules/queries-preview/components/query-preview-button.vue2.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview.vue2.js +1 -0
- package/js/x-modules/queries-preview/components/query-preview.vue2.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue.js +16 -43
- package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue2.js +5 -36
- package/js/x-modules/related-prompts/components/related-prompt.vue2.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue3.js +7 -0
- package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +62 -68
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js +174 -21
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js +1 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue2.js +1 -0
- package/js/x-modules/scroll/components/scroll-to-top.vue2.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +342 -54
- package/report/x-components.api.md +48 -31
- package/types/directives/index.d.ts +1 -0
- package/types/directives/index.d.ts.map +1 -1
- package/types/directives/typing.d.ts +30 -0
- package/types/directives/typing.d.ts.map +1 -0
- package/types/views/adapter.d.ts.map +1 -1
- package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +4 -27
- package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -1
- package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts +86 -6
- package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-preview.vue2.js","sources":["../../../../../src/x-modules/queries-preview/components/query-preview.vue"],"sourcesContent":["<template>\n <ul v-if=\"hasResults\" data-test=\"query-preview\" class=\"x-query-preview\">\n <li\n v-for=\"result in queryPreviewResults?.results\"\n :key=\"result.id\"\n class=\"x-query-preview__item\"\n data-test=\"query-preview-item\"\n >\n <!--\n @slot Query Preview result slot.\n @binding {Result} result - A Query Preview result\n -->\n <slot name=\"result\" :result=\"result\">\n <span data-test=\"result-name\">{{ result.name }}</span>\n </slot>\n </li>\n </ul>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n ComputedRef,\n defineComponent,\n inject,\n onBeforeUnmount,\n PropType,\n provide,\n Ref,\n watch\n } from 'vue';\n import { SearchRequest, Filter } from '@empathyco/x-types';\n import { deepEqual, Dictionary } from '@empathyco/x-utils';\n import { LIST_ITEMS_KEY } from '../../../components';\n import { QueryFeature, FeatureLocation } from '../../../types';\n import { QueryPreviewInfo, QueryPreviewItem } from '../store/types';\n import { QueriesPreviewConfig } from '../config.types';\n import { queriesPreviewXModule } from '../x-module';\n import {\n DebouncedFunction,\n debounceFunction,\n createOrigin,\n createRawFilters\n } from '../../../utils';\n import { getHashFromQueryPreviewInfo } from '../utils/get-hash-from-query-preview';\n import { useXBus, useState } from '../../../composables';\n\n /**\n * Retrieves a preview of the results of a query and exposes them in the default slot,\n * along with the query preview and the totalResults of the search request.\n * By default, it renders the names of the results.\n *\n * @public\n */\n export default defineComponent({\n name: 'QueryPreview',\n xModule: queriesPreviewXModule.name,\n props: {\n /** The information about the request of the query preview. */\n queryPreviewInfo: {\n type: Object as PropType<QueryPreviewInfo>,\n required: true\n },\n /** The origin property for the request. */\n queryFeature: {\n type: String as PropType<QueryFeature>\n },\n /** Number of query preview results to be rendered. */\n maxItemsToRender: {\n type: Number\n },\n /**\n * Debounce time in milliseconds for triggering the search requests.\n * It will default to 0 to fit the most common use case (pre-search),\n * and it would work properly with a 250 value inside empathize.\n */\n debounceTimeMs: {\n type: Number,\n default: 0\n },\n /**\n * Controls whether the QueryPreview should be removed from the state\n * when the component is destroyed.\n */\n persistInCache: {\n type: Boolean,\n default: false\n }\n },\n emits: ['load', 'error'],\n setup(props, { emit, slots }) {\n const xBus = useXBus();\n\n const queriesPreviewState = useState('queriesPreview', [\n 'queriesPreview',\n 'params',\n 'config'\n ]);\n\n /**\n * The results preview of the queries preview cacheable mounted.\n * It is a dictionary, indexed by the query preview query.\n */\n const previewResults: ComputedRef<Dictionary<QueryPreviewItem>> =\n queriesPreviewState.queriesPreview;\n\n /**\n * As the request is handled in this component, we need\n * the extra params that will be used in the request.\n */\n const params: ComputedRef<Dictionary<unknown>> = queriesPreviewState.params;\n\n /**\n * As the request is handled in this component, we need\n * the config that will be used in the request.\n */\n const config: ComputedRef<QueriesPreviewConfig> = queriesPreviewState.config;\n\n /**\n * Query Preview key converted into a unique id.\n *\n * @returns The query hash.\n */\n const queryPreviewHash = computed(() =>\n getHashFromQueryPreviewInfo(props.queryPreviewInfo, params.value.lang as string)\n );\n\n provide('queryPreviewHash', queryPreviewHash);\n\n /**\n * Gets from the state the results preview of the query preview.\n *\n * @returns The results preview of the actual query preview.\n */\n const queryPreviewResults = computed(() => {\n const resultsPreview = previewResults.value[queryPreviewHash.value];\n return resultsPreview?.results\n ? {\n ...resultsPreview,\n results: resultsPreview.results.slice(0, props.maxItemsToRender)\n }\n : undefined;\n });\n\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 * @returns A list of results.\n */\n const results = computed(() => queryPreviewResults.value?.results);\n provide(LIST_ITEMS_KEY as string, results);\n\n /**\n * It injects the provided {@link FeatureLocation} of the selected query in the search request.\n *\n * @internal\n */\n const injectedLocation = inject<Ref<FeatureLocation> | FeatureLocation>('location', 'none');\n const location =\n typeof injectedLocation === 'object' && 'value' in injectedLocation\n ? injectedLocation.value\n : injectedLocation;\n\n /**\n * The computed request object to be used to retrieve the query preview results.\n *\n * @returns The search request object.\n */\n const queryPreviewRequest = computed<SearchRequest>(() => {\n const origin = createOrigin({\n feature: props.queryFeature,\n location: location\n });\n const filters = props.queryPreviewInfo.filters?.reduce((filtersList, filterId) => {\n const facetId = filterId.split(':')[0];\n const rawFilter = createRawFilters([filterId])[0];\n filtersList[facetId] = filtersList[facetId]\n ? filtersList[facetId].concat(rawFilter)\n : [rawFilter];\n\n return filtersList;\n }, {} as Record<string, Filter[]>);\n\n return {\n query: props.queryPreviewInfo.query,\n rows: config.value.maxItemsToRequest,\n extraParams: {\n ...params.value,\n ...props.queryPreviewInfo.extraParams\n },\n filters: filters,\n ...(origin && { origin })\n };\n });\n\n /**\n * The debounce method to trigger the request after the debounceTimeMs defined\n * for cacheable queries.\n *\n * @returns The search request object.\n */\n const emitQueryPreviewRequestUpdated = computed<DebouncedFunction<[SearchRequest]>>(() =>\n debounceFunction(request => {\n xBus.emit('QueryPreviewRequestUpdated', request, { priority: 0, replaceable: false });\n }, props.debounceTimeMs)\n );\n\n /**\n * Initialises watcher to emit debounced requests, and first value for the requests.\n *\n * @internal\n */\n watch(queryPreviewRequest, (newRequest, oldRequest) => {\n if (!deepEqual(newRequest, oldRequest)) {\n emitQueryPreviewRequestUpdated.value(newRequest);\n }\n });\n\n const cachedQueryPreview = previewResults.value[queryPreviewHash.value];\n\n // If the query has been saved it will emit load instead of the emitting the updated request.\n if (cachedQueryPreview?.status === 'success') {\n emit('load', queryPreviewHash.value);\n xBus.emit('QueryPreviewMounted', queryPreviewHash.value, {\n priority: 0,\n replaceable: false\n });\n } else {\n emitQueryPreviewRequestUpdated.value(queryPreviewRequest.value);\n }\n\n /**\n * Cancels the (remaining) requests when the component is destroyed\n * via the `debounce.cancel()` method.\n * If the prop 'persistInCache' is set to false, it also removes the QueryPreview\n * from the state when the component is destroyed.\n */\n onBeforeUnmount(() => {\n emitQueryPreviewRequestUpdated.value.cancel();\n xBus.emit(\n 'QueryPreviewUnmounted',\n { queryPreviewHash: queryPreviewHash.value, cache: props.persistInCache },\n {\n priority: 0,\n replaceable: false\n }\n );\n });\n\n /**\n * Cancels the previous request when the debounced function changes (e.g: the debounceTimeMs\n * prop changes or there is a request in progress that cancels it).\n *\n * @param _new - The new debounced function.\n * @param old - The previous debounced function.\n * @internal\n */\n watch(\n emitQueryPreviewRequestUpdated,\n (_new: DebouncedFunction<[SearchRequest]>, old: DebouncedFunction<[SearchRequest]>) => {\n old.cancel();\n }\n );\n\n const queryPreviewResultsStatus = computed(() => queryPreviewResults.value?.status);\n\n /**\n * Emits an event when the query results are loaded or fail to load.\n *\n * @param status - The status of the query preview request.\n */\n watch(queryPreviewResultsStatus, () => {\n if (queryPreviewResultsStatus.value === 'success') {\n emit(results.value?.length ? 'load' : 'error', queryPreviewHash.value);\n } else if (queryPreviewResultsStatus.value === 'error') {\n emit('error', queryPreviewHash.value);\n }\n });\n\n const hasResults = computed(() => (queryPreviewResults.value?.totalResults ?? 0) > 0);\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 results, 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 no results.\n */\n function renderDefaultSlot() {\n const slotProps = {\n queryPreviewInfo: props.queryPreviewInfo,\n results: queryPreviewResults.value?.results,\n totalResults: queryPreviewResults.value?.totalResults,\n displayTagging: queryPreviewResults.value?.displayTagging,\n queryTagging: queryPreviewResults.value?.queryTagging\n };\n\n return hasResults.value ? 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 = { hasResults, queryPreviewResults };\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps;\n }\n });\n</script>\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`QueryPreviewRequestUpdated`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted when the component is mounted and when the properties of the request object\n changes. The event payload is the `queryPreviewRequest` object.\n\n## Vue Events\n\nA list of vue events that the component will emit:\n\n- `load`: the event is emitted when the query results have been loaded.\n- `error`: the event is emitted if there is some error when retrieving the query results.\n\n## See it in action\n\nHere you have a basic example of how the QueryPreview is rendered. Keep in mind that this component\nis intended to be used overriding its default slot. By default it will only render the names of the\nresults.\n\n```vue live\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" />\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemo',\n components: {\n QueryPreview\n },\n data() {\n return {\n queryPreviewInfo: { query: 'sandals' }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, the results will be rendered inside a sliding panel.\n\n```vue live\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" #default=\"{ totalResults, results }\">\n <section>\n <p>Total results: {{ totalResults }}</p>\n <SlidingPanel :resetOnContentChange=\"false\">\n <article\n v-for=\"result in results\"\n :key=\"result.id\"\n class=\"x-result\"\n style=\"max-width: 300px; overflow: hidden\"\n >\n <BaseResultLink :result=\"result\">\n <BaseResultImage :result=\"result\" class=\"x-result__picture\" />\n </BaseResultLink>\n <div class=\"x-result__description\">\n <BaseResultLink :result=\"result\">\n <h1 class=\"x-title3\">{{ result.name }}</h1>\n </BaseResultLink>\n </div>\n </article>\n </SlidingPanel>\n </section>\n </QueryPreview>\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n import { BaseResultImage, BaseResultLink, SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'QueryPreviewDemoOverridingSlot',\n components: {\n BaseResultImage,\n BaseResultLink,\n QueryPreview,\n SlidingPanel\n },\n data() {\n return {\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n\n### Play with the result slot\n\nThe component exposes a slot to override the result content, without modifying the list.\n\nIn this example, the ID of the results will be rendered along with the name.\n\n```vue\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" #result=\"{ result }\">\n <span>{{ result.id }}</span>\n <span>{{ result.name }}</span>\n </QueryPreview>\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemoOverridingResultSlot',\n components: {\n QueryPreview\n },\n data() {\n return {\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the query preview has been limited to render a maximum of 4 results.\n\n```vue\n<template>\n <QueryPreview\n :maxItemsToRender=\"maxItemsToRender\"\n :queryPreviewInfo=\"queryPreviewInfo\"\n #default=\"{ results }\"\n >\n <BaseGrid #default=\"{ item }\" :items=\"results\">\n <BaseResultLink :result=\"item\">\n <BaseResultImage :result=\"item\" />\n </BaseResultLink>\n </BaseGrid>\n </QueryPreview>\n</template>\n\n<script>\n import { BaseGrid, BaseResultImage, BaseResultLink } from '@empathyco/x-components';\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemo',\n components: {\n BaseGrid,\n BaseResultImage,\n BaseResultLink,\n QueryPreview\n },\n data() {\n return {\n maxItemsToRender: 4,\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["debounceFunction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CE;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,qBAAqB,CAAC,IAAI;AACnC,IAAA,KAAK,EAAE;;AAEL,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAoC;AAC1C,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA+B;AACtC,SAAA;;AAED,QAAA,gBAAgB,EAAE;AAChB,YAAA,IAAI,EAAE,MAAK;AACZ,SAAA;AACD;;;;AAIE;AACF,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,CAAA;AACV,SAAA;AACD;;;AAGE;AACF,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAI;AACf,SAAA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D,gBAAA,YAAY,EAAE,mBAAmB,CAAC,KAAK,EAAE,YAAW;aACrD,CAAA;YAED,OAAO,UAAU,CAAC,KAAM,GAAE,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA,GAAI,EAAE,CAAA;SAC9D;AAEA;AAC6E;AAC7E,QAAA,MAAM,cAAa,GAAI,EAAE,UAAU,EAAE,mBAAkB,EAAG,CAAA;AAC1D,QAAA,QAAQ,KAAK,CAAC,OAAM,GAAI,iBAAgB,GAAI,cAAc,EAA0B;KACtF;AACD,CAAA,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"query-preview.vue2.js","sources":["../../../../../src/x-modules/queries-preview/components/query-preview.vue"],"sourcesContent":["<template>\n <ul v-if=\"hasResults\" data-test=\"query-preview\" class=\"x-query-preview\">\n <li\n v-for=\"result in queryPreviewResults?.results\"\n :key=\"result.id\"\n class=\"x-query-preview__item\"\n data-test=\"query-preview-item\"\n >\n <!--\n @slot Query Preview result slot.\n @binding {Result} result - A Query Preview result\n -->\n <slot name=\"result\" :result=\"result\">\n <span data-test=\"result-name\">{{ result.name }}</span>\n </slot>\n </li>\n </ul>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n ComputedRef,\n defineComponent,\n inject,\n onBeforeUnmount,\n PropType,\n provide,\n Ref,\n watch\n } from 'vue';\n import { SearchRequest, Filter } from '@empathyco/x-types';\n import { deepEqual, Dictionary } from '@empathyco/x-utils';\n import { LIST_ITEMS_KEY } from '../../../components';\n import { QueryFeature, FeatureLocation } from '../../../types';\n import { QueryPreviewInfo, QueryPreviewItem } from '../store/types';\n import { QueriesPreviewConfig } from '../config.types';\n import { queriesPreviewXModule } from '../x-module';\n import {\n DebouncedFunction,\n debounceFunction,\n createOrigin,\n createRawFilters\n } from '../../../utils';\n import { getHashFromQueryPreviewInfo } from '../utils/get-hash-from-query-preview';\n import { useXBus, useState } from '../../../composables';\n\n /**\n * Retrieves a preview of the results of a query and exposes them in the default slot,\n * along with the query preview and the totalResults of the search request.\n * By default, it renders the names of the results.\n *\n * @public\n */\n export default defineComponent({\n name: 'QueryPreview',\n xModule: queriesPreviewXModule.name,\n props: {\n /** The information about the request of the query preview. */\n queryPreviewInfo: {\n type: Object as PropType<QueryPreviewInfo>,\n required: true\n },\n /** The origin property for the request. */\n queryFeature: {\n type: String as PropType<QueryFeature>\n },\n /** Number of query preview results to be rendered. */\n maxItemsToRender: {\n type: Number\n },\n /**\n * Debounce time in milliseconds for triggering the search requests.\n * It will default to 0 to fit the most common use case (pre-search),\n * and it would work properly with a 250 value inside empathize.\n */\n debounceTimeMs: {\n type: Number,\n default: 0\n },\n /**\n * Controls whether the QueryPreview should be removed from the state\n * when the component is destroyed.\n */\n persistInCache: {\n type: Boolean,\n default: false\n }\n },\n emits: ['load', 'error'],\n setup(props, { emit, slots }) {\n const xBus = useXBus();\n\n const queriesPreviewState = useState('queriesPreview', [\n 'queriesPreview',\n 'params',\n 'config'\n ]);\n\n /**\n * The results preview of the queries preview cacheable mounted.\n * It is a dictionary, indexed by the query preview query.\n */\n const previewResults: ComputedRef<Dictionary<QueryPreviewItem>> =\n queriesPreviewState.queriesPreview;\n\n /**\n * As the request is handled in this component, we need\n * the extra params that will be used in the request.\n */\n const params: ComputedRef<Dictionary<unknown>> = queriesPreviewState.params;\n\n /**\n * As the request is handled in this component, we need\n * the config that will be used in the request.\n */\n const config: ComputedRef<QueriesPreviewConfig> = queriesPreviewState.config;\n\n /**\n * Query Preview key converted into a unique id.\n *\n * @returns The query hash.\n */\n const queryPreviewHash = computed(() =>\n getHashFromQueryPreviewInfo(props.queryPreviewInfo, params.value.lang as string)\n );\n\n provide('queryPreviewHash', queryPreviewHash);\n\n /**\n * Gets from the state the results preview of the query preview.\n *\n * @returns The results preview of the actual query preview.\n */\n const queryPreviewResults = computed(() => {\n const resultsPreview = previewResults.value[queryPreviewHash.value];\n return resultsPreview?.results\n ? {\n ...resultsPreview,\n results: resultsPreview.results.slice(0, props.maxItemsToRender)\n }\n : undefined;\n });\n\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 * @returns A list of results.\n */\n const results = computed(() => queryPreviewResults.value?.results);\n provide(LIST_ITEMS_KEY as string, results);\n\n /**\n * It injects the provided {@link FeatureLocation} of the selected query in the search request.\n *\n * @internal\n */\n const injectedLocation = inject<Ref<FeatureLocation> | FeatureLocation>('location', 'none');\n const location =\n typeof injectedLocation === 'object' && 'value' in injectedLocation\n ? injectedLocation.value\n : injectedLocation;\n\n /**\n * The computed request object to be used to retrieve the query preview results.\n *\n * @returns The search request object.\n */\n const queryPreviewRequest = computed<SearchRequest>(() => {\n const origin = createOrigin({\n feature: props.queryFeature,\n location: location\n });\n const filters = props.queryPreviewInfo.filters?.reduce((filtersList, filterId) => {\n const facetId = filterId.split(':')[0];\n const rawFilter = createRawFilters([filterId])[0];\n filtersList[facetId] = filtersList[facetId]\n ? filtersList[facetId].concat(rawFilter)\n : [rawFilter];\n\n return filtersList;\n }, {} as Record<string, Filter[]>);\n\n return {\n query: props.queryPreviewInfo.query,\n rows: config.value.maxItemsToRequest,\n extraParams: {\n ...params.value,\n ...props.queryPreviewInfo.extraParams\n },\n filters: filters,\n ...(origin && { origin })\n };\n });\n\n /**\n * The debounce method to trigger the request after the debounceTimeMs defined\n * for cacheable queries.\n *\n * @returns The search request object.\n */\n const emitQueryPreviewRequestUpdated = computed<DebouncedFunction<[SearchRequest]>>(() =>\n debounceFunction(request => {\n xBus.emit('QueryPreviewRequestUpdated', request, { priority: 0, replaceable: false });\n }, props.debounceTimeMs)\n );\n\n /**\n * Initialises watcher to emit debounced requests, and first value for the requests.\n *\n * @internal\n */\n watch(queryPreviewRequest, (newRequest, oldRequest) => {\n if (!deepEqual(newRequest, oldRequest)) {\n emitQueryPreviewRequestUpdated.value(newRequest);\n }\n });\n\n const cachedQueryPreview = previewResults.value[queryPreviewHash.value];\n\n // If the query has been saved it will emit load instead of the emitting the updated request.\n if (cachedQueryPreview?.status === 'success') {\n emit('load', queryPreviewHash.value);\n xBus.emit('QueryPreviewMounted', queryPreviewHash.value, {\n priority: 0,\n replaceable: false\n });\n } else {\n emitQueryPreviewRequestUpdated.value(queryPreviewRequest.value);\n }\n\n /**\n * Cancels the (remaining) requests when the component is destroyed\n * via the `debounce.cancel()` method.\n * If the prop 'persistInCache' is set to false, it also removes the QueryPreview\n * from the state when the component is destroyed.\n */\n onBeforeUnmount(() => {\n emitQueryPreviewRequestUpdated.value.cancel();\n xBus.emit(\n 'QueryPreviewUnmounted',\n { queryPreviewHash: queryPreviewHash.value, cache: props.persistInCache },\n {\n priority: 0,\n replaceable: false\n }\n );\n });\n\n /**\n * Cancels the previous request when the debounced function changes (e.g: the debounceTimeMs\n * prop changes or there is a request in progress that cancels it).\n *\n * @param _new - The new debounced function.\n * @param old - The previous debounced function.\n * @internal\n */\n watch(\n emitQueryPreviewRequestUpdated,\n (_new: DebouncedFunction<[SearchRequest]>, old: DebouncedFunction<[SearchRequest]>) => {\n old.cancel();\n }\n );\n\n const queryPreviewResultsStatus = computed(() => queryPreviewResults.value?.status);\n\n /**\n * Emits an event when the query results are loaded or fail to load.\n *\n * @param status - The status of the query preview request.\n */\n watch(queryPreviewResultsStatus, () => {\n if (queryPreviewResultsStatus.value === 'success') {\n emit(results.value?.length ? 'load' : 'error', queryPreviewHash.value);\n } else if (queryPreviewResultsStatus.value === 'error') {\n emit('error', queryPreviewHash.value);\n }\n });\n\n const hasResults = computed(() => (queryPreviewResults.value?.totalResults ?? 0) > 0);\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 results, 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 no results.\n */\n function renderDefaultSlot() {\n const slotProps = {\n queryPreviewInfo: props.queryPreviewInfo,\n results: queryPreviewResults.value?.results,\n totalResults: queryPreviewResults.value?.totalResults,\n displayTagging: queryPreviewResults.value?.displayTagging,\n queryTagging: queryPreviewResults.value?.queryTagging\n };\n\n return hasResults.value ? 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 = { hasResults, queryPreviewResults };\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps;\n }\n });\n</script>\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`QueryPreviewRequestUpdated`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted when the component is mounted and when the properties of the request object\n changes. The event payload is the `queryPreviewRequest` object.\n\n## Vue Events\n\nA list of vue events that the component will emit:\n\n- `load`: the event is emitted when the query results have been loaded.\n- `error`: the event is emitted if there is some error when retrieving the query results.\n\n## See it in action\n\nHere you have a basic example of how the QueryPreview is rendered. Keep in mind that this component\nis intended to be used overriding its default slot. By default it will only render the names of the\nresults.\n\n```vue live\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" />\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemo',\n components: {\n QueryPreview\n },\n data() {\n return {\n queryPreviewInfo: { query: 'sandals' }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, the results will be rendered inside a sliding panel.\n\n```vue live\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" #default=\"{ totalResults, results }\">\n <section>\n <p>Total results: {{ totalResults }}</p>\n <SlidingPanel :resetOnContentChange=\"false\">\n <article\n v-for=\"result in results\"\n :key=\"result.id\"\n class=\"x-result\"\n style=\"max-width: 300px; overflow: hidden\"\n >\n <BaseResultLink :result=\"result\">\n <BaseResultImage :result=\"result\" class=\"x-result__picture\" />\n </BaseResultLink>\n <div class=\"x-result__description\">\n <BaseResultLink :result=\"result\">\n <h1 class=\"x-title3\">{{ result.name }}</h1>\n </BaseResultLink>\n </div>\n </article>\n </SlidingPanel>\n </section>\n </QueryPreview>\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n import { BaseResultImage, BaseResultLink, SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'QueryPreviewDemoOverridingSlot',\n components: {\n BaseResultImage,\n BaseResultLink,\n QueryPreview,\n SlidingPanel\n },\n data() {\n return {\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n\n### Play with the result slot\n\nThe component exposes a slot to override the result content, without modifying the list.\n\nIn this example, the ID of the results will be rendered along with the name.\n\n```vue\n<template>\n <QueryPreview :queryPreviewInfo=\"queryPreviewInfo\" #result=\"{ result }\">\n <span>{{ result.id }}</span>\n <span>{{ result.name }}</span>\n </QueryPreview>\n</template>\n\n<script>\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemoOverridingResultSlot',\n components: {\n QueryPreview\n },\n data() {\n return {\n queryPreviewInfo: { query: 'flip-flops' }\n };\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the query preview has been limited to render a maximum of 4 results.\n\n```vue\n<template>\n <QueryPreview\n :maxItemsToRender=\"maxItemsToRender\"\n :queryPreviewInfo=\"queryPreviewInfo\"\n #default=\"{ results }\"\n >\n <BaseGrid #default=\"{ item }\" :items=\"results\">\n <BaseResultLink :result=\"item\">\n <BaseResultImage :result=\"item\" />\n </BaseResultLink>\n </BaseGrid>\n </QueryPreview>\n</template>\n\n<script>\n import { BaseGrid, BaseResultImage, BaseResultLink } from '@empathyco/x-components';\n import { QueryPreview } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'QueryPreviewDemo',\n components: {\n BaseGrid,\n BaseResultImage,\n BaseResultLink,\n QueryPreview\n },\n data() {\n return {\n maxItemsToRender: 4,\n queryPreviewInfo: { query: 'flip-flops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+
import { resolveDirective, openBlock, createElementBlock, withDirectives, createElementVNode, createBlock, resolveDynamicComponent } from 'vue';
|
|
3
|
+
import './related-prompt.vue3.js';
|
|
3
4
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
4
5
|
|
|
5
|
-
const _hoisted_1 = { class: "x-related-
|
|
6
|
+
const _hoisted_1 = { class: "x-related-prompt" };
|
|
6
7
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
renderSlot(_ctx.$slots, "related-prompt-button-info", {}, () => [
|
|
21
|
-
createElementVNode("div", _hoisted_1, [
|
|
22
|
-
createElementVNode(
|
|
23
|
-
"span",
|
|
24
|
-
{
|
|
25
|
-
class: normalizeClass(["x-typewritter-initial", [{ "x-typewritter-animation": _ctx.isPromptVisible }]]),
|
|
26
|
-
style: normalizeStyle({
|
|
27
|
-
animationDelay: `${_ctx.index * 0.4 + 0.05}s`,
|
|
28
|
-
"--suggestion-text-length": _ctx.relatedPrompt.suggestionText.length
|
|
29
|
-
})
|
|
30
|
-
},
|
|
31
|
-
toDisplayString(_ctx.relatedPrompt.suggestionText),
|
|
32
|
-
7
|
|
33
|
-
/* TEXT, CLASS, STYLE */
|
|
34
|
-
)
|
|
35
|
-
]),
|
|
36
|
-
_ctx.isSelected ? (openBlock(), createBlock(_component_CrossTinyIcon, {
|
|
37
|
-
key: 0,
|
|
38
|
-
class: "x-icon-lg"
|
|
39
|
-
})) : (openBlock(), createBlock(_component_PlusIcon, {
|
|
40
|
-
key: 1,
|
|
41
|
-
class: "x-icon-lg"
|
|
42
|
-
}))
|
|
43
|
-
])
|
|
44
|
-
],
|
|
45
|
-
34
|
|
46
|
-
/* CLASS, NEED_HYDRATION */
|
|
47
|
-
);
|
|
8
|
+
const _directive_typing = resolveDirective("typing");
|
|
9
|
+
return openBlock(), createElementBlock("button", _hoisted_1, [
|
|
10
|
+
withDirectives(createElementVNode(
|
|
11
|
+
"span",
|
|
12
|
+
null,
|
|
13
|
+
null,
|
|
14
|
+
512
|
|
15
|
+
/* NEED_PATCH */
|
|
16
|
+
), [
|
|
17
|
+
[_directive_typing, { text: _ctx.relatedPrompt.suggestionText, speed: 50 }]
|
|
18
|
+
]),
|
|
19
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.selected ? "CrossTinyIcon" : "PlusIcon"), { class: "x-icon-lg x-related-prompt-icon" }))
|
|
20
|
+
]);
|
|
48
21
|
}
|
|
49
22
|
var RelatedPrompt = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
50
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-prompt.vue.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <
|
|
1
|
+
{"version":3,"file":"related-prompt.vue.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <button class=\"x-related-prompt\">\n <span v-typing=\"{ text: relatedPrompt.suggestionText, speed: 50 }\" />\n <component\n :is=\"selected ? 'CrossTinyIcon' : 'PlusIcon'\"\n class=\"x-icon-lg x-related-prompt-icon\"\n />\n </button>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { RelatedPrompt } from '@empathyco/x-types';\n import CrossTinyIcon from '../../../components/icons/cross-tiny.vue';\n import PlusIcon from '../../../components/icons/plus.vue';\n import vTyping from '../../../directives/typing';\n\n /**\n * This component shows a suggested related prompt.\n */\n export default defineComponent({\n name: 'RelatedPrompt',\n directives: {\n typing: vTyping\n },\n components: {\n CrossTinyIcon,\n PlusIcon\n },\n props: {\n relatedPrompt: {\n type: Object as PropType<RelatedPrompt>,\n required: true\n },\n selected: {\n type: Boolean,\n default: false\n }\n }\n });\n</script>\n<style lang=\"css\">\n .x-related-prompt {\n display: flex;\n align-items: center;\n justify-content: space-between;\n text-align: start;\n padding: 8px;\n height: 100%;\n width: 100%;\n }\n .x-related-prompt-icon {\n align-self: start;\n }\n</style>\n"],"names":["_resolveDirective","relatedPrompt","_withDirectives","_createElementVNode","selected"],"mappings":";;;;;;;AACE,EAAA,MAAA,iBAAA,GAAAA,gBAAA,CAMS,QANT,CAAA,CAAA;yCAC0BC,QAAc,EAAA,UAAA,EAAA;AAAA,IAAAC,cAAA,CAAAC,kBAAA;;;;;;;AACtC,MAAA,CAAA,iBAAA,EAAA,EAAA,IAAA,EAHJ,mCAIWC,KAAQ,EAAA,EAAA,EAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;"}
|
|
@@ -1,60 +1,29 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
|
-
import { relatedPromptsXModule } from '../x-module.js';
|
|
3
2
|
import CrossTinyIcon from '../../../components/icons/cross-tiny.vue.js';
|
|
4
3
|
import PlusIcon from '../../../components/icons/plus.vue.js';
|
|
5
|
-
import '../../../
|
|
6
|
-
import { use$x } from '../../../composables/use-_x.js';
|
|
7
|
-
import '@vue/devtools-api';
|
|
8
|
-
import '../../../plugins/devtools/timeline.devtools.js';
|
|
9
|
-
import '@empathyco/x-utils';
|
|
10
|
-
import 'rxjs/operators';
|
|
11
|
-
import 'rxjs';
|
|
12
|
-
import '../../../plugins/devtools/colors.utils.js';
|
|
13
|
-
import '../../../plugins/x-bus.js';
|
|
14
|
-
import '../../../plugins/x-plugin.js';
|
|
15
|
-
import 'vuex';
|
|
16
|
-
import '@vueuse/core';
|
|
4
|
+
import typingDirective from '../../../directives/typing.js';
|
|
17
5
|
|
|
18
6
|
/**
|
|
19
7
|
* This component shows a suggested related prompt.
|
|
20
|
-
*
|
|
21
|
-
* It provides a slot to customize the related prompt button information.
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
8
|
*/
|
|
25
9
|
var _sfc_main = defineComponent({
|
|
26
10
|
name: 'RelatedPrompt',
|
|
11
|
+
directives: {
|
|
12
|
+
typing: typingDirective
|
|
13
|
+
},
|
|
27
14
|
components: {
|
|
28
15
|
CrossTinyIcon,
|
|
29
16
|
PlusIcon
|
|
30
17
|
},
|
|
31
|
-
xModule: relatedPromptsXModule.name,
|
|
32
18
|
props: {
|
|
33
19
|
relatedPrompt: {
|
|
34
20
|
type: Object,
|
|
35
21
|
required: true
|
|
36
22
|
},
|
|
37
|
-
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: false
|
|
40
|
-
},
|
|
41
|
-
isSelected: {
|
|
23
|
+
selected: {
|
|
42
24
|
type: Boolean,
|
|
43
25
|
default: false
|
|
44
|
-
},
|
|
45
|
-
index: {
|
|
46
|
-
type: Number,
|
|
47
|
-
required: true
|
|
48
26
|
}
|
|
49
|
-
},
|
|
50
|
-
setup() {
|
|
51
|
-
const x = use$x();
|
|
52
|
-
const toggleSuggestion = (index) => {
|
|
53
|
-
x.emit('UserSelectedARelatedPrompt', index);
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
toggleSuggestion
|
|
57
|
-
};
|
|
58
27
|
}
|
|
59
28
|
});
|
|
60
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-prompt.vue2.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <
|
|
1
|
+
{"version":3,"file":"related-prompt.vue2.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <button class=\"x-related-prompt\">\n <span v-typing=\"{ text: relatedPrompt.suggestionText, speed: 50 }\" />\n <component\n :is=\"selected ? 'CrossTinyIcon' : 'PlusIcon'\"\n class=\"x-icon-lg x-related-prompt-icon\"\n />\n </button>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { RelatedPrompt } from '@empathyco/x-types';\n import CrossTinyIcon from '../../../components/icons/cross-tiny.vue';\n import PlusIcon from '../../../components/icons/plus.vue';\n import vTyping from '../../../directives/typing';\n\n /**\n * This component shows a suggested related prompt.\n */\n export default defineComponent({\n name: 'RelatedPrompt',\n directives: {\n typing: vTyping\n },\n components: {\n CrossTinyIcon,\n PlusIcon\n },\n props: {\n relatedPrompt: {\n type: Object as PropType<RelatedPrompt>,\n required: true\n },\n selected: {\n type: Boolean,\n default: false\n }\n }\n });\n</script>\n<style lang=\"css\">\n .x-related-prompt {\n display: flex;\n align-items: center;\n justify-content: space-between;\n text-align: start;\n padding: 8px;\n height: 100%;\n width: 100%;\n }\n .x-related-prompt-icon {\n align-self: start;\n }\n</style>\n"],"names":["vTyping"],"mappings":";;;;;AAgBE;;AAEE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,UAAU,EAAE;AACV,QAAA,MAAM,EAAEA,eAAM;AACf,KAAA;AACD,IAAA,UAAU,EAAE;QACV,aAAa;QACb,QAAO;AACR,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,MAAiC;AACvC,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAI;AACf,SAAA;AACF,KAAA;AACD,CAAA,CAAC;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import injectCss from '../../../../tools/inject-css.js';
|
|
2
|
+
|
|
3
|
+
var css = "[dir=ltr] .x-related-prompt{text-align:left}[dir=rtl] .x-related-prompt{text-align:right}.x-related-prompt{align-items:center;display:flex;height:100%;justify-content:space-between;padding:8px;width:100%}.x-related-prompt-icon{align-self:start}";
|
|
4
|
+
injectCss(css);
|
|
5
|
+
|
|
6
|
+
export { css, css as default };
|
|
7
|
+
//# sourceMappingURL=related-prompt.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-prompt.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,78 +1,72 @@
|
|
|
1
1
|
import _sfc_main from './related-prompts-tag-list.vue2.js';
|
|
2
|
-
import { resolveComponent, openBlock,
|
|
2
|
+
import { resolveComponent, openBlock, createBlock, withCtx, renderSlot, createVNode, TransitionGroup, createElementBlock, Fragment, renderList, normalizeClass, normalizeStyle } from 'vue';
|
|
3
3
|
import './related-prompts-tag-list.vue3.js';
|
|
4
4
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
6
|
+
const _hoisted_1 = ["data-index"];
|
|
6
7
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7
8
|
const _component_RelatedPrompt = resolveComponent("RelatedPrompt");
|
|
8
9
|
const _component_SlidingPanel = resolveComponent("SlidingPanel");
|
|
9
|
-
return openBlock(),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"sliding-panel-left-button"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"sliding-panel-right-button"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
)
|
|
70
|
-
])
|
|
71
|
-
]),
|
|
72
|
-
_: 3
|
|
73
|
-
/* FORWARDED */
|
|
74
|
-
}, 8, ["button-class", "scroll-container-class"])
|
|
75
|
-
]);
|
|
10
|
+
return openBlock(), createBlock(_component_SlidingPanel, {
|
|
11
|
+
key: _ctx.x.query.search,
|
|
12
|
+
"reset-on-content-change": false,
|
|
13
|
+
"button-class": _ctx.buttonClass,
|
|
14
|
+
"scroll-container-class": "x-related-prompts-tag-list-scroll-container"
|
|
15
|
+
}, {
|
|
16
|
+
"sliding-panel-left-button": withCtx(() => [
|
|
17
|
+
renderSlot(_ctx.$slots, "sliding-panel-left-button")
|
|
18
|
+
]),
|
|
19
|
+
"sliding-panel-right-button": withCtx(() => [
|
|
20
|
+
renderSlot(_ctx.$slots, "sliding-panel-right-button")
|
|
21
|
+
]),
|
|
22
|
+
default: withCtx(() => [
|
|
23
|
+
createVNode(TransitionGroup, {
|
|
24
|
+
onBeforeEnter: _ctx.onBeforeEnter,
|
|
25
|
+
onEnter: _ctx.onEnter,
|
|
26
|
+
onLeave: _ctx.onLeave,
|
|
27
|
+
class: "x-related-prompts-tag-list",
|
|
28
|
+
css: false,
|
|
29
|
+
tag: "ul",
|
|
30
|
+
appear: ""
|
|
31
|
+
}, {
|
|
32
|
+
default: withCtx(() => [
|
|
33
|
+
(openBlock(true), createElementBlock(
|
|
34
|
+
Fragment,
|
|
35
|
+
null,
|
|
36
|
+
renderList(_ctx.visibleRelatedPrompts, ({ index, ...relatedPrompt }) => {
|
|
37
|
+
return openBlock(), createElementBlock("li", {
|
|
38
|
+
ref_for: true,
|
|
39
|
+
ref: "listItems",
|
|
40
|
+
key: relatedPrompt.suggestionText,
|
|
41
|
+
class: normalizeClass(["x-related-prompts-tag-list-item", [_ctx.tagClass, _ctx.tagColors && _ctx.tagColors[index % _ctx.tagColors.length]]]),
|
|
42
|
+
"data-index": index,
|
|
43
|
+
style: normalizeStyle(_ctx.isAnimating && { pointerEvents: "none" }),
|
|
44
|
+
"data-test": "related-prompts-tag-list-item"
|
|
45
|
+
}, [
|
|
46
|
+
renderSlot(_ctx.$slots, "default", {
|
|
47
|
+
relatedPrompt,
|
|
48
|
+
onSelect: () => _ctx.onSelect(index),
|
|
49
|
+
isSelected: _ctx.isSelected(index)
|
|
50
|
+
}, () => [
|
|
51
|
+
createVNode(_component_RelatedPrompt, {
|
|
52
|
+
onClick: ($event) => _ctx.onSelect(index),
|
|
53
|
+
"related-prompt": relatedPrompt,
|
|
54
|
+
selected: _ctx.isSelected(index)
|
|
55
|
+
}, null, 8, ["onClick", "related-prompt", "selected"])
|
|
56
|
+
])
|
|
57
|
+
], 14, _hoisted_1);
|
|
58
|
+
}),
|
|
59
|
+
128
|
|
60
|
+
/* KEYED_FRAGMENT */
|
|
61
|
+
))
|
|
62
|
+
]),
|
|
63
|
+
_: 3
|
|
64
|
+
/* FORWARDED */
|
|
65
|
+
}, 8, ["onBeforeEnter", "onEnter", "onLeave"])
|
|
66
|
+
]),
|
|
67
|
+
_: 3
|
|
68
|
+
/* FORWARDED */
|
|
69
|
+
}, 8, ["button-class"]);
|
|
76
70
|
}
|
|
77
71
|
var relatedPromptsTagList = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
78
72
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-prompts-tag-list.vue.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompts-tag-list.vue"],"sourcesContent":["<template>\n <div>\n <template v-if=\"$slots.header\">\n <slot name=\"header\" />\n </template>\n <SlidingPanel\n :reset-on-content-change=\"true\"\n :button-class=\"buttonClass\"\n :scroll-container-class=\"\n selectedPrompt === -1 ? 'desktop:x-sliding-panel-fade desktop:x-sliding-panel-fade-sm' : ''\n \"\n >\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panel-left-button\" />\n </template>\n\n <slot name=\"sliding-panel-content\">\n <div\n ref=\"slidingPanelContent\"\n class=\"x-related-prompt__sliding-panel-content\"\n :class=\"{ 'x-related-prompt__sliding-panel-content-selected': selectedPrompt !== -1 }\"\n >\n <div\n v-for=\"(suggestion, index) in relatedPrompts\"\n :key=\"index\"\n :style=\"{\n animationDelay: `${index * 0.4 + 0.05}s`\n }\"\n class=\"x-related-prompt x-staggered-initial\"\n :class=\"[\n { 'x-staggered-animation': arePromptsVisible },\n { 'x-hidden': hidePrompt(index) },\n { 'x-related-prompt-selected': isSelected(index) }\n ]\"\n data-test=\"related-prompt-item\"\n >\n <slot\n name=\"related-prompt-button\"\n v-bind=\"{ suggestion, index, arePromptsVisible, isSelected }\"\n >\n <RelatedPrompt\n :related-prompt=\"suggestion\"\n :index=\"index\"\n :is-prompt-visible=\"arePromptsVisible\"\n :is-selected=\"isSelected(index)\"\n />\n </slot>\n </div>\n </div>\n </slot>\n\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panel-right-button\" />\n </template>\n </SlidingPanel>\n </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\n import SlidingPanel from '../../../components/sliding-panel.vue';\n import { relatedPromptsXModule } from '../x-module';\n import { useState } from '../../../composables/index';\n import RelatedPrompt from './related-prompt.vue';\n\n export default defineComponent({\n name: 'RelatedPromptsTagList',\n xModule: relatedPromptsXModule.name,\n components: { RelatedPrompt, SlidingPanel },\n props: {\n buttonClass: String\n },\n setup() {\n const { relatedPrompts, selectedPrompt } = useState('relatedPrompts', [\n 'relatedPrompts',\n 'selectedPrompt'\n ]);\n\n const slidingPanelContent = ref<Element>();\n const arePromptsVisible = ref(false);\n\n const observer = new IntersectionObserver(([entry]) => {\n arePromptsVisible.value = entry.isIntersecting;\n });\n\n onMounted(() => {\n observer.observe(slidingPanelContent.value as Element);\n });\n\n onUnmounted(() => {\n observer.disconnect();\n });\n\n const isSelected = (index: number): boolean => selectedPrompt.value === index;\n\n const hidePrompt = (index: number): boolean =>\n selectedPrompt.value !== -1 && selectedPrompt.value !== index;\n\n return {\n arePromptsVisible,\n hidePrompt,\n isSelected,\n relatedPrompts,\n selectedPrompt,\n slidingPanelContent\n };\n }\n });\n</script>\n\n<style lang=\"css\">\n .x-related-prompt__sliding-panel-content {\n display: flex;\n gap: 8px;\n }\n\n .x-related-prompt__sliding-panel-content-selected {\n width: calc(100%);\n }\n\n .x-related-prompt {\n display: flex;\n flex-direction: column;\n border-radius: 12px;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 500ms;\n min-height: 112px;\n height: 100%;\n width: 303px;\n }\n\n .x-related-prompt-selected {\n width: 100% !important;\n min-height: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n &__button {\n width: 100% !important;\n }\n }\n\n .x-related-prompt__button {\n display: flex;\n flex-direction: row;\n gap: 12px;\n justify-content: space-between;\n align-items: start;\n text-align: start;\n padding: 16px;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 500ms;\n flex-grow: 1;\n width: 303px;\n }\n\n .x-related-prompt__button-info {\n display: flex;\n min-height: 32px;\n }\n\n @media (max-width: 743px) {\n .x-related-prompt {\n width: 204px;\n &__button {\n width: 204px;\n }\n }\n }\n\n .x-no-scrollbar::-webkit-scrollbar {\n display: none;\n }\n\n .x-no-scrollbar {\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n }\n\n .x-typewritter-initial {\n color: #0000;\n background: linear-gradient(-90deg, transparent 5px, #0000 0) 10px 0,\n linear-gradient(#575757 0 0) 0 0;\n background-size: 0 200%;\n -webkit-background-clip: padding-box, text;\n background-clip: padding-box, text;\n background-repeat: no-repeat;\n }\n\n .x-typewritter-animation {\n animation: typewritter calc(var(--suggestion-text-length) * 0.05s)\n steps(var(--suggestion-text-length)) forwards;\n }\n\n @keyframes typewritter {\n from {\n background-size: 0 200%;\n }\n to {\n background-size: calc(var(--suggestion-text-length) * 1ch) 200%;\n }\n }\n\n .x-staggered-initial {\n opacity: 0;\n transform: translateY(20px);\n }\n\n .x-staggered-animation {\n animation: fadeInUp 0.6s forwards;\n }\n\n @keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n</style>\n"],"names":["_resolveComponent","_openBlock","_createElementBlock","_renderSlot","_createCommentVNode","_createVNode","selectedPrompt","_withCtx","_createElementVNode","_normalizeClass","relatedPrompts","_Fragment","_renderList","hidePrompt","isSelected","_mergeProps"],"mappings":";;;;;;;kCACEA,gBAsDM,CAAA,cAAA,CAAA,CAAA;AApDF,EAAA,OAAAC,SAAA,EAHN,EAAAC,kBAAA,CAAA,KAAA,EAAA,IAAA,EAAA;AAAA,IAKI,IAAA,CAAA,MAAA,CAAA,MAAA,GAAAC,UAAA,CAiDe,IAhDZ,CAAA,MAAA,EAAA,QAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,GAAAC,kBAAA,CAAA,MAAA,EAAyB,IAAI,CAAA;AAAA,IAAAC,WAAA,CAC7B,uBAAyB,EAAA;AAAA,MACzB,yBAAsB,EAAA,IAAA;AAAA,MAAA,cAAA,EAAWC,IAAc,CAAA,WAAA;AAAA,MAAA,wBAAA,EAAA,IAAA,CAAA,cAAA,KAAA,CAAA,CAAA,GAAA,8DAAA,GAAA,EAAA;;;QA2CrCH,UACiC,CAAA,IAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;AAAA,OAAA,CAAA;;QApDlDA,UAiDa,CAAA,IAAA,CAAA,MAAA,EAAA,4BAAA,CAAA;AAAA,OAAA,CAAA;eAhCLI,OA+BM,CAAA,MAAA;AAAA,QAAAJ,UAAA,CA9BA,IAAqB,CAAA,MAAA,EAAA,uBAAA,EAAA,EAAA,EAAA,MAAA;AAAA,UAAAK,kBAAA;AAlBnC,YAAA,K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;;;;;;;AA5CjB,SAAA,CAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"related-prompts-tag-list.vue.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompts-tag-list.vue"],"sourcesContent":["<template>\n <SlidingPanel\n :key=\"x.query.search\"\n :reset-on-content-change=\"false\"\n :button-class=\"buttonClass\"\n scroll-container-class=\"x-related-prompts-tag-list-scroll-container\"\n >\n <template #sliding-panel-left-button>\n <!-- \n @slot sliding-panel-left-button - The button to be displayed on the left side of the sliding panel. \n -->\n <slot name=\"sliding-panel-left-button\" />\n </template>\n <transition-group\n @before-enter=\"onBeforeEnter\"\n @enter=\"onEnter\"\n @leave=\"onLeave\"\n class=\"x-related-prompts-tag-list\"\n :css=\"false\"\n tag=\"ul\"\n appear\n >\n <li\n v-for=\"{ index, ...relatedPrompt } in visibleRelatedPrompts\"\n ref=\"listItems\"\n :key=\"relatedPrompt.suggestionText\"\n class=\"x-related-prompts-tag-list-item\"\n :class=\"[tagClass, tagColors && tagColors[index % tagColors.length]]\"\n :data-index=\"index\"\n :style=\"isAnimating && { pointerEvents: 'none' }\"\n data-test=\"related-prompts-tag-list-item\"\n >\n <!--\n @slot - The slot to render related prompt information.\n @prop {Object} relatedPrompt - The related prompt object.\n @prop {Function} onSelect - The function to select the related prompt.\n @prop {Boolean} isSelected - Indicates if the related prompt is currently selected.\n -->\n <slot\n :relatedPrompt=\"relatedPrompt\"\n :onSelect=\"() => onSelect(index)\"\n :isSelected=\"isSelected(index)\"\n >\n <RelatedPrompt\n @click=\"onSelect(index)\"\n :related-prompt=\"relatedPrompt\"\n :selected=\"isSelected(index)\"\n />\n </slot>\n </li>\n </transition-group>\n <template #sliding-panel-right-button>\n <!-- \n @slot sliding-panel-right-button - The button to be displayed on the right side of the sliding panel. \n -->\n <slot name=\"sliding-panel-right-button\" />\n </template>\n </SlidingPanel>\n</template>\n\n<script lang=\"ts\">\n import { RelatedPrompt as RelatedPromptModel } from '@empathyco/x-types';\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n import SlidingPanel from '../../../components/sliding-panel.vue';\n import { relatedPromptsXModule } from '../x-module';\n import { use$x, useState } from '../../../composables';\n import RelatedPrompt from './related-prompt.vue';\n\n /**\n * This component shows the list of `RelatedPrompts` components.\n *\n * If the default slot is reimplemented in the consumer, `onSelect` function will be\n * necessary to handle the selection of the related prompt and to trigger the stagger-fade-slide animation.\n *\n * @public\n */\n export default defineComponent({\n name: 'RelatedPromptsTagList',\n xModule: relatedPromptsXModule.name,\n components: { RelatedPrompt, SlidingPanel },\n props: {\n /**\n * The CSS class for the left and right button of the sliding panel.\n *\n * @public\n */\n buttonClass: String,\n /**\n * The CSS class for all the related prompt wrapper elements.\n *\n * @public\n */\n tagClass: String,\n /**\n * Array of colors to apply to the related prompts. It will be applied to tag\n * elements cyclically according to their index in the nex way: `tagColors[index % tagColors.length]`.\n *\n * @public\n */\n tagColors: Array as PropType<string[]>,\n /**\n * The duration of the total animation in milliseconds.\n *\n * @public\n */\n animationDurationInMs: {\n type: Number,\n default: 700\n }\n },\n setup(props) {\n const x = use$x();\n const { relatedPrompts, selectedPrompt: selectedPromptIndex } = useState('relatedPrompts', [\n 'relatedPrompts',\n 'selectedPrompt'\n ]);\n\n const clickedListItemIndex = ref<number | null>(null);\n const initialOffsetLefts: Record<number, number> = {};\n const isAnimating = ref(false);\n const listItems = ref<HTMLElement[]>([]);\n\n const sortedListItems = computed<HTMLElement[]>(() =>\n [...listItems.value].sort(\n (a: HTMLElement, b: HTMLElement) =>\n Number.parseInt(b.getAttribute('data-index')!) -\n Number.parseInt(a.getAttribute('data-index')!)\n )\n );\n\n // The duration of a single animation (enter or leave) in milliseconds\n // if a related prompt is clicked (clickedListItemIndex.value !== null), the duration is divided by the number of related\n // prompts -1 (the clicked one is synchronized with the last one to leave or the first one to enter)\n const singleAnimationDurationInMs = computed(\n () =>\n props.animationDurationInMs /\n (clickedListItemIndex.value !== null\n ? relatedPrompts.value.length - 1\n : relatedPrompts.value.length)\n );\n\n const indexRelatedPrompts = computed(() =>\n (relatedPrompts.value as RelatedPromptModel[]).map(\n (relatedPrompt: RelatedPromptModel, index: number) => ({\n ...relatedPrompt,\n index\n })\n )\n );\n\n const visibleRelatedPrompts = computed(() => {\n return selectedPromptIndex.value !== -1\n ? [indexRelatedPrompts.value[selectedPromptIndex.value]]\n : indexRelatedPrompts.value;\n });\n\n let timeOutId: number;\n const resetTransitionStyle = () => {\n if (timeOutId) {\n clearTimeout(timeOutId);\n }\n\n isAnimating.value = true;\n timeOutId = +setTimeout(() => {\n isAnimating.value = false;\n clickedListItemIndex.value = null;\n\n sortedListItems.value.forEach(element => {\n element.style.cssText\n .split(';')\n .map(rule => rule.split(':')[0]?.trim())\n .forEach(property => {\n if (property !== 'width') {\n element.style.removeProperty(property);\n }\n });\n });\n }, props.animationDurationInMs);\n };\n\n const onSelect = (selectedIndex: number): void => {\n resetTransitionStyle();\n\n clickedListItemIndex.value = selectedIndex;\n const selected: HTMLElement = sortedListItems.value.find(\n element => Number.parseInt(element.getAttribute('data-index')!) === selectedIndex\n )!;\n\n // selectedPromptIndex.value === -1 ? 'SELECTING' : 'DESELECTING'\n if (selectedPromptIndex.value === -1) {\n // Prepare all the elements for the leave animation (~ 'beforeLeave' hook). Remember the elements are\n // sorted in descending order by index.\n sortedListItems.value.forEach(element => {\n const index = Number.parseInt(element.getAttribute('data-index')!);\n\n initialOffsetLefts[index] = element.offsetLeft;\n element.style.left = `${element.offsetLeft}px`;\n element.style.position = 'absolute';\n element.style.transitionDuration = `${singleAnimationDurationInMs.value}ms`;\n\n if (index !== selectedIndex) {\n element.style.opacity = '1';\n element.style.transitionDelay = `${\n (index < selectedIndex ? index : index - 1) * singleAnimationDurationInMs.value\n }ms`;\n }\n });\n\n // Synchronize the transition delay of the selected element with the last\n // element to leave\n selected.style.transitionDelay = `${\n (relatedPrompts.value.length > 1 ? relatedPrompts.value.length - 2 : 0) *\n singleAnimationDurationInMs.value\n }ms`;\n\n // Trigger the animation (selecting) for the selected element\n requestAnimationFrame(() => {\n const maxWidth = getComputedStyle(selected).maxWidth;\n\n selected.style.left = '0px';\n selected.style.setProperty(\n 'width',\n `${maxWidth !== 'none' ? maxWidth : '100%'}`,\n 'important'\n );\n });\n } else {\n // Prepare the selected element for the deselecting animation\n selected.style.transitionDuration = `${singleAnimationDurationInMs.value}ms`;\n selected.style.left = '0px';\n selected.style.position = 'absolute';\n\n // Trigger the animation (deselecting) for the selected element\n selected.style.removeProperty('width');\n requestAnimationFrame(() => {\n selected.style.left = `${initialOffsetLefts[selectedIndex]}px`;\n });\n }\n\n x.emit('UserSelectedARelatedPrompt', selectedIndex);\n };\n\n const onBeforeEnter = (el: Element) => {\n const element = el as HTMLElement;\n const index = Number.parseInt(element.getAttribute('data-index')!);\n\n // Prepare the element for the enter animation\n element.style.opacity = '0';\n element.style.transform = 'translateY(5px)';\n element.style.transitionDelay = `${\n (clickedListItemIndex.value !== null && index > clickedListItemIndex.value\n ? index - 1\n : index) * singleAnimationDurationInMs.value\n }ms`;\n element.style.transitionDuration = `${singleAnimationDurationInMs.value}ms`;\n };\n\n const onEnter = (el: Element, done: () => void) => {\n const element = el as HTMLElement;\n const index = Number.parseInt(element.getAttribute('data-index')!);\n\n // Also part of the preparation for the enter animation, but it needs to be done\n // once the element is inserted in DOM (if not the offsetLeft will be always 0)\n element.style.left = `${initialOffsetLefts[index] ?? element.offsetLeft}px`;\n\n // trigger enter animation\n requestAnimationFrame(() => {\n element.style.opacity = '1';\n element.style.position = 'absolute';\n element.style.transform = 'translateY(0)';\n });\n\n done();\n };\n\n const onLeave = (el: Element, done: () => void) => {\n const element = el as HTMLElement;\n\n // trigger leave animation\n requestAnimationFrame(() => {\n element.style.opacity = '0';\n element.style.transform = 'translateY(5px)';\n });\n\n // Wait for the animation to finish (done() exectution extracts the element from the DOM)\n setTimeout(done, props.animationDurationInMs);\n };\n\n const isSelected = (index: number): boolean => selectedPromptIndex.value === index;\n\n // Changing the query will trigger the appear animation, so we need to reset the\n // style after it finishes\n watch(() => x.query.search, resetTransitionStyle, { immediate: true });\n\n return {\n isSelected,\n onSelect,\n onBeforeEnter,\n onEnter,\n onLeave,\n selectedPromptIndex,\n visibleRelatedPrompts,\n listItems,\n isAnimating,\n x\n };\n }\n });\n</script>\n<style lang=\"css\">\n .x-related-prompts-tag-list-scroll-container {\n height: 100%;\n position: relative;\n }\n .x-related-prompts-tag-list {\n display: flex;\n gap: 16px;\n min-width: 100%;\n }\n .x-related-prompts-tag-list-item {\n height: 100%;\n }\n</style>\n"],"names":["_resolveComponent","_openBlock","_createBlock","buttonClass","_renderSlot","_withCtx","onBeforeEnter","onEnter","onLeave","_createElementBlock","_Fragment","_renderList","_normalizeClass","isAnimating","_normalizeStyle","onSelect","_createVNode","isSelected"],"mappings":";;;;;;;;kCACEA,gBAwDe,CAAA,cAAA,CAAA,CAAA;SAtDZC,SAA8B,EAAA,EAAAC,WAAA,CAAA,uBAAA,EAAA;AAAA,IAC9B,GAAcC,EAAAA,IAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,MAAAA;AAAAA,IACf,yBAAuB,EAAA,KAAA;AAAA,IAAA,cAAA,EAAA,IAAA,CAAA,WAAA;AAEZ,IAAA,wBAAA,EAAA,6CAAA;AAAA,GAAA,EAAA;;MA4CAC,UAIiC,CAAA,IAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;AAAA,KAAA,CAAA;;MAvDhDA,UAkDuB,CAAA,IAAA,CAAA,MAAA,EAAA,4BAAA,CAAA;AAAA,KAAA,CAAA;AApChB,IAAA,OAAA,EAAAC,OAAA,CAAY,MAAEC;AAAAA,MAAAA,WAAAA,CACPC,eAAO,EAAA;AAAA,QACd,aAAOC,EAAAA,IAAAA,CAAAA,aAAAA;AAAAA,QACR,OAAM,EAAA,IAAA,CAAA,OAAA;AAAA,QACL,SAAK,IAAK,CAAA,OAAA;AAAA,QACX,KAAI,EAAA,4BAAA;AAAA,QACJ,GAAA,EA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