@coveo/atomic 3.64.1 → 3.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/custom-elements.json +236 -102
  2. package/dist/cjs/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.cjs +108 -13
  3. package/dist/cjs/components/commerce/product-list/product-template-provider.cjs +2 -0
  4. package/dist/cjs/components/common/atomic-modal/atomic-modal.cjs +8 -1
  5. package/dist/cjs/components/common/atomic-tab-popover/atomic-tab-popover.cjs +1 -0
  6. package/dist/cjs/components/common/facets/timeframe-facet-common.cjs +2 -2
  7. package/dist/cjs/components/common/generated-answer/generated-content/markdown-utils.cjs +1 -0
  8. package/dist/cjs/components/common/item-list/result-template-provider.cjs +1 -0
  9. package/dist/cjs/components/common/result-templates/result-template-controller.cjs +1 -0
  10. package/dist/cjs/components/common/suggestions/suggestion-manager.cjs +3 -0
  11. package/dist/cjs/components/insight/atomic-insight-facet/atomic-insight-facet.cjs +2 -2
  12. package/dist/cjs/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.cjs +1 -0
  13. package/dist/cjs/components/insight/atomic-insight-user-actions-session/atomic-insight-user-actions-session.cjs +1 -0
  14. package/dist/cjs/components/insight/atomic-insight-user-actions-session/user-action.cjs +1 -0
  15. package/dist/cjs/components/search/atomic-rating-range-facet/atomic-rating-range-facet.cjs +3 -4
  16. package/dist/cjs/components/search/atomic-search-box/atomic-search-box.cjs +107 -13
  17. package/dist/cjs/components/search/atomic-search-box-instant-results/atomic-search-box-instant-results.cjs +1 -0
  18. package/dist/cjs/global/environment.cjs +1 -1
  19. package/dist/cjs/utils/tailwind.global.tw.css.cjs +1 -1
  20. package/dist/cjs/versions.cjs +1 -1
  21. package/dist/esm/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +109 -14
  22. package/dist/esm/components/commerce/product-list/product-template-provider.js +2 -0
  23. package/dist/esm/components/common/atomic-modal/atomic-modal.js +9 -2
  24. package/dist/esm/components/common/atomic-tab-popover/atomic-tab-popover.js +1 -0
  25. package/dist/esm/components/common/facets/timeframe-facet-common.js +2 -2
  26. package/dist/esm/components/common/generated-answer/generated-content/markdown-utils.js +1 -0
  27. package/dist/esm/components/common/item-list/result-template-provider.js +1 -0
  28. package/dist/esm/components/common/result-templates/result-template-controller.js +1 -0
  29. package/dist/esm/components/common/suggestions/suggestion-manager.js +3 -0
  30. package/dist/esm/components/insight/atomic-insight-facet/atomic-insight-facet.js +2 -2
  31. package/dist/esm/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.js +1 -0
  32. package/dist/esm/components/insight/atomic-insight-user-actions-session/atomic-insight-user-actions-session.js +1 -0
  33. package/dist/esm/components/insight/atomic-insight-user-actions-session/user-action.js +1 -0
  34. package/dist/esm/components/search/atomic-rating-range-facet/atomic-rating-range-facet.js +3 -4
  35. package/dist/esm/components/search/atomic-search-box/atomic-search-box.js +109 -15
  36. package/dist/esm/components/search/atomic-search-box-instant-results/atomic-search-box-instant-results.js +1 -0
  37. package/dist/esm/global/environment.js +1 -1
  38. package/dist/esm/utils/tailwind.global.tw.css.js +1 -1
  39. package/dist/esm/versions.js +1 -1
  40. package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts +23 -6
  41. package/dist/types/components/commerce/product-list/product-template-provider.d.ts +2 -0
  42. package/dist/types/components/common/atomic-modal/atomic-modal.d.ts +6 -0
  43. package/dist/types/components/common/atomic-tab-popover/atomic-tab-popover.d.ts +1 -0
  44. package/dist/types/components/common/generated-answer/generated-content/markdown-utils.d.ts +1 -0
  45. package/dist/types/components/common/item-list/result-template-provider.d.ts +1 -0
  46. package/dist/types/components/common/layout/item-layout-sections.d.ts +1 -1
  47. package/dist/types/components/common/result-templates/result-template-controller.d.ts +1 -0
  48. package/dist/types/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.d.ts +1 -0
  49. package/dist/types/components/insight/atomic-insight-user-actions-session/atomic-insight-user-actions-session.d.ts +1 -0
  50. package/dist/types/components/insight/atomic-insight-user-actions-session/user-action.d.ts +1 -0
  51. package/dist/types/components/search/atomic-search-box/atomic-search-box.d.ts +23 -6
  52. package/dist/types/components/search/atomic-search-box-instant-results/atomic-search-box-instant-results.d.ts +1 -0
  53. package/package.json +26 -25
