@empathyco/x-components 10.9.0 → 10.10.0
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 +15 -0
- package/package.json +7 -7
- package/skills/x-components/SKILL.md +105 -41
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.10.0](https://github.com/empathyco/x/compare/@empathyco/x-components@10.3.0...@empathyco/x-components@10.10.0) (2026-11-23)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **base-modal:** add scrollLock prop to control page scroll behavior (#2200)
|
|
11
|
+
* **search:** add priceFacetId to SearchConfig and update request accordingly (#2194)
|
|
12
|
+
* **skills:** ship validated agent skills in every package (#2203)
|
|
13
|
+
* **x-components:** add responsive image props and loading events to BaseResultImage (#2195)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* change CSS selector for only child teleport (#2197)
|
|
18
|
+
* remove parent selector when BaseTeleport is unmounted (#2198)
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [10.9.0](https://github.com/empathyco/x/compare/@empathyco/x-components@10.3.0...@empathyco/x-components@10.9.0) (2026-11-13)
|
|
7
22
|
|
|
8
23
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.10.0",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"vuex": "4.0.2"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@empathyco/x-adapter": "8.
|
|
71
|
-
"@empathyco/x-adapter-platform": "2.0
|
|
72
|
-
"@empathyco/x-types": "11.0
|
|
73
|
-
"@empathyco/x-utils": "1.
|
|
70
|
+
"@empathyco/x-adapter": "8.3.0",
|
|
71
|
+
"@empathyco/x-adapter-platform": "2.1.0",
|
|
72
|
+
"@empathyco/x-types": "11.1.0",
|
|
73
|
+
"@empathyco/x-utils": "1.2.0",
|
|
74
74
|
"@vue/devtools-api": "~6.6.4",
|
|
75
75
|
"@vueuse/core": "~12.8.2",
|
|
76
76
|
"js-md5": "~0.9.2",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@babel/preset-env": "8.0.7",
|
|
85
|
-
"@empathyco/x-design-system": "1.
|
|
85
|
+
"@empathyco/x-design-system": "1.3.0",
|
|
86
86
|
"@microsoft/api-documenter": "7.30.20",
|
|
87
87
|
"@microsoft/api-extractor": "7.60.1",
|
|
88
88
|
"@tailwindcss/vite": "4.3.5",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"access": "public",
|
|
118
118
|
"directory": "dist"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "193fbc1c4fef9c7dcaa6060cd2331b66e1a551d2"
|
|
121
121
|
}
|
|
@@ -1,47 +1,111 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: x-components
|
|
3
|
-
description: 'Use when
|
|
3
|
+
description: 'Vue 3 + Vuex search UI components from @empathyco/x-components, the entry point of Interface X (Empathy): x-modules for results (ResultsList, BannersList, PromotedsList), facets and filters (Facets, SimpleFilter, NumberRangeFilter, SliderFilter, SelectedFiltersList), search box, suggestions, queries preview and AI carousels, plus base building blocks (BaseResultImage, BaseGrid, BaseModal) and X events. Use when starting or integrating an Empathy search experience, or adding, wiring or fixing search UI in a project that depends on @empathyco/x-components: filters or price ranges, facets, sorting, result grids or carousels, product images or prices not rendering, modals, X-Bus events. Also use to decide which @empathyco/x-* package owns a feature (UI component, API mapping, data model, styling).'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Biblioteca de componentes Vue 3 para combinar y crear tu propia experiencia de búsqueda (o cualquier otra interfaz). También se documenta en https://docs.empathy.co (build search UI → web x components).
|
|
9
|
-
|
|
10
|
-
## Componentes disponibles
|
|
11
|
-
|
|
12
|
-
- `AutoProgressBar` — barra de progreso automática para peticiones en curso.
|
|
13
|
-
- `BaseDropdown` — dropdown reutilizable con items.
|
|
14
|
-
- `BaseEventButton` — botón que emite eventos al hacer clic.
|
|
15
|
-
- `BaseGrid` — grid para mostrar una lista de results.
|
|
16
|
-
- `BaseKeyboardNavigation` — navegación por teclado dentro de un componente.
|
|
17
|
-
- `BaseRating` — valoración tipo estrellas.
|
|
18
|
-
- `BaseSlider` — slider (basado en noUiSlider) para rangos numéricos.
|
|
19
|
-
- `BaseSwitch` — switch/toggle accesible.
|
|
20
|
-
- `BaseTeleport` — wrapper para teleportar contenido.
|
|
21
|
-
- `BaseVariableColumnGrid` — grid con número de columnas variable.
|
|
22
|
-
- `BaseColumnPickerDropdown` / `BaseColumnPickerList` — selectores de columnas del grid.
|
|
23
|
-
- `BaseCurrency` — formatea un precio en la divisa configurada.
|
|
24
|
-
- `Highlight` — resalta el texto de una query dentro de un resultado.
|
|
25
|
-
- `ItemsList` — lista básica de items (suggestions, etc.).
|
|
26
|
-
- `Message` — mensaje de estado (loading, error, vacío).
|
|
27
|
-
- `PageLoaderButton` — botón para cargar la siguiente página.
|
|
28
|
-
- `PageSelector` — selector de página del paginador.
|
|
29
|
-
- `SlidingPanel` — panel lateral deslizante.
|
|
30
|
-
- `BaseTogglePanel` / `BaseHeaderTogglePanel` / `BaseTabsPanel` / `BaseIdTogglePanel` — paneles colapsables y por pestañas.
|
|
31
|
-
- `BaseModal` / `MainModal` — modales con eventos de abrir/cerrar.
|
|
32
|
-
- `SortDropdown` / `SortList` / `SortPickerList` — selectores de ordenación.
|
|
33
|
-
- `BaseSuggestions` / `BaseSuggestion` — lista e item de sugerencias.
|
|
34
|
-
- `BaseResult*` — piezas del resultado: `image`, `fallback-image`, `placeholder-image`, `current-price`, `previous-price`, `rating`, `link`, `add-to-cart`.
|
|
35
|
-
- `ResultVariantSelector` / `ResultVariantsProvider` — selección de variantes de producto.
|
|
36
|
-
- `BaseScroll` — scroll con estado de posición.
|
|
37
|
-
- `SnippetCallbacks` — callbacks de ciclo de vida del snippet.
|
|
38
|
-
- `LocationProvider` / `DisplayClickProvider` / `DisplayEmitter` — providers/emitter de contexto.
|
|
39
|
-
- `GlobalXBus` — instancia global del X-Bus de eventos.
|
|
40
|
-
- `Icons` — iconos SVG inline (search, cart, chevron, sort, etc.).
|
|
41
|
-
- `Animations` — animaciones reutilizables (fade, cross-fade, collapse, staggered, etc.).
|
|
42
|
-
|
|
43
|
-
## Instalación
|
|
6
|
+
<!-- skills-check packages: @empathyco/x-components, @empathyco/x-adapter-platform, @empathyco/x-adapter, @empathyco/x-types, @empathyco/x-utils, @empathyco/x-archetype-utils -->
|
|
7
|
+
<!-- skills-check ignore: DefaultResultsEnrichmentService, rootComponent, domElement, xModules, snippetConfig, durationInSeconds, scrollLock -->
|
|
44
8
|
|
|
9
|
+
# @empathyco/x-components
|
|
10
|
+
|
|
11
|
+
Vue 3 + Vuex 4 components to build a search and discovery UI. Peer dependencies: `vue ^3.5`
|
|
12
|
+
and `vuex 4.0.2` (exact).
|
|
13
|
+
|
|
14
|
+
It is the core of Interface X, Empathy's open-source set of `@empathyco` packages for commerce
|
|
15
|
+
search UIs. Product docs: https://docs.empathy.co
|
|
16
|
+
|
|
17
|
+
## Other @empathyco packages
|
|
18
|
+
|
|
19
|
+
Each package ships its own skill, but agents only get the skills of **direct** dependencies.
|
|
20
|
+
x-components already depends on x-adapter, x-adapter-platform, x-types and x-utils; add the ones
|
|
21
|
+
the project imports to its own `package.json` to get their skills.
|
|
22
|
+
|
|
23
|
+
- `@empathyco/x-adapter` — generic API client framework: endpoint adapters, mappers, mutable
|
|
24
|
+
schemas and HTTP clients.
|
|
25
|
+
- `@empathyco/x-adapter-platform` — Empathy Platform endpoints and schemas built on
|
|
26
|
+
x-adapter; exposes `platformAdapter`, the default adapter for `XInstaller`.
|
|
27
|
+
- `@empathyco/x-types` — shared data models, type guards and Vitest test schemas.
|
|
28
|
+
- `@empathyco/x-utils` — session/storage services and object helpers such as `deepMerge`.
|
|
29
|
+
- `@empathyco/x-design-system` — Tailwind CSS v4 styles; every utility uses the `xds:` prefix.
|
|
30
|
+
- `@empathyco/x-archetype-utils` — i18n, runtime CSS injection and build helpers for
|
|
31
|
+
x-archetype projects.
|
|
32
|
+
|
|
33
|
+
## Import rule (read first)
|
|
34
|
+
|
|
35
|
+
- The package root only exports **core**: base components, animations, icons, composables,
|
|
36
|
+
the X plugin and the installer.
|
|
37
|
+
- Every **x-module** has its own subpath, and importing it registers the module:
|
|
38
|
+
`/search`, `/facets`, `/search-box`, `/query-suggestions`, `/popular-searches`,
|
|
39
|
+
`/history-queries`, `/next-queries`, `/related-tags`, `/related-prompts`, `/recommendations`,
|
|
40
|
+
`/queries-preview`, `/semantic-queries`, `/identifier-results`, `/ai`, `/browse`, `/scroll`,
|
|
41
|
+
`/url`, `/tagging`, `/extra-params`, `/device`, `/empathize`, `/experience-controls`, `/vendor`.
|
|
42
|
+
- If a component is not in the root, look for it in a module before writing your own.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { BaseGrid, BaseResultImage, use$x } from '@empathyco/x-components'
|
|
46
|
+
import { Facets, SimpleFilter } from '@empathyco/x-components/facets'
|
|
47
|
+
import { ResultsList } from '@empathyco/x-components/search'
|
|
48
|
+
import { SearchInput } from '@empathyco/x-components/search-box'
|
|
45
49
|
```
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
|
|
51
|
+
## Where to find the exact API
|
|
52
|
+
|
|
53
|
+
Never guess a name, prop or event. The installed package ships its generated reference:
|
|
54
|
+
|
|
55
|
+
- Exported names: search `node_modules/@empathyco/x-components/report/x-components.api.md`
|
|
56
|
+
(large file — grep it, do not read it whole). x-types and x-adapter-platform ship the same
|
|
57
|
+
`report/*.api.md`.
|
|
58
|
+
- Props, events, slots and examples of each component:
|
|
59
|
+
`node_modules/@empathyco/x-components/docs/API-reference/components/<module>/x-components.<kebab-name>.md`
|
|
60
|
+
(for example `common/modals/x-components.base-modal.md`). Some examples there import from
|
|
61
|
+
`@empathyco/x-components/animations` or `/url-handler`; those subpaths do not exist — use the
|
|
62
|
+
root and `/url`.
|
|
63
|
+
|
|
64
|
+
## Setup
|
|
65
|
+
|
|
66
|
+
- `XInstaller` creates the app and the `window.InterfaceX` API:
|
|
67
|
+
`new XInstaller(options).init(snippetConfig)`. Options include `adapter` (usually
|
|
68
|
+
`platformAdapter` from `@empathyco/x-adapter-platform`), `rootComponent`, `domElement` and
|
|
69
|
+
`xModules`. `SnippetConfig` carries `instance`, `scope`, `lang`, `currency`, `callbacks`…
|
|
70
|
+
- `XInstaller` installs an `XPlugin`, which sets up the X-Bus, the store and the emitters; do
|
|
71
|
+
not install it a second time.
|
|
72
|
+
- State and events from components: `use$x`, `useState`, `useGetter`, `useXBus`; the bus
|
|
73
|
+
instance is `bus`.
|
|
74
|
+
|
|
75
|
+
## Core building blocks
|
|
76
|
+
|
|
77
|
+
- Results: `BaseResultImage`, `BaseResultCurrentPrice`, `BaseResultPreviousPrice`,
|
|
78
|
+
`BaseResultRating`, `BaseResultLink`, `BaseFallbackImage`, `BasePlaceholderImage`,
|
|
79
|
+
`BaseAddToCart`, `ResultVariantSelector`, `ResultVariantsProvider`.
|
|
80
|
+
- Layout: `BaseGrid`, `BaseVariableColumnGrid`, `BaseColumnPickerDropdown`,
|
|
81
|
+
`BaseColumnPickerList`, `SlidingPanel` (horizontal scroller with arrow buttons — a carousel,
|
|
82
|
+
not a side drawer), `BaseScroll` (emits scroll direction / start / end events).
|
|
83
|
+
- Panels and modals: `BaseTogglePanel`, `BaseHeaderTogglePanel`, `BaseTabsPanel`,
|
|
84
|
+
`BaseIdTogglePanel` (needs a `BaseIdTogglePanelButton` with the same id), `BaseModal`,
|
|
85
|
+
`MainModal`, `OpenMainModal`, `CloseMainModal`, `BaseEventsModal`, `BaseIdModal`, `Tabs`.
|
|
86
|
+
- Controls: `BaseDropdown`, `BaseSwitch`, `BaseSlider` (noUiSlider), `BaseRating`,
|
|
87
|
+
`BaseEventButton` (emits X events), `PageLoaderButton`, `PageSelector`, `SortDropdown`,
|
|
88
|
+
`SortList`, `SortPickerList`, `BaseCurrency` (accepts `locale`).
|
|
89
|
+
- Suggestions: `BaseSuggestions`, `BaseSuggestion`, `ItemsList`, `Highlight` (highlights any
|
|
90
|
+
`highlight` substring in a `text`).
|
|
91
|
+
- Events and tracking: `GlobalXBus` (component to listen to X events — not the bus itself),
|
|
92
|
+
`SnippetCallbacks` (runs `snippetConfig.callbacks` on X events), `DisplayEmitter`,
|
|
93
|
+
`DisplayClickProvider`, `LocationProvider`.
|
|
94
|
+
- Animations are separate components (`Fade`, `CrossFade`, `CollapseHeight`,
|
|
95
|
+
`StaggeredFadeAndSlide`, `NoAnimation`…). Icons are separate components too (`SearchIcon`,
|
|
96
|
+
`CartIcon`…); check the report for exact names.
|
|
97
|
+
- `AutoProgressBar` is a timed animation (`durationInSeconds`), used for redirection
|
|
98
|
+
countdowns — not a request loading indicator. `Message` is a plain content wrapper.
|
|
99
|
+
|
|
100
|
+
## Common mistakes
|
|
101
|
+
|
|
102
|
+
- Importing module components from the root (`ResultsList`, `Facets`, `SearchInput` are not
|
|
103
|
+
there).
|
|
104
|
+
- `BaseModal` is controlled by its `open` prop and only emits `click:overlay` and
|
|
105
|
+
`focusin:body`; it locks page scroll unless `scrollLock` is `false`.
|
|
106
|
+
- `BaseTeleport` defaults to `position="onlychild"`, which hides the other children of the
|
|
107
|
+
target element.
|
|
108
|
+
- Inventing `BaseResult*` names: fallback, placeholder and add-to-cart pieces are
|
|
109
|
+
`BaseFallbackImage`, `BasePlaceholderImage` and `BaseAddToCart`.
|
|
110
|
+
- Results enrichment was removed in v9 (`DefaultResultsEnrichmentService` no longer exists);
|
|
111
|
+
check `CHANGELOG.md` in the package for other breaking changes.
|