From 900eb9c0c9bce7b48897b86ca11e4f1ec82d783b Mon Sep 17 00:00:00 2001 From: davidglezz Date: Wed, 4 Dec 2024 16:27:03 +0100 Subject: [PATCH 1/8] feat(x-installer): extend domElement type to allow ShadowRoot Signed-off-by: davidglezz --- .../x-components/src/x-installer/x-installer/types.ts | 6 +++++- .../src/x-installer/x-installer/x-installer.ts | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/x-components/src/x-installer/x-installer/types.ts b/packages/x-components/src/x-installer/x-installer/types.ts index dedf6e3a5d..caa4acff1c 100644 --- a/packages/x-components/src/x-installer/x-installer/types.ts +++ b/packages/x-components/src/x-installer/x-installer/types.ts @@ -30,7 +30,11 @@ export interface InstallXOptions extends XPluginOptions * An Element | string | function to indicate the HTML element that will contain the Vue * application. If it isn't passed, the {@link XInstaller} will create the target element. */ - domElement?: Element | string | ((snippetConfig: NormalisedSnippetConfig) => Element | string); + domElement?: + | Element + | ShadowRoot + | string + | ((snippetConfig: NormalisedSnippetConfig) => Element | ShadowRoot | string); /** * The XPlugin which will be installed. If not passed, an instance of {@link XPlugin} will be * installed. diff --git a/packages/x-components/src/x-installer/x-installer/x-installer.ts b/packages/x-components/src/x-installer/x-installer/x-installer.ts index 5e03672ee7..9b88464318 100644 --- a/packages/x-components/src/x-installer/x-installer/x-installer.ts +++ b/packages/x-components/src/x-installer/x-installer/x-installer.ts @@ -289,13 +289,13 @@ export class XInstaller { * returns an Element or element selector to use. * If it is not present, a new
Element is created and appended to the body. * - * @param domElement - {@link InstallXOptions.domElement | Element, string or function} Used - * to mount the Vue Application. + * @param domElement - {@link InstallXOptions.domElement} Element, ShadowRoot, string or function + * used to mount the Vue Application. * - * @returns The Element to use as mounting target for the Vue Application. + * @returns The Element or ShadowRoot to use as mounting target for the Vue Application. * @internal */ - protected getMountingTarget(domElement?: InstallXOptions['domElement']): Element { + protected getMountingTarget(domElement?: InstallXOptions['domElement']): Element | ShadowRoot { if (isFunction(domElement)) { domElement = domElement(this.snippetConfig!); } From 12d5a053b55d8a4f09b6e396f16a9ce1877c0774 Mon Sep 17 00:00:00 2001 From: davidglezz Date: Wed, 4 Dec 2024 17:13:27 +0100 Subject: [PATCH 2/8] fix: fix ref usage Signed-off-by: davidglezz --- packages/x-components/src/components/base-dropdown.vue | 9 ++------- .../src/components/result/base-result-image.vue | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/x-components/src/components/base-dropdown.vue b/packages/x-components/src/components/base-dropdown.vue index 6608048770..c3254876cc 100644 --- a/packages/x-components/src/components/base-dropdown.vue +++ b/packages/x-components/src/components/base-dropdown.vue @@ -80,7 +80,7 @@ import { Identifiable } from '@empathyco/x-types'; import { computed, defineComponent, nextTick, onBeforeUnmount, PropType, ref, watch } from 'vue'; import { AnimationProp } from '../types'; - import { debounceFunction, normalizeString, getTargetElement, isInRange } from '../utils'; + import { debounceFunction, normalizeString, getTargetElement } from '../utils'; import { NoAnimation } from './animations'; type DropdownItem = string | number | Identifiable; @@ -322,12 +322,7 @@ watch( highlightedItemIndex, highlightedItemIndex => { - nextTick(() => { - if (itemsButtonRefs && isInRange(highlightedItemIndex, [0, props.items.length - 1])) { - const newItem = itemsButtonRefs?.value?.[highlightedItemIndex]; - newItem?.focus(); - } - }); + nextTick(() => itemsButtonRefs.value[highlightedItemIndex]?.focus()); }, { immediate: true } ); diff --git a/packages/x-components/src/components/result/base-result-image.vue b/packages/x-components/src/components/result/base-result-image.vue index 4c5903ce6e..60377cd879 100644 --- a/packages/x-components/src/components/result/base-result-image.vue +++ b/packages/x-components/src/components/result/base-result-image.vue @@ -151,7 +151,7 @@ * @internal */ const animation = computed(() => { - return userHasHoveredImage + return userHasHoveredImage.value ? props.hoverAnimation ?? props.loadAnimation : props.loadAnimation; }); @@ -177,7 +177,7 @@ * @internal */ const shouldLoadNextImage = computed(() => { - const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage ? 2 : 1; + const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage.value ? 2 : 1; return !!pendingImages.value.length && loadedImages.value.length < numImagesToLoad; }); From b1075867e6d284f94ce76cec66b157f714797310 Mon Sep 17 00:00:00 2001 From: empathy/x Date: Mon, 9 Dec 2024 09:02:25 +0000 Subject: [PATCH 3/8] chore(release): publish - @empathyco/x-components@6.0.0-alpha.21 --- packages/x-components/CHANGELOG.md | 9 +++++++++ packages/x-components/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/x-components/CHANGELOG.md b/packages/x-components/CHANGELOG.md index ed52439df4..c253d8af17 100644 --- a/packages/x-components/CHANGELOG.md +++ b/packages/x-components/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.0.0-alpha.21](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.20...@empathyco/x-components@6.0.0-alpha.21) (2024-12-09) + + +### Features + +* **x-installer:** extend domElement type to allow ShadowRoot ([900eb9c](https://github.com/empathyco/x/commit/900eb9c0c9bce7b48897b86ca11e4f1ec82d783b)) + + + ## [6.0.0-alpha.20](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.19...@empathyco/x-components@6.0.0-alpha.20) (2024-11-25) diff --git a/packages/x-components/package.json b/packages/x-components/package.json index 54a00013d8..b575ae08d4 100644 --- a/packages/x-components/package.json +++ b/packages/x-components/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-components", - "version": "6.0.0-alpha.20", + "version": "6.0.0-alpha.21", "description": "Empathy X Components", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0", From 38a9ca3fc5222906abaf928cabc817b4b374076e Mon Sep 17 00:00:00 2001 From: empathy/x Date: Mon, 9 Dec 2024 11:22:28 +0000 Subject: [PATCH 4/8] chore(release): publish - @empathyco/x-components@6.0.0-alpha.22 --- packages/x-components/CHANGELOG.md | 9 +++++++++ packages/x-components/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/x-components/CHANGELOG.md b/packages/x-components/CHANGELOG.md index c253d8af17..8481dace7e 100644 --- a/packages/x-components/CHANGELOG.md +++ b/packages/x-components/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.0.0-alpha.22](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.21...@empathyco/x-components@6.0.0-alpha.22) (2024-12-09) + + +### Bug Fixes + +* fix ref usage ([12d5a05](https://github.com/empathyco/x/commit/12d5a053b55d8a4f09b6e396f16a9ce1877c0774)) + + + ## [6.0.0-alpha.21](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.20...@empathyco/x-components@6.0.0-alpha.21) (2024-12-09) diff --git a/packages/x-components/package.json b/packages/x-components/package.json index b575ae08d4..b00d41bcd3 100644 --- a/packages/x-components/package.json +++ b/packages/x-components/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-components", - "version": "6.0.0-alpha.21", + "version": "6.0.0-alpha.22", "description": "Empathy X Components", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0", From a1f9cee4b2006a71689fc2ce7f07f12816fbb574 Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Thu, 12 Dec 2024 13:06:20 +0100 Subject: [PATCH 5/8] fix(components): export missing store utils (#1677) --- packages/x-components/src/store/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/x-components/src/store/index.ts b/packages/x-components/src/store/index.ts index f1bdc33241..fd04287f5c 100644 --- a/packages/x-components/src/store/index.ts +++ b/packages/x-components/src/store/index.ts @@ -1,7 +1,10 @@ export * from './actions.types'; -export * from './utils/fetch-and-save-action.utils'; export * from './getters.types'; export * from './mutations.types'; +export * from './utils/config-store.utils'; +export * from './utils/fetch-and-save-action.utils'; +export * from './utils/getters-proxy.utils'; +export * from './utils/query.utils'; export * from './utils/status-store.utils'; export * from './utils/store-emitters.utils'; export * from './store.types'; From 48cedcd9087dc546f2f716aa41802743eb34989a Mon Sep 17 00:00:00 2001 From: empathy/x Date: Thu, 12 Dec 2024 12:21:33 +0000 Subject: [PATCH 6/8] chore(release): publish - @empathyco/x-components@6.0.0-alpha.23 --- packages/x-components/CHANGELOG.md | 9 +++++++++ packages/x-components/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/x-components/CHANGELOG.md b/packages/x-components/CHANGELOG.md index 8481dace7e..be8a923730 100644 --- a/packages/x-components/CHANGELOG.md +++ b/packages/x-components/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.0.0-alpha.23](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.22...@empathyco/x-components@6.0.0-alpha.23) (2024-12-12) + + +### Bug Fixes + +* **components:** export missing store utils (#1677) ([a1f9cee](https://github.com/empathyco/x/commit/a1f9cee4b2006a71689fc2ce7f07f12816fbb574)) + + + ## [6.0.0-alpha.22](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.21...@empathyco/x-components@6.0.0-alpha.22) (2024-12-09) diff --git a/packages/x-components/package.json b/packages/x-components/package.json index b00d41bcd3..dad6a8b554 100644 --- a/packages/x-components/package.json +++ b/packages/x-components/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-components", - "version": "6.0.0-alpha.22", + "version": "6.0.0-alpha.23", "description": "Empathy X Components", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0", From 99d0620d7017167441d63805d29446778432d60b Mon Sep 17 00:00:00 2001 From: davidglezz Date: Wed, 18 Dec 2024 18:08:49 +0100 Subject: [PATCH 7/8] fix(types): update installExtraPlugins to support Promise return type Signed-off-by: davidglezz --- packages/x-components/src/x-installer/x-installer/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/x-components/src/x-installer/x-installer/types.ts b/packages/x-components/src/x-installer/x-installer/types.ts index caa4acff1c..61388c9b89 100644 --- a/packages/x-components/src/x-installer/x-installer/types.ts +++ b/packages/x-components/src/x-installer/x-installer/types.ts @@ -53,7 +53,7 @@ export interface InstallXOptions extends XPluginOptions * @param options - An object that contains utilities that might be helpful for installing Vue * plugins. */ - installExtraPlugins?(options: ExtraPluginsOptions): void; + installExtraPlugins?(options: ExtraPluginsOptions): void | Promise; } /** From 4d06c42bf80d524b0c0f300180e435c6947b8c50 Mon Sep 17 00:00:00 2001 From: empathy/x Date: Thu, 19 Dec 2024 12:25:41 +0000 Subject: [PATCH 8/8] chore(release): publish - @empathyco/x-components@6.0.0-alpha.24 --- packages/x-components/CHANGELOG.md | 9 +++++++++ packages/x-components/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/x-components/CHANGELOG.md b/packages/x-components/CHANGELOG.md index be8a923730..74042813c0 100644 --- a/packages/x-components/CHANGELOG.md +++ b/packages/x-components/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.0.0-alpha.24](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.23...@empathyco/x-components@6.0.0-alpha.24) (2024-12-19) + + +### Bug Fixes + +* **types:** update installExtraPlugins to support Promise return type ([99d0620](https://github.com/empathyco/x/commit/99d0620d7017167441d63805d29446778432d60b)) + + + ## [6.0.0-alpha.23](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.22...@empathyco/x-components@6.0.0-alpha.23) (2024-12-12) diff --git a/packages/x-components/package.json b/packages/x-components/package.json index dad6a8b554..b135c10ba5 100644 --- a/packages/x-components/package.json +++ b/packages/x-components/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-components", - "version": "6.0.0-alpha.23", + "version": "6.0.0-alpha.24", "description": "Empathy X Components", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0",