@@ -6818,21 +6818,25 @@
6818
6818
  "name": "recent-query-text-highlight"
6819
6819
  },
6820
6820
  {
6821
- "description": "The clear button above suggestions from the `atomic-commerce-search-box-recent-queries` component.",
6821
+ "description": "The clear button above suggestions from the `atomic-commerce-search-box-recent-queries` component, when `clear-recent-button-position` is `top`.",
6822
6822
  "name": "recent-query-title-item"
6823
6823
  },
6824
6824
  {
6825
- "description": "The contents of the clear button above suggestions from the `atomic-commerce-search-box-recent-queries` component.",
6825
+ "description": "The contents of the clear button above suggestions from the `atomic-commerce-search-box-recent-queries` component, when `clear-recent-button-position` is `top`.",
6826
6826
  "name": "recent-query-title-content"
6827
6827
  },
6828
6828
  {
6829
- "description": "The \"recent searches\" text of the clear button above suggestions from the `atomic-commerce-search-box-recent-queries` component.",
6829
+ "description": "The \"recent searches\" title above the recent queries from the `atomic-commerce-search-box-recent-queries` component.",
6830
6830
  "name": "recent-query-title"
6831
6831
  },
6832
6832
  {
6833
- "description": "The \"clear\" text of the clear button above suggestions from the `atomic-commerce-search-box-recent-queries` component.",
6833
+ "description": "The \"clear\" text of the clear button above suggestions from the `atomic-commerce-search-box-recent-queries` component, when `clear-recent-button-position` is `top`.",
6834
6834
  "name": "recent-query-clear"
6835
6835
  },
6836
+ {
6837
+ "description": "The button below suggestions to clear the recent queries from the `atomic-commerce-search-box-recent-queries` component, when `clear-recent-button-position` is `bottom`.",
6838
+ "name": "recent-query-clear-button"
6839
+ },
6836
6840
  {
6837
6841
  "description": "An instant product rendered by an `atomic-commerce-search-box-instant-products` component.",
6838
6842
  "name": "instant-results-item"
@@ -6853,6 +6857,14 @@
6853
6857
  }
6854
6858
  ],
6855
6859
  "members": [
6860
+ {
6861
+ "kind": "field",
6862
+ "name": "propsSchema",
6863
+ "privacy": "private",
6864
+ "static": true,
6865
+ "readonly": true,
6866
+ "default": "new Schema({ clearRecentButtonPosition: new StringValue({constrainTo: ['top', 'bottom']}), })"
6867
+ },
6856
6868
  {
6857
6869
  "kind": "field",
6858
6870
  "name": "shadowRootOptions",
@@ -6899,6 +6911,16 @@
6899
6911
  "name": "textAreaRef",
6900
6912
  "privacy": "private"
6901
6913
  },
6914
+ {
6915
+ "kind": "field",
6916
+ "name": "setLeftPanel",
6917
+ "privacy": "private"
6918
+ },
6919
+ {
6920
+ "kind": "field",
6921
+ "name": "setRightPanel",
6922
+ "privacy": "private"
6923
+ },
6902
6924
  {
6903
6925
  "kind": "field",
6904
6926
  "name": "searchBoxSuggestionEventsQueue",
@@ -7016,6 +7038,18 @@
7016
7038
  "attribute": "clear-filters",
7017
7039
  "reflects": true
7018
7040
  },
7041
+ {
7042
+ "kind": "field",
7043
+ "name": "clearRecentButtonPosition",
7044
+ "type": {
7045
+ "text": "'top' | 'bottom'"
7046
+ },
7047
+ "privacy": "public",
7048
+ "default": "'top'",
7049
+ "description": "The position of the option to clear the recent queries.\n\n- `top`: The option is the first suggestion, next to the \"Recent searches\" title.\n- `bottom`: The option is a button below the suggestions, so the arrow keys only navigate through the suggestions and the button is reached with the Tab key.\n\nIn the next major version of Atomic (v4), `bottom` will become the default behavior. To adopt it ahead of time, set this property to `bottom`.",
7050
+ "attribute": "clear-recent-button-position",
7051
+ "reflects": true
7052
+ },
7019
7053
  {
7020
7054
  "kind": "method",
7021
7055
  "name": "initialize",
@@ -7189,6 +7223,30 @@
7189
7223
  "name": "renderTextBox",
7190
7224
  "privacy": "private"
7191
7225
  },
7226
+ {
7227
+ "kind": "field",
7228
+ "name": "clearRecentQueriesElement",
7229
+ "privacy": "private",
7230
+ "readonly": true
7231
+ },
7232
+ {
7233
+ "kind": "method",
7234
+ "name": "renderRecentQueriesTitle",
7235
+ "privacy": "private"
7236
+ },
7237
+ {
7238
+ "kind": "method",
7239
+ "name": "renderClearRecentQueriesButton",
7240
+ "privacy": "private",
7241
+ "parameters": [
7242
+ {
7243
+ "name": "element",
7244
+ "type": {
7245
+ "text": "SearchBoxSuggestionElement"
7246
+ }
7247
+ }
7248
+ ]
7249
+ },
7192
7250
  {
7193
7251
  "kind": "method",
7194
7252
  "name": "renderSuggestions",
@@ -7335,6 +7393,15 @@
7335
7393
  "default": "true",
7336
7394
  "description": "Whether to clear all active query filters when the end user submits a new query from the search box.\nSetting this option to \"false\" is not recommended and can lead to an increasing number of queries returning no products.",
7337
7395
  "fieldName": "clearFilters"
7396
+ },
7397
+ {
7398
+ "name": "clear-recent-button-position",
7399
+ "type": {
7400
+ "text": "'top' | 'bottom'"
7401
+ },
7402
+ "default": "'top'",
7403
+ "description": "The position of the option to clear the recent queries.\n\n- `top`: The option is the first suggestion, next to the \"Recent searches\" title.\n- `bottom`: The option is a button below the suggestions, so the arrow keys only navigate through the suggestions and the button is reached with the Tab key.\n\nIn the next major version of Atomic (v4), `bottom` will become the default behavior. To adopt it ahead of time, set this property to `bottom`.",
7404
+ "fieldName": "clearRecentButtonPosition"
7338
7405
  }
7339
7406
  ],
