@coveo/atomic 3.34.0-pre.933691a916 → 3.34.0-pre.941e709b3a
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/dist/atomic/_atomic.esm.js +1 -1
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-product/atomic-product.js +58 -26
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/{p-06b89454.js → p-78abc041.js} +2 -2
- package/dist/atomic/{p-4de7cb56.entry.js → p-d6576be9.entry.js} +2 -2
- package/dist/atomic/{p-4d4cd09c.entry.js → p-de823787.entry.js} +2 -2
- package/dist/cjs/{analytics-config-22e803de.js → analytics-config-933a5eb0.js} +2 -2
- package/dist/cjs/{analytics-config-22e803de.js.map → analytics-config-933a5eb0.js.map} +1 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/{analytics-config-2f5f12b6.js → analytics-config-00814762.js} +2 -2
- package/dist/esm/{analytics-config-2f5f12b6.js.map → analytics-config-00814762.js.map} +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +16 -4
- package/docs/atomic-docs.json +1 -1
- package/package.json +1 -1
- package/dist/atomic/components/components/common/layout/custom-render-controller.js +0 -37
- package/dist/atomic/components/components/common/layout/item-layout-controller.js +0 -103
- package/dist/types/components/common/layout/custom-render-controller.d.ts +0 -25
- package/dist/types/components/common/layout/item-layout-controller.d.ts +0 -47
- /package/dist/atomic/{p-06b89454.js.map → p-78abc041.js.map} +0 -0
- /package/dist/atomic/{p-4de7cb56.entry.js.map → p-d6576be9.entry.js.map} +0 -0
- /package/dist/atomic/{p-4d4cd09c.entry.js.map → p-de823787.entry.js.map} +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, s as setNonce, h, H as Host, g as getElement } from './index-3f35faca.js';
|
2
2
|
import { m as markParentAsReady } from './init-queue-fbe942c3.js';
|
3
3
|
import { buildResultsPerPage, loadFieldActions, buildInsightEngine } from '@coveo/headless/insight';
|
4
|
-
import { g as getNextAnalyticsConfig, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance } from './analytics-config-
|
4
|
+
import { g as getNextAnalyticsConfig, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance } from './analytics-config-00814762.js';
|
5
5
|
import { A as ArrayProp } from './props-utils-e97ad6bd.js';
|
6
6
|
import { D as DEFAULT_MOBILE_BREAKPOINT } from './replace-breakpoint-utils-7a336631.js';
|
7
7
|
import { u as unsetLoadingFlag, s as setLoadingFlag, r as registerFacet, g as getFacetElements, w as waitUntilAppLoaded, a as createBaseStore } from './store-015afa83.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, s as setNonce, h, g as getElement } from './index-3f35faca.js';
|
2
2
|
import { m as markParentAsReady } from './init-queue-fbe942c3.js';
|
3
3
|
import { loadRecommendationActions, loadSearchConfigurationActions, EcommerceDefaultFieldsToInclude, loadFieldActions, buildRecommendationEngine } from '@coveo/headless/recommendation';
|
4
|
-
import { g as getNextAnalyticsConfig, c as augmentAnalyticsConfigWithDocument, d as augmentAnalyticsConfigWithAtomicVersion, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance, m as mismatchedInterfaceAndEnginePropError } from './analytics-config-
|
4
|
+
import { g as getNextAnalyticsConfig, c as augmentAnalyticsConfigWithDocument, d as augmentAnalyticsConfigWithAtomicVersion, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance, m as mismatchedInterfaceAndEnginePropError } from './analytics-config-00814762.js';
|
5
5
|
import { A as ArrayProp } from './props-utils-e97ad6bd.js';
|
6
6
|
import { u as unsetLoadingFlag, s as setLoadingFlag, a as createBaseStore } from './store-015afa83.js';
|
7
7
|
import './dayjs.min-d04628c6.js';
|
package/dist/esm/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
export const headlessVersion = '3.31.1';
|
2
|
-
export const atomicVersion = '3.34.0-pre.
|
2
|
+
export const atomicVersion = '3.34.0-pre.941e709b3a';
|
@@ -1,19 +1,20 @@
|
|
1
1
|
import type { InteractiveProduct, Product } from '@coveo/headless/commerce';
|
2
2
|
import { type CSSResultGroup, LitElement } from 'lit';
|
3
|
-
import type { CommerceStore } from "../atomic-commerce-interface/store";
|
4
|
-
import type { CommerceRecommendationStore } from "../atomic-commerce-recommendation-interface/store";
|
5
3
|
import type { DisplayConfig } from "../../common/item-list/context/item-display-config-context-controller";
|
6
4
|
import { type ItemRenderingFunction } from "../../common/item-list/item-list-common";
|
7
|
-
import type
|
5
|
+
import { type ItemDisplayDensity, type ItemDisplayImageSize, type ItemDisplayLayout } from "../../common/layout/display-options";
|
8
6
|
import type { InteractiveProductContextEvent, ProductContextEvent } from "../../../decorators/commerce/product-template-decorators";
|
7
|
+
import type { CommerceStore } from '../atomic-commerce-interface/store';
|
8
|
+
import type { CommerceRecommendationStore } from '../atomic-commerce-recommendation-interface/store';
|
9
9
|
declare const AtomicProduct_base: typeof LitElement;
|
10
10
|
/**
|
11
11
|
* The `atomic-product` component is used internally by the `atomic-commerce-product-list` and `atomic-commerce-recommendation-list` components.
|
12
12
|
*/
|
13
13
|
export declare class AtomicProduct extends AtomicProduct_base {
|
14
|
+
private layout;
|
14
15
|
private productRootRef?;
|
15
16
|
private linkContainerRef?;
|
16
|
-
private
|
17
|
+
private executedRenderingFunctionOnce;
|
17
18
|
static styles: CSSResultGroup;
|
18
19
|
/**
|
19
20
|
* Whether `atomic-product-link` components nested in the `atomic-product` should stop click event propagation.
|
@@ -83,14 +84,25 @@ export declare class AtomicProduct extends AtomicProduct_base {
|
|
83
84
|
clickLinkContainer: () => void;
|
84
85
|
connectedCallback(): Promise<void>;
|
85
86
|
disconnectedCallback(): void;
|
87
|
+
private get isCustomRenderFunctionMode();
|
86
88
|
private getContentHTML;
|
87
89
|
private getLinkHTML;
|
90
|
+
private shouldExecuteRenderFunction;
|
88
91
|
render(): import("lit-html").TemplateResult<1>;
|
89
92
|
firstUpdated(_changedProperties: Map<string, unknown>): void;
|
93
|
+
private getCombinedClasses;
|
94
|
+
private applyClassesToChildren;
|
95
|
+
updated(_changedProperties: Map<string, unknown>): void;
|
90
96
|
}
|
91
97
|
declare global {
|
92
98
|
interface HTMLElementTagNameMap {
|
93
99
|
'atomic-product': AtomicProduct;
|
94
100
|
}
|
101
|
+
interface HTMLElementEventMap {
|
102
|
+
'atomic/resolveResult': ProductContextEvent;
|
103
|
+
'atomic/resolveInteractiveResult': InteractiveProductContextEvent;
|
104
|
+
'atomic/resolveStopPropagation': CustomEvent;
|
105
|
+
'atomic/resolveResultDisplayConfig': ProductContextEvent<DisplayConfig>;
|
106
|
+
}
|
95
107
|
}
|
96
108
|
export {};
|
package/docs/atomic-docs.json
CHANGED
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@coveo/atomic",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.34.0-pre.
|
4
|
+
"version": "3.34.0-pre.941e709b3a",
|
5
5
|
"description": "A web-component library for building modern UIs interfacing with the Coveo platform",
|
6
6
|
"homepage": "https://docs.coveo.com/en/atomic/latest/",
|
7
7
|
"repository": {
|
@@ -1,37 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* A reactive controller that manages custom rendering function execution for item components.
|
3
|
-
*/
|
4
|
-
export class CustomRenderController {
|
5
|
-
constructor(host, options) {
|
6
|
-
this.hasExecutedRenderFunction = false;
|
7
|
-
this.options = {
|
8
|
-
linkContainerRef: () => undefined,
|
9
|
-
onRenderComplete: () => { },
|
10
|
-
...options,
|
11
|
-
};
|
12
|
-
host.addController(this);
|
13
|
-
}
|
14
|
-
hostConnected() {
|
15
|
-
this.resetRenderState();
|
16
|
-
}
|
17
|
-
hostUpdated() {
|
18
|
-
this.executeRenderFunction();
|
19
|
-
}
|
20
|
-
resetRenderState() {
|
21
|
-
this.hasExecutedRenderFunction = false;
|
22
|
-
}
|
23
|
-
executeRenderFunction() {
|
24
|
-
const renderingFunction = this.options.renderingFunction();
|
25
|
-
const itemData = this.options.itemData();
|
26
|
-
const rootElementRef = this.options.rootElementRef();
|
27
|
-
if (!renderingFunction ||
|
28
|
-
!itemData ||
|
29
|
-
!rootElementRef ||
|
30
|
-
this.hasExecutedRenderFunction) {
|
31
|
-
return;
|
32
|
-
}
|
33
|
-
const customRenderOutput = renderingFunction(itemData, rootElementRef, this.options.linkContainerRef());
|
34
|
-
this.options.onRenderComplete(rootElementRef, customRenderOutput);
|
35
|
-
this.hasExecutedRenderFunction = true;
|
36
|
-
}
|
37
|
-
}
|
@@ -1,103 +0,0 @@
|
|
1
|
-
import { ItemLayout, } from './display-options';
|
2
|
-
/**
|
3
|
-
* A reactive controller that manages layout creation and class application for item components.
|
4
|
-
*/
|
5
|
-
export class ItemLayoutController {
|
6
|
-
constructor(host, options) {
|
7
|
-
this.layoutInstance = null;
|
8
|
-
this.host = host;
|
9
|
-
this.options = {
|
10
|
-
...options,
|
11
|
-
};
|
12
|
-
host.addController(this);
|
13
|
-
}
|
14
|
-
hostConnected() {
|
15
|
-
this.createLayout();
|
16
|
-
}
|
17
|
-
hostUpdated() {
|
18
|
-
this.applyLayoutClasses();
|
19
|
-
}
|
20
|
-
/**
|
21
|
-
* Gets the current layout instance
|
22
|
-
*/
|
23
|
-
getLayout() {
|
24
|
-
return this.layoutInstance;
|
25
|
-
}
|
26
|
-
/**
|
27
|
-
* Gets combined layout and extra classes
|
28
|
-
*/
|
29
|
-
getCombinedClasses(additionalContent) {
|
30
|
-
const layout = this.getLayout();
|
31
|
-
const layoutClasses = layout ? layout.getClasses(additionalContent) : [];
|
32
|
-
const itemClasses = this.options
|
33
|
-
.itemClasses()
|
34
|
-
.split(/\s+/)
|
35
|
-
.filter((c) => c);
|
36
|
-
return [...layoutClasses, ...itemClasses];
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
* Applies layout classes to a specific element (useful for custom rendering)
|
40
|
-
*/
|
41
|
-
applyLayoutClassesToElement(element, additionalContent) {
|
42
|
-
const layout = this.getLayout();
|
43
|
-
if (!layout) {
|
44
|
-
return;
|
45
|
-
}
|
46
|
-
const classes = this.getCombinedClasses(additionalContent);
|
47
|
-
if (classes.length > 0) {
|
48
|
-
element.classList.add(...classes);
|
49
|
-
}
|
50
|
-
}
|
51
|
-
applyLayoutClasses() {
|
52
|
-
const layout = this.getLayout();
|
53
|
-
if (!layout) {
|
54
|
-
return;
|
55
|
-
}
|
56
|
-
const classes = this.getCombinedClasses();
|
57
|
-
const root = this.host.shadowRoot?.querySelector('.result-root');
|
58
|
-
if (!root || classes.length === 0) {
|
59
|
-
return;
|
60
|
-
}
|
61
|
-
if (this.hasCustomRenderFunction()) {
|
62
|
-
this.observeAndApplyClasses(root, classes);
|
63
|
-
}
|
64
|
-
else {
|
65
|
-
this.addClassesToElements(root, classes);
|
66
|
-
}
|
67
|
-
}
|
68
|
-
createLayout() {
|
69
|
-
const content = this.options.content();
|
70
|
-
if (!content) {
|
71
|
-
console.warn(`${this.options.elementPrefix}: content property is undefined. Cannot create layout.`, this.host);
|
72
|
-
this.layoutInstance = null;
|
73
|
-
return;
|
74
|
-
}
|
75
|
-
const config = this.options.layoutConfig();
|
76
|
-
this.layoutInstance = new ItemLayout(content.children, config.display, config.density, config.imageSize);
|
77
|
-
}
|
78
|
-
hasCustomRenderFunction() {
|
79
|
-
return this.options.renderingFunction() !== undefined;
|
80
|
-
}
|
81
|
-
addClassesToElements(root, classes) {
|
82
|
-
if (classes.length === 0) {
|
83
|
-
return;
|
84
|
-
}
|
85
|
-
const elements = root.querySelectorAll('*');
|
86
|
-
elements.forEach((element) => {
|
87
|
-
const tagName = element.tagName.toLowerCase();
|
88
|
-
if (tagName.startsWith(`${this.options.elementPrefix}-`)) {
|
89
|
-
element.classList.add(...classes);
|
90
|
-
}
|
91
|
-
});
|
92
|
-
}
|
93
|
-
observeAndApplyClasses(root, classes) {
|
94
|
-
const observer = new MutationObserver((mutations) => {
|
95
|
-
const hasNewElements = mutations.some((mutation) => mutation.type === 'childList' && mutation.addedNodes.length > 0);
|
96
|
-
if (hasNewElements) {
|
97
|
-
this.addClassesToElements(root, classes);
|
98
|
-
observer.disconnect();
|
99
|
-
}
|
100
|
-
});
|
101
|
-
observer.observe(root, { childList: true, subtree: true });
|
102
|
-
}
|
103
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import type { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
|
2
|
-
import type { ItemRenderingFunction } from "../item-list/item-list-common";
|
3
|
-
import type { AnyItem } from "../item-list/unfolded-item";
|
4
|
-
export interface CustomRenderHost extends ReactiveControllerHost {
|
5
|
-
shadowRoot?: ShadowRoot | null;
|
6
|
-
}
|
7
|
-
export interface CustomRenderOptions {
|
8
|
-
renderingFunction: () => ItemRenderingFunction<AnyItem> | undefined;
|
9
|
-
itemData: () => AnyItem | undefined;
|
10
|
-
rootElementRef: () => HTMLElement | undefined;
|
11
|
-
linkContainerRef?: () => HTMLElement | undefined;
|
12
|
-
onRenderComplete?: (element: HTMLElement, output: string) => void;
|
13
|
-
}
|
14
|
-
/**
|
15
|
-
* A reactive controller that manages custom rendering function execution for item components.
|
16
|
-
*/
|
17
|
-
export declare class CustomRenderController implements ReactiveController {
|
18
|
-
private options;
|
19
|
-
private hasExecutedRenderFunction;
|
20
|
-
constructor(host: CustomRenderHost & LitElement, options: CustomRenderOptions);
|
21
|
-
hostConnected(): void;
|
22
|
-
hostUpdated(): void;
|
23
|
-
private resetRenderState;
|
24
|
-
private executeRenderFunction;
|
25
|
-
}
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import type { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
|
2
|
-
import type { ItemRenderingFunction } from "../item-list/item-list-common";
|
3
|
-
import type { AnyItem } from "../item-list/unfolded-item";
|
4
|
-
import { type ItemDisplayDensity, type ItemDisplayImageSize, type ItemDisplayLayout, ItemLayout } from './display-options';
|
5
|
-
export interface ItemLayoutHost extends ReactiveControllerHost {
|
6
|
-
shadowRoot?: ShadowRoot | null;
|
7
|
-
}
|
8
|
-
export interface LayoutDisplayConfig {
|
9
|
-
display: ItemDisplayLayout;
|
10
|
-
density: ItemDisplayDensity;
|
11
|
-
imageSize: ItemDisplayImageSize;
|
12
|
-
}
|
13
|
-
export interface ItemLayoutOptions {
|
14
|
-
elementPrefix: string;
|
15
|
-
renderingFunction: () => ItemRenderingFunction<AnyItem> | undefined;
|
16
|
-
content: () => ParentNode | undefined;
|
17
|
-
layoutConfig: () => LayoutDisplayConfig;
|
18
|
-
itemClasses: () => string;
|
19
|
-
}
|
20
|
-
/**
|
21
|
-
* A reactive controller that manages layout creation and class application for item components.
|
22
|
-
*/
|
23
|
-
export declare class ItemLayoutController implements ReactiveController {
|
24
|
-
private host;
|
25
|
-
private options;
|
26
|
-
private layoutInstance;
|
27
|
-
constructor(host: ItemLayoutHost & LitElement, options: ItemLayoutOptions);
|
28
|
-
hostConnected(): void;
|
29
|
-
hostUpdated(): void;
|
30
|
-
/**
|
31
|
-
* Gets the current layout instance
|
32
|
-
*/
|
33
|
-
getLayout(): ItemLayout | null;
|
34
|
-
/**
|
35
|
-
* Gets combined layout and extra classes
|
36
|
-
*/
|
37
|
-
getCombinedClasses(additionalContent?: string): string[];
|
38
|
-
/**
|
39
|
-
* Applies layout classes to a specific element (useful for custom rendering)
|
40
|
-
*/
|
41
|
-
applyLayoutClassesToElement(element: HTMLElement, additionalContent?: string): void;
|
42
|
-
private applyLayoutClasses;
|
43
|
-
private createLayout;
|
44
|
-
private hasCustomRenderFunction;
|
45
|
-
private addClassesToElements;
|
46
|
-
private observeAndApplyClasses;
|
47
|
-
}
|
File without changes
|
File without changes
|
File without changes
|