@empathyco/x-components 6.0.0-alpha.156 → 6.0.0-alpha.158
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 +17 -0
- package/docs/API-reference/api/x-components.baseteleport.md +3 -1
- package/docs/API-reference/api/x-components.empathizexevents.empathizegotnocontent.md +13 -0
- package/docs/API-reference/api/x-components.empathizexevents.md +1 -0
- package/docs/API-reference/api/x-components.hierarchicalfilter.md +1 -0
- package/docs/API-reference/api/x-components.simplefilter.md +1 -0
- package/docs/API-reference/api/x-components.snippetcallbacks.md +1 -0
- package/docs/API-reference/components/common/x-components.base-teleport.md +6 -5
- package/js/components/base-teleport.vue.js.map +1 -1
- package/js/components/base-teleport.vue2.js +18 -2
- package/js/components/base-teleport.vue2.js.map +1 -1
- package/js/x-modules/empathize/components/empathize.vue.js.map +1 -1
- package/js/x-modules/empathize/components/empathize.vue2.js +1 -1
- package/js/x-modules/empathize/components/empathize.vue2.js.map +1 -1
- package/js/x-modules/search/wiring.js +4 -0
- package/js/x-modules/search/wiring.js.map +1 -1
- package/package.json +3 -3
- package/report/x-components.api.json +80 -8
- package/report/x-components.api.md +16 -6
- package/types/components/base-teleport.vue.d.ts +5 -1
- package/types/components/base-teleport.vue.d.ts.map +1 -1
- package/types/components/snippet-callbacks.vue.d.ts +1 -0
- package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
- package/types/x-modules/empathize/events.types.d.ts +5 -0
- package/types/x-modules/empathize/events.types.d.ts.map +1 -1
- package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +1 -0
- package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
- package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +1 -0
- package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
- package/types/x-modules/search/wiring.d.ts +4 -0
- package/types/x-modules/search/wiring.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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
|
+
## 6.0.0-alpha.158 (2025-10-01)
|
|
7
|
+
|
|
8
|
+
* feat(base-teleport): support dynamic host styles and improve type safety (#1839) ([0713104](https://github.com/empathyco/x/commit/0713104)), closes [#1839](https://github.com/empathyco/x/issues/1839)
|
|
9
|
+
* chore(deps): update dependency @badeball/cypress-cucumber-preprocessor to v23 (#1885) ([5af25a4](https://github.com/empathyco/x/commit/5af25a4)), closes [#1885](https://github.com/empathyco/x/issues/1885)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 6.0.0-alpha.157 (2025-10-01)
|
|
16
|
+
|
|
17
|
+
* fix: selected tag being removed (#1894) ([287cb48](https://github.com/empathyco/x/commit/287cb48)), closes [#1894](https://github.com/empathyco/x/issues/1894)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## 6.0.0-alpha.156 (2025-09-26)
|
|
7
24
|
|
|
8
25
|
* feat(ai): smoothly scroll to AI overview on collapse and add relevant test ([45e8133](https://github.com/empathyco/x/commit/45e8133))
|
|
@@ -20,8 +20,9 @@ _default: import("vue").DefineComponent<{
|
|
|
20
20
|
type: BooleanConstructor;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
|
+
hostStyle: PropType<string | CSSStyleDeclaration>;
|
|
23
24
|
}, {
|
|
24
|
-
teleportHost: import("vue").Ref<
|
|
25
|
+
teleportHost: import("vue").Ref<HTMLElement | undefined>;
|
|
25
26
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
27
|
target: {
|
|
27
28
|
type: PropType<string | Element>;
|
|
@@ -35,6 +36,7 @@ _default: import("vue").DefineComponent<{
|
|
|
35
36
|
type: BooleanConstructor;
|
|
36
37
|
default: boolean;
|
|
37
38
|
};
|
|
39
|
+
hostStyle: PropType<string | CSSStyleDeclaration>;
|
|
38
40
|
}>>, {
|
|
39
41
|
position: "beforebegin" | "afterbegin" | "beforeend" | "afterend" | "onlychild";
|
|
40
42
|
disabled: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [EmpathizeXEvents](./x-components.empathizexevents.md) > [EmpathizeGotNoContent](./x-components.empathizexevents.empathizegotnocontent.md)
|
|
4
|
+
|
|
5
|
+
## EmpathizeXEvents.EmpathizeGotNoContent property
|
|
6
|
+
|
|
7
|
+
The empathize reached a state with no content (empty). Payload: The search box query at the time of the event.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
EmpathizeGotNoContent: string;
|
|
13
|
+
```
|
|
@@ -17,6 +17,7 @@ export interface EmpathizeXEvents
|
|
|
17
17
|
| Property | Modifiers | Type | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
19
|
| [EmpathizeClosed](./x-components.empathizexevents.empathizeclosed.md) | | void | The empathize closed following its events configuration. Payload: none. |
|
|
20
|
+
| [EmpathizeGotNoContent](./x-components.empathizexevents.empathizegotnocontent.md) | | string | The empathize reached a state with no content (empty). Payload: The search box query at the time of the event. |
|
|
20
21
|
| [EmpathizeOpened](./x-components.empathizexevents.empathizeopened.md) | | void | The empathize opened following its events configuration. Payload: none. |
|
|
21
22
|
| [UserClosedEmpathize](./x-components.empathizexevents.userclosedempathize.md) | | void | The user closed the empathize. Payload: none. |
|
|
22
23
|
|
|
@@ -67,6 +67,7 @@ _default: import("vue").DefineComponent<{
|
|
|
67
67
|
EmpathizeClosed?: void | undefined;
|
|
68
68
|
EmpathizeOpened?: void | undefined;
|
|
69
69
|
UserClosedEmpathize?: void | undefined;
|
|
70
|
+
EmpathizeGotNoContent?: string | undefined;
|
|
70
71
|
UserChangedExtraParams?: Dictionary<unknown> | undefined;
|
|
71
72
|
ExtraParamsChanged?: Dictionary<unknown> | undefined;
|
|
72
73
|
ExtraParamsProvided?: Dictionary<unknown> | undefined;
|
|
@@ -64,6 +64,7 @@ _default: import("vue").DefineComponent<{
|
|
|
64
64
|
EmpathizeClosed?: void | undefined;
|
|
65
65
|
EmpathizeOpened?: void | undefined;
|
|
66
66
|
UserClosedEmpathize?: void | undefined;
|
|
67
|
+
EmpathizeGotNoContent?: string | undefined;
|
|
67
68
|
UserChangedExtraParams?: Dictionary<unknown> | undefined;
|
|
68
69
|
ExtraParamsChanged?: Dictionary<unknown> | undefined;
|
|
69
70
|
ExtraParamsProvided?: Dictionary<unknown> | undefined;
|
|
@@ -54,6 +54,7 @@ _default: import("vue").DefineComponent<{}, {
|
|
|
54
54
|
EmpathizeClosed: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
55
55
|
EmpathizeOpened: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
56
56
|
UserClosedEmpathize: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
57
|
+
EmpathizeGotNoContent: (payload: string, metadata: WireMetadata) => unknown;
|
|
57
58
|
UserChangedExtraParams: (payload: import("@empathyco/x-utils").Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
58
59
|
ExtraParamsChanged: (payload: import("@empathyco/x-utils").Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
59
60
|
ExtraParamsProvided: (payload: import("@empathyco/x-utils").Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
@@ -8,11 +8,12 @@ title: BaseTeleport
|
|
|
8
8
|
|
|
9
9
|
## Props
|
|
10
10
|
|
|
11
|
-
| Name
|
|
12
|
-
|
|
|
13
|
-
| <code>target</code>
|
|
14
|
-
| <code>position</code>
|
|
15
|
-
| <code>disabled</code>
|
|
11
|
+
| Name | Description | Type | Default |
|
|
12
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ------------------------ |
|
|
13
|
+
| <code>target</code> | The element or css selector to which the component will be teleported. | <code>string \| Element</code> | <code></code> |
|
|
14
|
+
| <code>position</code> | The position relative to the target<br />- `beforebegin`: Before the target element.<br />- `afterbegin`: Inside the target element, before its first child.<br />- `beforeend`: Inside the target element, after its last child.<br />- `afterend`: After the target element.<br />- `onlychild`: Adds it as child and hides all other children of the target element. | <code>string</code> | <code>'onlychild'</code> |
|
|
15
|
+
| <code>disabled</code> | If disabled, the slot content will not be teleported | <code>boolean</code> | <code>false</code> |
|
|
16
|
+
| <code>hostStyle</code> | Styles for the teleport (content container) | <code>string \| CSSStyleDeclaration</code> | <code></code> |
|
|
16
17
|
|
|
17
18
|
## Slots
|
|
18
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-teleport.vue.js","sources":["../../../src/components/base-teleport.vue"],"sourcesContent":["<template>\n <Teleport v-if=\"teleportHost\" :to=\"teleportHost.shadowRoot ?? teleportHost\" :disabled>\n <slot></slot>\n </Teleport>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport {\n defineComponent,\n getCurrentInstance,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n ref,\n watch,\n watchEffect,\n} from 'vue'\n\nexport default defineComponent({\n name: 'BaseTeleport',\n props: {\n /** The element or css selector to which the component will be teleported. */\n target: {\n type: [String, Object] as PropType<string | Element>,\n required: true,\n },\n /**\n * The position relative to the target\n * - `beforebegin`: Before the target element.\n * - `afterbegin`: Inside the target element, before its first child.\n * - `beforeend`: Inside the target element, after its last child.\n * - `afterend`: After the target element.\n * - `onlychild`: Adds it as child and hides all other children of the target element.\n */\n position: {\n type: String as PropType<\n 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend' | 'onlychild'\n >,\n default: 'onlychild',\n },\n /** If disabled, the slot content will not be teleported */\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n if (typeof document === 'undefined') {\n return { teleportHost: ref<
|
|
1
|
+
{"version":3,"file":"base-teleport.vue.js","sources":["../../../src/components/base-teleport.vue"],"sourcesContent":["<template>\n <Teleport v-if=\"teleportHost\" :to=\"teleportHost.shadowRoot ?? teleportHost\" :disabled>\n <slot></slot>\n </Teleport>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport {\n defineComponent,\n getCurrentInstance,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n ref,\n watch,\n watchEffect,\n} from 'vue'\n\nexport default defineComponent({\n name: 'BaseTeleport',\n props: {\n /** The element or css selector to which the component will be teleported. */\n target: {\n type: [String, Object] as PropType<string | Element>,\n required: true,\n },\n /**\n * The position relative to the target\n * - `beforebegin`: Before the target element.\n * - `afterbegin`: Inside the target element, before its first child.\n * - `beforeend`: Inside the target element, after its last child.\n * - `afterend`: After the target element.\n * - `onlychild`: Adds it as child and hides all other children of the target element.\n */\n position: {\n type: String as PropType<\n 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend' | 'onlychild'\n >,\n default: 'onlychild',\n },\n /** If disabled, the slot content will not be teleported */\n disabled: {\n type: Boolean,\n default: false,\n },\n /** Styles for the teleport (content container) */\n hostStyle: Object as PropType<string | CSSStyleDeclaration>,\n },\n setup(props) {\n if (typeof document === 'undefined') {\n return { teleportHost: ref<HTMLElement>() }\n }\n\n const instance = getCurrentInstance()\n /** Hook where the slot content will be teleported to. */\n const teleportHost = ref<HTMLElement>()\n /** The page element where the teleport host will be inserted. */\n const targetElement = ref<HTMLElement>()\n let isIsolated = false\n\n // Before doing app.mount it is unknown if it will be mounted in a shadow so we need to wait.\n if (instance?.appContext.app._container) {\n createHost()\n } else {\n afterAppMount(createHost)\n }\n\n const targetAddedObserver = new MutationObserver(targetAdded)\n const targetRemovedObserver = new MutationObserver(targetRemoved)\n\n onUnmounted(() => {\n if (isIsolated && teleportHost.value) {\n ;(window as any).xCSSInjector.removeHost(teleportHost.value.shadowRoot)\n }\n })\n\n onBeforeUnmount(() => {\n targetAddedObserver.disconnect()\n targetRemovedObserver.disconnect()\n teleportHost.value?.remove()\n })\n\n // Handles target prop changes and init the observers accordingly.\n watch(\n () => props.target,\n newTarget => {\n targetAddedObserver.disconnect()\n targetRemovedObserver.disconnect()\n const target = typeof newTarget === 'string' ? document.querySelector(newTarget) : newTarget\n if (target?.isConnected) {\n targetAdded()\n } else {\n targetRemoved()\n }\n },\n { immediate: true },\n )\n\n // Updates the teleport host when props change.\n watchEffect(() => {\n if (!teleportHost.value) {\n return\n }\n if (props.disabled) {\n teleportHost.value.remove()\n return\n }\n teleportHost.value.className = `x-base-teleport x-base-teleport--${props.position}`\n\n if (!targetElement.value) {\n console.warn(`BaseTeleport: Target element \"${props.target}\" not found.`)\n return\n }\n const position = props.position === 'onlychild' ? 'beforeend' : props.position\n targetElement.value.insertAdjacentElement(position, teleportHost.value)\n })\n\n /* Update the host inline styles when it changes */\n watchEffect(() => {\n if (teleportHost.value && props.hostStyle) {\n if (typeof props.hostStyle === 'string') {\n teleportHost.value.style.cssText = props.hostStyle\n } else {\n Object.assign(teleportHost.value.style, props.hostStyle)\n }\n }\n })\n\n /** Checks if the target element exists in the DOM and updates the observers */\n function targetAdded() {\n let element: string | Element | null = props.target\n if (typeof element === 'string') {\n element = document.querySelector(element)\n }\n if (element instanceof HTMLElement && element.isConnected) {\n targetAddedObserver.disconnect()\n targetElement.value = element\n while (element.parentElement) {\n element = element.parentElement\n targetRemovedObserver.observe(element, { childList: true })\n }\n }\n }\n\n /** Checks if the target was disconnected from the DOM and updates the observers */\n function targetRemoved() {\n if (targetElement.value && !targetElement.value.isConnected) {\n targetRemovedObserver.disconnect()\n targetAddedObserver.observe(document.body, { childList: true, subtree: true })\n targetElement.value = undefined\n }\n }\n\n /** Creates and sets the teleport host element */\n function createHost() {\n teleportHost.value = document.createElement('div')\n isIsolated = instance?.appContext.app._container instanceof ShadowRoot\n if (isIsolated) {\n teleportHost.value.attachShadow({ mode: 'open' })\n ;(window as any).xCSSInjector.addHost(teleportHost.value.shadowRoot)\n }\n }\n\n function afterAppMount(fn: () => void) {\n onMounted(() => setTimeout(fn, 0))\n }\n\n return { teleportHost }\n },\n})\n\n/** Teleport host styles should be injected outside our shadowRoots */\nif (typeof document !== 'undefined') {\n const css = document.createElement('style')\n css.textContent =\n ':has(> .x-base-teleport--onlychild) > *:not(.x-base-teleport) { display: none; }'\n document.head?.appendChild(css) ||\n document.addEventListener('DOMContentLoaded', () => document.head.appendChild(css))\n}\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nThe BaseTeleport component allows you to teleport its slot content to a specified target element in\nthe DOM. It provides flexibility in positioning the content relative to the target element and\nsupports shadow DOM integration.\n\n### Basic example\n\nTeleport content to a specific element in the DOM:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\">\n <div>This content will be teleported.</div>\n </BaseTeleport>\n</template>\n```\n\n### Positioning options\n\nTeleport content inside the target element, before its first child:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\" position=\"afterbegin\">\n <div>Teleported content at the beginning.</div>\n </BaseTeleport>\n</template>\n```\n\n### Disabled Teleport\n\nPrevent teleporting the content:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\" :disabled=\"true\">\n <div>This content will not be teleported.</div>\n </BaseTeleport>\n</template>\n```\n\n### Notes\n\n- When using the `onlychild` position, all other children of the target element will be hidden.\n- The component supports shadow DOM integration, automatically handling style injection. Anyway, Empathy's custom CSS\n injector is required. Teleport depends on it to add the styles.\n</docs>\n"],"names":["_openBlock","_createBlock","_Teleport","_renderSlot","_createCommentVNode"],"mappings":";;;;;AACkB,EAAA,OAAA,IAAA,CAAA,YAAA,IAAAA,SAAA,EAAA,EAAhBC,WAEW,CAAAC,QAAA,EAAA;AAAA,IAHb,GAAA,EAAA,CAAA;AAAA,IACiC,EAAA,EAAI,kBAAa,UAAc,IAAA,IAAA,CAAA,YAAA;AAAA,IAAe,QAAA,EAAA,IAAA,CAAA,QAAA;AAAA,GAAA,EAAA;IAC3EC,UAAa,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,GAFjB,EAAA,CAAA,EAAA,CAAA,IAAA,EAAA,UAAA,CAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
|
|
@@ -25,6 +25,8 @@ var _sfc_main = defineComponent({
|
|
|
25
25
|
type: Boolean,
|
|
26
26
|
default: false,
|
|
27
27
|
},
|
|
28
|
+
/** Styles for the teleport (content container) */
|
|
29
|
+
hostStyle: Object,
|
|
28
30
|
},
|
|
29
31
|
setup(props) {
|
|
30
32
|
if (typeof document === 'undefined') {
|
|
@@ -84,10 +86,24 @@ var _sfc_main = defineComponent({
|
|
|
84
86
|
const position = props.position === 'onlychild' ? 'beforeend' : props.position;
|
|
85
87
|
targetElement.value.insertAdjacentElement(position, teleportHost.value);
|
|
86
88
|
});
|
|
89
|
+
/* Update the host inline styles when it changes */
|
|
90
|
+
watchEffect(() => {
|
|
91
|
+
if (teleportHost.value && props.hostStyle) {
|
|
92
|
+
if (typeof props.hostStyle === 'string') {
|
|
93
|
+
teleportHost.value.style.cssText = props.hostStyle;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
Object.assign(teleportHost.value.style, props.hostStyle);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
87
100
|
/** Checks if the target element exists in the DOM and updates the observers */
|
|
88
101
|
function targetAdded() {
|
|
89
|
-
let element =
|
|
90
|
-
if (element
|
|
102
|
+
let element = props.target;
|
|
103
|
+
if (typeof element === 'string') {
|
|
104
|
+
element = document.querySelector(element);
|
|
105
|
+
}
|
|
106
|
+
if (element instanceof HTMLElement && element.isConnected) {
|
|
91
107
|
targetAddedObserver.disconnect();
|
|
92
108
|
targetElement.value = element;
|
|
93
109
|
while (element.parentElement) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-teleport.vue2.js","sources":["../../../src/components/base-teleport.vue"],"sourcesContent":["<template>\n <Teleport v-if=\"teleportHost\" :to=\"teleportHost.shadowRoot ?? teleportHost\" :disabled>\n <slot></slot>\n </Teleport>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport {\n defineComponent,\n getCurrentInstance,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n ref,\n watch,\n watchEffect,\n} from 'vue'\n\nexport default defineComponent({\n name: 'BaseTeleport',\n props: {\n /** The element or css selector to which the component will be teleported. */\n target: {\n type: [String, Object] as PropType<string | Element>,\n required: true,\n },\n /**\n * The position relative to the target\n * - `beforebegin`: Before the target element.\n * - `afterbegin`: Inside the target element, before its first child.\n * - `beforeend`: Inside the target element, after its last child.\n * - `afterend`: After the target element.\n * - `onlychild`: Adds it as child and hides all other children of the target element.\n */\n position: {\n type: String as PropType<\n 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend' | 'onlychild'\n >,\n default: 'onlychild',\n },\n /** If disabled, the slot content will not be teleported */\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n if (typeof document === 'undefined') {\n return { teleportHost: ref<Element>() }\n }\n\n const instance = getCurrentInstance()\n /** Hook where the slot content will be teleported to. */\n const teleportHost = ref<Element>()\n /** The page element where the teleport host will be inserted. */\n const targetElement = ref<Element>()\n let isIsolated = false\n\n // Before doing app.mount it is unknown if it will be mounted in a shadow so we need to wait.\n if (instance?.appContext.app._container) {\n createHost()\n } else {\n afterAppMount(createHost)\n }\n\n const targetAddedObserver = new MutationObserver(targetAdded)\n const targetRemovedObserver = new MutationObserver(targetRemoved)\n\n onUnmounted(() => {\n if (isIsolated && teleportHost.value) {\n ;(window as any).xCSSInjector.removeHost(teleportHost.value.shadowRoot)\n }\n })\n\n onBeforeUnmount(() => {\n targetAddedObserver.disconnect()\n targetRemovedObserver.disconnect()\n teleportHost.value?.remove()\n })\n\n // Handles target prop changes and init the observers accordingly.\n watch(\n () => props.target,\n newTarget => {\n targetAddedObserver.disconnect()\n targetRemovedObserver.disconnect()\n const target = typeof newTarget === 'string' ? document.querySelector(newTarget) : newTarget\n if (target?.isConnected) {\n targetAdded()\n } else {\n targetRemoved()\n }\n },\n { immediate: true },\n )\n\n // Updates the teleport host when props change.\n watchEffect(() => {\n if (!teleportHost.value) {\n return\n }\n if (props.disabled) {\n teleportHost.value.remove()\n return\n }\n teleportHost.value.className = `x-base-teleport x-base-teleport--${props.position}`\n\n if (!targetElement.value) {\n console.warn(`BaseTeleport: Target element \"${props.target}\" not found.`)\n return\n }\n const position = props.position === 'onlychild' ? 'beforeend' : props.position\n targetElement.value.insertAdjacentElement(position, teleportHost.value)\n })\n\n /** Checks if the target element exists in the DOM and updates the observers */\n function targetAdded() {\n let element =\n typeof props.target === 'string' ? document.querySelector(props.target) : props.target\n if (element?.isConnected) {\n targetAddedObserver.disconnect()\n targetElement.value = element\n while (element.parentElement) {\n element = element.parentElement\n targetRemovedObserver.observe(element, { childList: true })\n }\n }\n }\n\n /** Checks if the target was disconnected from the DOM and updates the observers */\n function targetRemoved() {\n if (targetElement.value && !targetElement.value.isConnected) {\n targetRemovedObserver.disconnect()\n targetAddedObserver.observe(document.body, { childList: true, subtree: true })\n targetElement.value = undefined\n }\n }\n\n /** Creates and sets the teleport host element */\n function createHost() {\n teleportHost.value = document.createElement('div')\n isIsolated = instance?.appContext.app._container instanceof ShadowRoot\n if (isIsolated) {\n teleportHost.value.attachShadow({ mode: 'open' })\n ;(window as any).xCSSInjector.addHost(teleportHost.value.shadowRoot)\n }\n }\n\n function afterAppMount(fn: () => void) {\n onMounted(() => setTimeout(fn, 0))\n }\n\n return { teleportHost }\n },\n})\n\n/** Teleport host styles should be injected outside our shadowRoots */\nif (typeof document !== 'undefined') {\n const css = document.createElement('style')\n css.textContent =\n ':has(> .x-base-teleport--onlychild) > *:not(.x-base-teleport) { display: none; }'\n document.head?.appendChild(css) ||\n document.addEventListener('DOMContentLoaded', () => document.head.appendChild(css))\n}\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nThe BaseTeleport component allows you to teleport its slot content to a specified target element in\nthe DOM. It provides flexibility in positioning the content relative to the target element and\nsupports shadow DOM integration.\n\n### Basic example\n\nTeleport content to a specific element in the DOM:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\">\n <div>This content will be teleported.</div>\n </BaseTeleport>\n</template>\n```\n\n### Positioning options\n\nTeleport content inside the target element, before its first child:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\" position=\"afterbegin\">\n <div>Teleported content at the beginning.</div>\n </BaseTeleport>\n</template>\n```\n\n### Disabled Teleport\n\nPrevent teleporting the content:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\" :disabled=\"true\">\n <div>This content will not be teleported.</div>\n </BaseTeleport>\n</template>\n```\n\n### Notes\n\n- When using the `onlychild` position, all other children of the target element will be hidden.\n- The component supports shadow DOM integration, automatically handling style injection. Anyway, Empathy's custom CSS\n injector is required. Teleport depends on it to add the styles.\n</docs>\n"],"names":[],"mappings":";;AAmBA,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAA+B;AACpD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;;;;AAOE;AACF,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,MAEL;AACD,YAAA,OAAO,EAAE,WAAW;AACrB,SAAA;;AAED,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,IAAI,OAAO,QAAS,KAAI,WAAW,EAAE;AACnC,YAAA,OA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,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA,CAAA;AACtF;;;;"}
|
|
1
|
+
{"version":3,"file":"base-teleport.vue2.js","sources":["../../../src/components/base-teleport.vue"],"sourcesContent":["<template>\n <Teleport v-if=\"teleportHost\" :to=\"teleportHost.shadowRoot ?? teleportHost\" :disabled>\n <slot></slot>\n </Teleport>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport {\n defineComponent,\n getCurrentInstance,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n ref,\n watch,\n watchEffect,\n} from 'vue'\n\nexport default defineComponent({\n name: 'BaseTeleport',\n props: {\n /** The element or css selector to which the component will be teleported. */\n target: {\n type: [String, Object] as PropType<string | Element>,\n required: true,\n },\n /**\n * The position relative to the target\n * - `beforebegin`: Before the target element.\n * - `afterbegin`: Inside the target element, before its first child.\n * - `beforeend`: Inside the target element, after its last child.\n * - `afterend`: After the target element.\n * - `onlychild`: Adds it as child and hides all other children of the target element.\n */\n position: {\n type: String as PropType<\n 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend' | 'onlychild'\n >,\n default: 'onlychild',\n },\n /** If disabled, the slot content will not be teleported */\n disabled: {\n type: Boolean,\n default: false,\n },\n /** Styles for the teleport (content container) */\n hostStyle: Object as PropType<string | CSSStyleDeclaration>,\n },\n setup(props) {\n if (typeof document === 'undefined') {\n return { teleportHost: ref<HTMLElement>() }\n }\n\n const instance = getCurrentInstance()\n /** Hook where the slot content will be teleported to. */\n const teleportHost = ref<HTMLElement>()\n /** The page element where the teleport host will be inserted. */\n const targetElement = ref<HTMLElement>()\n let isIsolated = false\n\n // Before doing app.mount it is unknown if it will be mounted in a shadow so we need to wait.\n if (instance?.appContext.app._container) {\n createHost()\n } else {\n afterAppMount(createHost)\n }\n\n const targetAddedObserver = new MutationObserver(targetAdded)\n const targetRemovedObserver = new MutationObserver(targetRemoved)\n\n onUnmounted(() => {\n if (isIsolated && teleportHost.value) {\n ;(window as any).xCSSInjector.removeHost(teleportHost.value.shadowRoot)\n }\n })\n\n onBeforeUnmount(() => {\n targetAddedObserver.disconnect()\n targetRemovedObserver.disconnect()\n teleportHost.value?.remove()\n })\n\n // Handles target prop changes and init the observers accordingly.\n watch(\n () => props.target,\n newTarget => {\n targetAddedObserver.disconnect()\n targetRemovedObserver.disconnect()\n const target = typeof newTarget === 'string' ? document.querySelector(newTarget) : newTarget\n if (target?.isConnected) {\n targetAdded()\n } else {\n targetRemoved()\n }\n },\n { immediate: true },\n )\n\n // Updates the teleport host when props change.\n watchEffect(() => {\n if (!teleportHost.value) {\n return\n }\n if (props.disabled) {\n teleportHost.value.remove()\n return\n }\n teleportHost.value.className = `x-base-teleport x-base-teleport--${props.position}`\n\n if (!targetElement.value) {\n console.warn(`BaseTeleport: Target element \"${props.target}\" not found.`)\n return\n }\n const position = props.position === 'onlychild' ? 'beforeend' : props.position\n targetElement.value.insertAdjacentElement(position, teleportHost.value)\n })\n\n /* Update the host inline styles when it changes */\n watchEffect(() => {\n if (teleportHost.value && props.hostStyle) {\n if (typeof props.hostStyle === 'string') {\n teleportHost.value.style.cssText = props.hostStyle\n } else {\n Object.assign(teleportHost.value.style, props.hostStyle)\n }\n }\n })\n\n /** Checks if the target element exists in the DOM and updates the observers */\n function targetAdded() {\n let element: string | Element | null = props.target\n if (typeof element === 'string') {\n element = document.querySelector(element)\n }\n if (element instanceof HTMLElement && element.isConnected) {\n targetAddedObserver.disconnect()\n targetElement.value = element\n while (element.parentElement) {\n element = element.parentElement\n targetRemovedObserver.observe(element, { childList: true })\n }\n }\n }\n\n /** Checks if the target was disconnected from the DOM and updates the observers */\n function targetRemoved() {\n if (targetElement.value && !targetElement.value.isConnected) {\n targetRemovedObserver.disconnect()\n targetAddedObserver.observe(document.body, { childList: true, subtree: true })\n targetElement.value = undefined\n }\n }\n\n /** Creates and sets the teleport host element */\n function createHost() {\n teleportHost.value = document.createElement('div')\n isIsolated = instance?.appContext.app._container instanceof ShadowRoot\n if (isIsolated) {\n teleportHost.value.attachShadow({ mode: 'open' })\n ;(window as any).xCSSInjector.addHost(teleportHost.value.shadowRoot)\n }\n }\n\n function afterAppMount(fn: () => void) {\n onMounted(() => setTimeout(fn, 0))\n }\n\n return { teleportHost }\n },\n})\n\n/** Teleport host styles should be injected outside our shadowRoots */\nif (typeof document !== 'undefined') {\n const css = document.createElement('style')\n css.textContent =\n ':has(> .x-base-teleport--onlychild) > *:not(.x-base-teleport) { display: none; }'\n document.head?.appendChild(css) ||\n document.addEventListener('DOMContentLoaded', () => document.head.appendChild(css))\n}\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nThe BaseTeleport component allows you to teleport its slot content to a specified target element in\nthe DOM. It provides flexibility in positioning the content relative to the target element and\nsupports shadow DOM integration.\n\n### Basic example\n\nTeleport content to a specific element in the DOM:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\">\n <div>This content will be teleported.</div>\n </BaseTeleport>\n</template>\n```\n\n### Positioning options\n\nTeleport content inside the target element, before its first child:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\" position=\"afterbegin\">\n <div>Teleported content at the beginning.</div>\n </BaseTeleport>\n</template>\n```\n\n### Disabled Teleport\n\nPrevent teleporting the content:\n\n```vue\n<template>\n <BaseTeleport target=\"#my-target\" :disabled=\"true\">\n <div>This content will not be teleported.</div>\n </BaseTeleport>\n</template>\n```\n\n### Notes\n\n- When using the `onlychild` position, all other children of the target element will be hidden.\n- The component supports shadow DOM integration, automatically handling style injection. Anyway, Empathy's custom CSS\n injector is required. Teleport depends on it to add the styles.\n</docs>\n"],"names":[],"mappings":";;AAmBA,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAA+B;AACpD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;;;;AAOE;AACF,QAAA,QAA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D,UAAW,GAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,UAAS,YAAa,UAAS,CAAA;YACrE,IAAI,UAAU,EAAE;gBACd,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAA,CAC/C;gBAAC,MAAc,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,CAAA,CAAA;aACrE;SACF;QAEA,SAAS,aAAa,CAAC,EAAc,EAAA;YACnC,SAAS,CAAC,MAAM,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA,CAAA;SACnC;QAEA,OAAO,EAAE,YAAa,EAAA,CAAA;KACvB;AACF,CAAA,CAAA,CAAA;AAED;AACA,IAAI,OAAO,QAAS,KAAI,WAAW,EAAE;IACnC,MAAM,GAAI,GAAE,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAA,CAAA;AAC1C,IAAA,GAAG,CAAC,WAAY;AACd,QAAA,kFAAiF,CAAA;AACnF,IAAA,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG;AAC5B,QAAA,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA,CAAA;AACtF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empathize.vue.js","sources":["../../../../../src/x-modules/empathize/components/empathize.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <div\n v-show=\"isOpenAndHasContent\"\n ref=\"empathizeRef\"\n class=\"x-empathize\"\n data-test=\"empathize\"\n @mousedown.prevent\n @focusin=\"open\"\n @focusout=\"close\"\n >\n <!-- @slot (Required) Modal container content -->\n <slot />\n </div>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType, WatchStopHandle } from 'vue'\nimport type { XEvent } from '../../../wiring'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { NoAnimation } from '../../../components'\nimport { use$x, useDebounce } from '../../../composables'\nimport { AnimationProp } from '../../../types'\nimport { getActiveElement } from '../../../utils'\nimport { empathizeXModule } from '../x-module'\n\n/**\n * Component containing the empathize. It has a required slot to define its content.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Empathize',\n xModule: empathizeXModule.name,\n props: {\n /** Array of {@link XEvent} to open the empathize. */\n eventsToOpenEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => ['UserFocusedSearchBox', 'UserIsTypingAQuery', 'UserClickedSearchBox'],\n },\n /** Array of {@link XEvent} to close the empathize. */\n eventsToCloseEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => [\n 'UserClosedEmpathize',\n 'UserSelectedASuggestion',\n 'UserPressedEnterKey',\n 'UserBlurredSearchBox',\n ],\n },\n /** Animation component that will be used to animate the empathize. */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation,\n },\n /** Whether the empathize has content or not. As it is only known in the client, it is a prop. */\n hasContent: {\n type: Boolean,\n default: true,\n },\n /** Fallback flag to trigger a search and close the empathize when has no-content. */\n searchAndCloseOnNoContent: {\n type: Boolean,\n default: false,\n },\n /** Debounce time in milliseconds to search and close the empathize when has no-content. */\n searchAndCloseDebounceInMs: {\n type: Number,\n default: 1000,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const empathizeRef = ref<HTMLDivElement | null>(null)\n const isOpen = ref(false)\n const isOpenAndHasContent = computed(() => isOpen.value && props.hasContent)\n\n /** Emit 'EmpathizeOpened' or 'EmpathizeClosed' event when computed changes. */\n watch(isOpenAndHasContent, () => {\n const empathizeEvent = isOpenAndHasContent.value ? 'EmpathizeOpened' : 'EmpathizeClosed'\n $x.emit(empathizeEvent, undefined, { target: empathizeRef.value })\n })\n\n /** Debounce function to change the state `isOpen` to the new value. */\n const changeOpenDebounced = useDebounce((newOpen: boolean) => (isOpen.value = newOpen), 0)\n\n /**\n * Open empathize. This function will be executed on any event in\n * {@link Empathize.eventsToOpenEmpathize} and on DOM event `focusin` on the Empathize root\n * element.\n */\n function open() {\n changeOpenDebounced(true)\n }\n\n /**\n * Close empathize. This function will be executed on any event in\n * {@link Empathize.eventsToCloseEmpathize} and on DOM event `focusout` on the Empathize root\n * element.\n */\n function close() {\n const activeElement = getActiveElement()\n if (!empathizeRef.value?.contains(activeElement)) {\n changeOpenDebounced(false)\n }\n }\n\n /** Events subscriptions to open and close empathize. */\n props.eventsToOpenEmpathize.forEach(event => $x.on(event, false).subscribe(open))\n props.eventsToCloseEmpathize.forEach(event => $x.on(event, false).subscribe(close))\n\n let unwatchSearchBoxQuery: WatchStopHandle = () => {}\n\n /** Debounced function to unwatch the search-box query and also search and close empathize. */\n const searchAndCloseDebounced = useDebounce(async () => {\n unwatchSearchBoxQuery()\n await $x.emit('
|
|
1
|
+
{"version":3,"file":"empathize.vue.js","sources":["../../../../../src/x-modules/empathize/components/empathize.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <div\n v-show=\"isOpenAndHasContent\"\n ref=\"empathizeRef\"\n class=\"x-empathize\"\n data-test=\"empathize\"\n @mousedown.prevent\n @focusin=\"open\"\n @focusout=\"close\"\n >\n <!-- @slot (Required) Modal container content -->\n <slot />\n </div>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType, WatchStopHandle } from 'vue'\nimport type { XEvent } from '../../../wiring'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { NoAnimation } from '../../../components'\nimport { use$x, useDebounce } from '../../../composables'\nimport { AnimationProp } from '../../../types'\nimport { getActiveElement } from '../../../utils'\nimport { empathizeXModule } from '../x-module'\n\n/**\n * Component containing the empathize. It has a required slot to define its content.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Empathize',\n xModule: empathizeXModule.name,\n props: {\n /** Array of {@link XEvent} to open the empathize. */\n eventsToOpenEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => ['UserFocusedSearchBox', 'UserIsTypingAQuery', 'UserClickedSearchBox'],\n },\n /** Array of {@link XEvent} to close the empathize. */\n eventsToCloseEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => [\n 'UserClosedEmpathize',\n 'UserSelectedASuggestion',\n 'UserPressedEnterKey',\n 'UserBlurredSearchBox',\n ],\n },\n /** Animation component that will be used to animate the empathize. */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation,\n },\n /** Whether the empathize has content or not. As it is only known in the client, it is a prop. */\n hasContent: {\n type: Boolean,\n default: true,\n },\n /** Fallback flag to trigger a search and close the empathize when has no-content. */\n searchAndCloseOnNoContent: {\n type: Boolean,\n default: false,\n },\n /** Debounce time in milliseconds to search and close the empathize when has no-content. */\n searchAndCloseDebounceInMs: {\n type: Number,\n default: 1000,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const empathizeRef = ref<HTMLDivElement | null>(null)\n const isOpen = ref(false)\n const isOpenAndHasContent = computed(() => isOpen.value && props.hasContent)\n\n /** Emit 'EmpathizeOpened' or 'EmpathizeClosed' event when computed changes. */\n watch(isOpenAndHasContent, () => {\n const empathizeEvent = isOpenAndHasContent.value ? 'EmpathizeOpened' : 'EmpathizeClosed'\n $x.emit(empathizeEvent, undefined, { target: empathizeRef.value })\n })\n\n /** Debounce function to change the state `isOpen` to the new value. */\n const changeOpenDebounced = useDebounce((newOpen: boolean) => (isOpen.value = newOpen), 0)\n\n /**\n * Open empathize. This function will be executed on any event in\n * {@link Empathize.eventsToOpenEmpathize} and on DOM event `focusin` on the Empathize root\n * element.\n */\n function open() {\n changeOpenDebounced(true)\n }\n\n /**\n * Close empathize. This function will be executed on any event in\n * {@link Empathize.eventsToCloseEmpathize} and on DOM event `focusout` on the Empathize root\n * element.\n */\n function close() {\n const activeElement = getActiveElement()\n if (!empathizeRef.value?.contains(activeElement)) {\n changeOpenDebounced(false)\n }\n }\n\n /** Events subscriptions to open and close empathize. */\n props.eventsToOpenEmpathize.forEach(event => $x.on(event, false).subscribe(open))\n props.eventsToCloseEmpathize.forEach(event => $x.on(event, false).subscribe(close))\n\n let unwatchSearchBoxQuery: WatchStopHandle = () => {}\n\n /** Debounced function to unwatch the search-box query and also search and close empathize. */\n const searchAndCloseDebounced = useDebounce(async () => {\n unwatchSearchBoxQuery()\n await $x.emit('EmpathizeGotNoContent', $x.query.searchBox)\n close()\n }, props.searchAndCloseDebounceInMs)\n\n /**\n * Watcher triggered when `hasContent` change and the `searchAndCloseOnNoContent` flag is active\n * with the following casuistics:\n * 1. Empathize has content: unwatch the search-box query and cancel debounced search&close.\n * 2. Empathize has NO content: create a watcher for the search-box query. It is to debounce the\n * search fallback when the user types in the search-box during debounced time.\n */\n watch(\n () => props.hasContent,\n () => {\n if (props.searchAndCloseOnNoContent) {\n if (props.hasContent) {\n unwatchSearchBoxQuery()\n searchAndCloseDebounced.cancel()\n } else {\n unwatchSearchBoxQuery = watch(() => $x.query.searchBox, searchAndCloseDebounced, {\n immediate: true,\n })\n }\n }\n },\n )\n\n return { empathizeRef, isOpenAndHasContent, open, close }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`EmpathizeOpened`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `true` and `hasContent` to `true`.\n The event payload is undefined and can have a metadata with the module and the element that emitted it.\n- [`EmpathizeClosed`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `false` and `hasContent` to `true`.\n The event payload is undefined and can have a metadata with the module and the element that emitted it.\n\n## Examples\n\nThis component will listen to the configured events in `eventsToOpenEmpathize` and\n`eventsToCloseEmpathize` props and open/close itself accordingly. By default, those props values\nare:\n\n- Open: `UserFocusedSearchBox`, `UserIsTypingAQuery`, `UserClickedSearchBox`\n- Close: `UserClosedEmpathize`, `UserSelectedASuggestion`, `UserPressedEnter` and 'UserBlurredSearchBox`\n\n### Basic examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation.\n\n```vue\n<Empathize>\n <template #default>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n </template>\n</Empathize>\n```\n\nDefining custom values for the events to open and close the Empathize. For example opening it when\nthe search box loses the focus and closing it when the search box receives the focus:\n\n```vue\n<Empathize\n :eventsToOpenEmpathize=\"['UserBlurredSearchBox']\"\n :eventsToCloseEmpathize=\"['UserFocusedSearchBox']\"\n>\n <template #default>\n Please, type a query in the Search Box.\n </template>\n</Empathize>\n```\n\nAn animation can be used for the opening and closing using the `animation` prop. The animation, must\nbe a Component with a `Transition` with a slot inside:\n\n```vue\n<Empathize :animation=\"collapseFromTop\">\n <template #default>\n <PopularSearches/>\n </template>\n</Empathize>\n```\n\n### Advance examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation. It also configures `searchAndCloseOnNoContent` to trigger a search and close the empathize\nwhen has no-content as fallback behaviour. To do that, `hasContent` prop must be reactive to know\nif the empathize has content or not.\nIt also configures `searchAndCloseDebounceInMs` to 500ms as debounce time to search and close the\nempathize when has no-content.\n\n```vue\n<Empathize\n :animation=\"empathizeAnimation\"\n :events-to-close-empathize=\"empathizeCloseEvents\"\n :has-content=\"showEmpathize\"\n :search-and-close-debounce-in-ms=\"500\"\n search-and-close-on-no-content\n>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n</Empathize>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_withDirectives","_createElementVNode","_withModifiers","_renderSlot"],"mappings":";;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAaYC,wBAbI,IAAS,CAAA,SAAA,CAAA,EAAA,IAAA,EAAA;AAAA,IAD3B,iBAEI,MAWM;AAAA,MAXNC,cAAA,CAAAC,kBAAA;AAAA,QAWM,KAAA;AAAA,QAAA;AAAA,UATJ,GAAI,EAAA,cAAA;AAAA,UACJ,KAAM,EAAA,aAAA;AAAA,UACN,WAAU,EAAA,WAAA;AAAA,UACT,WAAA,EAAS,0BAPhBC,aAOM,CAAA,MAAA;AAAA,WAAkB,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;AAAA,UACjB,WAAO,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,IAAA,IAAA,IAAA,CAAA,IAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,UACT,YAAQ,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,KAAA,IAAA,IAAA,CAAA,KAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,SAAA;;UAGXC,UAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,SAAA;;;;gBATA,IAAmB,CAAA,mBAAA,CAAA;AAAA,OAAA,CAAA;;AAHjC,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,CAAA;;;;;;"}
|
|
@@ -194,7 +194,7 @@ var _sfc_main = defineComponent({
|
|
|
194
194
|
/** Debounced function to unwatch the search-box query and also search and close empathize. */
|
|
195
195
|
const searchAndCloseDebounced = useDebounce(async () => {
|
|
196
196
|
unwatchSearchBoxQuery();
|
|
197
|
-
await $x.emit('
|
|
197
|
+
await $x.emit('EmpathizeGotNoContent', $x.query.searchBox);
|
|
198
198
|
close();
|
|
199
199
|
}, props.searchAndCloseDebounceInMs);
|
|
200
200
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empathize.vue2.js","sources":["../../../../../src/x-modules/empathize/components/empathize.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <div\n v-show=\"isOpenAndHasContent\"\n ref=\"empathizeRef\"\n class=\"x-empathize\"\n data-test=\"empathize\"\n @mousedown.prevent\n @focusin=\"open\"\n @focusout=\"close\"\n >\n <!-- @slot (Required) Modal container content -->\n <slot />\n </div>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType, WatchStopHandle } from 'vue'\nimport type { XEvent } from '../../../wiring'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { NoAnimation } from '../../../components'\nimport { use$x, useDebounce } from '../../../composables'\nimport { AnimationProp } from '../../../types'\nimport { getActiveElement } from '../../../utils'\nimport { empathizeXModule } from '../x-module'\n\n/**\n * Component containing the empathize. It has a required slot to define its content.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Empathize',\n xModule: empathizeXModule.name,\n props: {\n /** Array of {@link XEvent} to open the empathize. */\n eventsToOpenEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => ['UserFocusedSearchBox', 'UserIsTypingAQuery', 'UserClickedSearchBox'],\n },\n /** Array of {@link XEvent} to close the empathize. */\n eventsToCloseEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => [\n 'UserClosedEmpathize',\n 'UserSelectedASuggestion',\n 'UserPressedEnterKey',\n 'UserBlurredSearchBox',\n ],\n },\n /** Animation component that will be used to animate the empathize. */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation,\n },\n /** Whether the empathize has content or not. As it is only known in the client, it is a prop. */\n hasContent: {\n type: Boolean,\n default: true,\n },\n /** Fallback flag to trigger a search and close the empathize when has no-content. */\n searchAndCloseOnNoContent: {\n type: Boolean,\n default: false,\n },\n /** Debounce time in milliseconds to search and close the empathize when has no-content. */\n searchAndCloseDebounceInMs: {\n type: Number,\n default: 1000,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const empathizeRef = ref<HTMLDivElement | null>(null)\n const isOpen = ref(false)\n const isOpenAndHasContent = computed(() => isOpen.value && props.hasContent)\n\n /** Emit 'EmpathizeOpened' or 'EmpathizeClosed' event when computed changes. */\n watch(isOpenAndHasContent, () => {\n const empathizeEvent = isOpenAndHasContent.value ? 'EmpathizeOpened' : 'EmpathizeClosed'\n $x.emit(empathizeEvent, undefined, { target: empathizeRef.value })\n })\n\n /** Debounce function to change the state `isOpen` to the new value. */\n const changeOpenDebounced = useDebounce((newOpen: boolean) => (isOpen.value = newOpen), 0)\n\n /**\n * Open empathize. This function will be executed on any event in\n * {@link Empathize.eventsToOpenEmpathize} and on DOM event `focusin` on the Empathize root\n * element.\n */\n function open() {\n changeOpenDebounced(true)\n }\n\n /**\n * Close empathize. This function will be executed on any event in\n * {@link Empathize.eventsToCloseEmpathize} and on DOM event `focusout` on the Empathize root\n * element.\n */\n function close() {\n const activeElement = getActiveElement()\n if (!empathizeRef.value?.contains(activeElement)) {\n changeOpenDebounced(false)\n }\n }\n\n /** Events subscriptions to open and close empathize. */\n props.eventsToOpenEmpathize.forEach(event => $x.on(event, false).subscribe(open))\n props.eventsToCloseEmpathize.forEach(event => $x.on(event, false).subscribe(close))\n\n let unwatchSearchBoxQuery: WatchStopHandle = () => {}\n\n /** Debounced function to unwatch the search-box query and also search and close empathize. */\n const searchAndCloseDebounced = useDebounce(async () => {\n unwatchSearchBoxQuery()\n await $x.emit('UserAcceptedAQuery', $x.query.searchBox)\n close()\n }, props.searchAndCloseDebounceInMs)\n\n /**\n * Watcher triggered when `hasContent` change and the `searchAndCloseOnNoContent` flag is active\n * with the following casuistics:\n * 1. Empathize has content: unwatch the search-box query and cancel debounced search&close.\n * 2. Empathize has NO content: create a watcher for the search-box query. It is to debounce the\n * search fallback when the user types in the search-box during debounced time.\n */\n watch(\n () => props.hasContent,\n () => {\n if (props.searchAndCloseOnNoContent) {\n if (props.hasContent) {\n unwatchSearchBoxQuery()\n searchAndCloseDebounced.cancel()\n } else {\n unwatchSearchBoxQuery = watch(() => $x.query.searchBox, searchAndCloseDebounced, {\n immediate: true,\n })\n }\n }\n },\n )\n\n return { empathizeRef, isOpenAndHasContent, open, close }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`EmpathizeOpened`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `true` and `hasContent` to `true`.\n The event payload is undefined and can have a metadata with the module and the element that emitted it.\n- [`EmpathizeClosed`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `false` and `hasContent` to `true`.\n The event payload is undefined and can have a metadata with the module and the element that emitted it.\n\n## Examples\n\nThis component will listen to the configured events in `eventsToOpenEmpathize` and\n`eventsToCloseEmpathize` props and open/close itself accordingly. By default, those props values\nare:\n\n- Open: `UserFocusedSearchBox`, `UserIsTypingAQuery`, `UserClickedSearchBox`\n- Close: `UserClosedEmpathize`, `UserSelectedASuggestion`, `UserPressedEnter` and 'UserBlurredSearchBox`\n\n### Basic examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation.\n\n```vue\n<Empathize>\n <template #default>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n </template>\n</Empathize>\n```\n\nDefining custom values for the events to open and close the Empathize. For example opening it when\nthe search box loses the focus and closing it when the search box receives the focus:\n\n```vue\n<Empathize\n :eventsToOpenEmpathize=\"['UserBlurredSearchBox']\"\n :eventsToCloseEmpathize=\"['UserFocusedSearchBox']\"\n>\n <template #default>\n Please, type a query in the Search Box.\n </template>\n</Empathize>\n```\n\nAn animation can be used for the opening and closing using the `animation` prop. The animation, must\nbe a Component with a `Transition` with a slot inside:\n\n```vue\n<Empathize :animation=\"collapseFromTop\">\n <template #default>\n <PopularSearches/>\n </template>\n</Empathize>\n```\n\n### Advance examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation. It also configures `searchAndCloseOnNoContent` to trigger a search and close the empathize\nwhen has no-content as fallback behaviour. To do that, `hasContent` prop must be reactive to know\nif the empathize has content or not.\nIt also configures `searchAndCloseDebounceInMs` to 500ms as debounce time to search and close the\nempathize when has no-content.\n\n```vue\n<Empathize\n :animation=\"empathizeAnimation\"\n :events-to-close-empathize=\"empathizeCloseEvents\"\n :has-content=\"showEmpathize\"\n :search-and-close-debounce-in-ms=\"500\"\n search-and-close-on-no-content\n>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n</Empathize>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,gBAAgB,CAAC,IAAI;AAC9B,IAAA,KAAK,EAAE;;AAEL,QAAA,qBAAqB,EAAE;AACrB,YAAA,IAAI,EAAE,KAA2B;YACjC,OAAO,EAAE,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,CAAC;AACtF,SAAA;;AAED,QAAA,sBAAsB,EAAE;AACtB,YAAA,IAAI,EAAE,KAA2B;YACjC,OAAO,EAAE,MAAM;gBACb,qBAAqB;gBACrB,yBAAyB;gBACzB,qBAAqB;gBACrB,sBAAsB;AACvB,aAAA;AACF,SAAA;;AAED,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,MAAMA,WAAW;AAC3B,SAAA;;AAED,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;;AAED,QAAA,yBAAyB,EAAE;AACzB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;;AAED,QAAA,0BAA0B,EAAE;AAC1B,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KA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EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA,CAAA;AAElF,QAAA,IAAI,qBAAqB,GAAoB,SAAO,CAAA;;AAGpD,QAAA,MAAM,uBAAsB,GAAI,WAAW,CAAC,YAAY;AACtD,YAAA,qBAAqB,EAAC,CAAA;AACtB,YAAA,MAAM,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAA,CAAA;AACtD,YAAA,KAAK,EAAC,CAAA;AACR,SAAC,EAAE,KAAK,CAAC,0BAA0B,CAAA,CAAA;AAEnC;;;;;;AAME;QACF,KAAK,CACH,MAAM,KAAK,CAAC,UAAU,EACtB,MAAM;AACJ,YAAA,IAAI,KAAK,CAAC,yBAAyB,EAAE;AACnC,gBAAA,IAAI,KAAK,CAAC,UAAU,EAAE;AACpB,oBAAA,qBAAqB,EAAC,CAAA;oBACtB,uBAAuB,CAAC,MAAM,EAAC,CAAA;iBAC/B;qBAAK;AACL,oBAAA,qBAAsB,GAAE,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,uBAAuB,EAAE;AAC/E,wBAAA,SAAS,EAAE,IAAI;AAChB,qBAAA,CAAA,CAAA;iBACH;aACF;AACF,SAAC,CACH,CAAA;QAEA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAM,EAAA,CAAA;KACzD;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"empathize.vue2.js","sources":["../../../../../src/x-modules/empathize/components/empathize.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <div\n v-show=\"isOpenAndHasContent\"\n ref=\"empathizeRef\"\n class=\"x-empathize\"\n data-test=\"empathize\"\n @mousedown.prevent\n @focusin=\"open\"\n @focusout=\"close\"\n >\n <!-- @slot (Required) Modal container content -->\n <slot />\n </div>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType, WatchStopHandle } from 'vue'\nimport type { XEvent } from '../../../wiring'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { NoAnimation } from '../../../components'\nimport { use$x, useDebounce } from '../../../composables'\nimport { AnimationProp } from '../../../types'\nimport { getActiveElement } from '../../../utils'\nimport { empathizeXModule } from '../x-module'\n\n/**\n * Component containing the empathize. It has a required slot to define its content.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Empathize',\n xModule: empathizeXModule.name,\n props: {\n /** Array of {@link XEvent} to open the empathize. */\n eventsToOpenEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => ['UserFocusedSearchBox', 'UserIsTypingAQuery', 'UserClickedSearchBox'],\n },\n /** Array of {@link XEvent} to close the empathize. */\n eventsToCloseEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => [\n 'UserClosedEmpathize',\n 'UserSelectedASuggestion',\n 'UserPressedEnterKey',\n 'UserBlurredSearchBox',\n ],\n },\n /** Animation component that will be used to animate the empathize. */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation,\n },\n /** Whether the empathize has content or not. As it is only known in the client, it is a prop. */\n hasContent: {\n type: Boolean,\n default: true,\n },\n /** Fallback flag to trigger a search and close the empathize when has no-content. */\n searchAndCloseOnNoContent: {\n type: Boolean,\n default: false,\n },\n /** Debounce time in milliseconds to search and close the empathize when has no-content. */\n searchAndCloseDebounceInMs: {\n type: Number,\n default: 1000,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const empathizeRef = ref<HTMLDivElement | null>(null)\n const isOpen = ref(false)\n const isOpenAndHasContent = computed(() => isOpen.value && props.hasContent)\n\n /** Emit 'EmpathizeOpened' or 'EmpathizeClosed' event when computed changes. */\n watch(isOpenAndHasContent, () => {\n const empathizeEvent = isOpenAndHasContent.value ? 'EmpathizeOpened' : 'EmpathizeClosed'\n $x.emit(empathizeEvent, undefined, { target: empathizeRef.value })\n })\n\n /** Debounce function to change the state `isOpen` to the new value. */\n const changeOpenDebounced = useDebounce((newOpen: boolean) => (isOpen.value = newOpen), 0)\n\n /**\n * Open empathize. This function will be executed on any event in\n * {@link Empathize.eventsToOpenEmpathize} and on DOM event `focusin` on the Empathize root\n * element.\n */\n function open() {\n changeOpenDebounced(true)\n }\n\n /**\n * Close empathize. This function will be executed on any event in\n * {@link Empathize.eventsToCloseEmpathize} and on DOM event `focusout` on the Empathize root\n * element.\n */\n function close() {\n const activeElement = getActiveElement()\n if (!empathizeRef.value?.contains(activeElement)) {\n changeOpenDebounced(false)\n }\n }\n\n /** Events subscriptions to open and close empathize. */\n props.eventsToOpenEmpathize.forEach(event => $x.on(event, false).subscribe(open))\n props.eventsToCloseEmpathize.forEach(event => $x.on(event, false).subscribe(close))\n\n let unwatchSearchBoxQuery: WatchStopHandle = () => {}\n\n /** Debounced function to unwatch the search-box query and also search and close empathize. */\n const searchAndCloseDebounced = useDebounce(async () => {\n unwatchSearchBoxQuery()\n await $x.emit('EmpathizeGotNoContent', $x.query.searchBox)\n close()\n }, props.searchAndCloseDebounceInMs)\n\n /**\n * Watcher triggered when `hasContent` change and the `searchAndCloseOnNoContent` flag is active\n * with the following casuistics:\n * 1. Empathize has content: unwatch the search-box query and cancel debounced search&close.\n * 2. Empathize has NO content: create a watcher for the search-box query. It is to debounce the\n * search fallback when the user types in the search-box during debounced time.\n */\n watch(\n () => props.hasContent,\n () => {\n if (props.searchAndCloseOnNoContent) {\n if (props.hasContent) {\n unwatchSearchBoxQuery()\n searchAndCloseDebounced.cancel()\n } else {\n unwatchSearchBoxQuery = watch(() => $x.query.searchBox, searchAndCloseDebounced, {\n immediate: true,\n })\n }\n }\n },\n )\n\n return { empathizeRef, isOpenAndHasContent, open, close }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`EmpathizeOpened`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `true` and `hasContent` to `true`.\n The event payload is undefined and can have a metadata with the module and the element that emitted it.\n- [`EmpathizeClosed`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `false` and `hasContent` to `true`.\n The event payload is undefined and can have a metadata with the module and the element that emitted it.\n\n## Examples\n\nThis component will listen to the configured events in `eventsToOpenEmpathize` and\n`eventsToCloseEmpathize` props and open/close itself accordingly. By default, those props values\nare:\n\n- Open: `UserFocusedSearchBox`, `UserIsTypingAQuery`, `UserClickedSearchBox`\n- Close: `UserClosedEmpathize`, `UserSelectedASuggestion`, `UserPressedEnter` and 'UserBlurredSearchBox`\n\n### Basic examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation.\n\n```vue\n<Empathize>\n <template #default>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n </template>\n</Empathize>\n```\n\nDefining custom values for the events to open and close the Empathize. For example opening it when\nthe search box loses the focus and closing it when the search box receives the focus:\n\n```vue\n<Empathize\n :eventsToOpenEmpathize=\"['UserBlurredSearchBox']\"\n :eventsToCloseEmpathize=\"['UserFocusedSearchBox']\"\n>\n <template #default>\n Please, type a query in the Search Box.\n </template>\n</Empathize>\n```\n\nAn animation can be used for the opening and closing using the `animation` prop. The animation, must\nbe a Component with a `Transition` with a slot inside:\n\n```vue\n<Empathize :animation=\"collapseFromTop\">\n <template #default>\n <PopularSearches/>\n </template>\n</Empathize>\n```\n\n### Advance examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation. It also configures `searchAndCloseOnNoContent` to trigger a search and close the empathize\nwhen has no-content as fallback behaviour. To do that, `hasContent` prop must be reactive to know\nif the empathize has content or not.\nIt also configures `searchAndCloseDebounceInMs` to 500ms as debounce time to search and close the\nempathize when has no-content.\n\n```vue\n<Empathize\n :animation=\"empathizeAnimation\"\n :events-to-close-empathize=\"empathizeCloseEvents\"\n :has-content=\"showEmpathize\"\n :search-and-close-debounce-in-ms=\"500\"\n search-and-close-on-no-content\n>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n</Empathize>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,gBAAgB,CAAC,IAAI;AAC9B,IAAA,KAAK,EAAE;;AAEL,QAAA,qBAAqB,EAAE;AACrB,YAAA,IAAI,EAAE,KAA2B;YACjC,OAAO,EAAE,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,CAAC;AACtF,SAAA;;AAED,QAAA,sBAAsB,EAAE;AACtB,YAAA,IAAI,EAAE,KAA2B;YACjC,OAAO,EAAE,MAAM;gBACb,qBAAqB;gBACrB,yBAAyB;gBACzB,qBAAqB;gBACrB,sBAAsB;AACvB,aAAA;AACF,SAAA;;AAED,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,MAAMA,WAAW;AAC3B,SAAA;;AAED,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;;AAED,QAAA,yBAAyB,EAAE;AACzB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;;AAED,QAAA,0BAA0B,EAAE;AAC1B,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC,CAAA;AAEjB,QAAA,MAAM,YAAW,GAAI,G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A,MAAM,uBAAsB,GAAI,WAAW,CAAC,YAAY;AACtD,YAAA,qBAAqB,EAAC,CAAA;AACtB,YAAA,MAAM,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAA,CAAA;AACzD,YAAA,KAAK,EAAC,CAAA;AACR,SAAC,EAAE,KAAK,CAAC,0BAA0B,CAAA,CAAA;AAEnC;;;;;;AAME;QACF,KAAK,CACH,MAAM,KAAK,CAAC,UAAU,EACtB,MAAM;AACJ,YAAA,IAAI,KAAK,CAAC,yBAAyB,EAAE;AACnC,gBAAA,IAAI,KAAK,CAAC,UAAU,EAAE;AACpB,oBAAA,qBAAqB,EAAC,CAAA;oBACtB,uBAAuB,CAAC,MAAM,EAAC,CAAA;iBAC/B;qBAAK;AACL,oBAAA,qBAAsB,GAAE,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,uBAAuB,EAAE;AAC/E,wBAAA,SAAS,EAAE,IAAI;AAChB,qBAAA,CAAA,CAAA;iBACH;aACF;AACF,SAAC,CACH,CAAA;QAEA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAM,EAAA,CAAA;KACzD;AACF,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search/wiring.ts"],"sourcesContent":["import type { WirePayload } from '../../wiring'\nimport type { InternalSearchRequest } from './types'\nimport { createRawFilters } from '../../utils'\nimport {\n createWiring,\n filterTruthyPayload,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring'\n\n/**\n * `search` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'search'\n\n/**\n * WireCommit for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName)\n\n/**\n * WireCommit without Payload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * WireDispatchWithoutPayload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * Cancels the {@link SearchActions.fetchAndSaveSearchResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSearchResponse',\n)\n\n/**\n * Sets the search state `origin`.\n *\n * @public\n */\nexport const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata)\n\n/**\n * Requests and stores the search response.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse')\n\n/**\n * Resets the search state `spellcheckedQuery` to its initial value, an empty string.\n *\n * @public\n */\nexport const resetSpellcheckQuery = wireCommit('setSpellcheck', '')\n\n/**\n * Sets the search state `relatedTags`.\n *\n * @public\n */\nexport const setRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setSearchQuery = wireCommit('setQuery')\n\n/**\n * Clears the search state `query`.\n *\n * @public\n */\nexport const clearSearchQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the search state `selectedFilters`.\n *\n * @public\n */\nexport const setSelectedFilters = wireCommit('setSelectedFilters')\n\n/**\n * Sets the search state `sort`.\n *\n * @public\n */\nexport const setSort = wireCommit('setSort')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the search state `page`.\n *\n * @public\n */\nexport const setSearchPage = wireCommit('setPage')\n\n/**\n * Sets the search state `params`.\n *\n * @public\n */\nexport const setSearchExtraParams = wireCommit('setParams')\n\n/**\n * Resets the search state to reload the current search.\n *\n * @public\n */\nexport const resetStateForReloadWire = wireCommitWithoutPayload('resetStateForReload')\n\n/**\n * Resets the search state `isNoResults`.\n *\n * @public\n */\nexport const resetIsNoResults = wireCommit('setIsNoResults', false)\n\n/**\n * Resets the search state `fromNoResultsWithFilters`.\n *\n * @public\n */\nexport const resetFromNoResultsWithFilters = wireCommit('setFromNoResultsWithFilters', false)\n\n/**\n * Increases the current search state `page` by one.\n *\n * @public\n */\nexport const increasePageAppendingResultsWire = wireDispatchWithoutPayload(\n 'increasePageAppendingResults',\n)\n\n/**\n * Resets the search state `isAppendingResults`.\n *\n * @public\n */\nexport const resetAppending = wireCommit('setIsAppendResults', false)\n\n/**\n * Resets the {@link SearchGetters.request} parameters when refining request and before the actual\n * request is launched.\n *\n * @public\n */\nexport const resetRequestOnRefinementWire = wireDispatch(\n 'resetRequestOnRefinement',\n ({ eventPayload: newRequest, metadata: { oldValue } }: WirePayload<InternalSearchRequest>) => ({\n newRequest,\n oldRequest: oldValue as InternalSearchRequest,\n }),\n)\n\n/**\n * Resets the search state when the request is changed to null. See the\n * {@link SearchXStoreModule} for details.\n *\n * @public\n */\nexport const resetStateIfNoRequestWire = filterTruthyPayload<InternalSearchRequest | null>(\n wireCommitWithoutPayload('resetState'),\n)\n\n/**\n * Sets the search state `query` with the selectedQueryPreview's query.\n *\n * @public\n */\nexport const setSearchQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the search state `params` with the selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setSearchExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the search state `selectedFilters` with the selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromPreview = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []),\n)\n\n/**\n * Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromHistoryQuery = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { selectedFilters } }) => selectedFilters ?? [],\n)\n\n/**\n * Search wiring.\n *\n * @internal\n */\nexport const searchWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n saveOriginWire,\n },\n UserAcceptedAQuery: {\n setSearchQuery,\n saveOriginWire,\n },\n UserAcceptedSpellcheckQuery: {\n resetSpellcheckQuery,\n },\n UserClearedQuery: {\n setSearchQuery,\n cancelFetchAndSaveSearchResponseWire,\n resetFromNoResultsWithFilters,\n resetIsNoResults,\n },\n UserClickedASort: {\n setSort,\n },\n UserPickedARelatedTag: {\n saveOriginWire,\n },\n UserReachedResultsListEnd: {\n increasePageAppendingResultsWire,\n },\n SearchRequestUpdated: {\n resetStateIfNoRequestWire,\n fetchAndSaveSearchResponseWire,\n },\n SearchRequestChanged: {\n resetRequestOnRefinementWire,\n },\n SelectedRelatedTagsChanged: {\n setRelatedTags,\n },\n SelectedFiltersForRequestChanged: {\n setSelectedFilters,\n },\n ResultsChanged: {\n resetAppending,\n },\n ReloadSearchRequested: {\n resetStateForReloadWire,\n },\n SelectedSortProvided: {\n setSort,\n },\n ExtraParamsChanged: {\n setSearchExtraParams,\n },\n UserClickedCloseX: {\n clearSearchQuery,\n },\n UserClickedOutOfMainModal: {\n clearSearchQuery,\n },\n UserAcceptedAQueryPreview: {\n setSearchQueryFromPreview,\n setSearchExtraParamsFromPreview,\n setSearchSelectedFiltersFromPreview,\n saveOriginWire,\n },\n QueryPreviewUnselected: {\n setSearchExtraParams,\n },\n UserSelectedAHistoryQuery: {\n setSearchSelectedFiltersFromHistoryQuery,\n },\n UserSelectedAPage: {\n setSearchPage,\n resetAppending,\n },\n})\n"],"names":[],"mappings":";;;;;;AAYA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAA;AAE3B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UA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,EAAE;QAC3B,oBAAoB;AACrB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,cAAc;QACd,oCAAoC;QACpC,6BAA6B;QAC7B,gBAAgB;AACjB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,OAAO;AACR,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,cAAc;AACf,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gCAAgC;AACjC,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,yBAAyB;QACzB,8BAA8B;AAC/B,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,4BAA4B;AAC7B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,cAAc;AACf,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,kBAAkB;AACnB,KAAA;AACD,IAAA,cAAc,EAAE;QACd,cAAc;AACf,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,uBAAuB;AACxB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,OAAO;AACR,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,oBAAoB;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,yBAAyB;QACzB,+BAA+B;QAC/B,mCAAmC;QACnC,cAAc;AACf,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,oBAAoB;AACrB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,wCAAwC;AACzC,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,aAAa;QACb,cAAc;AACf,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search/wiring.ts"],"sourcesContent":["import type { WirePayload } from '../../wiring'\nimport type { InternalSearchRequest } from './types'\nimport { createRawFilters } from '../../utils'\nimport {\n createWiring,\n filterTruthyPayload,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring'\n\n/**\n * `search` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'search'\n\n/**\n * WireCommit for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName)\n\n/**\n * WireCommit without Payload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * WireDispatchWithoutPayload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * Cancels the {@link SearchActions.fetchAndSaveSearchResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSearchResponse',\n)\n\n/**\n * Sets the search state `origin`.\n *\n * @public\n */\nexport const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata)\n\n/**\n * Requests and stores the search response.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse')\n\n/**\n * Resets the search state `spellcheckedQuery` to its initial value, an empty string.\n *\n * @public\n */\nexport const resetSpellcheckQuery = wireCommit('setSpellcheck', '')\n\n/**\n * Sets the search state `relatedTags`.\n *\n * @public\n */\nexport const setRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setSearchQuery = wireCommit('setQuery')\n\n/**\n * Clears the search state `query`.\n *\n * @public\n */\nexport const clearSearchQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the search state `selectedFilters`.\n *\n * @public\n */\nexport const setSelectedFilters = wireCommit('setSelectedFilters')\n\n/**\n * Sets the search state `sort`.\n *\n * @public\n */\nexport const setSort = wireCommit('setSort')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the search state `page`.\n *\n * @public\n */\nexport const setSearchPage = wireCommit('setPage')\n\n/**\n * Sets the search state `params`.\n *\n * @public\n */\nexport const setSearchExtraParams = wireCommit('setParams')\n\n/**\n * Resets the search state to reload the current search.\n *\n * @public\n */\nexport const resetStateForReloadWire = wireCommitWithoutPayload('resetStateForReload')\n\n/**\n * Resets the search state `isNoResults`.\n *\n * @public\n */\nexport const resetIsNoResults = wireCommit('setIsNoResults', false)\n\n/**\n * Resets the search state `fromNoResultsWithFilters`.\n *\n * @public\n */\nexport const resetFromNoResultsWithFilters = wireCommit('setFromNoResultsWithFilters', false)\n\n/**\n * Increases the current search state `page` by one.\n *\n * @public\n */\nexport const increasePageAppendingResultsWire = wireDispatchWithoutPayload(\n 'increasePageAppendingResults',\n)\n\n/**\n * Resets the search state `isAppendingResults`.\n *\n * @public\n */\nexport const resetAppending = wireCommit('setIsAppendResults', false)\n\n/**\n * Resets the {@link SearchGetters.request} parameters when refining request and before the actual\n * request is launched.\n *\n * @public\n */\nexport const resetRequestOnRefinementWire = wireDispatch(\n 'resetRequestOnRefinement',\n ({ eventPayload: newRequest, metadata: { oldValue } }: WirePayload<InternalSearchRequest>) => ({\n newRequest,\n oldRequest: oldValue as InternalSearchRequest,\n }),\n)\n\n/**\n * Resets the search state when the request is changed to null. See the\n * {@link SearchXStoreModule} for details.\n *\n * @public\n */\nexport const resetStateIfNoRequestWire = filterTruthyPayload<InternalSearchRequest | null>(\n wireCommitWithoutPayload('resetState'),\n)\n\n/**\n * Sets the search state `query` with the selectedQueryPreview's query.\n *\n * @public\n */\nexport const setSearchQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the search state `params` with the selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setSearchExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the search state `selectedFilters` with the selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromPreview = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []),\n)\n\n/**\n * Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromHistoryQuery = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { selectedFilters } }) => selectedFilters ?? [],\n)\n\n/**\n * Search wiring.\n *\n * @internal\n */\nexport const searchWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n saveOriginWire,\n },\n UserAcceptedAQuery: {\n setSearchQuery,\n saveOriginWire,\n },\n EmpathizeGotNoContent: {\n setSearchQuery,\n saveOriginWire,\n },\n UserAcceptedSpellcheckQuery: {\n resetSpellcheckQuery,\n },\n UserClearedQuery: {\n setSearchQuery,\n cancelFetchAndSaveSearchResponseWire,\n resetFromNoResultsWithFilters,\n resetIsNoResults,\n },\n UserClickedASort: {\n setSort,\n },\n UserPickedARelatedTag: {\n saveOriginWire,\n },\n UserReachedResultsListEnd: {\n increasePageAppendingResultsWire,\n },\n SearchRequestUpdated: {\n resetStateIfNoRequestWire,\n fetchAndSaveSearchResponseWire,\n },\n SearchRequestChanged: {\n resetRequestOnRefinementWire,\n },\n SelectedRelatedTagsChanged: {\n setRelatedTags,\n },\n SelectedFiltersForRequestChanged: {\n setSelectedFilters,\n },\n ResultsChanged: {\n resetAppending,\n },\n ReloadSearchRequested: {\n resetStateForReloadWire,\n },\n SelectedSortProvided: {\n setSort,\n },\n ExtraParamsChanged: {\n setSearchExtraParams,\n },\n UserClickedCloseX: {\n clearSearchQuery,\n },\n UserClickedOutOfMainModal: {\n clearSearchQuery,\n },\n UserAcceptedAQueryPreview: {\n setSearchQueryFromPreview,\n setSearchExtraParamsFromPreview,\n setSearchSelectedFiltersFromPreview,\n saveOriginWire,\n },\n QueryPreviewUnselected: {\n setSearchExtraParams,\n },\n UserSelectedAHistoryQuery: {\n setSearchSelectedFiltersFromHistoryQuery,\n },\n UserSelectedAPage: {\n setSearchPage,\n resetAppending,\n },\n})\n"],"names":[],"mappings":";;;;;;AAYA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAA;AAE3B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;AAEnD;;;;AAIG;AACH,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAA;AAE/E;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAA;AAEvD;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAA;AAEnF;;;;AAIG;MACU,oCAAoC,GAAG,0BAA0B,CAC5E,kCAAkC,EACnC;AAED;;;;AAIG;AACU,MAAA,cAAc,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAC;AAEpF;;;;AAIG;MACU,8BAA8B,GAAG,YAAY,CAAC,4BAA4B,EAAC;AAExF;;;;AAIG;AACU,MAAA,oBAAoB,GAAG,UAAU,CAAC,eAAe,EAAE,EAAE,EAAC;AAEnE;;;;AAIG;MACU,cAAc,GAAG,UAAU,CAAC,gBAAgB,EAAC;AAE1D;;;;AAIG;MACU,cAAc,GAAG,UAAU,CAAC,UAAU,EAAC;AAEpD;;;;AAIG;AACU,MAAA,gBAAgB,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,EAAC;AAE1D;;;;AAIG;MACU,kBAAkB,GAAG,UAAU,CAAC,oBAAoB,EAAC;AAElE;;;;AAIG;MACU,OAAO,GAAG,UAAU,CAAC,SAAS,EAAC;AAE5C;;;;AAIG;MACU,YAAY,GAAG,YAAY,CAAC,cAAc,EAAC;AAEx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QACnC,cAAc;AACf,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,oBAAoB;AACrB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,wCAAwC;AACzC,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,aAAa;QACb,cAAc;AACf,KAAA;AACF,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.158",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@babel/preset-env": "7.28.0",
|
|
98
|
-
"@badeball/cypress-cucumber-preprocessor": "
|
|
98
|
+
"@badeball/cypress-cucumber-preprocessor": "23.2.0",
|
|
99
99
|
"@bahmutov/cypress-esbuild-preprocessor": "2.2.5",
|
|
100
100
|
"@cucumber/messages": "28.0.0",
|
|
101
101
|
"@empathyco/x-tailwindcss": "^2.0.0-alpha.16",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"access": "public",
|
|
143
143
|
"directory": "dist"
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "14f470b5f13bfa43f1cb0bb4e3822e7304ed8e41"
|
|
146
146
|
}
|
|
@@ -10795,7 +10795,25 @@
|
|
|
10795
10795
|
},
|
|
10796
10796
|
{
|
|
10797
10797
|
"kind": "Content",
|
|
10798
|
-
"text": ";\n default: boolean;\n };\n
|
|
10798
|
+
"text": ";\n default: boolean;\n };\n hostStyle: "
|
|
10799
|
+
},
|
|
10800
|
+
{
|
|
10801
|
+
"kind": "Reference",
|
|
10802
|
+
"text": "PropType",
|
|
10803
|
+
"canonicalReference": "@vue/runtime-core!PropType:type"
|
|
10804
|
+
},
|
|
10805
|
+
{
|
|
10806
|
+
"kind": "Content",
|
|
10807
|
+
"text": "<string | "
|
|
10808
|
+
},
|
|
10809
|
+
{
|
|
10810
|
+
"kind": "Reference",
|
|
10811
|
+
"text": "CSSStyleDeclaration",
|
|
10812
|
+
"canonicalReference": "!CSSStyleDeclaration:interface"
|
|
10813
|
+
},
|
|
10814
|
+
{
|
|
10815
|
+
"kind": "Content",
|
|
10816
|
+
"text": ">;\n}, {\n teleportHost: import(\"vue\")."
|
|
10799
10817
|
},
|
|
10800
10818
|
{
|
|
10801
10819
|
"kind": "Reference",
|
|
@@ -10808,8 +10826,8 @@
|
|
|
10808
10826
|
},
|
|
10809
10827
|
{
|
|
10810
10828
|
"kind": "Reference",
|
|
10811
|
-
"text": "
|
|
10812
|
-
"canonicalReference": "!
|
|
10829
|
+
"text": "HTMLElement",
|
|
10830
|
+
"canonicalReference": "!HTMLElement:interface"
|
|
10813
10831
|
},
|
|
10814
10832
|
{
|
|
10815
10833
|
"kind": "Content",
|
|
@@ -10894,7 +10912,25 @@
|
|
|
10894
10912
|
},
|
|
10895
10913
|
{
|
|
10896
10914
|
"kind": "Content",
|
|
10897
|
-
"text": ";\n default: boolean;\n };\n
|
|
10915
|
+
"text": ";\n default: boolean;\n };\n hostStyle: "
|
|
10916
|
+
},
|
|
10917
|
+
{
|
|
10918
|
+
"kind": "Reference",
|
|
10919
|
+
"text": "PropType",
|
|
10920
|
+
"canonicalReference": "@vue/runtime-core!PropType:type"
|
|
10921
|
+
},
|
|
10922
|
+
{
|
|
10923
|
+
"kind": "Content",
|
|
10924
|
+
"text": "<string | "
|
|
10925
|
+
},
|
|
10926
|
+
{
|
|
10927
|
+
"kind": "Reference",
|
|
10928
|
+
"text": "CSSStyleDeclaration",
|
|
10929
|
+
"canonicalReference": "!CSSStyleDeclaration:interface"
|
|
10930
|
+
},
|
|
10931
|
+
{
|
|
10932
|
+
"kind": "Content",
|
|
10933
|
+
"text": ">;\n}>>, {\n position: \"beforebegin\" | \"afterbegin\" | \"beforeend\" | \"afterend\" | \"onlychild\";\n disabled: boolean;\n}, {}>"
|
|
10898
10934
|
}
|
|
10899
10935
|
],
|
|
10900
10936
|
"fileUrlPath": "dist/types/components/base-teleport.vue.d.ts",
|
|
@@ -10903,7 +10939,7 @@
|
|
|
10903
10939
|
"name": "BaseTeleport",
|
|
10904
10940
|
"variableTypeTokenRange": {
|
|
10905
10941
|
"startIndex": 1,
|
|
10906
|
-
"endIndex":
|
|
10942
|
+
"endIndex": 42
|
|
10907
10943
|
}
|
|
10908
10944
|
},
|
|
10909
10945
|
{
|
|
@@ -19643,6 +19679,33 @@
|
|
|
19643
19679
|
"endIndex": 2
|
|
19644
19680
|
}
|
|
19645
19681
|
},
|
|
19682
|
+
{
|
|
19683
|
+
"kind": "PropertySignature",
|
|
19684
|
+
"canonicalReference": "@empathyco/x-components!EmpathizeXEvents#EmpathizeGotNoContent:member",
|
|
19685
|
+
"docComment": "/**\n * The empathize reached a state with no content (empty). Payload: The search box query at the time of the event.\n */\n",
|
|
19686
|
+
"excerptTokens": [
|
|
19687
|
+
{
|
|
19688
|
+
"kind": "Content",
|
|
19689
|
+
"text": "EmpathizeGotNoContent: "
|
|
19690
|
+
},
|
|
19691
|
+
{
|
|
19692
|
+
"kind": "Content",
|
|
19693
|
+
"text": "string"
|
|
19694
|
+
},
|
|
19695
|
+
{
|
|
19696
|
+
"kind": "Content",
|
|
19697
|
+
"text": ";"
|
|
19698
|
+
}
|
|
19699
|
+
],
|
|
19700
|
+
"isReadonly": false,
|
|
19701
|
+
"isOptional": false,
|
|
19702
|
+
"releaseTag": "Public",
|
|
19703
|
+
"name": "EmpathizeGotNoContent",
|
|
19704
|
+
"propertyTypeTokenRange": {
|
|
19705
|
+
"startIndex": 1,
|
|
19706
|
+
"endIndex": 2
|
|
19707
|
+
}
|
|
19708
|
+
},
|
|
19646
19709
|
{
|
|
19647
19710
|
"kind": "PropertySignature",
|
|
19648
19711
|
"canonicalReference": "@empathyco/x-components!EmpathizeXEvents#EmpathizeOpened:member",
|
|
@@ -29408,7 +29471,7 @@
|
|
|
29408
29471
|
},
|
|
29409
29472
|
{
|
|
29410
29473
|
"kind": "Content",
|
|
29411
|
-
"text": " | undefined;\n DeviceProvided?: string | null | undefined;\n EmpathizeClosed?: void | undefined;\n EmpathizeOpened?: void | undefined;\n UserClosedEmpathize?: void | undefined;\n UserChangedExtraParams?: "
|
|
29474
|
+
"text": " | undefined;\n DeviceProvided?: string | null | undefined;\n EmpathizeClosed?: void | undefined;\n EmpathizeOpened?: void | undefined;\n UserClosedEmpathize?: void | undefined;\n EmpathizeGotNoContent?: string | undefined;\n UserChangedExtraParams?: "
|
|
29412
29475
|
},
|
|
29413
29476
|
{
|
|
29414
29477
|
"kind": "Reference",
|
|
@@ -65082,7 +65145,7 @@
|
|
|
65082
65145
|
},
|
|
65083
65146
|
{
|
|
65084
65147
|
"kind": "Content",
|
|
65085
|
-
"text": " | undefined;\n DeviceProvided?: string | null | undefined;\n EmpathizeClosed?: void | undefined;\n EmpathizeOpened?: void | undefined;\n UserClosedEmpathize?: void | undefined;\n UserChangedExtraParams?: "
|
|
65148
|
+
"text": " | undefined;\n DeviceProvided?: string | null | undefined;\n EmpathizeClosed?: void | undefined;\n EmpathizeOpened?: void | undefined;\n UserClosedEmpathize?: void | undefined;\n EmpathizeGotNoContent?: string | undefined;\n UserChangedExtraParams?: "
|
|
65086
65149
|
},
|
|
65087
65150
|
{
|
|
65088
65151
|
"kind": "Reference",
|
|
@@ -67186,6 +67249,15 @@
|
|
|
67186
67249
|
"text": "WireMetadata",
|
|
67187
67250
|
"canonicalReference": "@empathyco/x-components!WireMetadata:interface"
|
|
67188
67251
|
},
|
|
67252
|
+
{
|
|
67253
|
+
"kind": "Content",
|
|
67254
|
+
"text": ") => unknown;\n EmpathizeGotNoContent: (payload: string, metadata: "
|
|
67255
|
+
},
|
|
67256
|
+
{
|
|
67257
|
+
"kind": "Reference",
|
|
67258
|
+
"text": "WireMetadata",
|
|
67259
|
+
"canonicalReference": "@empathyco/x-components!WireMetadata:interface"
|
|
67260
|
+
},
|
|
67189
67261
|
{
|
|
67190
67262
|
"kind": "Content",
|
|
67191
67263
|
"text": ") => unknown;\n UserChangedExtraParams: (payload: import(\"@empathyco/x-utils\")."
|
|
@@ -69069,7 +69141,7 @@
|
|
|
69069
69141
|
"name": "SnippetCallbacks",
|
|
69070
69142
|
"variableTypeTokenRange": {
|
|
69071
69143
|
"startIndex": 1,
|
|
69072
|
-
"endIndex":
|
|
69144
|
+
"endIndex": 522
|
|
69073
69145
|
}
|
|
69074
69146
|
},
|
|
69075
69147
|
{
|
|
@@ -1579,8 +1579,9 @@ disabled: {
|
|
|
1579
1579
|
type: BooleanConstructor;
|
|
1580
1580
|
default: boolean;
|
|
1581
1581
|
};
|
|
1582
|
+
hostStyle: PropType<string | CSSStyleDeclaration>;
|
|
1582
1583
|
}, {
|
|
1583
|
-
teleportHost: Ref<
|
|
1584
|
+
teleportHost: Ref<HTMLElement | undefined>;
|
|
1584
1585
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
1585
1586
|
target: {
|
|
1586
1587
|
type: PropType<string | Element>;
|
|
@@ -1594,6 +1595,7 @@ disabled: {
|
|
|
1594
1595
|
type: BooleanConstructor;
|
|
1595
1596
|
default: boolean;
|
|
1596
1597
|
};
|
|
1598
|
+
hostStyle: PropType<string | CSSStyleDeclaration>;
|
|
1597
1599
|
}>>, {
|
|
1598
1600
|
position: "beforebegin" | "afterbegin" | "beforeend" | "afterend" | "onlychild";
|
|
1599
1601
|
disabled: boolean;
|
|
@@ -2501,6 +2503,7 @@ export const empathizeWiring: {
|
|
|
2501
2503
|
// @public
|
|
2502
2504
|
export interface EmpathizeXEvents {
|
|
2503
2505
|
EmpathizeClosed: void;
|
|
2506
|
+
EmpathizeGotNoContent: string;
|
|
2504
2507
|
EmpathizeOpened: void;
|
|
2505
2508
|
UserClosedEmpathize: void;
|
|
2506
2509
|
}
|
|
@@ -3415,6 +3418,7 @@ DeviceProvided?: string | null | undefined;
|
|
|
3415
3418
|
EmpathizeClosed?: void | undefined;
|
|
3416
3419
|
EmpathizeOpened?: void | undefined;
|
|
3417
3420
|
UserClosedEmpathize?: void | undefined;
|
|
3421
|
+
EmpathizeGotNoContent?: string | undefined;
|
|
3418
3422
|
UserChangedExtraParams?: Dictionary<unknown> | undefined;
|
|
3419
3423
|
ExtraParamsChanged?: Dictionary<unknown> | undefined;
|
|
3420
3424
|
ExtraParamsProvided?: Dictionary<unknown> | undefined;
|
|
@@ -6821,6 +6825,10 @@ export const searchWiring: {
|
|
|
6821
6825
|
setSearchQuery: Wire<string>;
|
|
6822
6826
|
saveOriginWire: AnyWire;
|
|
6823
6827
|
};
|
|
6828
|
+
EmpathizeGotNoContent: {
|
|
6829
|
+
setSearchQuery: Wire<string>;
|
|
6830
|
+
saveOriginWire: AnyWire;
|
|
6831
|
+
};
|
|
6824
6832
|
UserAcceptedSpellcheckQuery: {
|
|
6825
6833
|
resetSpellcheckQuery: AnyWire;
|
|
6826
6834
|
};
|
|
@@ -7391,6 +7399,7 @@ DeviceProvided?: string | null | undefined;
|
|
|
7391
7399
|
EmpathizeClosed?: void | undefined;
|
|
7392
7400
|
EmpathizeOpened?: void | undefined;
|
|
7393
7401
|
UserClosedEmpathize?: void | undefined;
|
|
7402
|
+
EmpathizeGotNoContent?: string | undefined;
|
|
7394
7403
|
UserChangedExtraParams?: Dictionary<unknown> | undefined;
|
|
7395
7404
|
ExtraParamsChanged?: Dictionary<unknown> | undefined;
|
|
7396
7405
|
ExtraParamsProvided?: Dictionary<unknown> | undefined;
|
|
@@ -7724,6 +7733,7 @@ DeviceProvided: (payload: string | null, metadata: WireMetadata) => unknown;
|
|
|
7724
7733
|
EmpathizeClosed: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
7725
7734
|
EmpathizeOpened: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
7726
7735
|
UserClosedEmpathize: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
7736
|
+
EmpathizeGotNoContent: (payload: string, metadata: WireMetadata) => unknown;
|
|
7727
7737
|
UserChangedExtraParams: (payload: Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
7728
7738
|
ExtraParamsChanged: (payload: Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
7729
7739
|
ExtraParamsProvided: (payload: Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
@@ -9256,11 +9266,11 @@ export type XStoreModuleOptions<StoreModule extends AnyXStoreModule> = StoreModu
|
|
|
9256
9266
|
// dist/types/x-modules/facets/components/filters/all-filter.vue.d.ts:16:9 - (ae-forgotten-export) The symbol "Facet" needs to be exported by the entry point index.d.ts
|
|
9257
9267
|
// dist/types/x-modules/facets/components/filters/editable-number-range-filter.vue.d.ts:25:9 - (ae-forgotten-export) The symbol "EditableNumberRangeFilter_2" needs to be exported by the entry point index.d.ts
|
|
9258
9268
|
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:62:13 - (ae-forgotten-export) The symbol "ResultVariant" needs to be exported by the entry point index.d.ts
|
|
9259
|
-
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:
|
|
9260
|
-
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:
|
|
9261
|
-
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:
|
|
9262
|
-
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:
|
|
9263
|
-
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:
|
|
9269
|
+
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:111:9 - (ae-forgotten-export) The symbol "NextQuery_2" needs to be exported by the entry point index.d.ts
|
|
9270
|
+
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:174:9 - (ae-forgotten-export) The symbol "Redirection_2" needs to be exported by the entry point index.d.ts
|
|
9271
|
+
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:175:9 - (ae-forgotten-export) The symbol "Promoted_2" needs to be exported by the entry point index.d.ts
|
|
9272
|
+
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:180:9 - (ae-forgotten-export) The symbol "SemanticQuery_2" needs to be exported by the entry point index.d.ts
|
|
9273
|
+
// dist/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts:202:9 - (ae-forgotten-export) The symbol "RelatedPrompt_2" needs to be exported by the entry point index.d.ts
|
|
9264
9274
|
// dist/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts:35:5 - (ae-forgotten-export) The symbol "RenderFilter" needs to be exported by the entry point index.d.ts
|
|
9265
9275
|
// dist/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts:62:9 - (ae-forgotten-export) The symbol "RelatedPromptNextQuery" needs to be exported by the entry point index.d.ts
|
|
9266
9276
|
// dist/types/x-modules/search/components/banner.vue.d.ts:23:9 - (ae-forgotten-export) The symbol "Banner_2" needs to be exported by the entry point index.d.ts
|
|
@@ -22,8 +22,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
type: BooleanConstructor;
|
|
23
23
|
default: boolean;
|
|
24
24
|
};
|
|
25
|
+
/** Styles for the teleport (content container) */
|
|
26
|
+
hostStyle: PropType<string | CSSStyleDeclaration>;
|
|
25
27
|
}, {
|
|
26
|
-
teleportHost: import("vue").Ref<
|
|
28
|
+
teleportHost: import("vue").Ref<HTMLElement | undefined>;
|
|
27
29
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
30
|
/** The element or css selector to which the component will be teleported. */
|
|
29
31
|
target: {
|
|
@@ -47,6 +49,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
49
|
type: BooleanConstructor;
|
|
48
50
|
default: boolean;
|
|
49
51
|
};
|
|
52
|
+
/** Styles for the teleport (content container) */
|
|
53
|
+
hostStyle: PropType<string | CSSStyleDeclaration>;
|
|
50
54
|
}>>, {
|
|
51
55
|
position: "beforebegin" | "afterbegin" | "beforeend" | "afterend" | "onlychild";
|
|
52
56
|
disabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-teleport.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../src/components/base-teleport.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;;IAe/B,6EAA6E;;cAEjD,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC;;;IAGtD;;;;;;;OAOG;;cAEe,QAAQ,CACtB,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CACtE;;;IAGH,2DAA2D
|
|
1
|
+
{"version":3,"file":"base-teleport.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../src/components/base-teleport.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;;IAe/B,6EAA6E;;cAEjD,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC;;;IAGtD;;;;;;;OAOG;;cAEe,QAAQ,CACtB,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CACtE;;;IAGH,2DAA2D;;;;;IAK3D,kDAAkD;eAC7B,QAAQ,CAAC,MAAM,GAAG,mBAAmB,CAAC;;;;IAzB3D,6EAA6E;;cAEjD,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC;;;IAGtD;;;;;;;OAOG;;cAEe,QAAQ,CACtB,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CACtE;;;IAGH,2DAA2D;;;;;IAK3D,kDAAkD;eAC7B,QAAQ,CAAC,MAAM,GAAG,mBAAmB,CAAC;;;;;AA5B/D,wBAuJE"}
|
|
@@ -50,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
50
50
|
EmpathizeClosed: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
51
51
|
EmpathizeOpened: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
52
52
|
UserClosedEmpathize: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
53
|
+
EmpathizeGotNoContent: (payload: string, metadata: WireMetadata) => unknown;
|
|
53
54
|
UserChangedExtraParams: (payload: import("@empathyco/x-utils").Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
54
55
|
ExtraParamsChanged: (payload: import("@empathyco/x-utils").Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
55
56
|
ExtraParamsProvided: (payload: import("@empathyco/x-utils").Dictionary<unknown>, metadata: WireMetadata) => unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-callbacks.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../src/components/snippet-callbacks.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAO7C;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"snippet-callbacks.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../src/components/snippet-callbacks.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAO7C;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBA0CE"}
|
|
@@ -20,5 +20,10 @@ export interface EmpathizeXEvents {
|
|
|
20
20
|
* Payload: none.
|
|
21
21
|
*/
|
|
22
22
|
UserClosedEmpathize: void;
|
|
23
|
+
/**
|
|
24
|
+
* The empathize reached a state with no content (empty).
|
|
25
|
+
* Payload: The search box query at the time of the event.
|
|
26
|
+
*/
|
|
27
|
+
EmpathizeGotNoContent: string;
|
|
23
28
|
}
|
|
24
29
|
//# sourceMappingURL=events.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.types.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/empathize/events.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,eAAe,EAAE,IAAI,CAAA;IACrB;;;OAGG;IACH,eAAe,EAAE,IAAI,CAAA;IACrB;;;OAGG;IACH,mBAAmB,EAAE,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"events.types.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/empathize/events.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,eAAe,EAAE,IAAI,CAAA;IACrB;;;OAGG;IACH,eAAe,EAAE,IAAI,CAAA;IACrB;;;OAGG;IACH,mBAAmB,EAAE,IAAI,CAAA;IACzB;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAA;CAC9B"}
|
|
@@ -75,6 +75,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
75
75
|
EmpathizeClosed?: void | undefined;
|
|
76
76
|
EmpathizeOpened?: void | undefined;
|
|
77
77
|
UserClosedEmpathize?: void | undefined;
|
|
78
|
+
EmpathizeGotNoContent?: string | undefined;
|
|
78
79
|
UserChangedExtraParams?: Dictionary<unknown> | undefined;
|
|
79
80
|
ExtraParamsChanged?: Dictionary<unknown> | undefined;
|
|
80
81
|
ExtraParamsProvided?: Dictionary<unknown> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hierarchical-filter.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/facets/components/filters/hierarchical-filter.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AASnE;;;;GAIG;;IAMC,iCAAiC;;cAEf,QAAQ,CAAC,uBAAuB,CAAC;;;IAGnD,+DAA+D;;IAE/D;;;;OAIG;iBACoB,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,+BAA+B;;cAEd,QAAQ,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;;;IAG3D,0CAA0C;;IAE1C,0CAA0C
|
|
1
|
+
{"version":3,"file":"hierarchical-filter.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/facets/components/filters/hierarchical-filter.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AASnE;;;;GAIG;;IAMC,iCAAiC;;cAEf,QAAQ,CAAC,uBAAuB,CAAC;;;IAGnD,+DAA+D;;IAE/D;;;;OAIG;iBACoB,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,+BAA+B;;cAEd,QAAQ,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;;;IAG3D,0CAA0C;;IAE1C,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAwDM,uBAAuB;;IA5EvE,iCAAiC;;cAEf,QAAQ,CAAC,uBAAuB,CAAC;;;IAGnD,+DAA+D;;IAE/D;;;;OAIG;iBACoB,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,+BAA+B;;cAEd,QAAQ,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;;;IAG3D,0CAA0C;;IAE1C,0CAA0C;;;;;AAzB9C,wBA+GE"}
|
|
@@ -65,6 +65,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
65
|
EmpathizeClosed?: void | undefined;
|
|
66
66
|
EmpathizeOpened?: void | undefined;
|
|
67
67
|
UserClosedEmpathize?: void | undefined;
|
|
68
|
+
EmpathizeGotNoContent?: string | undefined;
|
|
68
69
|
UserChangedExtraParams?: Dictionary<unknown> | undefined;
|
|
69
70
|
ExtraParamsChanged?: Dictionary<unknown> | undefined;
|
|
70
71
|
ExtraParamsProvided?: Dictionary<unknown> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-filter.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/facets/components/filters/simple-filter.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAKnE;;;;GAIG;;IAOC,iCAAiC;;cAEf,QAAQ,CAAC,iBAAiB,CAAC;;;IAG7C,iFAAiF;iBAC1D,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,+BAA+B;;cAEd,QAAQ,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"simple-filter.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/facets/components/filters/simple-filter.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAKnE;;;;GAIG;;IAOC,iCAAiC;;cAEf,QAAQ,CAAC,iBAAiB,CAAC;;;IAG7C,iFAAiF;iBAC1D,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,+BAA+B;;cAEd,QAAQ,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAT3D,iCAAiC;;cAEf,QAAQ,CAAC,iBAAiB,CAAC;;;IAG7C,iFAAiF;iBAC1D,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,+BAA+B;;cAEd,QAAQ,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;AAf/D,wBAsCE"}
|
|
@@ -153,6 +153,10 @@ export declare const searchWiring: {
|
|
|
153
153
|
setSearchQuery: import("../../wiring").Wire<string>;
|
|
154
154
|
saveOriginWire: import("../../wiring").AnyWire;
|
|
155
155
|
};
|
|
156
|
+
EmpathizeGotNoContent: {
|
|
157
|
+
setSearchQuery: import("../../wiring").Wire<string>;
|
|
158
|
+
saveOriginWire: import("../../wiring").AnyWire;
|
|
159
|
+
};
|
|
156
160
|
UserAcceptedSpellcheckQuery: {
|
|
157
161
|
resetSpellcheckQuery: import("../../wiring").AnyWire;
|
|
158
162
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/search/wiring.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AA8CpD;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,gCAEhD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,gCAAyD,CAAA;AAEpF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,2DAA6C,CAAA;AAExF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gCAAkC,CAAA;AAEnE;;;;GAIG;AACH,eAAO,MAAM,cAAc,wEAA+B,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,cAAc,qCAAyB,CAAA;AAEpD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,gCAA6B,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,oEAAmC,CAAA;AAElE;;;;GAIG;AACH,eAAO,MAAM,OAAO,qCAAwB,CAAA;AAE5C;;;;GAIG;AACH,eAAO,MAA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