7340
7407
  "superclass": {
@@ -42069,100 +42136,6 @@
42069
42136
  }
42070
42137
  ]
42071
42138
  },
42072
- {
42073
- "kind": "javascript-module",
42074
- "path": "src/components/search/atomic-result-section-excerpt/atomic-result-section-excerpt.ts",
42075
- "declarations": [
42076
- {
42077
- "kind": "class",
42078
- "description": "This section is intended to render an informative summary of the result's content\n\nBehavior:\n* Has a fixed height of one to three lines, depending on the layout and density.\n* Ellipses overflowing text.\n* Exposes the `--line-height` CSS variable so child elements can adjust to the current line height.\n* Has a defined CSS `color` property for text.",
42079
- "name": "AtomicResultSectionExcerpt",
42080
- "mixins": [
42081
- {
42082
- "name": "ItemSectionMixin",
42083
- "package": "@/src/mixins/item-section-mixin"
42084
- }
42085
- ],
42086
- "superclass": {
42087
- "name": "LitElement",
42088
- "package": "lit"
42089
- },
42090
- "tagName": "atomic-result-section-excerpt",
42091
- "customElement": true,
42092
- "members": [
42093
- {
42094
- "kind": "field",
42095
- "name": "styles",
42096
- "static": true,
42097
- "default": "styles",
42098
- "inheritedFrom": {
42099
- "name": "ItemSectionMixin",
42100
- "module": "src/mixins/item-section-mixin.ts"
42101
- }
42102
- },
42103
- {
42104
- "kind": "method",
42105
- "name": "injectStyles",
42106
- "parameters": [
42107
- {
42108
- "name": "dynamicStyles",
42109
- "optional": true,
42110
- "type": {
42111
- "text": "CSSResultGroup"
42112
- },
42113
- "description": "Optional dynamic styles to inject along with static styles"
42114
- }
42115
- ],
42116
- "description": "Injects styles into the document or shadow root.\n\nWhen called without arguments, injects the component's static styles.\nWhen called with dynamic styles, injects both static and dynamic styles.",
42117
- "inheritedFrom": {
42118
- "name": "LightDomMixin",
42119
- "module": "src/mixins/light-dom.ts"
42120
- }
42121
- },
42122
- {
42123
- "kind": "method",
42124
- "name": "getStyleSheet",
42125
- "privacy": "private",
42126
- "return": {
42127
- "type": {
42128
- "text": "CSSStyleSheet | null"
42129
- }
42130
- },
42131
- "parameters": [
42132
- {
42133
- "name": "style",
42134
- "type": {
42135
- "text": "CSSResultOrNative | CSSResultArray | null | undefined"
42136
- }
42137
- }
42138
- ],
42139
- "inheritedFrom": {
42140
- "name": "LightDomMixin",
42141
- "module": "src/mixins/light-dom.ts"
42142
- }
42143
- }
42144
- ]
42145
- }
42146
- ],
42147
- "exports": [
42148
- {
42149
- "kind": "js",
42150
- "name": "AtomicResultSectionExcerpt",
42151
- "declaration": {
42152
- "name": "AtomicResultSectionExcerpt",
42153
- "module": "src/components/search/atomic-result-section-excerpt/atomic-result-section-excerpt.ts"
42154
- }
42155
- },
42156
- {
42157
- "kind": "custom-element-definition",
42158
- "name": "atomic-result-section-excerpt",
42159
- "declaration": {
42160
- "name": "AtomicResultSectionExcerpt",
42161
- "module": "src/components/search/atomic-result-section-excerpt/atomic-result-section-excerpt.ts"
42162
- }
42163
- }
42164
- ]
42165
- },
42166
42139
  {
42167
42140
  "kind": "javascript-module",
42168
42141
  "path": "src/components/search/atomic-result-section-title/atomic-result-section-title.ts",
@@ -43408,21 +43381,25 @@
43408
43381
  "name": "recent-query-text-highlight"
43409
43382
  },
