@empathyco/x-components 3.0.0-alpha.63 → 3.0.0-alpha.64
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 +13 -0
- package/design-system/default-theme.css +23 -23
- package/design-system/full-theme.css +15 -15
- package/docs/API-reference/api/x-components.basexapi.init.md +1 -1
- package/docs/API-reference/api/x-components.basexapi.md +1 -0
- package/docs/API-reference/api/x-components.basexapi.setsnippetconfig.md +24 -0
- package/docs/API-reference/api/x-components.xapi.md +1 -0
- package/docs/API-reference/api/x-components.xapi.setsnippetconfig.md +24 -0
- package/js/x-installer/api/base-api.js +21 -1
- package/js/x-installer/api/base-api.js.map +1 -1
- package/js/x-installer/x-installer/x-installer.js +15 -2
- package/js/x-installer/x-installer/x-installer.js.map +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue.js.map +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js +1 -1
- package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue.js.map +1 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue_script.vue.js +1 -1
- package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue_script.vue.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +118 -1
- package/report/x-components.api.md +12 -0
- package/types/x-installer/api/api.types.d.ts +16 -0
- package/types/x-installer/api/api.types.d.ts.map +1 -1
- package/types/x-installer/api/base-api.d.ts +24 -1
- package/types/x-installer/api/base-api.d.ts.map +1 -1
- package/types/x-installer/x-installer/x-installer.d.ts +14 -0
- package/types/x-installer/x-installer/x-installer.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.0-alpha.64](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.63...@empathyco/x-components@3.0.0-alpha.64) (2022-03-03)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- Add `setSnippetConfig` function to the `X` API
|
|
11
|
+
([8c53cc7](https://github.com/empathyco/x/commit/8c53cc74cdd95e1a8ef3aa8167206cd81685d1e7)),
|
|
12
|
+
closes [EX-5384](https://searchbroker.atlassian.net/browse/EX-5384)
|
|
13
|
+
|
|
14
|
+
# Change Log
|
|
15
|
+
|
|
16
|
+
All notable changes to this project will be documented in this file. See
|
|
17
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
18
|
+
|
|
6
19
|
## [3.0.0-alpha.63](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.62...@empathyco/x-components@3.0.0-alpha.63) (2022-03-01)
|
|
7
20
|
|
|
8
21
|
### Build System
|
|
@@ -47,16 +47,6 @@
|
|
|
47
47
|
.x-badge-container {
|
|
48
48
|
position: relative;
|
|
49
49
|
}
|
|
50
|
-
:root {
|
|
51
|
-
--x-color-background-badge-default: var(--x-color-base-neutral-10);
|
|
52
|
-
--x-color-text-badge-default: var(--x-color-base-neutral-100);
|
|
53
|
-
--x-color-border-badge-default: var(--x-color-base-neutral-10);
|
|
54
|
-
--x-size-border-radius-badge-default: var(--x-size-border-radius-base-pill);
|
|
55
|
-
--x-size-border-width-badge-default: 0;
|
|
56
|
-
--x-size-width-badge-default: 1.5em;
|
|
57
|
-
--x-number-font-weight-badge-default: var(--x-number-font-weight-base-regular);
|
|
58
|
-
--x-size-font-badge-default: var(--x-size-font-base-xs);
|
|
59
|
-
}
|
|
60
50
|
:root {
|
|
61
51
|
--x-color-background-button-default: var(--x-color-base-lead);
|
|
62
52
|
--x-color-border-button-default: var(--x-color-background-button-default);
|
|
@@ -2227,6 +2217,16 @@
|
|
|
2227
2217
|
--x-size-line-height-suggestion-group-default: var(--x-size-line-height-suggestion-default);
|
|
2228
2218
|
--x-number-font-weight-suggestion-group-default: var(--x-number-font-weight-suggestion-default);
|
|
2229
2219
|
}
|
|
2220
|
+
:root {
|
|
2221
|
+
--x-color-background-badge-default: var(--x-color-base-neutral-10);
|
|
2222
|
+
--x-color-text-badge-default: var(--x-color-base-neutral-100);
|
|
2223
|
+
--x-color-border-badge-default: var(--x-color-base-neutral-10);
|
|
2224
|
+
--x-size-border-radius-badge-default: var(--x-size-border-radius-base-pill);
|
|
2225
|
+
--x-size-border-width-badge-default: 0;
|
|
2226
|
+
--x-size-width-badge-default: 1.5em;
|
|
2227
|
+
--x-number-font-weight-badge-default: var(--x-number-font-weight-base-regular);
|
|
2228
|
+
--x-size-font-badge-default: var(--x-size-font-base-xs);
|
|
2229
|
+
}
|
|
2230
2230
|
:root {
|
|
2231
2231
|
--x-string-align-items-suggestion-default: center;
|
|
2232
2232
|
--x-color-text-suggestion-default: var(--x-color-text-default);
|
|
@@ -2854,19 +2854,6 @@
|
|
|
2854
2854
|
--x-size-border-radius-base-pill: 99999px;
|
|
2855
2855
|
--x-size-border-width-base: 1px;
|
|
2856
2856
|
}
|
|
2857
|
-
:root {
|
|
2858
|
-
--x-color-base-lead: #36515b;
|
|
2859
|
-
--x-color-base-auxiliary: #667981;
|
|
2860
|
-
--x-color-base-neutral-10: #1a1a1a;
|
|
2861
|
-
--x-color-base-neutral-35: #595959;
|
|
2862
|
-
--x-color-base-neutral-70: #b3b3b3;
|
|
2863
|
-
--x-color-base-neutral-95: #f2f2f2;
|
|
2864
|
-
--x-color-base-neutral-100: #ffffff;
|
|
2865
|
-
--x-color-base-accent: #b90276;
|
|
2866
|
-
--x-color-base-enable: #00705c;
|
|
2867
|
-
--x-color-base-disable: #e11f26;
|
|
2868
|
-
--x-color-base-transparent: transparent;
|
|
2869
|
-
}
|
|
2870
2857
|
:root {
|
|
2871
2858
|
--x-size-base-01: 2px;
|
|
2872
2859
|
--x-size-base-02: 4px;
|
|
@@ -2902,4 +2889,17 @@
|
|
|
2902
2889
|
--x-size-line-height-base-s: 16px;
|
|
2903
2890
|
--x-size-line-height-base-m: 24px;
|
|
2904
2891
|
--x-size-line-height-base-l: 32px;
|
|
2892
|
+
}
|
|
2893
|
+
:root {
|
|
2894
|
+
--x-color-base-lead: #36515b;
|
|
2895
|
+
--x-color-base-auxiliary: #667981;
|
|
2896
|
+
--x-color-base-neutral-10: #1a1a1a;
|
|
2897
|
+
--x-color-base-neutral-35: #595959;
|
|
2898
|
+
--x-color-base-neutral-70: #b3b3b3;
|
|
2899
|
+
--x-color-base-neutral-95: #f2f2f2;
|
|
2900
|
+
--x-color-base-neutral-100: #ffffff;
|
|
2901
|
+
--x-color-base-accent: #b90276;
|
|
2902
|
+
--x-color-base-enable: #00705c;
|
|
2903
|
+
--x-color-base-disable: #e11f26;
|
|
2904
|
+
--x-color-base-transparent: transparent;
|
|
2905
2905
|
}
|
|
@@ -714,9 +714,6 @@
|
|
|
714
714
|
--x-size-border-width-left-dropdown-list-pill
|
|
715
715
|
);
|
|
716
716
|
}
|
|
717
|
-
.x-dropdown.x-dropdown--s {
|
|
718
|
-
--x-size-width-dropdown-toggle-default: var(--x-size-width-dropdown-s);
|
|
719
|
-
}
|
|
720
717
|
:root {
|
|
721
718
|
--x-size-gap-dropdown-pill: var(--x-size-base-03);
|
|
722
719
|
--x-size-border-width-dropdown-list-pill: var(--x-size-border-width-base);
|
|
@@ -725,6 +722,9 @@
|
|
|
725
722
|
--x-size-border-width-bottom-dropdown-list-pill: var(--x-size-border-width-dropdown-list-pill);
|
|
726
723
|
--x-size-border-width-left-dropdown-list-pill: var(--x-size-border-width-dropdown-list-pill);
|
|
727
724
|
}
|
|
725
|
+
.x-dropdown.x-dropdown--s {
|
|
726
|
+
--x-size-width-dropdown-toggle-default: var(--x-size-width-dropdown-s);
|
|
727
|
+
}
|
|
728
728
|
:root {
|
|
729
729
|
--x-size-width-dropdown-s: 74px;
|
|
730
730
|
}
|
|
@@ -747,18 +747,6 @@
|
|
|
747
747
|
--x-size-padding-bottom-facet-header-default: var(--x-size-padding-bottom-facet-header-card);
|
|
748
748
|
--x-size-padding-left-facet-header-default: var(--x-size-padding-left-facet-header-card);
|
|
749
749
|
}
|
|
750
|
-
:root {
|
|
751
|
-
--x-size-border-radius-facet-card: var(--x-size-border-radius-base-s);
|
|
752
|
-
--x-size-border-radius-top-left-facet-card: var(--x-size-border-radius-facet-card);
|
|
753
|
-
--x-size-border-radius-top-right-facet-card: var(--x-size-border-radius-facet-card);
|
|
754
|
-
--x-size-border-radius-bottom-right-facet-card: var(--x-size-border-radius-facet-card);
|
|
755
|
-
--x-size-border-radius-bottom-left-facet-card: var(--x-size-border-radius-facet-card);
|
|
756
|
-
--x-size-padding-facet-header-card: var(--x-size-base-03);
|
|
757
|
-
--x-size-padding-top-facet-header-card: var(--x-size-padding-facet-header-card);
|
|
758
|
-
--x-size-padding-right-facet-header-card: var(--x-size-padding-facet-header-card);
|
|
759
|
-
--x-size-padding-bottom-facet-header-card: var(--x-size-padding-facet-header-card);
|
|
760
|
-
--x-size-padding-left-facet-header-card: var(--x-size-padding-facet-header-card);
|
|
761
|
-
}
|
|
762
750
|
[dir="ltr"] .x-facet {
|
|
763
751
|
border-right-width: var(--x-size-border-width-right-facet-default);
|
|
764
752
|
}
|
|
@@ -848,6 +836,18 @@
|
|
|
848
836
|
.x-facet > *:first-child .x-icon:last-child:not(:first-child), .x-facet__header .x-icon:last-child:not(:first-child) {
|
|
849
837
|
margin-left: auto;
|
|
850
838
|
}
|
|
839
|
+
:root {
|
|
840
|
+
--x-size-border-radius-facet-card: var(--x-size-border-radius-base-s);
|
|
841
|
+
--x-size-border-radius-top-left-facet-card: var(--x-size-border-radius-facet-card);
|
|
842
|
+
--x-size-border-radius-top-right-facet-card: var(--x-size-border-radius-facet-card);
|
|
843
|
+
--x-size-border-radius-bottom-right-facet-card: var(--x-size-border-radius-facet-card);
|
|
844
|
+
--x-size-border-radius-bottom-left-facet-card: var(--x-size-border-radius-facet-card);
|
|
845
|
+
--x-size-padding-facet-header-card: var(--x-size-base-03);
|
|
846
|
+
--x-size-padding-top-facet-header-card: var(--x-size-padding-facet-header-card);
|
|
847
|
+
--x-size-padding-right-facet-header-card: var(--x-size-padding-facet-header-card);
|
|
848
|
+
--x-size-padding-bottom-facet-header-card: var(--x-size-padding-facet-header-card);
|
|
849
|
+
--x-size-padding-left-facet-header-card: var(--x-size-padding-facet-header-card);
|
|
850
|
+
}
|
|
851
851
|
:root {
|
|
852
852
|
--x-color-background-facet-default: transparent;
|
|
853
853
|
--x-color-border-facet-default: var(--x-color-background-facet-default);
|
|
@@ -16,7 +16,7 @@ init(config: SnippetConfig): void;
|
|
|
16
16
|
|
|
17
17
|
| Parameter | Type | Description |
|
|
18
18
|
| --- | --- | --- |
|
|
19
|
-
| config | [SnippetConfig](./x-components.snippetconfig.md) | The config
|
|
19
|
+
| config | [SnippetConfig](./x-components.snippetconfig.md) | The config coming from the customer snippet. |
|
|
20
20
|
|
|
21
21
|
<b>Returns:</b>
|
|
22
22
|
|
|
@@ -21,4 +21,5 @@ export declare class BaseXAPI implements XAPI
|
|
|
21
21
|
| [init(config)](./x-components.basexapi.init.md) | | Initializes the Application passing the [SnippetConfig](./x-components.snippetconfig.md)<!-- -->. |
|
|
22
22
|
| [search(query)](./x-components.basexapi.search.md) | | Searches the query parameter as user query. |
|
|
23
23
|
| [setInitCallback(initCallback)](./x-components.basexapi.setinitcallback.md) | | Setter for the callback to call in the init method. |
|
|
24
|
+
| [setSnippetConfig(config)](./x-components.basexapi.setsnippetconfig.md) | | Sets or updates the snippet config. |
|
|
24
25
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [BaseXAPI](./x-components.basexapi.md) > [setSnippetConfig](./x-components.basexapi.setsnippetconfig.md)
|
|
4
|
+
|
|
5
|
+
## BaseXAPI.setSnippetConfig() method
|
|
6
|
+
|
|
7
|
+
Sets or updates the snippet config.
|
|
8
|
+
|
|
9
|
+
<b>Signature:</b>
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setSnippetConfig(config: Partial<SnippetConfig>): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| config | Partial<[SnippetConfig](./x-components.snippetconfig.md)<!-- -->> | A part or all the snippet config. |
|
|
20
|
+
|
|
21
|
+
<b>Returns:</b>
|
|
22
|
+
|
|
23
|
+
void
|
|
24
|
+
|
|
@@ -19,4 +19,5 @@ export interface XAPI
|
|
|
19
19
|
| [addProductToCart(productId)](./x-components.xapi.addproducttocart.md) | To track that a product was added to the cart from PDP. |
|
|
20
20
|
| [init(config)](./x-components.xapi.init.md) | Method to initialize the XComponents app. |
|
|
21
21
|
| [search(query)](./x-components.xapi.search.md) | Dispatch a search with the query parameter. |
|
|
22
|
+
| [setSnippetConfig(config)](./x-components.xapi.setsnippetconfig.md) | To set or update any property of the [SnippetConfig](./x-components.snippetconfig.md)<!-- -->. |
|
|
22
23
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [XAPI](./x-components.xapi.md) > [setSnippetConfig](./x-components.xapi.setsnippetconfig.md)
|
|
4
|
+
|
|
5
|
+
## XAPI.setSnippetConfig() method
|
|
6
|
+
|
|
7
|
+
To set or update any property of the [SnippetConfig](./x-components.snippetconfig.md)<!-- -->.
|
|
8
|
+
|
|
9
|
+
<b>Signature:</b>
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setSnippetConfig(config: Partial<SnippetConfig>): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| config | Partial<[SnippetConfig](./x-components.snippetconfig.md)<!-- -->> | The properties to be changed. |
|
|
20
|
+
|
|
21
|
+
<b>Returns:</b>
|
|
22
|
+
|
|
23
|
+
void
|
|
24
|
+
|
|
@@ -38,6 +38,26 @@ class BaseXAPI {
|
|
|
38
38
|
setInitCallback(initCallback) {
|
|
39
39
|
this.initCallback = initCallback;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Setter for the callback to modify the snippet config.
|
|
43
|
+
*
|
|
44
|
+
* @param snippetCallback - The callback to call.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
setSnippetConfigCallback(snippetCallback) {
|
|
49
|
+
this.snippetCallback = snippetCallback;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Sets or updates the snippet config.
|
|
53
|
+
*
|
|
54
|
+
* @param config - A part or all the snippet config.
|
|
55
|
+
*
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
setSnippetConfig(config) {
|
|
59
|
+
this?.snippetCallback(config);
|
|
60
|
+
}
|
|
41
61
|
/**
|
|
42
62
|
* Searches the query parameter as user query.
|
|
43
63
|
*
|
|
@@ -54,7 +74,7 @@ class BaseXAPI {
|
|
|
54
74
|
/**
|
|
55
75
|
* Initializes the Application passing the {@link SnippetConfig}.
|
|
56
76
|
*
|
|
57
|
-
* @param config - The config
|
|
77
|
+
* @param config - The config coming from the customer snippet.
|
|
58
78
|
*
|
|
59
79
|
* @public
|
|
60
80
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-api.js","sources":["../../../../src/x-installer/api/base-api.ts"],"sourcesContent":["import { XBus } from '../../plugins/x-bus.types';\nimport { SnippetConfig, XAPI } from './api.types';\n\n/**\n * Default implementation for {@link XAPI}.\n *\n * @public\n */\nexport class BaseXAPI implements XAPI {\n /**\n * Flag to check if the initialization was already done.\n *\n * @internal\n */\n protected isXInitialized = false;\n\n /**\n * Bus for emitting and listening events.\n *\n * @internal\n */\n protected bus!: XBus;\n\n /**\n * The callback to call from the init method. The logic of initialization is out of this API\n * since this API is just a facade.\n *\n * @internal\n */\n protected initCallback!: (config: SnippetConfig) => any;\n\n /**\n * Tracks that a product was added to cart from PDP.\n *\n * @param productId - The product id that was added to cart.\n */\n addProductToCart(productId?: string): void {\n this.bus?.emit('UserClickedPDPAddToCart', productId);\n }\n\n /**\n * Setter for the {@link XBus}.\n *\n * @param bus - The {@link XBus} received to emit events.\n *\n * @internal\n */\n setBus(bus: XBus): void {\n this.bus = bus;\n }\n\n /**\n * Setter for the callback to call in the init method.\n *\n * @param initCallback - The callback to call.\n */\n setInitCallback(initCallback: (config: SnippetConfig) => any): void {\n this.initCallback = initCallback;\n }\n\n /**\n * Searches the query parameter as user query.\n *\n * @param query - Query to be searched.\n *\n * @public\n */\n search(query?: string): void {\n if (query) {\n this.bus?.emit('UserAcceptedAQuery', query);\n }\n this.bus?.emit('UserOpenXProgrammatically');\n }\n\n /**\n * Initializes the Application passing the {@link SnippetConfig}.\n *\n * @param config - The config
|
|
1
|
+
{"version":3,"file":"base-api.js","sources":["../../../../src/x-installer/api/base-api.ts"],"sourcesContent":["import { XBus } from '../../plugins/x-bus.types';\nimport { SnippetConfig, XAPI } from './api.types';\n\n/**\n * Default implementation for {@link XAPI}.\n *\n * @public\n */\nexport class BaseXAPI implements XAPI {\n /**\n * Flag to check if the initialization was already done.\n *\n * @internal\n */\n protected isXInitialized = false;\n\n /**\n * Bus for emitting and listening events.\n *\n * @internal\n */\n protected bus!: XBus;\n\n /**\n * The callback to call from the init method. The logic of initialization is out of this API\n * since this API is just a facade.\n *\n * @internal\n */\n protected initCallback!: (config: SnippetConfig) => any;\n\n /**\n * Callback that allows to update the snippet config. The logic of initialization is out of this\n * API since this API is just a facade.\n *\n * @internal\n */\n protected snippetCallback!: (config: Partial<SnippetConfig>) => void;\n\n /**\n * Tracks that a product was added to cart from PDP.\n *\n * @param productId - The product id that was added to cart.\n */\n addProductToCart(productId?: string): void {\n this.bus?.emit('UserClickedPDPAddToCart', productId);\n }\n\n /**\n * Setter for the {@link XBus}.\n *\n * @param bus - The {@link XBus} received to emit events.\n *\n * @internal\n */\n setBus(bus: XBus): void {\n this.bus = bus;\n }\n\n /**\n * Setter for the callback to call in the init method.\n *\n * @param initCallback - The callback to call.\n */\n setInitCallback(initCallback: (config: SnippetConfig) => any): void {\n this.initCallback = initCallback;\n }\n\n /**\n * Setter for the callback to modify the snippet config.\n *\n * @param snippetCallback - The callback to call.\n *\n * @internal\n */\n setSnippetConfigCallback(snippetCallback: (config: Partial<SnippetConfig>) => void): void {\n this.snippetCallback = snippetCallback;\n }\n\n /**\n * Sets or updates the snippet config.\n *\n * @param config - A part or all the snippet config.\n *\n * @public\n */\n setSnippetConfig(config: Partial<SnippetConfig>): void {\n this?.snippetCallback(config);\n }\n\n /**\n * Searches the query parameter as user query.\n *\n * @param query - Query to be searched.\n *\n * @public\n */\n search(query?: string): void {\n if (query) {\n this.bus?.emit('UserAcceptedAQuery', query);\n }\n this.bus?.emit('UserOpenXProgrammatically');\n }\n\n /**\n * Initializes the Application passing the {@link SnippetConfig}.\n *\n * @param config - The config coming from the customer snippet.\n *\n * @public\n */\n init(config: SnippetConfig): void {\n if (!this.isXInitialized) {\n this.isXInitialized = true;\n this?.initCallback(config);\n } else {\n //eslint-disable-next-line no-console\n console.warn('We know X is awesome, but you only need to initialize it once.');\n }\n }\n}\n"],"names":[],"mappings":"AAGA;;;;;MAKa,QAAQ;IAArB;;;;;;QAMY,mBAAc,GAAG,KAAK,CAAC;KA0GlC;;;;;;IA5EC,gBAAgB,CAAC,SAAkB;QACjC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;KACtD;;;;;;;;IASD,MAAM,CAAC,GAAS;QACd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;KAChB;;;;;;IAOD,eAAe,CAAC,YAA4C;QAC1D,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;KAClC;;;;;;;;IASD,wBAAwB,CAAC,eAAyD;QAChF,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;KACxC;;;;;;;;IASD,gBAAgB,CAAC,MAA8B;QAC7C,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;KAC/B;;;;;;;;IASD,MAAM,CAAC,KAAc;QACnB,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;SAC7C;QACD,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,2BAA2B,CAAC,CAAC;KAC7C;;;;;;;;IASD,IAAI,CAAC,MAAqB;QACxB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACxB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;SAC5B;aAAM;;YAEL,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;SAChF;KACF;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { deepMerge } from '@empathyco/x-deep-merge';
|
|
|
2
2
|
import Vue from 'vue';
|
|
3
3
|
import { BaseXBus } from '../../plugins/x-bus.js';
|
|
4
4
|
import { XPlugin } from '../../plugins/x-plugin.js';
|
|
5
|
-
import { cleanUndefined } from '../../utils/object.js';
|
|
5
|
+
import { cleanUndefined, forEach } from '../../utils/object.js';
|
|
6
6
|
import { BaseXAPI } from '../api/base-api.js';
|
|
7
7
|
|
|
8
8
|
const defaultAdapterConfig = {
|
|
@@ -112,6 +112,7 @@ class XInstaller {
|
|
|
112
112
|
if (api !== false) {
|
|
113
113
|
this.api = api ?? new BaseXAPI();
|
|
114
114
|
this.api.setInitCallback(this.init.bind(this));
|
|
115
|
+
this.api.setSnippetConfigCallback(this.updateSnippetConfig.bind(this));
|
|
115
116
|
window.X = this.api;
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -267,7 +268,7 @@ class XInstaller {
|
|
|
267
268
|
createApp(extraPlugins, snippetConfig) {
|
|
268
269
|
if (this.options.app !== undefined) {
|
|
269
270
|
const vue = this.getVue();
|
|
270
|
-
snippetConfig = vue.observable(snippetConfig);
|
|
271
|
+
this.snippetConfig = vue.observable(snippetConfig);
|
|
271
272
|
return new vue({
|
|
272
273
|
...extraPlugins,
|
|
273
274
|
...this.options.vueOptions,
|
|
@@ -307,6 +308,18 @@ class XInstaller {
|
|
|
307
308
|
return document.body.appendChild(document.createElement('div'));
|
|
308
309
|
}
|
|
309
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* It updates all the provided properties from the current snippet config.
|
|
313
|
+
*
|
|
314
|
+
* @param snippetConfig - All the properties to be updated in the {@link SnippetConfig}.
|
|
315
|
+
*
|
|
316
|
+
* @internal
|
|
317
|
+
*/
|
|
318
|
+
updateSnippetConfig(snippetConfig) {
|
|
319
|
+
forEach(snippetConfig, (name, value) => {
|
|
320
|
+
this.getVue().set(this.snippetConfig, name, value);
|
|
321
|
+
});
|
|
322
|
+
}
|
|
310
323
|
}
|
|
311
324
|
|
|
312
325
|
export { XInstaller };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-installer.js","sources":["../../../../src/x-installer/x-installer/x-installer.ts"],"sourcesContent":["import { EmpathyAdapterConfig } from '@empathyco/x-adapter';\nimport { deepMerge } from '@empathyco/x-deep-merge';\nimport Vue, { PluginObject, VueConstructor } from 'vue';\nimport { BaseXBus } from '../../plugins/x-bus';\nimport { XBus } from '../../plugins/x-bus.types';\nimport { XPlugin } from '../../plugins/x-plugin';\nimport { XPluginOptions } from '../../plugins/x-plugin.types';\nimport { cleanUndefined } from '../../utils/object';\nimport { DeepPartial } from '../../utils/types';\nimport { SnippetConfig, XAPI } from '../api/api.types';\nimport { BaseXAPI } from '../api/base-api';\nimport { InitWrapper, InstallXOptions, VueConstructorPartialArgument } from './types';\n\ndeclare global {\n interface Window {\n X?: XAPI;\n initX?: (() => SnippetConfig) | SnippetConfig;\n }\n}\n\nconst defaultAdapterConfig: DeepPartial<EmpathyAdapterConfig> = {\n env: 'live',\n requestParams: {\n lang: 'es',\n scope: 'default'\n }\n};\n\n/**\n * The purpose of this class is to offer a quick way to initialize the XComponents in a setup\n * project. It allows to receive all the options in {@link InstallXOptions} which is an extension\n * of {@link XPluginOptions} with all the options for the plugin and some options more.\n *\n * This class does multiple things:\n * 1. Install the {@link XPlugin} with the {@link XPluginOptions}.\n * 2. Creates the public {@link XAPI} and add it to global window.\n * 3. Creates the Vue Application for the customer project.\n *\n * The steps 2 & 3 are optional and depends on the options passed in {@link InstallXOptions}.\n *\n * @example The way to use this class is the next:\n * 1. Create the installer passing in the {@link InstallXOptions}. This only save the options:\n *\n * ```\n * const installer = new XInstaller(installXOptions)\n * ```\n *\n * 2. Initialize passing the {@link SnippetConfig}. This installs the plugin and creates the App.\n * There are 3 different ways to do this:\n *\n * 2.1 Using the created installer:\n *\n * ```\n * installer.init(snippetConfig)\n * ```\n *\n * 2.2 If the API option is enabled (`createAPI` is `true` in {@link InstallXOptions}, or\n * is not present as the default value is `true`) then this init step can be done with\n * the Public API:\n *\n * ```\n * window.X.init(snippetConfig)\n * ```\n *\n * 2.3 When the script of the project build is loaded it searches for a global `initX`\n * variable that the customer must have in their web site. This variable can be a\n * function that returns the {@link SnippetConfig} or an object that contains the\n * {@link SnippetConfig} itself:\n *\n * ```\n * window.initX = function() {\n * return {\n * instance,\n * env,\n * scope,\n * lang,\n * searchLang,\n * currency,\n * consent,\n * documentDirection\n * };\n * };\n * ```\n *\n * ```\n * window.initX = {\n * instance,\n * env,\n * scope,\n * lang,\n * searchLang,\n * currency,\n * consent,\n * documentDirection\n * };\n * ```\n *\n * @public\n */\nexport class XInstaller {\n private api?: XAPI;\n\n /**\n * Receives the {@link InstallXOptions} and merges it with the default fallback options. Also\n * creates the public {@link XAPI}.\n *\n * @remarks Auto initializes the Vue application if window.initX is defined as a function or\n * object specifying the {@link SnippetConfig | snippet config}.\n *\n *\n * @param options - The {@link InstallXOptions}.\n *\n * @public\n */\n public constructor(protected readonly options: InstallXOptions) {\n this.createAPI();\n }\n\n /**\n * Creates the public {@link XAPI} using the `api` option from {@link InstallXOptions}. If this\n * `api` option is not passed, then a default {@link BaseXAPI} is created. To disable the API\n * creation the value `false` must be passed in the `api` option.\n *\n * @internal\n */\n protected createAPI(): void {\n const { api } = this.options;\n if (api !== false) {\n this.api = api ?? new BaseXAPI();\n this.api.setInitCallback(this.init.bind(this));\n window.X = this.api;\n }\n }\n\n /**\n * Retrieves the {@link SnippetConfig | snippet config} it is defined in the window.initX.\n *\n * @returns The snippet config if it is defined or undefined otherwise.\n *\n * @internal\n */\n private retrieveSnippetConfig(): SnippetConfig | undefined {\n if (typeof window.initX === 'function') {\n return window.initX();\n } else if (typeof window.initX === 'object') {\n return window.initX;\n }\n }\n\n /**\n * Receives the {@link SnippetConfig | snippet config} or retrieves it from window.initX and\n * installs the plugin and initializes the Vue application.\n *\n * @param snippetConfig - The {@link SnippetConfig} that receives from snippet integration.\n *\n * @returns If {@link SnippetConfig | snippet config} is passed or configured in window.initX,\n * returns an object with the {@link XAPI}, the {@link XBus}, the {@link XPlugin} and the Vue App\n * used in the application. Else, a rejected promise is returned.\n *\n * @public\n */\n init(snippetConfig: SnippetConfig): Promise<InitWrapper>;\n init(): Promise<InitWrapper | void>;\n async init(snippetConfig = this.retrieveSnippetConfig()): Promise<InitWrapper | void> {\n if (snippetConfig) {\n const adapterConfig = this.getAdapterConfig(snippetConfig);\n this.applyConfigToAdapter(adapterConfig);\n const bus = this.createBus();\n const pluginOptions = this.getPluginOptions();\n const plugin = this.installPlugin(pluginOptions, bus);\n const extraPlugins = await this.installExtraPlugins(snippetConfig, bus);\n const app = this.createApp(extraPlugins, snippetConfig);\n this.api?.setBus(bus);\n\n return {\n api: this.api,\n app,\n bus,\n plugin\n };\n }\n\n return Promise.resolve();\n }\n\n /**\n * Creates the Adapter Config object using the {@link SnippetConfig} to do it. It also\n * merges the default configuration.\n *\n * @param options - The {@link SnippetConfig}.\n *\n * @returns The Adapter Config object.\n *\n * @internal\n */\n protected getAdapterConfig({ instance, env, lang, searchLang, scope }: SnippetConfig): unknown {\n return deepMerge(\n defaultAdapterConfig,\n cleanUndefined<DeepPartial<EmpathyAdapterConfig>>({\n instance,\n env,\n requestParams: {\n lang: searchLang ?? lang,\n scope\n }\n })\n );\n }\n\n /**\n * Creates the {@link XPluginOptions} object.\n *\n * @returns The {@link XPluginOptions} object.\n *\n * @internal\n */\n protected getPluginOptions(): XPluginOptions {\n const { adapter, store, initialXModules, xModules, __PRIVATE__xModules } = this.options;\n return {\n adapter,\n store,\n xModules,\n initialXModules,\n __PRIVATE__xModules\n };\n }\n\n /**\n * It applies the snippet configuration to the Adapter. Not all the parameters are for the Adapter\n * but they appear destructured to not include them in the `extraParams` parameter.\n *\n * @param adapterConfig - The Adapter config object.\n *\n * @internal\n */\n protected applyConfigToAdapter(adapterConfig: any): void {\n this.options.adapter.setConfig?.(adapterConfig);\n }\n\n /**\n * This method returns the bus instance to be used in the {@link XPlugin} and in the {@link XAPI}.\n * It returns the `bus` parameter in the {@link InstallXOptions} or if not provided, then\n * creates a new instance of {@link BaseXBus}.\n *\n * @returns XBus - The bus instance.\n *\n * @internal\n */\n protected createBus(): XBus {\n return this.options.bus ?? new BaseXBus();\n }\n\n /**\n * This method returns the VueConstructor to use to create the App instance.\n * It returns the `vue` parameter in the {@link InstallXOptions} or if not provided, then\n * returns the default Vue.\n *\n * @remarks The purpose of this option is mainly the testing. In a test we can use this option\n * to pass the local vue instance created by `createLocalVue` method.\n *\n * @returns VueConstructor - The vue constructor to create the App instance.\n *\n * @internal\n */\n protected getVue(): VueConstructor {\n return this.options.vue ?? Vue;\n }\n\n /**\n * Creates and install the Vue Plugin. If `plugin` parameter is passed in the\n * {@link InstallXOptions}, then it is used. If not, then a new instance of {@link XPlugin} is\n * created and installed.\n *\n * @param pluginOptions - The {@link XPluginOptions} to passed as parameter to the install method\n * of the plugin.\n * @param bus - The {@link XBus} to be used to create the XPlugin.\n *\n * @returns PluginObject<XPluginOption> - The plugin instance.\n * @internal\n */\n protected installPlugin(pluginOptions: XPluginOptions, bus: XBus): PluginObject<XPluginOptions> {\n const plugin = this.options.plugin ?? new XPlugin(bus);\n const vue = this.getVue();\n vue.use(plugin, pluginOptions);\n return plugin;\n }\n\n /**\n * Install more plugins to Vue defined by the user.\n *\n * @param snippet - The snippet configuration.\n * @param bus - The events bus used in the application.\n * @returns The arguments from the plugins installation to be used in Vue's constructor.\n * @internal\n */\n protected installExtraPlugins(\n snippet: SnippetConfig,\n bus: XBus\n ): Promise<VueConstructorPartialArgument> {\n const vue = this.getVue();\n return Promise.resolve(this.options.installExtraPlugins?.({ vue, snippet, bus }));\n }\n\n /**\n * In the case that the `app` parameter is present in the {@link InstallXOptions}, then a new Vue\n * application is created using that app.\n *\n * @param extraPlugins - Vue plugins initialisation data.\n * @param snippetConfig - Configuration from the client snippet.\n * @returns The Created Vue application or undefined if not created.\n *\n * @internal\n */\n protected createApp(\n extraPlugins: VueConstructorPartialArgument,\n snippetConfig: SnippetConfig\n ): Vue | undefined {\n if (this.options.app !== undefined) {\n const vue = this.getVue();\n snippetConfig = vue.observable(snippetConfig);\n return new vue({\n ...extraPlugins,\n ...this.options.vueOptions,\n provide() {\n return {\n snippetConfig\n };\n },\n store: this.options.store,\n el: this.getMountingTarget(this.options.domElement),\n render: h => h(this.options.app)\n });\n }\n }\n\n /**\n * It returns the HTML element to mount the Vue Application. If the `domElement` parameter in the\n * {@link InstallXOptions} is an Element or a string, then it is used. If it is\n * not present then a new <div> Element is created and append to the body to be used.\n *\n * @param elementOrSelector - String or Element used to mount the Vue App.\n *\n * @returns The Element to use as mounting point for the Vue App.\n * @internal\n */\n protected getMountingTarget(elementOrSelector?: string | Element): Element {\n if (typeof elementOrSelector === 'string') {\n const target = document.querySelector(elementOrSelector);\n if (!target) {\n throw Error(\n `XComponents app couldn't be mounted: Element \"${elementOrSelector}\" couldn't be found`\n );\n }\n return target;\n } else if (elementOrSelector !== undefined) {\n return elementOrSelector;\n } else {\n return document.body.appendChild(document.createElement('div'));\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;AAoBA,MAAM,oBAAoB,GAAsC;IAC9D,GAAG,EAAE,MAAM;IACX,aAAa,EAAE;QACb,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,SAAS;KACjB;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuEa,UAAU;;;;;;;;;;;;;IAerB,YAAsC,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;QAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;;;;;;;;IASS,SAAS;QACjB,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,GAAG,KAAK,KAAK,EAAE;YACjB,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/C,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;SACrB;KACF;;;;;;;;IASO,qBAAqB;QAC3B,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU,EAAE;YACtC,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;SACvB;aAAM,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC3C,OAAO,MAAM,CAAC,KAAK,CAAC;SACrB;KACF;IAgBD,MAAM,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,qBAAqB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AAC,OAAO,CAAC,KAAK;gBACzB,EAAE,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;gBACnD,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;aACjC,CAAC,CAAC;SACJ;KACF;;;;;;;;;;;IAYS,iBAAiB,CAAC,iBAAoC;QAC9D,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;YACzC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,KAAK,CACT,iDAAiD,iBAAiB,qBAAqB,CACxF,CAAC;aACH;YACD,OAAO,MAAM,CAAC;SACf;aAAM,IAAI,iBAAiB,KAAK,SAAS,EAAE;YAC1C,OAAO,iBAAiB,CAAC;SAC1B;aAAM;YACL,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;SACjE;KACF;;;;;"}
|
|
1
|
+
{"version":3,"file":"x-installer.js","sources":["../../../../src/x-installer/x-installer/x-installer.ts"],"sourcesContent":["import { EmpathyAdapterConfig } from '@empathyco/x-adapter';\nimport { deepMerge } from '@empathyco/x-deep-merge';\nimport Vue, { PluginObject, VueConstructor } from 'vue';\nimport { BaseXBus } from '../../plugins/x-bus';\nimport { XBus } from '../../plugins/x-bus.types';\nimport { XPlugin } from '../../plugins/x-plugin';\nimport { XPluginOptions } from '../../plugins/x-plugin.types';\nimport { cleanUndefined, forEach } from '../../utils/object';\nimport { DeepPartial } from '../../utils/types';\nimport { SnippetConfig, XAPI } from '../api/api.types';\nimport { BaseXAPI } from '../api/base-api';\nimport { InitWrapper, InstallXOptions, VueConstructorPartialArgument } from './types';\n\ndeclare global {\n interface Window {\n X?: XAPI;\n initX?: (() => SnippetConfig) | SnippetConfig;\n }\n}\n\nconst defaultAdapterConfig: DeepPartial<EmpathyAdapterConfig> = {\n env: 'live',\n requestParams: {\n lang: 'es',\n scope: 'default'\n }\n};\n\n/**\n * The purpose of this class is to offer a quick way to initialize the XComponents in a setup\n * project. It allows to receive all the options in {@link InstallXOptions} which is an extension\n * of {@link XPluginOptions} with all the options for the plugin and some options more.\n *\n * This class does multiple things:\n * 1. Install the {@link XPlugin} with the {@link XPluginOptions}.\n * 2. Creates the public {@link XAPI} and add it to global window.\n * 3. Creates the Vue Application for the customer project.\n *\n * The steps 2 & 3 are optional and depends on the options passed in {@link InstallXOptions}.\n *\n * @example The way to use this class is the next:\n * 1. Create the installer passing in the {@link InstallXOptions}. This only save the options:\n *\n * ```\n * const installer = new XInstaller(installXOptions)\n * ```\n *\n * 2. Initialize passing the {@link SnippetConfig}. This installs the plugin and creates the App.\n * There are 3 different ways to do this:\n *\n * 2.1 Using the created installer:\n *\n * ```\n * installer.init(snippetConfig)\n * ```\n *\n * 2.2 If the API option is enabled (`createAPI` is `true` in {@link InstallXOptions}, or\n * is not present as the default value is `true`) then this init step can be done with\n * the Public API:\n *\n * ```\n * window.X.init(snippetConfig)\n * ```\n *\n * 2.3 When the script of the project build is loaded it searches for a global `initX`\n * variable that the customer must have in their web site. This variable can be a\n * function that returns the {@link SnippetConfig} or an object that contains the\n * {@link SnippetConfig} itself:\n *\n * ```\n * window.initX = function() {\n * return {\n * instance,\n * env,\n * scope,\n * lang,\n * searchLang,\n * currency,\n * consent,\n * documentDirection\n * };\n * };\n * ```\n *\n * ```\n * window.initX = {\n * instance,\n * env,\n * scope,\n * lang,\n * searchLang,\n * currency,\n * consent,\n * documentDirection\n * };\n * ```\n *\n * @public\n */\nexport class XInstaller {\n private api?: XAPI;\n\n /**\n * The configuration coming from the snippet {@link SnippetConfig}.\n *\n * @internal\n */\n protected snippetConfig!: SnippetConfig;\n\n /**\n * Receives the {@link InstallXOptions} and merges it with the default fallback options. Also\n * creates the public {@link XAPI}.\n *\n * @remarks Auto initializes the Vue application if window.initX is defined as a function or\n * object specifying the {@link SnippetConfig | snippet config}.\n *\n *\n * @param options - The {@link InstallXOptions}.\n *\n * @public\n */\n public constructor(protected readonly options: InstallXOptions) {\n this.createAPI();\n }\n\n /**\n * Creates the public {@link XAPI} using the `api` option from {@link InstallXOptions}. If this\n * `api` option is not passed, then a default {@link BaseXAPI} is created. To disable the API\n * creation the value `false` must be passed in the `api` option.\n *\n * @internal\n */\n protected createAPI(): void {\n const { api } = this.options;\n if (api !== false) {\n this.api = api ?? new BaseXAPI();\n this.api.setInitCallback(this.init.bind(this));\n this.api.setSnippetConfigCallback(this.updateSnippetConfig.bind(this));\n window.X = this.api;\n }\n }\n\n /**\n * Retrieves the {@link SnippetConfig | snippet config} it is defined in the window.initX.\n *\n * @returns The snippet config if it is defined or undefined otherwise.\n *\n * @internal\n */\n private retrieveSnippetConfig(): SnippetConfig | undefined {\n if (typeof window.initX === 'function') {\n return window.initX();\n } else if (typeof window.initX === 'object') {\n return window.initX;\n }\n }\n\n /**\n * Receives the {@link SnippetConfig | snippet config} or retrieves it from window.initX and\n * installs the plugin and initializes the Vue application.\n *\n * @param snippetConfig - The {@link SnippetConfig} that receives from snippet integration.\n *\n * @returns If {@link SnippetConfig | snippet config} is passed or configured in window.initX,\n * returns an object with the {@link XAPI}, the {@link XBus}, the {@link XPlugin} and the Vue App\n * used in the application. Else, a rejected promise is returned.\n *\n * @public\n */\n init(snippetConfig: SnippetConfig): Promise<InitWrapper>;\n init(): Promise<InitWrapper | void>;\n async init(snippetConfig = this.retrieveSnippetConfig()): Promise<InitWrapper | void> {\n if (snippetConfig) {\n const adapterConfig = this.getAdapterConfig(snippetConfig);\n this.applyConfigToAdapter(adapterConfig);\n const bus = this.createBus();\n const pluginOptions = this.getPluginOptions();\n const plugin = this.installPlugin(pluginOptions, bus);\n const extraPlugins = await this.installExtraPlugins(snippetConfig, bus);\n const app = this.createApp(extraPlugins, snippetConfig);\n this.api?.setBus(bus);\n\n return {\n api: this.api,\n app,\n bus,\n plugin\n };\n }\n\n return Promise.resolve();\n }\n\n /**\n * Creates the Adapter Config object using the {@link SnippetConfig} to do it. It also\n * merges the default configuration.\n *\n * @param options - The {@link SnippetConfig}.\n *\n * @returns The Adapter Config object.\n *\n * @internal\n */\n protected getAdapterConfig({ instance, env, lang, searchLang, scope }: SnippetConfig): unknown {\n return deepMerge(\n defaultAdapterConfig,\n cleanUndefined<DeepPartial<EmpathyAdapterConfig>>({\n instance,\n env,\n requestParams: {\n lang: searchLang ?? lang,\n scope\n }\n })\n );\n }\n\n /**\n * Creates the {@link XPluginOptions} object.\n *\n * @returns The {@link XPluginOptions} object.\n *\n * @internal\n */\n protected getPluginOptions(): XPluginOptions {\n const { adapter, store, initialXModules, xModules, __PRIVATE__xModules } = this.options;\n return {\n adapter,\n store,\n xModules,\n initialXModules,\n __PRIVATE__xModules\n };\n }\n\n /**\n * It applies the snippet configuration to the Adapter. Not all the parameters are for the Adapter\n * but they appear destructured to not include them in the `extraParams` parameter.\n *\n * @param adapterConfig - The Adapter config object.\n *\n * @internal\n */\n protected applyConfigToAdapter(adapterConfig: any): void {\n this.options.adapter.setConfig?.(adapterConfig);\n }\n\n /**\n * This method returns the bus instance to be used in the {@link XPlugin} and in the {@link XAPI}.\n * It returns the `bus` parameter in the {@link InstallXOptions} or if not provided, then\n * creates a new instance of {@link BaseXBus}.\n *\n * @returns XBus - The bus instance.\n *\n * @internal\n */\n protected createBus(): XBus {\n return this.options.bus ?? new BaseXBus();\n }\n\n /**\n * This method returns the VueConstructor to use to create the App instance.\n * It returns the `vue` parameter in the {@link InstallXOptions} or if not provided, then\n * returns the default Vue.\n *\n * @remarks The purpose of this option is mainly the testing. In a test we can use this option\n * to pass the local vue instance created by `createLocalVue` method.\n *\n * @returns VueConstructor - The vue constructor to create the App instance.\n *\n * @internal\n */\n protected getVue(): VueConstructor {\n return this.options.vue ?? Vue;\n }\n\n /**\n * Creates and install the Vue Plugin. If `plugin` parameter is passed in the\n * {@link InstallXOptions}, then it is used. If not, then a new instance of {@link XPlugin} is\n * created and installed.\n *\n * @param pluginOptions - The {@link XPluginOptions} to passed as parameter to the install method\n * of the plugin.\n * @param bus - The {@link XBus} to be used to create the XPlugin.\n *\n * @returns PluginObject<XPluginOption> - The plugin instance.\n * @internal\n */\n protected installPlugin(pluginOptions: XPluginOptions, bus: XBus): PluginObject<XPluginOptions> {\n const plugin = this.options.plugin ?? new XPlugin(bus);\n const vue = this.getVue();\n vue.use(plugin, pluginOptions);\n return plugin;\n }\n\n /**\n * Install more plugins to Vue defined by the user.\n *\n * @param snippet - The snippet configuration.\n * @param bus - The events bus used in the application.\n * @returns The arguments from the plugins installation to be used in Vue's constructor.\n * @internal\n */\n protected installExtraPlugins(\n snippet: SnippetConfig,\n bus: XBus\n ): Promise<VueConstructorPartialArgument> {\n const vue = this.getVue();\n return Promise.resolve(this.options.installExtraPlugins?.({ vue, snippet, bus }));\n }\n\n /**\n * In the case that the `app` parameter is present in the {@link InstallXOptions}, then a new Vue\n * application is created using that app.\n *\n * @param extraPlugins - Vue plugins initialisation data.\n * @param snippetConfig - Configuration from the client snippet.\n * @returns The Created Vue application or undefined if not created.\n *\n * @internal\n */\n protected createApp(\n extraPlugins: VueConstructorPartialArgument,\n snippetConfig: SnippetConfig\n ): Vue | undefined {\n if (this.options.app !== undefined) {\n const vue = this.getVue();\n this.snippetConfig = vue.observable(snippetConfig);\n return new vue({\n ...extraPlugins,\n ...this.options.vueOptions,\n provide() {\n return {\n snippetConfig\n };\n },\n store: this.options.store,\n el: this.getMountingTarget(this.options.domElement),\n render: h => h(this.options.app)\n });\n }\n }\n\n /**\n * It returns the HTML element to mount the Vue Application. If the `domElement` parameter in the\n * {@link InstallXOptions} is an Element or a string, then it is used. If it is\n * not present then a new <div> Element is created and append to the body to be used.\n *\n * @param elementOrSelector - String or Element used to mount the Vue App.\n *\n * @returns The Element to use as mounting point for the Vue App.\n * @internal\n */\n protected getMountingTarget(elementOrSelector?: string | Element): Element {\n if (typeof elementOrSelector === 'string') {\n const target = document.querySelector(elementOrSelector);\n if (!target) {\n throw Error(\n `XComponents app couldn't be mounted: Element \"${elementOrSelector}\" couldn't be found`\n );\n }\n return target;\n } else if (elementOrSelector !== undefined) {\n return elementOrSelector;\n } else {\n return document.body.appendChild(document.createElement('div'));\n }\n }\n\n /**\n * It updates all the provided properties from the current snippet config.\n *\n * @param snippetConfig - All the properties to be updated in the {@link SnippetConfig}.\n *\n * @internal\n */\n protected updateSnippetConfig(snippetConfig: Partial<SnippetConfig>): void {\n forEach(snippetConfig, (name, value) => {\n this.getVue().set(this.snippetConfig, name, value);\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;AAoBA,MAAM,oBAAoB,GAAsC;IAC9D,GAAG,EAAE,MAAM;IACX,aAAa,EAAE;QACb,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,SAAS;KACjB;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuEa,UAAU;;;;;;;;;;;;;IAsBrB,YAAsC,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;QAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;;;;;;;;IASS,SAAS;QACjB,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,GAAG,KAAK,KAAK,EAAE;YACjB,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/C,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACvE,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;SACrB;KACF;;;;;;;;IASO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":"extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue"],"sourcesContent":["<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { State, xComponentMixin, XEmit } from '../../../components';\n import { Dictionary } from '../../../utils';\n import { extraParamsXModule } from '../x-module';\n\n /**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n })\n export default class ExtraParams extends Vue {\n /**\n * Emits the initial extra params, overriding with the state extra params, just in case, those\n * values were already set by XComponents initialization (url, plugin config, etc.).\n */\n mounted(): void {\n this.$x.emit('ExtraParamsInitialized', this.values);\n this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });\n }\n\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', { deep: true })\n @Prop({ required: true })\n public values!: Dictionary<unknown>;\n\n /**\n * State extra params. Used to override the initial extra params.\n */\n @State('extraParams', 'params')\n public storeExtraParams!: Dictionary<unknown>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n }\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\n- [`ExtraParamsProvided`][1]\n\n[1](./../../api/x-components.extraparamsxevents.extraparamsprovided.md)\n\n## See it in action\n\n_See how the event is triggered when the component is rendered._\n\n```vue\n<template>\n <ExtraParams :values=\"values\" />\n</template>\n\n<script>\n import { ExtraParams } from '@empathyco/x-components/extra-params';\n\n export default {\n name: 'ExtraParamsDemo',\n components: {\n ExtraParams\n },\n data() {\n return {\n values: {\n warehouse: 1234\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue"],"sourcesContent":["<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { State, xComponentMixin, XEmit } from '../../../components';\n import { Dictionary } from '../../../utils';\n import { extraParamsXModule } from '../x-module';\n\n /**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n @Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n })\n export default class ExtraParams extends Vue {\n /**\n * Emits the initial extra params, overriding with the state extra params, just in case, those\n * values were already set by XComponents initialization (url, plugin config, etc.).\n */\n mounted(): void {\n this.$x.emit('ExtraParamsInitialized', { ...this.values });\n this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });\n }\n\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', { deep: true })\n @Prop({ required: true })\n public values!: Dictionary<unknown>;\n\n /**\n * State extra params. Used to override the initial extra params.\n */\n @State('extraParams', 'params')\n public storeExtraParams!: Dictionary<unknown>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n }\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\n- [`ExtraParamsProvided`][1]\n\n[1](./../../api/x-components.extraparamsxevents.extraparamsprovided.md)\n\n## See it in action\n\n_See how the event is triggered when the component is rendered._\n\n```vue\n<template>\n <ExtraParams :values=\"values\" />\n</template>\n\n<script>\n import { ExtraParams } from '@empathyco/x-components/extra-params';\n\n export default {\n name: 'ExtraParamsDemo',\n components: {\n ExtraParams\n },\n data() {\n return {\n values: {\n warehouse: 1234\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js
CHANGED
|
@@ -129,7 +129,7 @@ let ExtraParams = class ExtraParams extends Vue {
|
|
|
129
129
|
* values were already set by XComponents initialization (url, plugin config, etc.).
|
|
130
130
|
*/
|
|
131
131
|
mounted() {
|
|
132
|
-
this.$x.emit('ExtraParamsInitialized', this.values);
|
|
132
|
+
this.$x.emit('ExtraParamsInitialized', { ...this.values });
|
|
133
133
|
this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });
|
|
134
134
|
}
|
|
135
135
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extra-params.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { State, xComponentMixin, XEmit } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class ExtraParams extends Vue {\n /**\n * Emits the initial extra params, overriding with the state extra params, just in case, those\n * values were already set by XComponents initialization (url, plugin config, etc.).\n */\n mounted(): void {\n this.$x.emit('ExtraParamsInitialized', this.values);\n this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });\n }\n\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', { deep: true })\n @Prop({ required: true })\n public values!: Dictionary<unknown>;\n\n /**\n * State extra params. Used to override the initial extra params.\n */\n @State('extraParams', 'params')\n public storeExtraParams!: Dictionary<unknown>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;AASA,IAAqB,WAAW,GAAhC,MAAqB,WAAY,SAAQ,GAAG;;;;;IAK1C,OAAO;QACL,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"extra-params.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/extra-params/components/extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport Vue from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { State, xComponentMixin, XEmit } from '../../../components';\nimport { Dictionary } from '../../../utils';\nimport { extraParamsXModule } from '../x-module';\n\n/**\n * It emits a {@link ExtraParamsXEvents.ExtraParamsProvided} with the values\n * received as a prop.\n *\n * @public\n */\n@Component({\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class ExtraParams extends Vue {\n /**\n * Emits the initial extra params, overriding with the state extra params, just in case, those\n * values were already set by XComponents initialization (url, plugin config, etc.).\n */\n mounted(): void {\n this.$x.emit('ExtraParamsInitialized', { ...this.values });\n this.$x.emit('ExtraParamsProvided', { ...this.values, ...this.storeExtraParams });\n }\n\n /**\n * (Required) A Dictionary where the keys are the extra param names and its values.\n *\n * @remarks Emits the {@link ExtraParamsXEvents.ExtraParamsProvided} when the\n * component is rendered or the values changed.\n *\n * @public\n */\n @XEmit('ExtraParamsProvided', { deep: true })\n @Prop({ required: true })\n public values!: Dictionary<unknown>;\n\n /**\n * State extra params. Used to override the initial extra params.\n */\n @State('extraParams', 'params')\n public storeExtraParams!: Dictionary<unknown>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n render(): void {}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;AASA,IAAqB,WAAW,GAAhC,MAAqB,WAAY,SAAQ,GAAG;;;;;IAK1C,OAAO;QACL,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;KACnF;;IAqBD,MAAM,MAAW;CAClB,CAAA;AAVC;IAFC,KAAK,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5C,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;2CACW;AAMpC;IADC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC;qDACe;AA1B3B,WAAW;IAH/B,SAAS,CAAC;QACT,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;KAC9C,CAAC;GACmB,WAAW,CA8B/B;aA9BoB,WAAW;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-config-extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue"],"sourcesContent":["<template>\n <ExtraParams :values=\"extraParams\" />\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Watch, Inject, Prop } from 'vue-property-decorator';\n import { xComponentMixin } from '../../../components';\n import { Dictionary, forEach } from '../../../utils';\n import { SnippetConfig } from '../../../x-installer';\n import { extraParamsXModule } from '../x-module';\n import ExtraParams from './extra-params.vue';\n\n /**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n @Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n })\n export default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * A Dictionary where the keys are the extra param names and its values.\n *\n * @public\n */\n @Prop()\n protected values?: Dictionary<unknown>;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Collection of properties from the snippet config not allowed to be sent as extra params.\n *\n * @internal\n */\n protected notAllowedExtraParams: Array<keyof SnippetConfig> = [\n 'callbacks',\n 'productId',\n 'instance',\n 'lang',\n 'searchLang',\n 'consent',\n 'documentDirection',\n 'currency'\n ];\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams(snippetConfig: SnippetConfig): void {\n forEach({ ...
|
|
1
|
+
{"version":3,"file":"snippet-config-extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue"],"sourcesContent":["<template>\n <ExtraParams :values=\"extraParams\" />\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Watch, Inject, Prop } from 'vue-property-decorator';\n import { xComponentMixin } from '../../../components';\n import { Dictionary, forEach } from '../../../utils';\n import { SnippetConfig } from '../../../x-installer';\n import { extraParamsXModule } from '../x-module';\n import ExtraParams from './extra-params.vue';\n\n /**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n @Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n })\n export default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * A Dictionary where the keys are the extra param names and its values.\n *\n * @public\n */\n @Prop()\n protected values?: Dictionary<unknown>;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Collection of properties from the snippet config not allowed to be sent as extra params.\n *\n * @internal\n */\n protected notAllowedExtraParams: Array<keyof SnippetConfig> = [\n 'callbacks',\n 'productId',\n 'instance',\n 'lang',\n 'searchLang',\n 'consent',\n 'documentDirection',\n 'currency'\n ];\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams(snippetConfig: SnippetConfig): void {\n forEach({ ...this.values, ...snippetConfig }, (name, value) => {\n if (this.notAllowedExtraParams.includes(name)) {\n return;\n }\n this.$set(this.extraParams, name, value);\n });\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## See it in action\n\n_See how the snippet config is injected and passed to the SnippetConfigExtraParams component._\n\n```vue\n<template>\n <Provider>\n <SnippetConfigExtraParams />\n </Provider>\n</template>\n\n<script>\n import { SnippetConfigExtraParams } from '@empathyco/x-components/extra-params';\n\n const Provider = {\n provide: {\n snippetConfig: {\n instance: 'demo',\n lang: 'es',\n warehouse: 1234\n }\n }\n };\n\n export default {\n name: 'SnippetConfigExtraParamsDemo',\n components: {\n Provider,\n SnippetConfigExtraParams\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -162,7 +162,7 @@ let SnippetConfigExtraParams = class SnippetConfigExtraParams extends Vue {
|
|
|
162
162
|
* @internal
|
|
163
163
|
*/
|
|
164
164
|
syncExtraParams(snippetConfig) {
|
|
165
|
-
forEach({ ...
|
|
165
|
+
forEach({ ...this.values, ...snippetConfig }, (name, value) => {
|
|
166
166
|
if (this.notAllowedExtraParams.includes(name)) {
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-config-extra-params.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Watch, Inject, Prop } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../components';\nimport { Dictionary, forEach } from '../../../utils';\nimport { SnippetConfig } from '../../../x-installer';\nimport { extraParamsXModule } from '../x-module';\nimport ExtraParams from './extra-params.vue';\n\n/**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n@Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * A Dictionary where the keys are the extra param names and its values.\n *\n * @public\n */\n @Prop()\n protected values?: Dictionary<unknown>;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Collection of properties from the snippet config not allowed to be sent as extra params.\n *\n * @internal\n */\n protected notAllowedExtraParams: Array<keyof SnippetConfig> = [\n 'callbacks',\n 'productId',\n 'instance',\n 'lang',\n 'searchLang',\n 'consent',\n 'documentDirection',\n 'currency'\n ];\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams(snippetConfig: SnippetConfig): void {\n forEach({ ...
|
|
1
|
+
{"version":3,"file":"snippet-config-extra-params.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport Vue from 'vue';\nimport { Component, Watch, Inject, Prop } from 'vue-property-decorator';\nimport { xComponentMixin } from '../../../components';\nimport { Dictionary, forEach } from '../../../utils';\nimport { SnippetConfig } from '../../../x-installer';\nimport { extraParamsXModule } from '../x-module';\nimport ExtraParams from './extra-params.vue';\n\n/**\n * Extracts the extra parameters from the {@link SnippetConfig} and syncs it with the request\n * objects of every x-module.\n *\n * @public\n */\n@Component({\n components: { ExtraParams },\n mixins: [xComponentMixin(extraParamsXModule)]\n})\nexport default class SnippetConfigExtraParams extends Vue {\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n *\n * @internal\n */\n @Inject('snippetConfig')\n public snippetConfig!: SnippetConfig;\n\n /**\n * A Dictionary where the keys are the extra param names and its values.\n *\n * @public\n */\n @Prop()\n protected values?: Dictionary<unknown>;\n\n /**\n * Custom object containing the extra params from the snippet config.\n *\n * @remarks This object keeps manually the desired snippet config properties to avoid\n * unnecessary re-renders.\n *\n * @internal\n */\n protected extraParams: Dictionary<unknown> = {};\n\n /**\n * Collection of properties from the snippet config not allowed to be sent as extra params.\n *\n * @internal\n */\n protected notAllowedExtraParams: Array<keyof SnippetConfig> = [\n 'callbacks',\n 'productId',\n 'instance',\n 'lang',\n 'searchLang',\n 'consent',\n 'documentDirection',\n 'currency'\n ];\n\n /**\n * Updates the extraParams object when the snippet config changes.\n *\n * @param snippetConfig - The new snippet config.\n *\n * @internal\n */\n @Watch('snippetConfig', { deep: true, immediate: true })\n syncExtraParams(snippetConfig: SnippetConfig): void {\n forEach({ ...this.values, ...snippetConfig }, (name, value) => {\n if (this.notAllowedExtraParams.includes(name)) {\n return;\n }\n this.$set(this.extraParams, name, value);\n });\n }\n}\n"],"names":["ExtraParams"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;;;;;AAUA,IAAqB,wBAAwB,GAA7C,MAAqB,wBAAyB,SAAQ,GAAG;IAAzD;;;;;;;;;;QAyBY,gBAAW,GAAwB,EAAE,CAAC;;;;;;QAOtC,0BAAqB,GAA+B;YAC5D,WAAW;YACX,WAAW;YACX,UAAU;YACV,MAAM;YACN,YAAY;YACZ,SAAS;YACT,mBAAmB;YACnB,UAAU;SACX,CAAC;KAkBH;;;;;;;;IARC,eAAe,CAAC,aAA4B;QAC1C,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,aAAa,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK;YACxD,IAAI,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBAC7C,OAAO;aACR;YACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;SAC1C,CAAC,CAAC;KACJ;CACF,CAAA;AApDC;IADC,MAAM,CAAC,eAAe,CAAC;+DACa;AAQrC;IADC,IAAI,EAAE;wDACgC;AAoCvC;IADC,KAAK,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;+DAQvD;AA1DkB,wBAAwB;IAJ5C,SAAS,CAAC;QACT,UAAU,EAAE,eAAEA,iBAAW,EAAE;QAC3B,MAAM,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;KAC9C,CAAC;GACmB,wBAAwB,CA2D5C;aA3DoB,wBAAwB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.64",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"access": "public",
|
|
128
128
|
"directory": "dist"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "5aa0afd249632ba7d5dfb30197c813cbafb8d2fa"
|
|
131
131
|
}
|
|
@@ -6504,7 +6504,7 @@
|
|
|
6504
6504
|
{
|
|
6505
6505
|
"kind": "Method",
|
|
6506
6506
|
"canonicalReference": "@empathyco/x-components!BaseXAPI#init:member(1)",
|
|
6507
|
-
"docComment": "/**\n * Initializes the Application passing the {@link SnippetConfig}.\n *\n * @param config - The config
|
|
6507
|
+
"docComment": "/**\n * Initializes the Application passing the {@link SnippetConfig}.\n *\n * @param config - The config coming from the customer snippet.\n *\n * @public\n */\n",
|
|
6508
6508
|
"excerptTokens": [
|
|
6509
6509
|
{
|
|
6510
6510
|
"kind": "Content",
|
|
@@ -6645,6 +6645,65 @@
|
|
|
6645
6645
|
}
|
|
6646
6646
|
],
|
|
6647
6647
|
"name": "setInitCallback"
|
|
6648
|
+
},
|
|
6649
|
+
{
|
|
6650
|
+
"kind": "Method",
|
|
6651
|
+
"canonicalReference": "@empathyco/x-components!BaseXAPI#setSnippetConfig:member(1)",
|
|
6652
|
+
"docComment": "/**\n * Sets or updates the snippet config.\n *\n * @param config - A part or all the snippet config.\n *\n * @public\n */\n",
|
|
6653
|
+
"excerptTokens": [
|
|
6654
|
+
{
|
|
6655
|
+
"kind": "Content",
|
|
6656
|
+
"text": "setSnippetConfig(config: "
|
|
6657
|
+
},
|
|
6658
|
+
{
|
|
6659
|
+
"kind": "Reference",
|
|
6660
|
+
"text": "Partial",
|
|
6661
|
+
"canonicalReference": "!Partial:type"
|
|
6662
|
+
},
|
|
6663
|
+
{
|
|
6664
|
+
"kind": "Content",
|
|
6665
|
+
"text": "<"
|
|
6666
|
+
},
|
|
6667
|
+
{
|
|
6668
|
+
"kind": "Reference",
|
|
6669
|
+
"text": "SnippetConfig",
|
|
6670
|
+
"canonicalReference": "@empathyco/x-components!SnippetConfig:interface"
|
|
6671
|
+
},
|
|
6672
|
+
{
|
|
6673
|
+
"kind": "Content",
|
|
6674
|
+
"text": ">"
|
|
6675
|
+
},
|
|
6676
|
+
{
|
|
6677
|
+
"kind": "Content",
|
|
6678
|
+
"text": "): "
|
|
6679
|
+
},
|
|
6680
|
+
{
|
|
6681
|
+
"kind": "Content",
|
|
6682
|
+
"text": "void"
|
|
6683
|
+
},
|
|
6684
|
+
{
|
|
6685
|
+
"kind": "Content",
|
|
6686
|
+
"text": ";"
|
|
6687
|
+
}
|
|
6688
|
+
],
|
|
6689
|
+
"isOptional": false,
|
|
6690
|
+
"isStatic": false,
|
|
6691
|
+
"returnTypeTokenRange": {
|
|
6692
|
+
"startIndex": 6,
|
|
6693
|
+
"endIndex": 7
|
|
6694
|
+
},
|
|
6695
|
+
"releaseTag": "Public",
|
|
6696
|
+
"overloadIndex": 1,
|
|
6697
|
+
"parameters": [
|
|
6698
|
+
{
|
|
6699
|
+
"parameterName": "config",
|
|
6700
|
+
"parameterTypeTokenRange": {
|
|
6701
|
+
"startIndex": 1,
|
|
6702
|
+
"endIndex": 5
|
|
6703
|
+
}
|
|
6704
|
+
}
|
|
6705
|
+
],
|
|
6706
|
+
"name": "setSnippetConfig"
|
|
6648
6707
|
}
|
|
6649
6708
|
],
|
|
6650
6709
|
"implementsTokenRanges": [
|
|
@@ -49179,6 +49238,64 @@
|
|
|
49179
49238
|
}
|
|
49180
49239
|
],
|
|
49181
49240
|
"name": "search"
|
|
49241
|
+
},
|
|
49242
|
+
{
|
|
49243
|
+
"kind": "MethodSignature",
|
|
49244
|
+
"canonicalReference": "@empathyco/x-components!XAPI#setSnippetConfig:member(1)",
|
|
49245
|
+
"docComment": "/**\n * To set or update any property of the {@link SnippetConfig}.\n *\n * @param config - The properties to be changed.\n *\n * @public\n */\n",
|
|
49246
|
+
"excerptTokens": [
|
|
49247
|
+
{
|
|
49248
|
+
"kind": "Content",
|
|
49249
|
+
"text": "setSnippetConfig(config: "
|
|
49250
|
+
},
|
|
49251
|
+
{
|
|
49252
|
+
"kind": "Reference",
|
|
49253
|
+
"text": "Partial",
|
|
49254
|
+
"canonicalReference": "!Partial:type"
|
|
49255
|
+
},
|
|
49256
|
+
{
|
|
49257
|
+
"kind": "Content",
|
|
49258
|
+
"text": "<"
|
|
49259
|
+
},
|
|
49260
|
+
{
|
|
49261
|
+
"kind": "Reference",
|
|
49262
|
+
"text": "SnippetConfig",
|
|
49263
|
+
"canonicalReference": "@empathyco/x-components!SnippetConfig:interface"
|
|
49264
|
+
},
|
|
49265
|
+
{
|
|
49266
|
+
"kind": "Content",
|
|
49267
|
+
"text": ">"
|
|
49268
|
+
},
|
|
49269
|
+
{
|
|
49270
|
+
"kind": "Content",
|
|
49271
|
+
"text": "): "
|
|
49272
|
+
},
|
|
49273
|
+
{
|
|
49274
|
+
"kind": "Content",
|
|
49275
|
+
"text": "void"
|
|
49276
|
+
},
|
|
49277
|
+
{
|
|
49278
|
+
"kind": "Content",
|
|
49279
|
+
"text": ";"
|
|
49280
|
+
}
|
|
49281
|
+
],
|
|
49282
|
+
"isOptional": false,
|
|
49283
|
+
"returnTypeTokenRange": {
|
|
49284
|
+
"startIndex": 6,
|
|
49285
|
+
"endIndex": 7
|
|
49286
|
+
},
|
|
49287
|
+
"releaseTag": "Public",
|
|
49288
|
+
"overloadIndex": 1,
|
|
49289
|
+
"parameters": [
|
|
49290
|
+
{
|
|
49291
|
+
"parameterName": "config",
|
|
49292
|
+
"parameterTypeTokenRange": {
|
|
49293
|
+
"startIndex": 1,
|
|
49294
|
+
"endIndex": 5
|
|
49295
|
+
}
|
|
49296
|
+
}
|
|
49297
|
+
],
|
|
49298
|
+
"name": "setSnippetConfig"
|
|
49182
49299
|
}
|
|
49183
49300
|
],
|
|
49184
49301
|
"extendsTokenRanges": []
|
|
@@ -627,6 +627,11 @@ export class BaseXAPI implements XAPI {
|
|
|
627
627
|
// @internal
|
|
628
628
|
setBus(bus: XBus): void;
|
|
629
629
|
setInitCallback(initCallback: (config: SnippetConfig) => any): void;
|
|
630
|
+
setSnippetConfig(config: Partial<SnippetConfig>): void;
|
|
631
|
+
// @internal
|
|
632
|
+
setSnippetConfigCallback(snippetCallback: (config: Partial<SnippetConfig>) => void): void;
|
|
633
|
+
// @internal
|
|
634
|
+
protected snippetCallback: (config: Partial<SnippetConfig>) => void;
|
|
630
635
|
}
|
|
631
636
|
|
|
632
637
|
// @public
|
|
@@ -4657,6 +4662,9 @@ export interface XAPI {
|
|
|
4657
4662
|
setBus(bus: XBus): void;
|
|
4658
4663
|
// @internal
|
|
4659
4664
|
setInitCallback(initCallback: (config: SnippetConfig) => void): void;
|
|
4665
|
+
setSnippetConfig(config: Partial<SnippetConfig>): void;
|
|
4666
|
+
// @internal
|
|
4667
|
+
setSnippetConfigCallback(callback: (config: Partial<SnippetConfig>) => void): void;
|
|
4660
4668
|
}
|
|
4661
4669
|
|
|
4662
4670
|
// @public
|
|
@@ -4813,6 +4821,10 @@ export class XInstaller {
|
|
|
4813
4821
|
protected installPlugin(pluginOptions: XPluginOptions, bus: XBus): PluginObject<XPluginOptions>;
|
|
4814
4822
|
// (undocumented)
|
|
4815
4823
|
protected readonly options: InstallXOptions;
|
|
4824
|
+
// @internal
|
|
4825
|
+
protected snippetConfig: SnippetConfig;
|
|
4826
|
+
// @internal
|
|
4827
|
+
protected updateSnippetConfig(snippetConfig: Partial<SnippetConfig>): void;
|
|
4816
4828
|
}
|
|
4817
4829
|
|
|
4818
4830
|
// @public
|
|
@@ -34,6 +34,22 @@ export interface XAPI {
|
|
|
34
34
|
* @internal
|
|
35
35
|
*/
|
|
36
36
|
setInitCallback(initCallback: (config: SnippetConfig) => void): void;
|
|
37
|
+
/**
|
|
38
|
+
* To set or update any property of the {@link SnippetConfig}.
|
|
39
|
+
*
|
|
40
|
+
* @param config - The properties to be changed.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
setSnippetConfig(config: Partial<SnippetConfig>): void;
|
|
45
|
+
/**
|
|
46
|
+
* To set the snippet config callback.
|
|
47
|
+
*
|
|
48
|
+
* @param callback - Function to be called.
|
|
49
|
+
*
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
setSnippetConfigCallback(callback: (config: Partial<SnippetConfig>) => void): void;
|
|
37
53
|
/**
|
|
38
54
|
* Dispatch a search with the query parameter.
|
|
39
55
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.types.d.ts","sourceRoot":"","sources":["../../../../src/x-installer/api/api.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,IAAI;IACnB;;;;;;;OAOG;IACH,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C;;;;;SAKK;IACL,MAAM,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;IAExB;;;;;;;OAOG;IACH,eAAe,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,IAAI,CAAC;IAErE;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CA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1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB"}
|
|
@@ -25,6 +25,13 @@ export declare class BaseXAPI implements XAPI {
|
|
|
25
25
|
* @internal
|
|
26
26
|
*/
|
|
27
27
|
protected initCallback: (config: SnippetConfig) => any;
|
|
28
|
+
/**
|
|
29
|
+
* Callback that allows to update the snippet config. The logic of initialization is out of this
|
|
30
|
+
* API since this API is just a facade.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
protected snippetCallback: (config: Partial<SnippetConfig>) => void;
|
|
28
35
|
/**
|
|
29
36
|
* Tracks that a product was added to cart from PDP.
|
|
30
37
|
*
|
|
@@ -45,6 +52,22 @@ export declare class BaseXAPI implements XAPI {
|
|
|
45
52
|
* @param initCallback - The callback to call.
|
|
46
53
|
*/
|
|
47
54
|
setInitCallback(initCallback: (config: SnippetConfig) => any): void;
|
|
55
|
+
/**
|
|
56
|
+
* Setter for the callback to modify the snippet config.
|
|
57
|
+
*
|
|
58
|
+
* @param snippetCallback - The callback to call.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
setSnippetConfigCallback(snippetCallback: (config: Partial<SnippetConfig>) => void): void;
|
|
63
|
+
/**
|
|
64
|
+
* Sets or updates the snippet config.
|
|
65
|
+
*
|
|
66
|
+
* @param config - A part or all the snippet config.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
setSnippetConfig(config: Partial<SnippetConfig>): void;
|
|
48
71
|
/**
|
|
49
72
|
* Searches the query parameter as user query.
|
|
50
73
|
*
|
|
@@ -56,7 +79,7 @@ export declare class BaseXAPI implements XAPI {
|
|
|
56
79
|
/**
|
|
57
80
|
* Initializes the Application passing the {@link SnippetConfig}.
|
|
58
81
|
*
|
|
59
|
-
* @param config - The config
|
|
82
|
+
* @param config - The config coming from the customer snippet.
|
|
60
83
|
*
|
|
61
84
|
* @public
|
|
62
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-api.d.ts","sourceRoot":"","sources":["../../../../src/x-installer/api/base-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,qBAAa,QAAS,YAAW,IAAI;IACnC;;;;OAIG;IACH,SAAS,CAAC,cAAc,UAAS;IAEjC;;;;OAIG;IACH,SAAS,CAAC,GAAG,EAAG,IAAI,CAAC;IAErB;;;;;OAKG;IACH,SAAS,CAAC,YAAY,EAAG,CAAC,MAAM,EAAE,aAAa,KAAK,GAAG,CAAC;IAExD;;;;OAIG;IACH,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAI1C;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI;IAIvB;;;;OAIG;IACH,eAAe,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,GAAG,GAAG,IAAI;IAInE;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAO5B;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;CASlC"}
|
|
1
|
+
{"version":3,"file":"base-api.d.ts","sourceRoot":"","sources":["../../../../src/x-installer/api/base-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,qBAAa,QAAS,YAAW,IAAI;IACnC;;;;OAIG;IACH,SAAS,CAAC,cAAc,UAAS;IAEjC;;;;OAIG;IACH,SAAS,CAAC,GAAG,EAAG,IAAI,CAAC;IAErB;;;;;OAKG;IACH,SAAS,CAAC,YAAY,EAAG,CAAC,MAAM,EAAE,aAAa,KAAK,GAAG,CAAC;IAExD;;;;;OAKG;IACH,SAAS,CAAC,eAAe,EAAG,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAErE;;;;OAIG;IACH,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAI1C;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI;IAIvB;;;;OAIG;IACH,eAAe,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,GAAG,GAAG,IAAI;IAInE;;;;;;OAMG;IACH,wBAAwB,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,GAAG,IAAI;IAIzF;;;;;;OAMG;IACH,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAItD;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAO5B;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;CASlC"}
|
|
@@ -83,6 +83,12 @@ declare global {
|
|
|
83
83
|
export declare class XInstaller {
|
|
84
84
|
protected readonly options: InstallXOptions;
|
|
85
85
|
private api?;
|
|
86
|
+
/**
|
|
87
|
+
* The configuration coming from the snippet {@link SnippetConfig}.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
protected snippetConfig: SnippetConfig;
|
|
86
92
|
/**
|
|
87
93
|
* Receives the {@link InstallXOptions} and merges it with the default fallback options. Also
|
|
88
94
|
* creates the public {@link XAPI}.
|
|
@@ -221,5 +227,13 @@ export declare class XInstaller {
|
|
|
221
227
|
* @internal
|
|
222
228
|
*/
|
|
223
229
|
protected getMountingTarget(elementOrSelector?: string | Element): Element;
|
|
230
|
+
/**
|
|
231
|
+
* It updates all the provided properties from the current snippet config.
|
|
232
|
+
*
|
|
233
|
+
* @param snippetConfig - All the properties to be updated in the {@link SnippetConfig}.
|
|
234
|
+
*
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
protected updateSnippetConfig(snippetConfig: Partial<SnippetConfig>): void;
|
|
224
238
|
}
|
|
225
239
|
//# sourceMappingURL=x-installer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-installer.d.ts","sourceRoot":"","sources":["../../../../src/x-installer/x-installer/x-installer.ts"],"names":[],"mappings":"AAEA,OAAO,GAAG,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAEtF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,CAAC,CAAC,EAAE,IAAI,CAAC;QACT,KAAK,CAAC,EAAE,CAAC,MAAM,aAAa,CAAC,GAAG,aAAa,CAAC;KAC/C;CACF;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,qBAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"x-installer.d.ts","sour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