@coveo/atomic 3.31.2-pre.ebf2a83c47 → 3.31.2-pre.fd4a2e6b54
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/atomic.esm.js.map +1 -1
- package/dist/atomic/components/_index.d.ts +0 -2
- package/dist/atomic/components/_index.js +0 -1
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-interface/analytics-config.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-interface/atomic-commerce-interface.js +6 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.js +6 -1
- package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +149 -0
- package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.tw.css.js +3 -0
- package/dist/atomic/components/components/commerce/atomic-product-template/atomic-product-template.js +1 -0
- package/dist/atomic/components/components/commerce/index.js +1 -0
- package/dist/atomic/components/components/commerce/lazy-index.js +1 -0
- package/dist/atomic/components/components/common/interface/analytics-config.js +38 -0
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/components/stencil-facet-show-more-less.js +7 -1
- package/dist/atomic/components/stencil-facet-show-more-less.js.map +1 -1
- package/dist/atomic/p-1e0f2e91.entry.js +2 -0
- package/dist/atomic/{p-8bb323e8.entry.js.map → p-1e0f2e91.entry.js.map} +1 -1
- package/dist/atomic/p-29c272bb.entry.js +2 -0
- package/dist/atomic/{p-4e77fe24.entry.js.map → p-29c272bb.entry.js.map} +1 -1
- package/dist/atomic/{p-29f21264.entry.js → p-34c06911.entry.js} +2 -2
- package/dist/atomic/p-417b1b64.js +2 -0
- package/dist/atomic/{p-c100197d.js.map → p-417b1b64.js.map} +1 -1
- package/dist/atomic/p-44a3c052.entry.js +2 -0
- package/dist/atomic/{p-e215ba76.entry.js.map → p-44a3c052.entry.js.map} +1 -1
- package/dist/atomic/{p-43188440.entry.js → p-5876976b.entry.js} +2 -2
- package/dist/atomic/p-91477908.entry.js +2 -0
- package/dist/atomic/{p-3f881919.entry.js.map → p-91477908.entry.js.map} +1 -1
- package/dist/atomic/p-e8ba8acd.entry.js +2 -0
- package/dist/atomic/{p-0873c1b8.entry.js.map → p-e8ba8acd.entry.js.map} +1 -1
- package/dist/atomic/{p-f699c143.entry.js → p-ec18a965.entry.js} +2 -2
- package/dist/atomic/{p-a55cd386.js → p-fcc41f67.js} +2 -2
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/{analytics-config-8482ce49.js → analytics-config-c1fcfc7f.js} +2 -2
- package/dist/cjs/{analytics-config-8482ce49.js.map → analytics-config-c1fcfc7f.js.map} +1 -1
- package/dist/cjs/atomic-category-facet.cjs.entry.js +1 -2
- package/dist/cjs/atomic-category-facet.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-color-facet.cjs.entry.js +1 -2
- package/dist/cjs/atomic-color-facet.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-commerce-category-facet_4.cjs.entry.js +1 -2
- package/dist/cjs/atomic-commerce-category-facet_4.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-facet.cjs.entry.js +1 -2
- package/dist/cjs/atomic-facet.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-facet.cjs.entry.js +1 -2
- package/dist/cjs/atomic-insight-facet.cjs.entry.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/atomic-search-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic.cjs.js +1 -1
- package/dist/cjs/index-757bc886.js +0 -4
- package/dist/cjs/{stencil-facet-show-more-less-21d22973.js → stencil-facet-show-more-less-541e1544.js} +10 -4
- package/dist/cjs/stencil-facet-show-more-less-541e1544.js.map +1 -0
- package/dist/cjs/version.cjs.js +2 -2
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/{analytics-config-d42bd300.js → analytics-config-8265b87c.js} +2 -2
- package/dist/esm/{analytics-config-d42bd300.js.map → analytics-config-8265b87c.js.map} +1 -1
- package/dist/esm/atomic-category-facet.entry.js +1 -2
- package/dist/esm/atomic-category-facet.entry.js.map +1 -1
- package/dist/esm/atomic-color-facet.entry.js +1 -2
- package/dist/esm/atomic-color-facet.entry.js.map +1 -1
- package/dist/esm/atomic-commerce-category-facet_4.entry.js +1 -2
- package/dist/esm/atomic-commerce-category-facet_4.entry.js.map +1 -1
- package/dist/esm/atomic-facet.entry.js +1 -2
- package/dist/esm/atomic-facet.entry.js.map +1 -1
- package/dist/esm/atomic-insight-facet.entry.js +1 -2
- package/dist/esm/atomic-insight-facet.entry.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/atomic-search-interface.entry.js +1 -1
- package/dist/esm/atomic.js +1 -1
- package/dist/esm/index-3f35faca.js +0 -4
- package/dist/esm/{stencil-facet-show-more-less-4b023ee3.js → stencil-facet-show-more-less-1198472f.js} +8 -2
- package/dist/esm/stencil-facet-show-more-less-1198472f.js.map +1 -0
- package/dist/esm/version.js +2 -2
- package/dist/types/components/commerce/atomic-product-description/atomic-product-description.d.ts +21 -10
- package/dist/types/components/commerce/atomic-product-template/atomic-product-template.d.ts +1 -0
- package/dist/types/components/commerce/index.d.ts +1 -0
- package/dist/types/components.d.ts +0 -51
- package/docs/atomic-docs.json +1 -124
- package/package.json +3 -3
- package/dist/atomic/components/atomic-product-description.d.ts +0 -11
- package/dist/atomic/components/atomic-product-description.js +0 -153
- package/dist/atomic/components/atomic-product-description.js.map +0 -1
- package/dist/atomic/components/plus.js +0 -10
- package/dist/atomic/components/plus.js.map +0 -1
- package/dist/atomic/p-0873c1b8.entry.js +0 -2
- package/dist/atomic/p-3f881919.entry.js +0 -2
- package/dist/atomic/p-4e77fe24.entry.js +0 -2
- package/dist/atomic/p-8bb323e8.entry.js +0 -2
- package/dist/atomic/p-8f20d930.js +0 -2
- package/dist/atomic/p-8f20d930.js.map +0 -1
- package/dist/atomic/p-c100197d.js +0 -2
- package/dist/atomic/p-e215ba76.entry.js +0 -2
- package/dist/atomic/p-f2d31b97.entry.js +0 -2
- package/dist/atomic/p-f2d31b97.entry.js.map +0 -1
- package/dist/cjs/atomic-product-description.cjs.entry.js +0 -141
- package/dist/cjs/atomic-product-description.cjs.entry.js.map +0 -1
- package/dist/cjs/plus-07843914.js +0 -13
- package/dist/cjs/plus-07843914.js.map +0 -1
- package/dist/cjs/stencil-facet-show-more-less-21d22973.js.map +0 -1
- package/dist/esm/atomic-product-description.entry.js +0 -137
- package/dist/esm/atomic-product-description.entry.js.map +0 -1
- package/dist/esm/plus-00840ff6.js +0 -10
- package/dist/esm/plus-00840ff6.js.map +0 -1
- package/dist/esm/stencil-facet-show-more-less-4b023ee3.js.map +0 -1
- /package/dist/atomic/{p-29f21264.entry.js.map → p-34c06911.entry.js.map} +0 -0
- /package/dist/atomic/{p-43188440.entry.js.map → p-5876976b.entry.js.map} +0 -0
- /package/dist/atomic/{p-f699c143.entry.js.map → p-ec18a965.entry.js.map} +0 -0
- /package/dist/atomic/{p-a55cd386.js.map → p-fcc41f67.js.map} +0 -0
|
@@ -20,7 +20,6 @@ import { InsightInitializationOptions } from "./components/insight/atomic-insigh
|
|
|
20
20
|
import { InsightStore } from "./components/insight/atomic-insight-interface/store";
|
|
21
21
|
import { Actions, InsightResultActionClickedEvent } from "./components/insight/atomic-insight-result-action/atomic-insight-result-action";
|
|
22
22
|
import { InsightResultAttachToCaseEvent } from "./components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action";
|
|
23
|
-
import { TruncateAfter } from "./components/common/expandable-text/stencil-expandable-text";
|
|
24
23
|
import { ItemDisplayImageSize as ItemDisplayImageSize1 } from "./components.d";
|
|
25
24
|
import { RecommendationEngine, InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "@coveo/headless/recommendation";
|
|
26
25
|
import { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface";
|
|
@@ -47,7 +46,6 @@ export { InsightInitializationOptions } from "./components/insight/atomic-insigh
|
|
|
47
46
|
export { InsightStore } from "./components/insight/atomic-insight-interface/store";
|
|
48
47
|
export { Actions, InsightResultActionClickedEvent } from "./components/insight/atomic-insight-result-action/atomic-insight-result-action";
|
|
49
48
|
export { InsightResultAttachToCaseEvent } from "./components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action";
|
|
50
|
-
export { TruncateAfter } from "./components/common/expandable-text/stencil-expandable-text";
|
|
51
49
|
export { ItemDisplayImageSize as ItemDisplayImageSize1 } from "./components.d";
|
|
52
50
|
export { RecommendationEngine, InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "@coveo/headless/recommendation";
|
|
53
51
|
export { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface";
|
|
@@ -1593,23 +1591,6 @@ export namespace Components {
|
|
|
1593
1591
|
*/
|
|
1594
1592
|
interface AtomicPopover {
|
|
1595
1593
|
}
|
|
1596
|
-
/**
|
|
1597
|
-
* @alpha The `atomic-product-description` component renders the description of a product.
|
|
1598
|
-
*/
|
|
1599
|
-
interface AtomicProductDescription {
|
|
1600
|
-
/**
|
|
1601
|
-
* The name of the description field to use.
|
|
1602
|
-
*/
|
|
1603
|
-
"field": 'ec_description' | 'ec_shortdesc';
|
|
1604
|
-
/**
|
|
1605
|
-
* Whether the description should be collapsible after being expanded.
|
|
1606
|
-
*/
|
|
1607
|
-
"isCollapsible": boolean;
|
|
1608
|
-
/**
|
|
1609
|
-
* The number of lines after which the product description should be truncated. A value of "none" will disable truncation.
|
|
1610
|
-
*/
|
|
1611
|
-
"truncateAfter": TruncateAfter;
|
|
1612
|
-
}
|
|
1613
1594
|
/**
|
|
1614
1595
|
* The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
|
|
1615
1596
|
* The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
|
|
@@ -4115,15 +4096,6 @@ declare global {
|
|
|
4115
4096
|
prototype: HTMLAtomicPopoverElement;
|
|
4116
4097
|
new (): HTMLAtomicPopoverElement;
|
|
4117
4098
|
};
|
|
4118
|
-
/**
|
|
4119
|
-
* @alpha The `atomic-product-description` component renders the description of a product.
|
|
4120
|
-
*/
|
|
4121
|
-
interface HTMLAtomicProductDescriptionElement extends Components.AtomicProductDescription, HTMLStencilElement {
|
|
4122
|
-
}
|
|
4123
|
-
var HTMLAtomicProductDescriptionElement: {
|
|
4124
|
-
prototype: HTMLAtomicProductDescriptionElement;
|
|
4125
|
-
new (): HTMLAtomicProductDescriptionElement;
|
|
4126
|
-
};
|
|
4127
4099
|
/**
|
|
4128
4100
|
* The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
|
|
4129
4101
|
* The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
|
|
@@ -5225,7 +5197,6 @@ declare global {
|
|
|
5225
5197
|
"atomic-numeric-range": HTMLAtomicNumericRangeElement;
|
|
5226
5198
|
"atomic-pager": HTMLAtomicPagerElement;
|
|
5227
5199
|
"atomic-popover": HTMLAtomicPopoverElement;
|
|
5228
|
-
"atomic-product-description": HTMLAtomicProductDescriptionElement;
|
|
5229
5200
|
"atomic-product-field-condition": HTMLAtomicProductFieldConditionElement;
|
|
5230
5201
|
"atomic-product-image": HTMLAtomicProductImageElement;
|
|
5231
5202
|
"atomic-product-rating": HTMLAtomicProductRatingElement;
|
|
@@ -6788,23 +6759,6 @@ declare namespace LocalJSX {
|
|
|
6788
6759
|
*/
|
|
6789
6760
|
interface AtomicPopover {
|
|
6790
6761
|
}
|
|
6791
|
-
/**
|
|
6792
|
-
* @alpha The `atomic-product-description` component renders the description of a product.
|
|
6793
|
-
*/
|
|
6794
|
-
interface AtomicProductDescription {
|
|
6795
|
-
/**
|
|
6796
|
-
* The name of the description field to use.
|
|
6797
|
-
*/
|
|
6798
|
-
"field"?: 'ec_description' | 'ec_shortdesc';
|
|
6799
|
-
/**
|
|
6800
|
-
* Whether the description should be collapsible after being expanded.
|
|
6801
|
-
*/
|
|
6802
|
-
"isCollapsible"?: boolean;
|
|
6803
|
-
/**
|
|
6804
|
-
* The number of lines after which the product description should be truncated. A value of "none" will disable truncation.
|
|
6805
|
-
*/
|
|
6806
|
-
"truncateAfter"?: TruncateAfter;
|
|
6807
|
-
}
|
|
6808
6762
|
/**
|
|
6809
6763
|
* The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
|
|
6810
6764
|
* The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
|
|
@@ -8445,7 +8399,6 @@ declare namespace LocalJSX {
|
|
|
8445
8399
|
"atomic-numeric-range": AtomicNumericRange;
|
|
8446
8400
|
"atomic-pager": AtomicPager;
|
|
8447
8401
|
"atomic-popover": AtomicPopover;
|
|
8448
|
-
"atomic-product-description": AtomicProductDescription;
|
|
8449
8402
|
"atomic-product-field-condition": AtomicProductFieldCondition;
|
|
8450
8403
|
"atomic-product-image": AtomicProductImage;
|
|
8451
8404
|
"atomic-product-rating": AtomicProductRating;
|
|
@@ -8763,10 +8716,6 @@ declare module "@stencil/core" {
|
|
|
8763
8716
|
* The `atomic-popover` component displays any facet as a popover menu.
|
|
8764
8717
|
*/
|
|
8765
8718
|
"atomic-popover": LocalJSX.AtomicPopover & JSXBase.HTMLAttributes<HTMLAtomicPopoverElement>;
|
|
8766
|
-
/**
|
|
8767
|
-
* @alpha The `atomic-product-description` component renders the description of a product.
|
|
8768
|
-
*/
|
|
8769
|
-
"atomic-product-description": LocalJSX.AtomicProductDescription & JSXBase.HTMLAttributes<HTMLAtomicProductDescriptionElement>;
|
|
8770
8719
|
/**
|
|
8771
8720
|
* The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
|
|
8772
8721
|
* The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
|
package/docs/atomic-docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2025-07-
|
|
2
|
+
"timestamp": "2025-07-30T21:47:13",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.20.0",
|
|
@@ -6593,124 +6593,6 @@
|
|
|
6593
6593
|
]
|
|
6594
6594
|
}
|
|
6595
6595
|
},
|
|
6596
|
-
{
|
|
6597
|
-
"filePath": "src/components/commerce/atomic-product-description/atomic-product-description.tsx",
|
|
6598
|
-
"encapsulation": "none",
|
|
6599
|
-
"tag": "atomic-product-description",
|
|
6600
|
-
"docs": "",
|
|
6601
|
-
"docsTags": [
|
|
6602
|
-
{
|
|
6603
|
-
"name": "alpha",
|
|
6604
|
-
"text": "The `atomic-product-description` component renders the description of a product."
|
|
6605
|
-
}
|
|
6606
|
-
],
|
|
6607
|
-
"usage": {},
|
|
6608
|
-
"props": [
|
|
6609
|
-
{
|
|
6610
|
-
"name": "field",
|
|
6611
|
-
"type": "\"ec_description\" | \"ec_shortdesc\"",
|
|
6612
|
-
"complexType": {
|
|
6613
|
-
"original": "'ec_description' | 'ec_shortdesc'",
|
|
6614
|
-
"resolved": "\"ec_description\" | \"ec_shortdesc\"",
|
|
6615
|
-
"references": {}
|
|
6616
|
-
},
|
|
6617
|
-
"mutable": false,
|
|
6618
|
-
"attr": "field",
|
|
6619
|
-
"reflectToAttr": false,
|
|
6620
|
-
"docs": "The name of the description field to use.",
|
|
6621
|
-
"docsTags": [],
|
|
6622
|
-
"default": "'ec_shortdesc'",
|
|
6623
|
-
"values": [
|
|
6624
|
-
{
|
|
6625
|
-
"value": "ec_description",
|
|
6626
|
-
"type": "string"
|
|
6627
|
-
},
|
|
6628
|
-
{
|
|
6629
|
-
"value": "ec_shortdesc",
|
|
6630
|
-
"type": "string"
|
|
6631
|
-
}
|
|
6632
|
-
],
|
|
6633
|
-
"optional": false,
|
|
6634
|
-
"required": false
|
|
6635
|
-
},
|
|
6636
|
-
{
|
|
6637
|
-
"name": "isCollapsible",
|
|
6638
|
-
"type": "boolean",
|
|
6639
|
-
"complexType": {
|
|
6640
|
-
"original": "boolean",
|
|
6641
|
-
"resolved": "boolean",
|
|
6642
|
-
"references": {}
|
|
6643
|
-
},
|
|
6644
|
-
"mutable": false,
|
|
6645
|
-
"attr": "is-collapsible",
|
|
6646
|
-
"reflectToAttr": false,
|
|
6647
|
-
"docs": "Whether the description should be collapsible after being expanded.",
|
|
6648
|
-
"docsTags": [],
|
|
6649
|
-
"default": "true",
|
|
6650
|
-
"values": [
|
|
6651
|
-
{
|
|
6652
|
-
"type": "boolean"
|
|
6653
|
-
}
|
|
6654
|
-
],
|
|
6655
|
-
"optional": false,
|
|
6656
|
-
"required": false
|
|
6657
|
-
},
|
|
6658
|
-
{
|
|
6659
|
-
"name": "truncateAfter",
|
|
6660
|
-
"type": "\"1\" | \"2\" | \"3\" | \"4\" | \"none\"",
|
|
6661
|
-
"complexType": {
|
|
6662
|
-
"original": "TruncateAfter",
|
|
6663
|
-
"resolved": "\"1\" | \"2\" | \"3\" | \"4\" | \"none\"",
|
|
6664
|
-
"references": {
|
|
6665
|
-
"TruncateAfter": {
|
|
6666
|
-
"location": "import",
|
|
6667
|
-
"path": "../../common/expandable-text/stencil-expandable-text",
|
|
6668
|
-
"id": "src/components/common/expandable-text/stencil-expandable-text.tsx::TruncateAfter"
|
|
6669
|
-
}
|
|
6670
|
-
}
|
|
6671
|
-
},
|
|
6672
|
-
"mutable": false,
|
|
6673
|
-
"attr": "truncate-after",
|
|
6674
|
-
"reflectToAttr": false,
|
|
6675
|
-
"docs": "The number of lines after which the product description should be truncated. A value of \"none\" will disable truncation.",
|
|
6676
|
-
"docsTags": [],
|
|
6677
|
-
"default": "'2'",
|
|
6678
|
-
"values": [
|
|
6679
|
-
{
|
|
6680
|
-
"value": "1",
|
|
6681
|
-
"type": "string"
|
|
6682
|
-
},
|
|
6683
|
-
{
|
|
6684
|
-
"value": "2",
|
|
6685
|
-
"type": "string"
|
|
6686
|
-
},
|
|
6687
|
-
{
|
|
6688
|
-
"value": "3",
|
|
6689
|
-
"type": "string"
|
|
6690
|
-
},
|
|
6691
|
-
{
|
|
6692
|
-
"value": "4",
|
|
6693
|
-
"type": "string"
|
|
6694
|
-
},
|
|
6695
|
-
{
|
|
6696
|
-
"value": "none",
|
|
6697
|
-
"type": "string"
|
|
6698
|
-
}
|
|
6699
|
-
],
|
|
6700
|
-
"optional": false,
|
|
6701
|
-
"required": false
|
|
6702
|
-
}
|
|
6703
|
-
],
|
|
6704
|
-
"methods": [],
|
|
6705
|
-
"events": [],
|
|
6706
|
-
"listeners": [],
|
|
6707
|
-
"styles": [],
|
|
6708
|
-
"slots": [],
|
|
6709
|
-
"parts": [],
|
|
6710
|
-
"dependents": [],
|
|
6711
|
-
"dependencies": [],
|
|
6712
|
-
"dependencyGraph": {}
|
|
6713
|
-
},
|
|
6714
6596
|
{
|
|
6715
6597
|
"filePath": "src/components/commerce/atomic-product-field-condition/atomic-product-field-condition.tsx",
|
|
6716
6598
|
"encapsulation": "none",
|
|
@@ -17809,11 +17691,6 @@
|
|
|
17809
17691
|
"docstring": "",
|
|
17810
17692
|
"path": "src/components/common/item-list/stencil-item-list-common.tsx"
|
|
17811
17693
|
},
|
|
17812
|
-
"src/components/common/expandable-text/stencil-expandable-text.tsx::TruncateAfter": {
|
|
17813
|
-
"declaration": "export type TruncateAfter = 'none' | '1' | '2' | '3' | '4';",
|
|
17814
|
-
"docstring": "",
|
|
17815
|
-
"path": "src/components/common/expandable-text/stencil-expandable-text.tsx"
|
|
17816
|
-
},
|
|
17817
17694
|
"src/components.d.ts::ItemDisplayImageSize": {
|
|
17818
17695
|
"declaration": "any",
|
|
17819
17696
|
"docstring": "",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/atomic",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.31.2-pre.
|
|
4
|
+
"version": "3.31.2-pre.fd4a2e6b54",
|
|
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": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@lit/context": "1.1.6",
|
|
74
74
|
"@coveo/bueno": "1.0.24",
|
|
75
|
-
"@coveo/headless": "3.27.
|
|
75
|
+
"@coveo/headless": "3.27.8-pre.fd4a2e6b54",
|
|
76
76
|
"@popperjs/core": "2.11.8",
|
|
77
77
|
"@salesforce-ux/design-system": "2.27.2",
|
|
78
78
|
"@stencil/core": "4.20.0",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
},
|
|
159
159
|
"peerDependencies": {
|
|
160
160
|
"@coveo/bueno": "1.0.24",
|
|
161
|
-
"@coveo/headless": "3.27.
|
|
161
|
+
"@coveo/headless": "3.27.8-pre.fd4a2e6b54",
|
|
162
162
|
"typescript": ">=5.0.0"
|
|
163
163
|
},
|
|
164
164
|
"peerDependenciesMeta": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../../types/components";
|
|
2
|
-
|
|
3
|
-
interface AtomicProductDescription extends Components.AtomicProductDescription, HTMLElement {}
|
|
4
|
-
export const AtomicProductDescription: {
|
|
5
|
-
prototype: AtomicProductDescription;
|
|
6
|
-
new (): AtomicProductDescription;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
2
|
-
import { Schema, StringValue } from '@coveo/bueno';
|
|
3
|
-
import { I as InitializeBindings, H as Hidden } from './initialization-utils.js';
|
|
4
|
-
import { M as MinusIcon, P as PlusIcon } from './plus.js';
|
|
5
|
-
import { B as Button } from './stencil-button.js';
|
|
6
|
-
import { P as ProductContext } from './stencil-product-template-decorators.js';
|
|
7
|
-
|
|
8
|
-
const getLineClampClass = (truncateAfter) => {
|
|
9
|
-
const lineClampMap = {
|
|
10
|
-
none: 'line-clamp-none',
|
|
11
|
-
1: 'line-clamp-1',
|
|
12
|
-
2: 'line-clamp-2',
|
|
13
|
-
3: 'line-clamp-3',
|
|
14
|
-
4: 'line-clamp-4',
|
|
15
|
-
};
|
|
16
|
-
return lineClampMap[truncateAfter] || 'line-clamp-2';
|
|
17
|
-
};
|
|
18
|
-
const renderShowHideButton = (isExpanded, isTruncated, isCollapsible, onToggleExpand, showMoreLabel, showLessLabel) => {
|
|
19
|
-
let buttonClass = 'expandable-text-button p-1 text-xs leading-[calc(1/.75)]';
|
|
20
|
-
if (!isTruncated && !isExpanded) {
|
|
21
|
-
buttonClass += ' invisible';
|
|
22
|
-
}
|
|
23
|
-
else if (!isCollapsible && !isTruncated && isExpanded) {
|
|
24
|
-
buttonClass += ' hidden';
|
|
25
|
-
}
|
|
26
|
-
const label = isExpanded ? showLessLabel : showMoreLabel;
|
|
27
|
-
return (h(Button, { style: "text-primary", class: buttonClass, title: label, onClick: onToggleExpand },
|
|
28
|
-
h("atomic-icon", { icon: isExpanded ? MinusIcon : PlusIcon, class: "mx-1 w-2 align-baseline" }),
|
|
29
|
-
label));
|
|
30
|
-
};
|
|
31
|
-
const ExpandableText = ({ isExpanded, isTruncated, truncateAfter, onToggleExpand, showMoreLabel, showLessLabel, isCollapsible = false, }, children) => {
|
|
32
|
-
return (h("div", { class: "flex flex-col items-start" },
|
|
33
|
-
h("div", { part: "expandable-text", class: `expandable-text ${!isExpanded ? getLineClampClass(truncateAfter) : ''} min-lines-${truncateAfter}` }, children),
|
|
34
|
-
renderShowHideButton(isExpanded, isTruncated, isCollapsible, onToggleExpand, showMoreLabel, showLessLabel)));
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const atomicProductDescriptionCss = "/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */.expandable-text{line-height:var(--line-height)}.min-lines-1{min-height:calc(var(--line-height) * 1)}.min-lines-2{min-height:calc(var(--line-height) * 2)}.min-lines-3{min-height:calc(var(--line-height) * 3)}.min-lines-4{min-height:calc(var(--line-height) * 4)}";
|
|
38
|
-
const AtomicProductDescriptionStyle0 = atomicProductDescriptionCss;
|
|
39
|
-
|
|
40
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
41
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
42
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
43
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
44
|
-
else
|
|
45
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
46
|
-
if (d = decorators[i])
|
|
47
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
48
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
49
|
-
};
|
|
50
|
-
const AtomicProductDescription$1 = /*@__PURE__*/ proxyCustomElement(class AtomicProductDescription extends HTMLElement {
|
|
51
|
-
constructor() {
|
|
52
|
-
super();
|
|
53
|
-
this.__registerHost();
|
|
54
|
-
this.isExpanded = false;
|
|
55
|
-
this.isTruncated = false;
|
|
56
|
-
/**
|
|
57
|
-
* The number of lines after which the product description should be truncated. A value of "none" will disable truncation.
|
|
58
|
-
*/
|
|
59
|
-
this.truncateAfter = '2';
|
|
60
|
-
/**
|
|
61
|
-
* The name of the description field to use.
|
|
62
|
-
*/
|
|
63
|
-
this.field = 'ec_shortdesc';
|
|
64
|
-
/**
|
|
65
|
-
* Whether the description should be collapsible after being expanded.
|
|
66
|
-
*/
|
|
67
|
-
this.isCollapsible = true;
|
|
68
|
-
this.isExpanded = false;
|
|
69
|
-
this.isTruncated = false;
|
|
70
|
-
this.truncateAfter = '2';
|
|
71
|
-
this.field = 'ec_shortdesc';
|
|
72
|
-
this.isCollapsible = true;
|
|
73
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
74
|
-
if (this.descriptionText &&
|
|
75
|
-
this.descriptionText.scrollHeight > this.descriptionText.clientHeight) {
|
|
76
|
-
this.isTruncated = true;
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this.isTruncated = false;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
this.validateProps();
|
|
83
|
-
}
|
|
84
|
-
validateProps() {
|
|
85
|
-
new Schema({
|
|
86
|
-
truncateAfter: new StringValue({
|
|
87
|
-
constrainTo: ['none', '1', '2', '3', '4'],
|
|
88
|
-
}),
|
|
89
|
-
field: new StringValue({
|
|
90
|
-
constrainTo: ['ec_shortdesc', 'ec_description'],
|
|
91
|
-
}),
|
|
92
|
-
}).validate({
|
|
93
|
-
truncateAfter: this.truncateAfter,
|
|
94
|
-
field: this.field,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
componentDidLoad() {
|
|
98
|
-
this.descriptionText = this.hostElement.querySelector('.expandable-text');
|
|
99
|
-
if (this.descriptionText) {
|
|
100
|
-
this.resizeObserver.observe(this.descriptionText);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
onToggleExpand(e) {
|
|
104
|
-
if (e) {
|
|
105
|
-
e.stopPropagation();
|
|
106
|
-
}
|
|
107
|
-
this.isExpanded = !this.isExpanded;
|
|
108
|
-
}
|
|
109
|
-
disconnectedCallback() {
|
|
110
|
-
this.resizeObserver.disconnect();
|
|
111
|
-
}
|
|
112
|
-
render() {
|
|
113
|
-
const productDescription = this.product[this.field] ?? null;
|
|
114
|
-
if (!productDescription) {
|
|
115
|
-
return h(Hidden, null);
|
|
116
|
-
}
|
|
117
|
-
return (h(ExpandableText, { isExpanded: this.isExpanded, isTruncated: this.isTruncated, truncateAfter: this.truncateAfter, onToggleExpand: (e) => this.onToggleExpand(e), showMoreLabel: this.bindings.i18n.t('show-more'), showLessLabel: this.bindings.i18n.t('show-less'), isCollapsible: this.isCollapsible }, h("atomic-product-text", { field: this.field })));
|
|
118
|
-
}
|
|
119
|
-
get hostElement() { return this; }
|
|
120
|
-
static get style() { return AtomicProductDescriptionStyle0; }
|
|
121
|
-
}, [0, "atomic-product-description", {
|
|
122
|
-
"truncateAfter": [1, "truncate-after"],
|
|
123
|
-
"field": [1],
|
|
124
|
-
"isCollapsible": [4, "is-collapsible"],
|
|
125
|
-
"isExpanded": [32],
|
|
126
|
-
"isTruncated": [32]
|
|
127
|
-
}]);
|
|
128
|
-
__decorate([
|
|
129
|
-
InitializeBindings()
|
|
130
|
-
], AtomicProductDescription$1.prototype, "bindings", void 0);
|
|
131
|
-
__decorate([
|
|
132
|
-
ProductContext()
|
|
133
|
-
], AtomicProductDescription$1.prototype, "product", void 0);
|
|
134
|
-
function defineCustomElement$1() {
|
|
135
|
-
if (typeof customElements === "undefined") {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const components = ["atomic-product-description"];
|
|
139
|
-
components.forEach(tagName => { switch (tagName) {
|
|
140
|
-
case "atomic-product-description":
|
|
141
|
-
if (!customElements.get(tagName)) {
|
|
142
|
-
customElements.define(tagName, AtomicProductDescription$1);
|
|
143
|
-
}
|
|
144
|
-
break;
|
|
145
|
-
} });
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const AtomicProductDescription = AtomicProductDescription$1;
|
|
149
|
-
const defineCustomElement = defineCustomElement$1;
|
|
150
|
-
|
|
151
|
-
export { AtomicProductDescription, defineCustomElement };
|
|
152
|
-
|
|
153
|
-
//# sourceMappingURL=atomic-product-description.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"atomic-product-description.js","mappings":"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","names":["AtomicProductDescription"],"sources":["src/components/common/expandable-text/stencil-expandable-text.tsx","src/components/commerce/atomic-product-description/atomic-product-description.pcss?tag=atomic-product-description","src/components/commerce/atomic-product-description/atomic-product-description.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport MinusIcon from '../../../images/minus.svg';\nimport PlusIcon from '../../../images/plus.svg';\nimport {Button} from '../stencil-button';\n\nexport type TruncateAfter = 'none' | '1' | '2' | '3' | '4';\n\ninterface ExpandableTextProps {\n isExpanded: boolean;\n isTruncated: boolean;\n isCollapsible?: boolean;\n truncateAfter: TruncateAfter;\n onToggleExpand: (e: MouseEvent | undefined) => void;\n showMoreLabel: string;\n showLessLabel: string;\n}\n\nconst getLineClampClass = (truncateAfter: TruncateAfter) => {\n const lineClampMap: Record<TruncateAfter, string> = {\n none: 'line-clamp-none',\n 1: 'line-clamp-1',\n 2: 'line-clamp-2',\n 3: 'line-clamp-3',\n 4: 'line-clamp-4',\n };\n return lineClampMap[truncateAfter] || 'line-clamp-2';\n};\n\nconst renderShowHideButton = (\n isExpanded: boolean,\n isTruncated: boolean,\n isCollapsible: boolean,\n onToggleExpand: (e?: MouseEvent) => void,\n showMoreLabel: string,\n showLessLabel: string\n) => {\n let buttonClass = 'expandable-text-button p-1 text-xs leading-[calc(1/.75)]';\n if (!isTruncated && !isExpanded) {\n buttonClass += ' invisible';\n } else if (!isCollapsible && !isTruncated && isExpanded) {\n buttonClass += ' hidden';\n }\n\n const label = isExpanded ? showLessLabel : showMoreLabel;\n\n return (\n <Button\n style=\"text-primary\"\n class={buttonClass}\n title={label}\n onClick={onToggleExpand}\n >\n <atomic-icon\n icon={isExpanded ? MinusIcon : PlusIcon}\n class=\"mx-1 w-2 align-baseline\"\n ></atomic-icon>\n {label}\n </Button>\n );\n};\n\nexport const ExpandableText: FunctionalComponent<ExpandableTextProps> = (\n {\n isExpanded,\n isTruncated,\n truncateAfter,\n onToggleExpand,\n showMoreLabel,\n showLessLabel,\n isCollapsible = false,\n },\n children\n) => {\n return (\n <div class=\"flex flex-col items-start\">\n <div\n part=\"expandable-text\"\n class={`expandable-text ${!isExpanded ? getLineClampClass(truncateAfter) : ''} min-lines-${truncateAfter}`}\n >\n {children}\n </div>\n {renderShowHideButton(\n isExpanded,\n isTruncated,\n isCollapsible,\n onToggleExpand,\n showMoreLabel,\n showLessLabel\n )}\n </div>\n );\n};\n","@import '../../common/expandable-text/expandable-text.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {Product} from '@coveo/headless/commerce';\nimport {Component, State, h, Element, Prop} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {\n ExpandableText,\n TruncateAfter,\n} from '../../common/expandable-text/stencil-expandable-text';\nimport {Hidden} from '../../common/stencil-hidden';\nimport {CommerceBindings} from '../atomic-commerce-interface/atomic-commerce-interface';\nimport {ProductContext} from '../product-template-component-utils/stencil-product-template-decorators';\n\n/**\n * @alpha\n * The `atomic-product-description` component renders the description of a product.\n */\n@Component({\n tag: 'atomic-product-description',\n styleUrl: 'atomic-product-description.pcss',\n shadow: false,\n})\nexport class AtomicProductDescription\n implements InitializableComponent<CommerceBindings>\n{\n @InitializeBindings() public bindings!: CommerceBindings;\n @ProductContext() private product!: Product;\n\n @Element() hostElement!: HTMLElement;\n\n public error!: Error;\n\n @State() private isExpanded = false;\n @State() private isTruncated = false;\n\n private descriptionText!: HTMLDivElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The number of lines after which the product description should be truncated. A value of \"none\" will disable truncation.\n */\n @Prop() public truncateAfter: TruncateAfter = '2';\n\n /**\n * The name of the description field to use.\n */\n @Prop() public field: 'ec_description' | 'ec_shortdesc' = 'ec_shortdesc';\n\n /**\n * Whether the description should be collapsible after being expanded.\n */\n @Prop() public isCollapsible = true;\n\n constructor() {\n this.resizeObserver = new ResizeObserver(() => {\n if (\n this.descriptionText &&\n this.descriptionText.scrollHeight > this.descriptionText.clientHeight\n ) {\n this.isTruncated = true;\n } else {\n this.isTruncated = false;\n }\n });\n this.validateProps();\n }\n\n private validateProps() {\n new Schema({\n truncateAfter: new StringValue({\n constrainTo: ['none', '1', '2', '3', '4'],\n }),\n field: new StringValue({\n constrainTo: ['ec_shortdesc', 'ec_description'],\n }),\n }).validate({\n truncateAfter: this.truncateAfter,\n field: this.field,\n });\n }\n\n componentDidLoad() {\n this.descriptionText = this.hostElement.querySelector(\n '.expandable-text'\n ) as HTMLDivElement;\n if (this.descriptionText) {\n this.resizeObserver.observe(this.descriptionText);\n }\n }\n\n private onToggleExpand(e?: MouseEvent) {\n if (e) {\n e.stopPropagation();\n }\n\n this.isExpanded = !this.isExpanded;\n }\n\n disconnectedCallback() {\n this.resizeObserver.disconnect();\n }\n\n public render() {\n const productDescription = this.product[this.field] ?? null;\n\n if (!productDescription) {\n return <Hidden />;\n }\n\n return (\n <ExpandableText\n isExpanded={this.isExpanded}\n isTruncated={this.isTruncated}\n truncateAfter={this.truncateAfter}\n onToggleExpand={(e) => this.onToggleExpand(e)}\n showMoreLabel={this.bindings.i18n.t('show-more')}\n showLessLabel={this.bindings.i18n.t('show-less')}\n isCollapsible={this.isCollapsible}\n >\n <atomic-product-text field={this.field}></atomic-product-text>\n </ExpandableText>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const MinusIcon = `<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m64 208h384v96h-384z"/></svg>`;
|
|
2
|
-
|
|
3
|
-
const PlusIcon = `<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<path d="M496 208H304V16h-96v192H16v96h192v192h96V304h192"/>
|
|
5
|
-
</svg>
|
|
6
|
-
`;
|
|
7
|
-
|
|
8
|
-
export { MinusIcon as M, PlusIcon as P };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=plus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"plus.js","mappings":";;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|