43410
43383
  {
43411
- "description": "The clear button above suggestions from the `atomic-search-box-recent-queries` component.",
43384
+ "description": "The clear button above suggestions from the `atomic-search-box-recent-queries` component, when `clear-recent-button-position` is `top`.",
43412
43385
  "name": "recent-query-title-item"
43413
43386
  },
43414
43387
  {
43415
- "description": "The contents of the clear button above suggestions from the `atomic-search-box-recent-queries` component.",
43388
+ "description": "The contents of the clear button above suggestions from the `atomic-search-box-recent-queries` component, when `clear-recent-button-position` is `top`.",
43416
43389
  "name": "recent-query-title-content"
43417
43390
  },
43418
43391
  {
43419
- "description": "The \"recent searches\" text of the clear button above suggestions from the `atomic-search-box-recent-queries` component.",
43392
+ "description": "The \"recent searches\" title above the recent queries from the `atomic-search-box-recent-queries` component.",
43420
43393
  "name": "recent-query-title"
43421
43394
  },
43422
43395
  {
43423
- "description": "The \"clear\" text of the clear button above suggestions from the `atomic-search-box-recent-queries` component.",
43396
+ "description": "The \"clear\" text of the clear button above suggestions from the `atomic-search-box-recent-queries` component, when `clear-recent-button-position` is `top`.",
43424
43397
  "name": "recent-query-clear"
43425
43398
  },
43399
+ {
43400
+ "description": "The button below suggestions to clear the recent queries from the `atomic-search-box-recent-queries` component, when `clear-recent-button-position` is `bottom`.",
43401
+ "name": "recent-query-clear-button"
43402
+ },
43426
43403
  {
43427
43404
  "description": "An instant result rendered by an `atomic-search-box-instant-results` component.",
43428
43405
  "name": "instant-results-item"
@@ -43443,6 +43420,14 @@
43443
43420
  }
43444
43421
  ],
43445
43422
  "members": [
43423
+ {
43424
+ "kind": "field",
43425
+ "name": "propsSchema",
43426
+ "privacy": "private",
43427
+ "static": true,
43428
+ "readonly": true,
43429
+ "default": "new Schema({ clearRecentButtonPosition: new StringValue({constrainTo: ['top', 'bottom']}), })"
43430
+ },
43446
43431
  {
43447
43432
  "kind": "field",
43448
43433
  "name": "shadowRootOptions",
@@ -43489,6 +43474,16 @@
43489
43474
  "name": "textAreaRef",
43490
43475
  "privacy": "private"
43491
43476
  },
43477
+ {
43478
+ "kind": "field",
43479
+ "name": "setLeftPanel",
43480
+ "privacy": "private"
43481
+ },
43482
+ {
43483
+ "kind": "field",
43484
+ "name": "setRightPanel",
43485
+ "privacy": "private"
43486
+ },
43492
43487
  {
43493
43488
  "kind": "field",
43494
43489
  "name": "searchBoxSuggestionEventsQueue",
@@ -43625,6 +43620,18 @@
43625
43620
  "attribute": "enable-query-syntax",
43626
43621
  "reflects": true
43627
43622
  },
43623
+ {
43624
+ "kind": "field",
43625
+ "name": "clearRecentButtonPosition",
43626
+ "type": {
43627
+ "text": "'top' | 'bottom'"
43628
+ },
43629
+ "privacy": "public",
43630
+ "default": "'top'",
43631
+ "description": "The position of the option to clear the recent queries.\n\n- `top`: The option is the first suggestion, next to the \"Recent searches\" title.\n- `bottom`: The option is a button below the suggestions, so the arrow keys only navigate through the suggestions and the button is reached with the Tab key.\n\nIn the next major version of Atomic (v4), `bottom` will become the default behavior. To adopt it ahead of time, set this property to `bottom`.",
43632
+ "attribute": "clear-recent-button-position",
43633
+ "reflects": true
43634
+ },
43628
43635
  {
43629
43636
  "kind": "method",
43630
43637
  "name": "initialize",
@@ -43790,6 +43797,30 @@
43790
43797
  "name": "renderTextBox",
43791
43798
  "privacy": "private"
43792
43799
  },
43800
+ {
43801
+ "kind": "field",
43802
+ "name": "clearRecentQueriesElement",
43803
+ "privacy": "private",
43804
+ "readonly": true
43805
+ },
43806
+ {
43807
+ "kind": "method",
43808
+ "name": "renderRecentQueriesTitle",
43809
+ "privacy": "private"
43810
+ },
43811
+ {
43812
+ "kind": "method",
43813
+ "name": "renderClearRecentQueriesButton",
43814
+ "privacy": "private",
43815
+ "parameters": [
43816
+ {
43817
+ "name": "element",
43818
+ "type": {
43819
+ "text": "SearchBoxSuggestionElement"
43820
+ }
43821
+ }
43822
+ ]
43823
+ },
43793
43824
  {
43794
43825
  "kind": "method",
43795
43826
  "name": "renderSuggestions",
@@ -43940,6 +43971,15 @@
43940
43971
  "default": "false",
43941
43972
  "description": "Whether to interpret advanced [Coveo query syntax](https://docs.coveo.com/en/1552/) in the query.\nYou should only enable query syntax in the search box if you have good reasons to do so, as it\nrequires end users to be familiar with Coveo query syntax, otherwise they will likely be surprised\nby the search box behaviour.\n\nWhen the `redirection-url` property is set and redirects to a page with more `atomic-search-box` components, all `atomic-search-box` components need to have the same `enable-query-syntax` value.",
43942
43973
  "fieldName": "enableQuerySyntax"
43974
+ },
43975
+ {
43976
+ "name": "clear-recent-button-position",
43977
+ "type": {
43978
+ "text": "'top' | 'bottom'"
43979
+ },
43980
+ "default": "'top'",
43981
+ "description": "The position of the option to clear the recent queries.\n\n- `top`: The option is the first suggestion, next to the \"Recent searches\" title.\n- `bottom`: The option is a button below the suggestions, so the arrow keys only navigate through the suggestions and the button is reached with the Tab key.\n\nIn the next major version of Atomic (v4), `bottom` will become the default behavior. To adopt it ahead of time, set this property to `bottom`.",
43982
+ "fieldName": "clearRecentButtonPosition"
43943
43983
  }
43944
43984
  ],
43945
43985
  "superclass": {
@@ -43969,6 +44009,100 @@
43969
44009
  }
43970
44010
  ]
43971
44011
  },
44012
+ {
44013
+ "kind": "javascript-module",
44014
+ "path": "src/components/search/atomic-result-section-excerpt/atomic-result-section-excerpt.ts",
44015
+ "declarations": [
44016
+ {
44017
+ "kind": "class",
44018
+ "description": "This section is intended to render an informative summary of the result's content\n\nBehavior:\n* Has a fixed height of one to three lines, depending on the layout and density.\n* Ellipses overflowing text.\n* Exposes the `--line-height` CSS variable so child elements can adjust to the current line height.\n* Has a defined CSS `color` property for text.",
44019
+ "name": "AtomicResultSectionExcerpt",
44020
+ "mixins": [
44021
+ {
44022
+ "name": "ItemSectionMixin",
44023
+ "package": "@/src/mixins/item-section-mixin"
44024
+ }
44025
+ ],
44026
+ "superclass": {
44027
+ "name": "LitElement",
44028
+ "package": "lit"
44029
+ },
44030
+ "tagName": "atomic-result-section-excerpt",
44031
+ "customElement": true,
44032
+ "members": [
44033
+ {
44034
+ "kind": "field",
44035
+ "name": "styles",
44036
+ "static": true,
44037
+ "default": "styles",
44038
+ "inheritedFrom": {
44039
+ "name": "ItemSectionMixin",
44040
+ "module": "src/mixins/item-section-mixin.ts"
44041
+ }
44042
+ },
44043
+ {
44044
+ "kind": "method",
44045
+ "name": "injectStyles",
44046
+ "parameters": [
44047
+ {
44048
+ "name": "dynamicStyles",
44049
+ "optional": true,
44050
+ "type": {
44051
+ "text": "CSSResultGroup"
44052
+ },
44053
+ "description": "Optional dynamic styles to inject along with static styles"
44054
+ }
44055
+ ],
44056
+ "description": "Injects styles into the document or shadow root.\n\nWhen called without arguments, injects the component's static styles.\nWhen called with dynamic styles, injects both static and dynamic styles.",
44057
+ "inheritedFrom": {
44058
+ "name": "LightDomMixin",
44059
+ "module": "src/mixins/light-dom.ts"
44060
+ }
44061
+ },
44062
+ {
44063
+ "kind": "method",
44064
+ "name": "getStyleSheet",
44065
+ "privacy": "private",
44066
+ "return": {
44067
+ "type": {
44068
+ "text": "CSSStyleSheet | null"
44069
+ }
44070
+ },
44071
+ "parameters": [
44072
+ {
44073
+ "name": "style",
44074
+ "type": {
44075
+ "text": "CSSResultOrNative | CSSResultArray | null | undefined"
44076
+ }
44077
+ }
44078
+ ],
44079
+ "inheritedFrom": {
44080
+ "name": "LightDomMixin",
44081
+ "module": "src/mixins/light-dom.ts"
44082
+ }
44083
+ }
44084
+ ]
44085
+ }
44086
+ ],
44087
+ "exports": [
44088
+ {
44089
+ "kind": "js",
44090
+ "name": "AtomicResultSectionExcerpt",
44091
+ "declaration": {
44092
+ "name": "AtomicResultSectionExcerpt",
44093
+ "module": "src/components/search/atomic-result-section-excerpt/atomic-result-section-excerpt.ts"
44094
+ }
44095
+ },
44096
+ {
44097
+ "kind": "custom-element-definition",
44098
+ "name": "atomic-result-section-excerpt",
44099
+ "declaration": {
44100
+ "name": "AtomicResultSectionExcerpt",
44101
+ "module": "src/components/search/atomic-result-section-excerpt/atomic-result-section-excerpt.ts"
44102
+ }
44103
+ }
44104
+ ]
44105
+ },
43972
44106
  {
43973
44107
  "kind": "javascript-module",
43974
44108
  "path": "src/components/search/atomic-search-box-instant-results/atomic-search-box-instant-results.ts",
@@ -30,11 +30,15 @@ __webpack_require__.r(__webpack_exports__);
30
30
  __webpack_require__.d(__webpack_exports__, {
31
31
  AtomicCommerceSearchBox: ()=>AtomicCommerceSearchBox
32
32
  });
33
+ const bueno_namespaceObject = require("@coveo/bueno");
33
34
  const commerce_namespaceObject = require("@coveo/headless/commerce");
34
35
  const external_lit_namespaceObject = require("lit");
35
36
  const decorators_js_namespaceObject = require("lit/decorators.js");
36
37
  const class_map_js_namespaceObject = require("lit/directives/class-map.js");
37
38
  const ref_js_namespaceObject = require("lit/directives/ref.js");
39
+ const when_js_namespaceObject = require("lit/directives/when.js");
40
+ const button_cjs_namespaceObject = require("../../common/button.cjs");
41
+ const validate_props_controller_cjs_namespaceObject = require("../../common/validate-props-controller/validate-props-controller.cjs");
38
42
  const boolean_converter_cjs_namespaceObject = require("../../../converters/boolean-converter.cjs");
39
43
  const bind_state_cjs_namespaceObject = require("../../../decorators/bind-state.cjs");
40
44
  const binding_guard_cjs_namespaceObject = require("../../../decorators/binding-guard.cjs");
@@ -258,7 +262,7 @@ class AtomicCommerceSearchBox extends external_lit_namespaceObject.LitElement {
258
262
  }
259
263
  break;
260
264
  case 'Tab':
261
- this.suggestionManager.clearSuggestions();
265
+ if ('bottom' !== this.clearRecentButtonPosition || !this.clearRecentQueriesElement) this.suggestionManager.clearSuggestions();
262
266
  break;
263
267
  default:
264
268
  if (this.suggestionManager.keyboardActiveDescendant) this.suggestionManager.updateKeyboardActiveDescendant();
@@ -323,11 +327,59 @@ class AtomicCommerceSearchBox extends external_lit_namespaceObject.LitElement {
323
327
  }
324
328
  })}`;
325
329
  }
330
+ get clearRecentQueriesElement() {
331
+ const { leftSuggestionElements, rightSuggestionElements } = this.suggestionManager;
332
+ return [
333
+ leftSuggestionElements,
334
+ rightSuggestionElements
335
+ ].flatMap((elements)=>elements.slice(0, -1)).find((element)=>'recent-query-clear' === element.key);
336
+ }
337
+ renderRecentQueriesTitle() {
338
+ return (0, external_lit_namespaceObject.html)`<div
339
+ part="recent-query-title"
340
+ class="text-neutral-dark flex min-h-10 items-center px-4 font-bold"
341
+ @mousedown=${(e)=>e.preventDefault()}
342
+ >
343
+ ${this.bindings.i18n.t('recent-searches')}
344
+ </div>`;
345
+ }
346
+ renderClearRecentQueriesButton(element) {
347
+ const deselectSuggestion = ()=>{
348
+ this.suggestionManager.updateKeyboardActiveDescendant();
349
+ this.suggestionManager.updateActiveDescendant();
350
+ };
351
+ return (0, external_lit_namespaceObject.html)`<div
352
+ class="border-neutral flex border-t"
353
+ @mousedown=${(e)=>e.preventDefault()}
354
+ @mouseenter=${deselectSuggestion}
355
+ @focusin=${deselectSuggestion}
356
+ @keydown=${(e)=>{
357
+ if ('Escape' !== e.key) return;
358
+ this.textAreaRef.value?.focus();
359
+ this.isExpanded = false;
360
+ this.suggestionManager.clearSuggestions();
361
+ }}
362
+ >
363
+ ${(0, button_cjs_namespaceObject.renderButton)({
364
+ props: {
365
+ style: 'text-primary',
366
+ text: this.bindings.i18n.t('clear-recent-searches'),
367
+ part: 'recent-query-clear-button',
368
+ class: 'focus-visible:ring-ring-primary flex min-h-12 w-full items-center justify-center rounded-none px-4 focus-visible:ring-2 focus-visible:ring-inset',
369
+ onClick: (e)=>{
370
+ element.onSelect?.(e);
371
+ this.textAreaRef.value?.focus();
372
+ }
373
+ }
374
+ })(external_lit_namespaceObject.nothing)}
375
+ </div>`;
376
+ }
326
377
  renderSuggestions() {
327
378
  const part = `suggestions-wrapper ${this.suggestionManager.isDoubleList ? 'suggestions-double-list' : 'suggestions-single-list'}`;
328
379
  const isVisible = this.suggestionManager.hasSuggestions && this.isExpanded && !this.isSearchDisabledForEndUser;
329
380
  const classes = {
330
381
  'bg-background border-neutral absolute top-full left-0 z-10 flex w-full rounded-md border': true,
382
+ 'overflow-hidden': 'bottom' === this.clearRecentButtonPosition,
331
383
  hidden: !isVisible
332
384
  };
333
385
  return (0, external_lit_namespaceObject.html)`<div
@@ -338,25 +390,43 @@ class AtomicCommerceSearchBox extends external_lit_namespaceObject.LitElement {
338
390
  aria-label=${this.bindings.i18n.t(this.suggestionManager.isDoubleList ? 'search-suggestions-double-list' : 'search-suggestions-single-list')}
339
391
  aria-activedescendant=${this.suggestionManager.activeDescendant}
340
392
  >
341
- ${this.renderPanel('left', this.suggestionManager.leftSuggestionElements, (el)=>{
342
- this.suggestionManager.leftPanel = el;
343
- }, ()=>this.suggestionManager.leftPanel)}
344
- ${this.renderPanel('right', this.suggestionManager.rightSuggestionElements, (el)=>{
345
- this.suggestionManager.rightPanel = el;
346
- }, ()=>this.suggestionManager.rightPanel)}
393
+ ${this.renderPanel('left', this.suggestionManager.leftSuggestionElements, this.setLeftPanel, ()=>this.suggestionManager.leftPanel)}
394
+ ${this.renderPanel('right', this.suggestionManager.rightSuggestionElements, this.setRightPanel, ()=>this.suggestionManager.rightPanel)}
347
395
  </div>`;
348
396
  }
349
397
  renderPanel(side, elements, setRef, getRef) {
350
- if (!elements.length) return null;
398
+ let listElements = elements;
399
+ let isListNested = false;
400
+ let recentQueriesTitle;
401
+ let clearRecentQueriesButton;
402
+ switch(this.clearRecentButtonPosition){
403
+ case 'bottom':
404
+ {
405
+ isListNested = true;
406
+ const clearElement = this.clearRecentQueriesElement;
407
+ if (clearElement && elements.includes(clearElement)) {
408
+ listElements = elements.filter((element)=>element !== clearElement);
409
+ clearRecentQueriesButton = this.renderClearRecentQueriesButton(clearElement);
410
+ if (elements[0] === clearElement) recentQueriesTitle = this.renderRecentQueriesTitle();
411
+ }
412
+ break;
413
+ }
414
+ }
415
+ if (!listElements.length) return null;
416
+ const suggestions = listElements.map((suggestion, index)=>this.renderSuggestion(suggestion, index, listElements.length - 1, side));
351
417
  return (0, external_lit_namespaceObject.html)`<div
352
418
  part="suggestions suggestions-${side}"
353
- ${(0, ref_js_namespaceObject.ref)(setRef)}
419
+ ${(0, ref_js_namespaceObject.ref)(isListNested ? void 0 : setRef)}
354
420
  class="flex grow basis-1/2 flex-col"
355
421
  @mousedown=${(e)=>{
356
422
  if (e.target === getRef()) e.preventDefault();
357
423
  }}
358
424
  >
359
- ${elements.map((suggestion, index)=>this.renderSuggestion(suggestion, index, elements.length - 1, side))}
425
+ ${recentQueriesTitle}
426
+ ${(0, when_js_namespaceObject.when)(isListNested, ()=>(0, external_lit_namespaceObject.html)`<div class="flex grow flex-col" ${(0, ref_js_namespaceObject.ref)(setRef)}>
427
+ ${suggestions}
428
+ </div>`, ()=>suggestions)}
429
+ ${clearRecentQueriesButton}
360
430
  </div>`;
361
431
  }
362
432
  renderSuggestion(item, index, lastIndex, side) {
@@ -422,10 +492,25 @@ class AtomicCommerceSearchBox extends external_lit_namespaceObject.LitElement {
422
492
  announceClearSearchBoxToScreenReader() {
423
493
  this.searchBoxAriaMessage.message = this.bindings.i18n.t('search-box-cleared');
424
494
  }
425
- constructor(...args){
426
- super(...args), this.isExpanded = false, this.textAreaRef = (0, ref_js_namespaceObject.createRef)(), this.searchBoxSuggestionEventsQueue = [], this.searchBoxAriaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'search-box'), this.suggestionsAriaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'search-suggestions', true), this.numberOfQueries = 8, this.suggestionTimeout = 400, this.suggestionDelay = 0, this.disableSearch = false, this.minimumQueryLength = 0, this.clearFilters = true, this.updateBreakpoints = (0, utils_cjs_namespaceObject.once)(()=>(0, replace_breakpoint_utils_cjs_namespaceObject.updateBreakpoints)(this));
495
+ constructor(){
496
+ super(), this.isExpanded = false, this.textAreaRef = (0, ref_js_namespaceObject.createRef)(), this.setLeftPanel = (el)=>{
497
+ this.suggestionManager.leftPanel = el;
498
+ }, this.setRightPanel = (el)=>{
499
+ this.suggestionManager.rightPanel = el;
500
+ }, this.searchBoxSuggestionEventsQueue = [], this.searchBoxAriaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'search-box'), this.suggestionsAriaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'search-suggestions', true), this.numberOfQueries = 8, this.suggestionTimeout = 400, this.suggestionDelay = 0, this.disableSearch = false, this.minimumQueryLength = 0, this.clearFilters = true, this.clearRecentButtonPosition = 'top', this.updateBreakpoints = (0, utils_cjs_namespaceObject.once)(()=>(0, replace_breakpoint_utils_cjs_namespaceObject.updateBreakpoints)(this));
501
+ new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
502
+ clearRecentButtonPosition: this.clearRecentButtonPosition
503
+ }), AtomicCommerceSearchBox.propsSchema);
427
504
  }
428
505
  }
506
+ AtomicCommerceSearchBox.propsSchema = new bueno_namespaceObject.Schema({
507
+ clearRecentButtonPosition: new bueno_namespaceObject.StringValue({
508
+ constrainTo: [
509
+ 'top',
510
+ 'bottom'
511
+ ]
512
+ })
513
+ });
429
514
  AtomicCommerceSearchBox.shadowRootOptions = {
430
515
  ...external_lit_namespaceObject.LitElement.shadowRootOptions,
431
516
  delegatesFocus: true
@@ -499,6 +584,14 @@ _ts_decorate([
499
584
  converter: boolean_converter_cjs_namespaceObject.booleanConverter
500
585
  })
501
586
  ], AtomicCommerceSearchBox.prototype, "clearFilters", void 0);
587
+ _ts_decorate([
588
+ (0, decorators_js_namespaceObject.property)({
589
+ type: String,
590
+ attribute: 'clear-recent-button-position',
591
+ reflect: true
592
+ }),
593
+ _ts_metadata("design:type", String)
594
+ ], AtomicCommerceSearchBox.prototype, "clearRecentButtonPosition", void 0);
502
595
  _ts_decorate([
503
596
  (0, watch_cjs_namespaceObject.watch)('redirectionUrl'),
504
597
  _ts_metadata("design:type", Function),
@@ -515,7 +608,9 @@ _ts_decorate([
515
608
  AtomicCommerceSearchBox = _ts_decorate([
516
609
  (0, decorators_js_namespaceObject.customElement)('atomic-commerce-search-box'),
517
610
  (0, bindings_cjs_namespaceObject.bindings)(),
518
- with_tailwind_styles_cjs_namespaceObject.withTailwindStyles
611
+ with_tailwind_styles_cjs_namespaceObject.withTailwindStyles,
612
+ _ts_metadata("design:type", Function),
613
+ _ts_metadata("design:paramtypes", [])
519
614
  ], AtomicCommerceSearchBox);
520
615
  exports.AtomicCommerceSearchBox = __webpack_exports__.AtomicCommerceSearchBox;
521
616
  for(var __rspack_i in __webpack_exports__)if (-1 === [
@@ -33,6 +33,8 @@ __webpack_require__.d(__webpack_exports__, {
33
33
  const commerce_namespaceObject = require("@coveo/headless/commerce");
34
34
  const template_provider_cjs_namespaceObject = require("../../common/template-provider/template-provider.cjs");
35
35
  require("../atomic-product-template/atomic-product-template.cjs");
36
+ require("../atomic-product-section-name/atomic-product-section-name.cjs");
37
+ require("../atomic-product-section-visual/atomic-product-section-visual.cjs");
36
38
  class ProductTemplateProvider extends template_provider_cjs_namespaceObject.TemplateProvider {
37
39
  makeDefaultTemplate() {
38
40
  const content = document.createDocumentFragment();