From 8493f36b33dd188c5dd81caeb47061d2421f3935 Mon Sep 17 00:00:00 2001 From: Amlan Sengupta Date: Tue, 19 Mar 2024 17:08:48 +0530 Subject: [PATCH 1/8] coveo-search-popup design with api-integration --- blocks/header/coveo-body-requests.js | 1323 ++++++++++++++++++++++++++ blocks/header/header.js | 221 ++++- scripts/carousel.js | 8 +- scripts/scripts.js | 27 + styles/styles.css | 184 ++++ 5 files changed, 1743 insertions(+), 20 deletions(-) create mode 100644 blocks/header/coveo-body-requests.js diff --git a/blocks/header/coveo-body-requests.js b/blocks/header/coveo-body-requests.js new file mode 100644 index 000000000..0cec8d100 --- /dev/null +++ b/blocks/header/coveo-body-requests.js @@ -0,0 +1,1323 @@ +export const suggestions = { + count: 8, + q: "", + locale: 'en', + timezone: 'America/New_York', + pipeline: 'Danaher Marketplace', + searchHub: 'DanaherMainSearch', + visitorId: 'd8c6a2a1-84e4-4d6f-b262-b91ad50a4c44', +} + +export const facetSelect = { + locale: 'en', + timezone: 'America/New_York', + pipeline: 'Danaher Marketplace', + searchHub: 'DanaherMainSearch', + visitorId: '87f2e820-f08c-48c8-bf0a-de04825619f9', + "debug": false, + "tab": "default", + "referrer": "https://stage.lifesciences.danaher.com/", + "context": { + "host": "stage.lifesciences.danaher.com", + "internal": false + }, + "fieldsToInclude": [ + "author", + "language", + "urihash", + "objecttype", + "collection", + "source", + "permanentid", + "date", + "filetype", + "parents", + "ec_price", + "ec_name", + "ec_description", + "ec_brand", + "ec_category", + "ec_item_group_id", + "ec_shortdesc", + "ec_thumbnails", + "ec_images", + "ec_promo_price", + "ec_in_stock", + "ec_rating", + "brand", + "images", + "sku", + "title", + "description", + "richdescription", + "opco", + "contenttype", + "documenttype", + "pagetype", + "shortspecifications", + "specificationsjson", + "bundlepreviewjson" + ], + "q": "", + "enableQuerySyntax": false, + "sortCriteria": "relevancy", + "numberOfResults": 10, + "firstResult": 0, + "facetOptions": { + "freezeFacetOrder": true + }, + "facets": [ + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Document", + "state": "selected" + }, + { + "value": "Product", + "state": "idle" + }, + { + "value": "Webpage", + "state": "idle" + } + ], + "freezeCurrentValues": true, + "isFieldExpanded": false, + "preventAutoSelect": true, + "facetId": "ContentType", + "field": "contenttype" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Blog", + "state": "idle" + }, + { + "value": "Document", + "state": "idle" + }, + { + "value": "News", + "state": "idle" + }, + { + "value": "Other", + "state": "idle" + }, + { + "value": "Product", + "state": "idle" + }, + { + "value": "Technical Library", + "state": "idle" + }, + { + "value": "Workflow", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "PageType", + "field": "pagetype" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Beckman Coulter Life Sciences", + "state": "idle" + }, + { + "value": "Phenomenex", + "state": "idle" + }, + { + "value": "Leica Microsystems", + "state": "idle" + }, + { + "value": "Molecular Devices", + "state": "idle" + }, + { + "value": "SCIEX", + "state": "idle" + }, + { + "value": "Beckman Coulter", + "state": "idle" + }, + { + "value": "IDBS", + "state": "idle" + }, + { + "value": "Leica Microsystems;Molecular Devices", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "Brand", + "field": "opco" + }, + { + "delimitingCharacter": "|", + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "occurrences", + "basePath": [], + "filterByBasePath": true, + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "hierarchical", + "facetId": "ProductType", + "field": "categoriesname" + }, + { + "delimitingCharacter": "|", + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "occurrences", + "basePath": [], + "filterByBasePath": true, + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "hierarchical", + "facetId": "ProcessStep", + "field": "workflowname" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "SubBrand", + "field": "brand" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "ProductClass", + "field": "productclass" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "DocumentType", + "field": "documenttype" + } + ] +} + +export const facetDeselect = { + locale: 'en', + timezone: 'America/New_York', + pipeline: 'Danaher Marketplace', + searchHub: 'DanaherMainSearch', + visitorId: '87f2e820-f08c-48c8-bf0a-de04825619f9', + "debug": false, + "tab": "default", + "referrer": "https://stage.lifesciences.danaher.com/", + "actionsHistory": [ + { + "name": "Query", + "time": "\"2024-03-04T22:37:36.935Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T22:35:04.728Z\"" + }, + { + "name": "PageView", + "time": "2024-03-04T22:35:03.607Z", + "value": "/content/danaher/ls/us/en/search" + }, + { + "name": "Query", + "time": "\"2024-03-04T20:08:10.233Z\"", + "value": "cell" + }, + { + "name": "PageView", + "time": "2024-03-04T20:08:09.518Z", + "value": "/content/danaher/ls/us/en/search" + }, + { + "name": "Query", + "time": "\"2024-03-04T20:07:45.709Z\"", + "value": "cell" + }, + { + "name": "PageView", + "time": "2024-03-04T20:07:45.160Z", + "value": "/content/danaher/ls/us/en/search" + }, + { + "name": "Query", + "time": "\"2024-03-04T20:07:13.126Z\"", + "value": "cell" + }, + { + "name": "PageView", + "time": "2024-03-04T20:07:11.840Z", + "value": "/content/danaher/ls/us/en/search" + }, + { + "name": "Query", + "time": "\"2024-03-04T20:01:54.478Z\"", + "value": "mic" + }, + { + "name": "Query", + "time": "\"2024-03-04T19:58:14.143Z\"", + "value": "mic" + }, + { + "name": "PageView", + "time": "2024-03-04T19:58:12.728Z", + "value": "/content/danaher/ls/us/en/search" + }, + { + "name": "Query", + "time": "\"2024-03-04T15:48:09.863Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T15:45:25.428Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T15:42:36.513Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T15:41:15.301Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T15:35:14.401Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T15:34:12.218Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T15:30:34.952Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T15:27:39.498Z\"" + } + ], + "context": { + "host": "stage.lifesciences.danaher.com", + "internal": false + }, + "fieldsToInclude": [ + "author", + "language", + "urihash", + "objecttype", + "collection", + "source", + "permanentid", + "date", + "filetype", + "parents", + "ec_price", + "ec_name", + "ec_description", + "ec_brand", + "ec_category", + "ec_item_group_id", + "ec_shortdesc", + "ec_thumbnails", + "ec_images", + "ec_promo_price", + "ec_in_stock", + "ec_rating", + "brand", + "images", + "sku", + "title", + "description", + "richdescription", + "opco", + "contenttype", + "documenttype", + "pagetype", + "shortspecifications", + "specificationsjson", + "bundlepreviewjson" + ], + "q": "", + "enableQuerySyntax": false, + "sortCriteria": "relevancy", + "queryCorrection": { + "enabled": false, + "options": { + "automaticallyCorrect": "whenNoResults" + } + }, + "enableDidYouMean": true, + "facets": [ + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Document", + "state": "idle" + }, + { + "value": "Product", + "state": "idle" + }, + { + "value": "Webpage", + "state": "idle" + } + ], + "freezeCurrentValues": true, + "isFieldExpanded": false, + "preventAutoSelect": true, + "facetId": "ContentType", + "field": "contenttype" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Document", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "PageType", + "field": "pagetype" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Beckman Coulter Life Sciences", + "state": "idle" + }, + { + "value": "IDBS", + "state": "idle" + }, + { + "value": "Leica Microsystems", + "state": "idle" + }, + { + "value": "Molecular Devices", + "state": "idle" + }, + { + "value": "Phenomenex", + "state": "idle" + }, + { + "value": "SCIEX", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "Brand", + "field": "opco" + }, + { + "delimitingCharacter": "|", + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "occurrences", + "basePath": [], + "filterByBasePath": true, + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "hierarchical", + "facetId": "ProductType", + "field": "categoriesname" + }, + { + "delimitingCharacter": "|", + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "occurrences", + "basePath": [], + "filterByBasePath": true, + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "hierarchical", + "facetId": "ProcessStep", + "field": "workflowname" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "SubBrand", + "field": "brand" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "ProductClass", + "field": "productclass" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "DocumentType", + "field": "documenttype" + } + ], + "numberOfResults": 10, + "firstResult": 0, + "facetOptions": { + "freezeFacetOrder": true + } +} + +export const finishType = { + "locale": "en", + "debug": false, + "tab": "default", + "referrer": "default", + "timezone": "America/New_York", + "visitorId": "147f954b-ddc1-4834-8f71-0de880f7283f", + "actionsHistory": [ + { + "name": "Query", + "time": "\"2024-03-04T22:26:29.769Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T22:25:42.258Z\"", + "value": "men" + }, + { + "name": "Query", + "time": "\"2024-03-04T22:25:35.892Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T22:25:02.692Z\"", + "value": "sand" + }, + { + "name": "Query", + "time": "\"2024-03-04T22:24:46.716Z\"" + } + ], + "fieldsToInclude": [ + "author", + "language", + "urihash", + "objecttype", + "collection", + "source", + "permanentid", + "date", + "filetype", + "parents", + "ec_price", + "ec_name", + "ec_description", + "ec_brand", + "ec_category", + "ec_item_group_id", + "ec_shortdesc", + "ec_thumbnails", + "ec_images", + "ec_promo_price", + "ec_in_stock", + "ec_rating", + "cat_rating_count" + ], + "pipeline": "Search", + "q": "", + "enableQuerySyntax": false, + "searchHub": "MainSearch", + "facets": [ + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Document", + "state": "idle" + }, + { + "value": "Product", + "state": "idle" + }, + { + "value": "Webpage", + "state": "idle" + } + ], + "freezeCurrentValues": true, + "isFieldExpanded": false, + "preventAutoSelect": true, + "facetId": "ContentType", + "field": "contenttype" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Document", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "PageType", + "field": "pagetype" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Beckman Coulter Life Sciences", + "state": "idle" + }, + { + "value": "IDBS", + "state": "idle" + }, + { + "value": "Leica Microsystems", + "state": "idle" + }, + { + "value": "Molecular Devices", + "state": "idle" + }, + { + "value": "Phenomenex", + "state": "idle" + }, + { + "value": "SCIEX", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "Brand", + "field": "opco" + }, + { + "delimitingCharacter": "|", + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "occurrences", + "basePath": [], + "filterByBasePath": true, + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "hierarchical", + "facetId": "ProductType", + "field": "categoriesname" + }, + { + "delimitingCharacter": "|", + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "occurrences", + "basePath": [], + "filterByBasePath": true, + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "hierarchical", + "facetId": "ProcessStep", + "field": "workflowname" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "SubBrand", + "field": "brand" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "ProductClass", + "field": "productclass" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "DocumentType", + "field": "documenttype" + } + ], + "sortCriteria": "relevancy", + "analytics": { + "clientId": "147f954b-ddc1-4834-8f71-0de880f7283f", + "clientTimestamp": "2024-03-04T22:28:18.381Z", + "documentReferrer": "default", + "originContext": "Search", + "documentLocation": "https://atomicv2-mcgfqb.stackblitz.io/examples/fashion.html", + "capture": false + }, + "enableDidYouMean": true, + "numberOfResults": 4 +} + +export const quickSearch = { + locale: 'en', + timezone: 'America/New_York', + searchHub: 'default', + visitorId: '48e4da72-35f0-43ec-9c61-a6aed682e6c3', + "debug": false, + "tab": "default", + "referrer": "default", + "actionsHistory": [ + { + "name": "Query", + "time": "\"2024-03-04T22:19:01.829Z\"", + "value": "this is beacon testing" + }, + { + "name": "Query", + "time": "\"2024-03-04T22:17:18.017Z\"", + "value": "promega corporation" + }, + { + "name": "Query", + "time": "\"2024-03-04T22:17:10.215Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T20:02:41.386Z\"", + "value": "bank" + }, + { + "name": "Query", + "time": "\"2024-03-04T20:02:32.491Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T18:21:47.520Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T18:20:23.534Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T16:53:48.016Z\"", + "value": "bank" + }, + { + "name": "Query", + "time": "\"2024-03-04T16:52:20.699Z\"" + }, + { + "name": "Query", + "time": "\"2024-03-04T16:47:47.427Z\"" + }, + { + "name": "Query", + "time": "\"2024-02-21T14:10:02.721Z\"" + }, + { + "name": "Query", + "time": "\"2024-02-20T18:58:45.364Z\"" + }, + { + "name": "Query", + "time": "\"2024-02-20T18:45:48.757Z\"" + }, + { + "name": "Query", + "time": "\"2024-02-20T18:43:58.682Z\"" + }, + { + "name": "Query", + "time": "\"2023-12-07T19:35:58.897Z\"" + }, + { + "name": "Query", + "time": "\"2023-12-07T19:34:42.960Z\"" + }, + { + "name": "Query", + "time": "\"2023-12-07T19:34:33.361Z\"", + "value": "covid" + }, + { + "name": "Query", + "time": "\"2023-12-07T19:33:31.851Z\"" + }, + { + "name": "Query", + "time": "\"2023-12-07T19:33:28.699Z\"", + "value": "bank" + }, + { + "name": "Query", + "time": "\"2023-12-07T19:33:26.959Z\"", + "value": "the bank" + } + ], + "fieldsToInclude": [ + "author", + "language", + "urihash", + "objecttype", + "collection", + "source", + "permanentid", + "date", + "filetype", + "parents", + "ec_price", + "ec_name", + "ec_description", + "ec_brand", + "ec_category", + "ec_item_group_id", + "ec_shortdesc", + "ec_thumbnails", + "ec_images", + "ec_promo_price", + "ec_in_stock", + "ec_rating", + "snrating", + "sncost" + ], + "q": "", + "enableQuerySyntax": false, + "sortCriteria": "relevancy", + "queryCorrection": { + "enabled": false, + "options": { + "automaticallyCorrect": "whenNoResults" + } + }, + "enableDidYouMean": true, + "facets": [ + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 6, + "sortCriteria": "occurrences", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Image", + "state": "idle" + }, + { + "value": "lithiummessage", + "state": "idle" + }, + { + "value": "lithiumthread", + "state": "idle" + }, + { + "value": "pdf", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "filetype", + "field": "filetype" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "Coveo Sample - Lithium Community", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "source", + "field": "source" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "2021", + "state": "idle" + }, + { + "value": "2022", + "state": "idle" + }, + { + "value": "2023", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "year", + "field": "year" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 7, + "sortCriteria": "descending", + "rangeAlgorithm": "even", + "resultsMustMatch": "atLeastOneValue", + "currentValues": [ + { + "start": "2024/03/04@17:19:01", + "end": "2034/03/04@17:19:01", + "endInclusive": false, + "state": "idle" + }, + { + "start": "2024/03/04@16:19:01", + "end": "2024/03/04@17:19:01", + "endInclusive": false, + "state": "idle" + }, + { + "start": "2024/03/03@17:19:01", + "end": "2024/03/04@17:19:01", + "endInclusive": false, + "state": "idle" + }, + { + "start": "2024/02/26@17:19:01", + "end": "2024/03/04@17:19:01", + "endInclusive": false, + "state": "idle" + }, + { + "start": "2024/02/04@17:19:01", + "end": "2024/03/04@17:19:01", + "endInclusive": false, + "state": "idle" + }, + { + "start": "2023/12/04@17:19:01", + "end": "2024/03/04@17:19:01", + "endInclusive": false, + "state": "idle" + }, + { + "start": "2023/03/04@17:19:01", + "end": "2024/03/04@17:19:01", + "endInclusive": false, + "state": "idle" + } + ], + "preventAutoSelect": false, + "type": "dateRange", + "facetId": "date", + "field": "date", + "generateAutomaticRanges": false + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 1, + "sortCriteria": "ascending", + "rangeAlgorithm": "even", + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "dateRange", + "facetId": "date_input_range", + "generateAutomaticRanges": true, + "field": "date" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 0, + "sortCriteria": "ascending", + "rangeAlgorithm": "even", + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "dateRange", + "facetId": "date_input", + "field": "date", + "generateAutomaticRanges": false + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 6, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "inat_kingdom", + "field": "inat_kingdom", + "hasBreadcrumbs": false + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [ + { + "value": "mardueng", + "state": "idle" + } + ], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "author", + "field": "author" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "inat_family", + "field": "inat_family" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "automatic", + "resultsMustMatch": "atLeastOneValue", + "type": "specific", + "currentValues": [], + "freezeCurrentValues": false, + "isFieldExpanded": false, + "preventAutoSelect": false, + "facetId": "inat_class", + "field": "inat_class" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "ascending", + "rangeAlgorithm": "equiprobable", + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "numericalRange", + "facetId": "sncost", + "field": "sncost", + "generateAutomaticRanges": true + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 1, + "sortCriteria": "ascending", + "rangeAlgorithm": "equiprobable", + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "numericalRange", + "generateAutomaticRanges": true, + "facetId": "ytviewcount_input_range", + "field": "ytviewcount" + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 0, + "sortCriteria": "ascending", + "rangeAlgorithm": "even", + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "numericalRange", + "facetId": "ytviewcount_input", + "field": "ytviewcount", + "generateAutomaticRanges": false + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 5, + "sortCriteria": "descending", + "rangeAlgorithm": "even", + "resultsMustMatch": "atLeastOneValue", + "currentValues": [ + { + "start": 5, + "end": 5, + "endInclusive": true, + "state": "idle" + }, + { + "start": 4, + "end": 5, + "endInclusive": true, + "state": "idle" + }, + { + "start": 3, + "end": 5, + "endInclusive": true, + "state": "idle" + }, + { + "start": 2, + "end": 5, + "endInclusive": true, + "state": "idle" + }, + { + "start": 1, + "end": 5, + "endInclusive": true, + "state": "idle" + } + ], + "preventAutoSelect": false, + "type": "numericalRange", + "facetId": "snrating_range", + "field": "snrating", + "generateAutomaticRanges": false + }, + { + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 5, + "sortCriteria": "descending", + "rangeAlgorithm": "even", + "resultsMustMatch": "atLeastOneValue", + "currentValues": [ + { + "start": 5, + "end": 6, + "endInclusive": false, + "state": "idle" + }, + { + "start": 4, + "end": 5, + "endInclusive": false, + "state": "idle" + }, + { + "start": 3, + "end": 4, + "endInclusive": false, + "state": "idle" + }, + { + "start": 2, + "end": 3, + "endInclusive": false, + "state": "idle" + }, + { + "start": 1, + "end": 2, + "endInclusive": false, + "state": "idle" + } + ], + "preventAutoSelect": false, + "type": "numericalRange", + "facetId": "snrating", + "field": "snrating", + "generateAutomaticRanges": false + }, + { + "delimitingCharacter": ";", + "filterFacetCount": true, + "injectionDepth": 1000, + "numberOfValues": 8, + "sortCriteria": "occurrences", + "basePath": [], + "filterByBasePath": true, + "resultsMustMatch": "atLeastOneValue", + "currentValues": [], + "preventAutoSelect": false, + "type": "hierarchical", + "facetId": "geographicalhierarchy", + "field": "geographicalhierarchy" + } + ], + "numberOfResults": 10, + "firstResult": 0, + "facetOptions": { + "freezeFacetOrder": false + } +} \ No newline at end of file diff --git a/blocks/header/header.js b/blocks/header/header.js index 1d2ed6198..0562c3ca6 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -1,12 +1,13 @@ import { - span, div, a, input, button, + span, div, a, input, button, p, ul, li, h3, } from '../../scripts/dom-builder.js'; import { decorateIcons } from '../../scripts/lib-franklin.js'; import { getAuthorization, getCommerceBase, isLoggedInUser, makeCoveoApiRequest, } from '../../scripts/commerce.js'; -import { getCookie } from '../../scripts/scripts.js'; +import { createRequest, debounce, getCookie } from '../../scripts/scripts.js'; +import { facetDeselect, facetSelect, finishType, quickSearch, suggestions } from './coveo-body-requests.js'; const baseURL = getCommerceBase(); @@ -14,8 +15,150 @@ const COVEO_SEARCH_HUB = 'DanaherMainSearch'; const COVEO_PIPELINE = 'Danaher Marketplace'; const COVEO_MAX_RECENT_SEARCHES = 3; +const organizationId = 'danahernonproduction1892f3fhz'; +const bearerToken = 'xx2a2e7271-78c3-4e3b-bac3-2fcbab75323b'; + let selectedSuggestionIndex = -1; +const fetchSuggestions = debounce(async (value) => { + try { + const url = `https://${organizationId}.org.coveo.com/rest/search/v2/querySuggest`; + suggestions.q = value; + const body = JSON.stringify(suggestions); + const request = await createRequest({ + url, + method: 'POST', + authToken: bearerToken, + body, + }); + const response = await request.json(); + // console.log(response); + // CREATING THE LAYOUT + const suggestionsBox = document.querySelector('#search-suggestions'); + suggestionsBox.innerHTML = ''; + if (response.completions && response.completions.length > 0) { + for (let suggestionRes of response.completions) { + // console.log(suggestionRes); + const suggestion = p({ + class: 'flex items-center gap-x-3 px-1 py-1 select-none cursor-pointer hover:bg-gray-600/40', + }); + suggestion.innerHTML = + ''; + suggestion.append(span({ class: '' }, suggestionRes.expression)); + suggestionsBox.append(suggestion); + suggestion.addEventListener('click', () => { + // console.log('Suggestion clicked', suggestionRes.expression); + document.querySelector('#search-input').value = suggestionRes.expression; + fetchFinishType(suggestionRes.expression); + document.querySelector('#search-suggestions').innerHTML = ''; + }); + } + } else { + suggestionsBox.append(p({ class: 'text-center' }, 'No Results Found')); + } + } catch (e) { + console.log('Something happenned during request submission', e); + } +}); + +const fetchFinishType = debounce(async (value) => { + // console.log(value); + const url = `https://fashioncoveodemocomgzh7iep8.org.coveo.com/rest/search/v2`; + finishType.q = value; + const body = JSON.stringify(finishType); + const request = await createRequest({ + url, + method: 'POST', + authToken: 'xx149e3ec9-786f-4c6c-b64f-49a403b930de', + body, + }); + const response = await request.json(); + // console.log('Finish Typing: ', response); + const { facets, totalCount=0 } = response; + // CREATING THE LAYOUT + document.querySelector('#total-result-count').innerHTML = totalCount; + if (facets && facets.length > 0) { + const searchContent = document.querySelector('#search-content'); + searchContent.innerHTML = ''; + const facetWithContent = facets.filter(facet => facet.values.length > 0); + // console.log(facets, searchContent, facetWithContent); + for (let facetCategoryIndex = 0; facetCategoryIndex < facetWithContent.length; facetCategoryIndex++) { + const facetCategory = facetWithContent[facetCategoryIndex]; + const facetGroup = div({ class: 'flex flex-col' }); + const facetList = ul({ class: 'space-y-3 pl-3 border-l border-black' }); + if (facetCategory.values.length > 0) { + for (let facetIndex = 0; facetIndex < facetCategory.values.length; facetIndex++) { + if (facetCategory.values[facetIndex].value) { + const facetElement = li({ class: 'w-max px-4 py-2 rounded-full select-none bg-danaherpurple-25 hover:bg-danaherpurple-50 text-base leading-4 text-danaherpurple-800 font-normal space-x-1 cursor-pointer' }, facetCategory.values[facetIndex].value); + facetList.append(facetElement); + facetElement.addEventListener('click', function() { + selectFacet(facetCategory.values[facetIndex], facetWithContent); + const searchInput = document.querySelector('#search-input'); + const selectedFacet = span({ id: `facet-${facetCategory.values[facetIndex].value}`, class: 'flex gap-x-2 px-5 py-2 bg-danaherpurple-50 rounded-full' }, facetCategory.values[facetIndex].value); + selectedFacet.innerHTML += ''; + selectedFacet.addEventListener('click', function() { + deselectFacet(facetCategory.values[facetIndex], facetWithContent); + }); + searchInput.parentElement.insertBefore(selectedFacet, searchInput); + }); + } + } + facetGroup.append(h3({ class: 'font-medium text-black text-2xl leading-8 mb-2' }, facetCategory.facetId.replace(/([A-Z])/g, ' $&'))); + facetGroup.append(facetList); + searchContent.append(facetGroup); + } + } + } +}, 800); + +const selectFacet = debounce(async (selected, list) => { + // console.log('Select Facet: ', selected, list); + const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; + facetSelect.q = document.querySelector('#search-input').value; + facetSelect.facets = list; + const body = JSON.stringify(facetSelect); + const request = await createRequest({ + url, + method: 'POST', + authToken: bearerToken, + body, + }); + const response = await request.json(); + // console.log(response); +}, 100); + +const deselectFacet = debounce(async (selected, list) => { + // console.log('De-select Facet: ', selected, list); + const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; + facetSelect.q = document.querySelector('#search-input').value; + facetSelect.facets = list; + const body = JSON.stringify(facetDeselect); + const request = await createRequest({ + url, + method: 'POST', + authToken: bearerToken, + body, + }); + const response = await request.json(); + // console.log(response); + const searchInput = document.querySelector('#search-input'); + searchInput.parentElement.querySelector(`#facet-${selected.value}`).remove(); +}, 100); + +const fetchQuickSearch = debounce(async (value) => { + const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; + quickSearch.q = value; + const body = JSON.stringify(quickSearch); + const request = await createRequest({ + url, + method: 'POST', + authToken: bearerToken, + body, + }); + const response = await request.json(); + // console.log(response); +}, 400); + function shortName(user) { if (user) { return `${user.fname[0].toUpperCase()}${user.lname[0].toUpperCase()}`; @@ -269,21 +412,24 @@ function addEventToSearchInput(searchBlock) { } function getSearchInput() { + const coveoSearch = div( + { + class: 'grow flex items-center', + }, + input({ + type: 'text', + placeholder: 'Search', + id: 'search-by-coveo', + 'autocomplete': 'off', + class: 'h-full outline-none bg-transparent w-full grow px-4 py-3.5 text-lg', + title: 'Search field with suggestions. Suggestions may be available under this field. To send, press Enter.', + }), + ) const inputWrapper = div( { class: 'w-full relative flex bg-gray-50 border border-gray-600 rounded-lg focus-within:ring focus-within:border-primary focus-within:ring-ring-primary', }, - div( - { - class: 'grow flex items-center', - }, - input({ - type: 'text', - placeholder: 'Search', - class: 'h-full outline-none bg-transparent w-full grow px-4 py-3.5 text-lg', - title: 'Search field with suggestions. Suggestions may be available under this field. To send, press Enter.', - }), - ), + coveoSearch, div( { class: 'py-2' }, button( @@ -645,6 +791,23 @@ function buildFlyoutMenus(headerBlock) { }); } +function buildSearchBackdrop(headerBlock) { + // console.log('Search Backdrop', headerBlock); + const searchBackdropContainer = div({ id: 'search-container', class: 'w-screen h-screen fixed top-0 left-0 bg-white opacity-100 z-50 transition-all -translate-y-full' }); + const resultsBanner = '

Total results

0

Visit Results
'; + const closeSearchBackdrop = '
'; + const searchProduct = div({ id: 'search-product', class: 'w-full md:w-3/4 mx-auto sm:py-7' }); + searchProduct.innerHTML += ''; + searchProduct.innerHTML += '
'; + searchProduct.innerHTML += '

Search for targets, biochemicals, applications, species and more

'; + const searchContent = div({ id: 'search-content', class: 'w-full md:w-3/4 mx-auto mb-3 grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-x-12 gap-y-3' }); + searchBackdropContainer.append(searchProduct); + searchBackdropContainer.append(searchContent); + searchBackdropContainer.innerHTML += closeSearchBackdrop; + searchBackdropContainer.innerHTML += resultsBanner; + headerBlock.append(searchBackdropContainer); +} + function handleScroll() { if (window.scrollY >= 95) { document.getElementById('sticky-header').classList.add('remove-descedents', 'fixed', 'inset-x-0', 'top-0', 'w-full', 'lg:!pb-4', 'shadow-lg'); @@ -694,6 +857,7 @@ export default async function decorate(block) { buildFlyoutMenus(headerBlock); decorateIcons(headerBlock); + buildSearchBackdrop(headerBlock); window.addEventListener('scroll', handleScroll); block.innerHTML = ''; @@ -705,5 +869,36 @@ export default async function decorate(block) { } } + // DISPLAY COVEO { BACKDROP } ON DESKTOP + document.querySelector('#search-by-coveo').addEventListener('click', function () { + // console.log('Coveo being clicked'); + document.querySelector('#search-container').classList.toggle('-translate-y-full'); + document.querySelector('#search-input').focus(); + }); + // CLOSE COVEO { BACKDROP } ON DESKTOP/MOBILE + document.querySelector('#close-search-container').addEventListener('click', function () { + document.querySelector('#search-container').classList.toggle('-translate-y-full'); + }); + document.querySelector('#search-input').addEventListener('keyup', function (event) { + const value = event.target.value; + if (value.trim() !== '') { + fetchSuggestions(value); + fetchFinishType(value); + } else { + document.querySelector('#search-content').innerHTML = ''; + document.querySelector('#search-suggestions').innerHTML = ''; + } + }); + document.querySelector('#search-input').addEventListener('blur', function () { + setTimeout(() => { + document.querySelector('#search-suggestions').innerHTML = ''; + }, 200); + }); + // NULLIFY COVEO SEARCH TYPE-VALUE & SUGGESTIONS + document.querySelector('#empty-searchbar').addEventListener('click', function () { + document.querySelector('#search-input').value = ''; + document.querySelector('#search-suggestions').innerHTML = ''; + }); + return block; } diff --git a/scripts/carousel.js b/scripts/carousel.js index b6b21ea21..a607bbf26 100644 --- a/scripts/carousel.js +++ b/scripts/carousel.js @@ -1,10 +1,4 @@ -function debounce(func, timeout = 300) { - let timer; - return (...args) => { - clearTimeout(timer); - timer = setTimeout(() => { func.apply(this, args); }, timeout); - }; -} +import { debounce } from "./scripts.js"; export default function Carousel({ wrapperEl, diff --git a/scripts/scripts.js b/scripts/scripts.js index 87c286f87..23eb41120 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -34,6 +34,33 @@ const TEMPLATE_LIST = { info: 'library', }; +export function debounce(func, timeout = 300) { + let timer; + return (...args) => { + clearTimeout(timer); + timer = setTimeout(() => { func.apply(this, args); }, timeout); + }; +} + +export function createRequest(config) { + const { + url, + method = 'GET', + authToken, + type = 'application/json', + body, + } = config; + const headers = { + 'Content-Type': type, + Accept: 'application/json', + }; + let configuration = { method, headers }; + if (body) configuration['body'] = body; + if (authToken && authToken.trim() !== '') + headers['Authorization'] = `Bearer ${authToken}`; + return fetch(url, configuration); +} + /** * Get the Image URL from Scene7 and Optimize the picture * @param {string} imageUrl diff --git a/styles/styles.css b/styles/styles.css index 8dd314198..1341f6fa6 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -3103,10 +3103,19 @@ main .default-content-wrapper ul { right: 0px; } +.inset-y-0 { + top: 0px; + bottom: 0px; +} + .bottom-0 { bottom: 0px; } +.bottom-12 { + bottom: 3rem; +} + .bottom-4 { bottom: 1rem; } @@ -3115,6 +3124,10 @@ main .default-content-wrapper ul { bottom: 1.25rem; } +.bottom-8 { + bottom: 2rem; +} + .left-0 { left: 0px; } @@ -3139,6 +3152,14 @@ main .default-content-wrapper ul { right: 0px; } +.right-10 { + right: 2.5rem; +} + +.start-0 { + inset-inline-start: 0px; +} + .top-0 { top: 0px; } @@ -3379,6 +3400,10 @@ main .default-content-wrapper ul { margin-left: 1rem; } +.ml-56 { + margin-left: 14rem; +} + .ml-6 { margin-left: 1.5rem; } @@ -3752,6 +3777,10 @@ main .default-content-wrapper ul { width: 2.25rem; } +.w-96 { + width: 24rem; +} + .w-\[47\%\] { width: 47%; } @@ -3777,6 +3806,10 @@ main .default-content-wrapper ul { width: max-content; } +.w-screen { + width: 100vw; +} + .min-w-\[320px\] { min-width: 320px; } @@ -3876,6 +3909,11 @@ main .default-content-wrapper ul { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } +.-translate-y-full { + --tw-translate-y: -100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + .rotate-180 { --tw-rotate: 180deg; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -4057,6 +4095,11 @@ main .default-content-wrapper ul { column-gap: 2.5rem; } +.gap-x-12 { + -moz-column-gap: 3rem; + column-gap: 3rem; +} + .gap-x-16 { -moz-column-gap: 4rem; column-gap: 4rem; @@ -4095,6 +4138,10 @@ main .default-content-wrapper ul { row-gap: 0.5rem; } +.gap-y-3 { + row-gap: 0.75rem; +} + .gap-y-4 { row-gap: 1rem; } @@ -4103,6 +4150,12 @@ main .default-content-wrapper ul { row-gap: 2rem; } +.space-x-1 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.25rem * var(--tw-space-x-reverse)); + margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse))); +} + .space-x-2 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(0.5rem * var(--tw-space-x-reverse)); @@ -4370,6 +4423,11 @@ main .default-content-wrapper ul { background-color: transparent !important; } +.bg-\[\#F5EFFF\] { + --tw-bg-opacity: 1; + background-color: rgb(245 239 255 / var(--tw-bg-opacity)); +} + .bg-black { --tw-bg-opacity: 1; background-color: rgb(0 0 0 / var(--tw-bg-opacity)); @@ -4444,6 +4502,10 @@ main .default-content-wrapper ul { background-color: rgb(229 231 235 / var(--tw-bg-opacity)); } +.bg-gray-300\/30 { + background-color: rgb(209 213 219 / 0.3); +} + .bg-gray-50 { --tw-bg-opacity: 1; background-color: rgb(249 250 251 / var(--tw-bg-opacity)); @@ -4476,6 +4538,10 @@ main .default-content-wrapper ul { --tw-bg-opacity: 0.1; } +.fill-current { + fill: currentColor; +} + .fill-danaherpurple-500 { fill: #7523FF; } @@ -4603,6 +4669,11 @@ main .default-content-wrapper ul { padding-right: 2.25rem; } +.py-0 { + padding-top: 0px; + padding-bottom: 0px; +} + .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; @@ -4698,6 +4769,10 @@ main .default-content-wrapper ul { padding-bottom: 56.25%; } +.pe-2 { + padding-inline-end: 0.5rem; +} + .pl-1 { padding-left: 0.25rem; } @@ -4714,6 +4789,10 @@ main .default-content-wrapper ul { padding-left: 0.5rem; } +.pl-3 { + padding-left: 0.75rem; +} + .pl-4 { padding-left: 1rem; } @@ -4750,10 +4829,18 @@ main .default-content-wrapper ul { padding-right: 2rem; } +.ps-2 { + padding-inline-start: 0.5rem; +} + .pt-0 { padding-top: 0px; } +.pt-1 { + padding-top: 0.25rem; +} + .pt-10 { padding-top: 2.5rem; } @@ -4830,11 +4917,21 @@ main .default-content-wrapper ul { line-height: 2.5rem; } +.text-5xl { + font-size: 3rem; + line-height: 1; +} + .text-6xl { font-size: 3.75rem; line-height: 1; } +.text-8xl { + font-size: 6rem; + line-height: 1; +} + .text-base { font-size: 1rem; line-height: 1.5rem; @@ -4908,6 +5005,10 @@ main .default-content-wrapper ul { font-style: normal; } +.leading-3 { + line-height: .75rem; +} + .leading-4 { line-height: 1rem; } @@ -4971,6 +5072,14 @@ main .default-content-wrapper ul { color: rgb(0 0 0 / var(--tw-text-opacity)); } +.text-black\/60 { + color: rgb(0 0 0 / 0.6); +} + +.text-black\/70 { + color: rgb(0 0 0 / 0.7); +} + .text-danaherblack-500 { --tw-text-opacity: 1; color: rgb(51 51 51 / var(--tw-text-opacity)); @@ -5102,6 +5211,10 @@ main .default-content-wrapper ul { text-decoration-thickness: 3px; } +.opacity-100 { + opacity: 1; +} + .opacity-50 { opacity: 0.5; } @@ -5159,6 +5272,11 @@ main .default-content-wrapper ul { --tw-ring-offset-width: 0px !important; } +.blur { + --tw-blur: blur(8px); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + .brightness-0 { --tw-brightness: brightness(0); filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); @@ -5279,12 +5397,21 @@ main .section.top-border { } } +.empty\:hidden:empty { + display: none; +} + .focus-within\:ring:focus-within { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); } +.hover\:rotate-90:hover { + --tw-rotate: 90deg; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + .hover\:scale-105:hover { --tw-scale-x: 1.05; --tw-scale-y: 1.05; @@ -5346,6 +5473,10 @@ main .section.top-border { background-color: rgb(245 239 255 / var(--tw-bg-opacity)); } +.hover\:bg-danaherpurple-25\/60:hover { + background-color: rgb(245 239 255 / 0.6); +} + .hover\:bg-danaherpurple-50:hover { --tw-bg-opacity: 1; background-color: rgb(234 222 255 / var(--tw-bg-opacity)); @@ -5366,6 +5497,10 @@ main .section.top-border { background-color: rgb(243 244 246 / var(--tw-bg-opacity)); } +.hover\:bg-gray-600\/40:hover { + background-color: rgb(75 85 99 / 0.4); +} + .hover\:bg-purple-200:hover { --tw-bg-opacity: 1; background-color: rgb(125 86 164 / var(--tw-bg-opacity)); @@ -5525,6 +5660,14 @@ main .section.top-border { align-items: center; } + .sm\:border { + border-width: 1px; + } + + .sm\:border-solid { + border-style: solid; + } + .sm\:px-0 { padding-left: 0px; padding-right: 0px; @@ -5535,6 +5678,11 @@ main .section.top-border { padding-right: 1.5rem; } + .sm\:py-7 { + padding-top: 1.75rem; + padding-bottom: 1.75rem; + } + .sm\:pt-16 { padding-top: 4rem; } @@ -5567,6 +5715,11 @@ main .section.top-border { font-size: 0.875rem; line-height: 1.25rem; } + + .sm\:text-xl { + font-size: 1.25rem; + line-height: 1.75rem; + } } @media (min-width: 768px) { @@ -5763,6 +5916,11 @@ main .section.top-border { padding-right: 3rem; } + .md\:px-14 { + padding-left: 3.5rem; + padding-right: 3.5rem; + } + .md\:px-8 { padding-left: 2rem; padding-right: 2rem; @@ -5773,6 +5931,11 @@ main .section.top-border { padding-bottom: 0px; } + .md\:py-1 { + padding-top: 0.25rem; + padding-bottom: 0.25rem; + } + .md\:py-16 { padding-top: 4rem; padding-bottom: 4rem; @@ -5787,10 +5950,18 @@ main .section.top-border { padding-bottom: 6rem; } + .md\:pe-4 { + padding-inline-end: 1rem; + } + .md\:pr-8 { padding-right: 2rem; } + .md\:ps-4 { + padding-inline-start: 1rem; + } + .md\:pt-16 { padding-top: 4rem; } @@ -5819,6 +5990,14 @@ main .section.top-border { .md\:tracking-tight { letter-spacing: -0.025em; } + + .md\:placeholder-transparent::-moz-placeholder { + color: transparent; + } + + .md\:placeholder-transparent::placeholder { + color: transparent; + } } @media (min-width: 1024px) { @@ -6030,6 +6209,11 @@ main .section.top-border { padding-right: 2rem; } + .lg\:py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + } + .lg\:py-20 { padding-top: 5rem; padding-bottom: 5rem; From b53beb63c699215324dcfc7c6fddb95371fc5fa6 Mon Sep 17 00:00:00 2001 From: Amlan Sengupta Date: Tue, 19 Mar 2024 23:18:39 +0530 Subject: [PATCH 2/8] Include lint fixes --- blocks/header/coveo-body-requests.js | 2206 ++++++++++++-------------- blocks/header/header.js | 229 +-- scripts/carousel.js | 2 +- scripts/scripts.js | 11 +- styles/styles.css | 9 + 5 files changed, 1196 insertions(+), 1261 deletions(-) diff --git a/blocks/header/coveo-body-requests.js b/blocks/header/coveo-body-requests.js index 0cec8d100..37aafd18f 100644 --- a/blocks/header/coveo-body-requests.js +++ b/blocks/header/coveo-body-requests.js @@ -1,12 +1,12 @@ export const suggestions = { count: 8, - q: "", + q: '', locale: 'en', timezone: 'America/New_York', pipeline: 'Danaher Marketplace', searchHub: 'DanaherMainSearch', visitorId: 'd8c6a2a1-84e4-4d6f-b262-b91ad50a4c44', -} +}; export const facetSelect = { locale: 'en', @@ -14,250 +14,250 @@ export const facetSelect = { pipeline: 'Danaher Marketplace', searchHub: 'DanaherMainSearch', visitorId: '87f2e820-f08c-48c8-bf0a-de04825619f9', - "debug": false, - "tab": "default", - "referrer": "https://stage.lifesciences.danaher.com/", - "context": { - "host": "stage.lifesciences.danaher.com", - "internal": false + debug: false, + tab: 'default', + referrer: 'https://stage.lifesciences.danaher.com/', + context: { + host: 'stage.lifesciences.danaher.com', + internal: false, }, - "fieldsToInclude": [ - "author", - "language", - "urihash", - "objecttype", - "collection", - "source", - "permanentid", - "date", - "filetype", - "parents", - "ec_price", - "ec_name", - "ec_description", - "ec_brand", - "ec_category", - "ec_item_group_id", - "ec_shortdesc", - "ec_thumbnails", - "ec_images", - "ec_promo_price", - "ec_in_stock", - "ec_rating", - "brand", - "images", - "sku", - "title", - "description", - "richdescription", - "opco", - "contenttype", - "documenttype", - "pagetype", - "shortspecifications", - "specificationsjson", - "bundlepreviewjson" + fieldsToInclude: [ + 'author', + 'language', + 'urihash', + 'objecttype', + 'collection', + 'source', + 'permanentid', + 'date', + 'filetype', + 'parents', + 'ec_price', + 'ec_name', + 'ec_description', + 'ec_brand', + 'ec_category', + 'ec_item_group_id', + 'ec_shortdesc', + 'ec_thumbnails', + 'ec_images', + 'ec_promo_price', + 'ec_in_stock', + 'ec_rating', + 'brand', + 'images', + 'sku', + 'title', + 'description', + 'richdescription', + 'opco', + 'contenttype', + 'documenttype', + 'pagetype', + 'shortspecifications', + 'specificationsjson', + 'bundlepreviewjson', ], - "q": "", - "enableQuerySyntax": false, - "sortCriteria": "relevancy", - "numberOfResults": 10, - "firstResult": 0, - "facetOptions": { - "freezeFacetOrder": true + q: '', + enableQuerySyntax: false, + sortCriteria: 'relevancy', + numberOfResults: 10, + firstResult: 0, + facetOptions: { + freezeFacetOrder: true, }, - "facets": [ - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ + facets: [ + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ { - "value": "Document", - "state": "selected" + value: 'Document', + state: 'selected', }, { - "value": "Product", - "state": "idle" + value: 'Product', + state: 'idle', }, { - "value": "Webpage", - "state": "idle" - } + value: 'Webpage', + state: 'idle', + }, ], - "freezeCurrentValues": true, - "isFieldExpanded": false, - "preventAutoSelect": true, - "facetId": "ContentType", - "field": "contenttype" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ + freezeCurrentValues: true, + isFieldExpanded: false, + preventAutoSelect: true, + facetId: 'ContentType', + field: 'contenttype', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ { - "value": "Blog", - "state": "idle" + value: 'Blog', + state: 'idle', }, { - "value": "Document", - "state": "idle" + value: 'Document', + state: 'idle', }, { - "value": "News", - "state": "idle" + value: 'News', + state: 'idle', }, { - "value": "Other", - "state": "idle" + value: 'Other', + state: 'idle', }, { - "value": "Product", - "state": "idle" + value: 'Product', + state: 'idle', }, { - "value": "Technical Library", - "state": "idle" + value: 'Technical Library', + state: 'idle', }, { - "value": "Workflow", - "state": "idle" - } + value: 'Workflow', + state: 'idle', + }, ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "PageType", - "field": "pagetype" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'PageType', + field: 'pagetype', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ { - "value": "Beckman Coulter Life Sciences", - "state": "idle" + value: 'Beckman Coulter Life Sciences', + state: 'idle', }, { - "value": "Phenomenex", - "state": "idle" + value: 'Phenomenex', + state: 'idle', }, { - "value": "Leica Microsystems", - "state": "idle" + value: 'Leica Microsystems', + state: 'idle', }, { - "value": "Molecular Devices", - "state": "idle" + value: 'Molecular Devices', + state: 'idle', }, { - "value": "SCIEX", - "state": "idle" + value: 'SCIEX', + state: 'idle', }, { - "value": "Beckman Coulter", - "state": "idle" + value: 'Beckman Coulter', + state: 'idle', }, { - "value": "IDBS", - "state": "idle" + value: 'IDBS', + state: 'idle', }, { - "value": "Leica Microsystems;Molecular Devices", - "state": "idle" - } + value: 'Leica Microsystems;Molecular Devices', + state: 'idle', + }, ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "Brand", - "field": "opco" - }, - { - "delimitingCharacter": "|", - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "occurrences", - "basePath": [], - "filterByBasePath": true, - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "hierarchical", - "facetId": "ProductType", - "field": "categoriesname" - }, - { - "delimitingCharacter": "|", - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "occurrences", - "basePath": [], - "filterByBasePath": true, - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "hierarchical", - "facetId": "ProcessStep", - "field": "workflowname" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "SubBrand", - "field": "brand" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "ProductClass", - "field": "productclass" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "DocumentType", - "field": "documenttype" - } - ] -} + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'Brand', + field: 'opco', + }, + { + delimitingCharacter: '|', + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'occurrences', + basePath: [], + filterByBasePath: true, + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'hierarchical', + facetId: 'ProductType', + field: 'categoriesname', + }, + { + delimitingCharacter: '|', + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'occurrences', + basePath: [], + filterByBasePath: true, + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'hierarchical', + facetId: 'ProcessStep', + field: 'workflowname', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'SubBrand', + field: 'brand', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'ProductClass', + field: 'productclass', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'DocumentType', + field: 'documenttype', + }, + ], +}; export const facetDeselect = { locale: 'en', @@ -265,1059 +265,967 @@ export const facetDeselect = { pipeline: 'Danaher Marketplace', searchHub: 'DanaherMainSearch', visitorId: '87f2e820-f08c-48c8-bf0a-de04825619f9', - "debug": false, - "tab": "default", - "referrer": "https://stage.lifesciences.danaher.com/", - "actionsHistory": [ - { - "name": "Query", - "time": "\"2024-03-04T22:37:36.935Z\"" - }, - { - "name": "Query", - "time": "\"2024-03-04T22:35:04.728Z\"" - }, - { - "name": "PageView", - "time": "2024-03-04T22:35:03.607Z", - "value": "/content/danaher/ls/us/en/search" - }, - { - "name": "Query", - "time": "\"2024-03-04T20:08:10.233Z\"", - "value": "cell" - }, - { - "name": "PageView", - "time": "2024-03-04T20:08:09.518Z", - "value": "/content/danaher/ls/us/en/search" - }, - { - "name": "Query", - "time": "\"2024-03-04T20:07:45.709Z\"", - "value": "cell" - }, - { - "name": "PageView", - "time": "2024-03-04T20:07:45.160Z", - "value": "/content/danaher/ls/us/en/search" - }, - { - "name": "Query", - "time": "\"2024-03-04T20:07:13.126Z\"", - "value": "cell" - }, - { - "name": "PageView", - "time": "2024-03-04T20:07:11.840Z", - "value": "/content/danaher/ls/us/en/search" - }, - { - "name": "Query", - "time": "\"2024-03-04T20:01:54.478Z\"", - "value": "mic" - }, - { - "name": "Query", - "time": "\"2024-03-04T19:58:14.143Z\"", - "value": "mic" - }, - { - "name": "PageView", - "time": "2024-03-04T19:58:12.728Z", - "value": "/content/danaher/ls/us/en/search" - }, - { - "name": "Query", - "time": "\"2024-03-04T15:48:09.863Z\"" + debug: false, + tab: 'default', + referrer: 'https://stage.lifesciences.danaher.com/', + context: { + host: 'stage.lifesciences.danaher.com', + internal: false, + }, + fieldsToInclude: [ + 'author', + 'language', + 'urihash', + 'objecttype', + 'collection', + 'source', + 'permanentid', + 'date', + 'filetype', + 'parents', + 'ec_price', + 'ec_name', + 'ec_description', + 'ec_brand', + 'ec_category', + 'ec_item_group_id', + 'ec_shortdesc', + 'ec_thumbnails', + 'ec_images', + 'ec_promo_price', + 'ec_in_stock', + 'ec_rating', + 'brand', + 'images', + 'sku', + 'title', + 'description', + 'richdescription', + 'opco', + 'contenttype', + 'documenttype', + 'pagetype', + 'shortspecifications', + 'specificationsjson', + 'bundlepreviewjson', + ], + q: '', + enableQuerySyntax: false, + sortCriteria: 'relevancy', + queryCorrection: { + enabled: false, + options: { + automaticallyCorrect: 'whenNoResults', }, - { - "name": "Query", - "time": "\"2024-03-04T15:45:25.428Z\"" + }, + enableDidYouMean: true, + facets: [ + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ + { + value: 'Document', + state: 'idle', + }, + { + value: 'Product', + state: 'idle', + }, + { + value: 'Webpage', + state: 'idle', + }, + ], + freezeCurrentValues: true, + isFieldExpanded: false, + preventAutoSelect: true, + facetId: 'ContentType', + field: 'contenttype', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ + { + value: 'Document', + state: 'idle', + }, + ], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'PageType', + field: 'pagetype', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ + { + value: 'Beckman Coulter Life Sciences', + state: 'idle', + }, + { + value: 'IDBS', + state: 'idle', + }, + { + value: 'Leica Microsystems', + state: 'idle', + }, + { + value: 'Molecular Devices', + state: 'idle', + }, + { + value: 'Phenomenex', + state: 'idle', + }, + { + value: 'SCIEX', + state: 'idle', + }, + ], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'Brand', + field: 'opco', + }, + { + delimitingCharacter: '|', + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'occurrences', + basePath: [], + filterByBasePath: true, + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'hierarchical', + facetId: 'ProductType', + field: 'categoriesname', + }, + { + delimitingCharacter: '|', + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'occurrences', + basePath: [], + filterByBasePath: true, + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'hierarchical', + facetId: 'ProcessStep', + field: 'workflowname', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'SubBrand', + field: 'brand', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'ProductClass', + field: 'productclass', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'DocumentType', + field: 'documenttype', }, + ], + numberOfResults: 10, + firstResult: 0, + facetOptions: { + freezeFacetOrder: true, + }, +}; + +export const finishType = { + locale: 'en', + debug: false, + tab: 'default', + referrer: 'default', + timezone: 'America/New_York', + visitorId: '147f954b-ddc1-4834-8f71-0de880f7283f', + actionsHistory: [ { - "name": "Query", - "time": "\"2024-03-04T15:42:36.513Z\"" + name: 'Query', + time: '\'2024-03-04T22:26:29.769Z\'', }, { - "name": "Query", - "time": "\"2024-03-04T15:41:15.301Z\"" + name: 'Query', + time: '\'2024-03-04T22:25:42.258Z\'', + value: 'men', }, { - "name": "Query", - "time": "\"2024-03-04T15:35:14.401Z\"" + name: 'Query', + time: '\'2024-03-04T22:25:35.892Z\'', }, { - "name": "Query", - "time": "\"2024-03-04T15:34:12.218Z\"" + name: 'Query', + time: '\'2024-03-04T22:25:02.692Z\'', + value: 'sand', }, { - "name": "Query", - "time": "\"2024-03-04T15:30:34.952Z\"" + name: 'Query', + time: '\'2024-03-04T22:24:46.716Z\'', }, - { - "name": "Query", - "time": "\"2024-03-04T15:27:39.498Z\"" - } ], - "context": { - "host": "stage.lifesciences.danaher.com", - "internal": false - }, - "fieldsToInclude": [ - "author", - "language", - "urihash", - "objecttype", - "collection", - "source", - "permanentid", - "date", - "filetype", - "parents", - "ec_price", - "ec_name", - "ec_description", - "ec_brand", - "ec_category", - "ec_item_group_id", - "ec_shortdesc", - "ec_thumbnails", - "ec_images", - "ec_promo_price", - "ec_in_stock", - "ec_rating", - "brand", - "images", - "sku", - "title", - "description", - "richdescription", - "opco", - "contenttype", - "documenttype", - "pagetype", - "shortspecifications", - "specificationsjson", - "bundlepreviewjson" + fieldsToInclude: [ + 'author', + 'language', + 'urihash', + 'objecttype', + 'collection', + 'source', + 'permanentid', + 'date', + 'filetype', + 'parents', + 'ec_price', + 'ec_name', + 'ec_description', + 'ec_brand', + 'ec_category', + 'ec_item_group_id', + 'ec_shortdesc', + 'ec_thumbnails', + 'ec_images', + 'ec_promo_price', + 'ec_in_stock', + 'ec_rating', + 'cat_rating_count', ], - "q": "", - "enableQuerySyntax": false, - "sortCriteria": "relevancy", - "queryCorrection": { - "enabled": false, - "options": { - "automaticallyCorrect": "whenNoResults" - } - }, - "enableDidYouMean": true, - "facets": [ - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ + pipeline: 'Search', + q: '', + enableQuerySyntax: false, + searchHub: 'MainSearch', + facets: [ + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ { - "value": "Document", - "state": "idle" + value: 'Document', + state: 'idle', }, { - "value": "Product", - "state": "idle" + value: 'Product', + state: 'idle', }, { - "value": "Webpage", - "state": "idle" - } + value: 'Webpage', + state: 'idle', + }, ], - "freezeCurrentValues": true, - "isFieldExpanded": false, - "preventAutoSelect": true, - "facetId": "ContentType", - "field": "contenttype" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ - { - "value": "Document", - "state": "idle" - } + freezeCurrentValues: true, + isFieldExpanded: false, + preventAutoSelect: true, + facetId: 'ContentType', + field: 'contenttype', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ + { + value: 'Document', + state: 'idle', + }, ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "PageType", - "field": "pagetype" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ - { - "value": "Beckman Coulter Life Sciences", - "state": "idle" - }, - { - "value": "IDBS", - "state": "idle" - }, - { - "value": "Leica Microsystems", - "state": "idle" - }, - { - "value": "Molecular Devices", - "state": "idle" - }, - { - "value": "Phenomenex", - "state": "idle" - }, - { - "value": "SCIEX", - "state": "idle" - } + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'PageType', + field: 'pagetype', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ + { + value: 'Beckman Coulter Life Sciences', + state: 'idle', + }, + { + value: 'IDBS', + state: 'idle', + }, + { + value: 'Leica Microsystems', + state: 'idle', + }, + { + value: 'Molecular Devices', + state: 'idle', + }, + { + value: 'Phenomenex', + state: 'idle', + }, + { + value: 'SCIEX', + state: 'idle', + }, ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "Brand", - "field": "opco" - }, - { - "delimitingCharacter": "|", - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "occurrences", - "basePath": [], - "filterByBasePath": true, - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "hierarchical", - "facetId": "ProductType", - "field": "categoriesname" - }, - { - "delimitingCharacter": "|", - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "occurrences", - "basePath": [], - "filterByBasePath": true, - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "hierarchical", - "facetId": "ProcessStep", - "field": "workflowname" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "SubBrand", - "field": "brand" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "ProductClass", - "field": "productclass" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "DocumentType", - "field": "documenttype" - } - ], - "numberOfResults": 10, - "firstResult": 0, - "facetOptions": { - "freezeFacetOrder": true - } -} - -export const finishType = { - "locale": "en", - "debug": false, - "tab": "default", - "referrer": "default", - "timezone": "America/New_York", - "visitorId": "147f954b-ddc1-4834-8f71-0de880f7283f", - "actionsHistory": [ - { - "name": "Query", - "time": "\"2024-03-04T22:26:29.769Z\"" - }, - { - "name": "Query", - "time": "\"2024-03-04T22:25:42.258Z\"", - "value": "men" - }, - { - "name": "Query", - "time": "\"2024-03-04T22:25:35.892Z\"" - }, - { - "name": "Query", - "time": "\"2024-03-04T22:25:02.692Z\"", - "value": "sand" - }, - { - "name": "Query", - "time": "\"2024-03-04T22:24:46.716Z\"" - } - ], - "fieldsToInclude": [ - "author", - "language", - "urihash", - "objecttype", - "collection", - "source", - "permanentid", - "date", - "filetype", - "parents", - "ec_price", - "ec_name", - "ec_description", - "ec_brand", - "ec_category", - "ec_item_group_id", - "ec_shortdesc", - "ec_thumbnails", - "ec_images", - "ec_promo_price", - "ec_in_stock", - "ec_rating", - "cat_rating_count" - ], - "pipeline": "Search", - "q": "", - "enableQuerySyntax": false, - "searchHub": "MainSearch", - "facets": [ - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ - { - "value": "Document", - "state": "idle" - }, - { - "value": "Product", - "state": "idle" - }, - { - "value": "Webpage", - "state": "idle" - } - ], - "freezeCurrentValues": true, - "isFieldExpanded": false, - "preventAutoSelect": true, - "facetId": "ContentType", - "field": "contenttype" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ - { - "value": "Document", - "state": "idle" - } - ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "PageType", - "field": "pagetype" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ - { - "value": "Beckman Coulter Life Sciences", - "state": "idle" - }, - { - "value": "IDBS", - "state": "idle" - }, - { - "value": "Leica Microsystems", - "state": "idle" - }, - { - "value": "Molecular Devices", - "state": "idle" - }, - { - "value": "Phenomenex", - "state": "idle" - }, - { - "value": "SCIEX", - "state": "idle" - } - ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "Brand", - "field": "opco" - }, - { - "delimitingCharacter": "|", - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "occurrences", - "basePath": [], - "filterByBasePath": true, - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "hierarchical", - "facetId": "ProductType", - "field": "categoriesname" - }, - { - "delimitingCharacter": "|", - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "occurrences", - "basePath": [], - "filterByBasePath": true, - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "hierarchical", - "facetId": "ProcessStep", - "field": "workflowname" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "SubBrand", - "field": "brand" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "ProductClass", - "field": "productclass" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "DocumentType", - "field": "documenttype" - } + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'Brand', + field: 'opco', + }, + { + delimitingCharacter: '|', + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'occurrences', + basePath: [], + filterByBasePath: true, + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'hierarchical', + facetId: 'ProductType', + field: 'categoriesname', + }, + { + delimitingCharacter: '|', + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'occurrences', + basePath: [], + filterByBasePath: true, + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'hierarchical', + facetId: 'ProcessStep', + field: 'workflowname', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'SubBrand', + field: 'brand', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'ProductClass', + field: 'productclass', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'DocumentType', + field: 'documenttype', + }, ], - "sortCriteria": "relevancy", - "analytics": { - "clientId": "147f954b-ddc1-4834-8f71-0de880f7283f", - "clientTimestamp": "2024-03-04T22:28:18.381Z", - "documentReferrer": "default", - "originContext": "Search", - "documentLocation": "https://atomicv2-mcgfqb.stackblitz.io/examples/fashion.html", - "capture": false + sortCriteria: 'relevancy', + analytics: { + clientId: '147f954b-ddc1-4834-8f71-0de880f7283f', + clientTimestamp: '2024-03-04T22:28:18.381Z', + documentReferrer: 'default', + originContext: 'Search', + documentLocation: 'https://atomicv2-mcgfqb.stackblitz.io/examples/fashion.html', + capture: false, }, - "enableDidYouMean": true, - "numberOfResults": 4 -} + enableDidYouMean: true, + numberOfResults: 4, +}; export const quickSearch = { locale: 'en', timezone: 'America/New_York', searchHub: 'default', visitorId: '48e4da72-35f0-43ec-9c61-a6aed682e6c3', - "debug": false, - "tab": "default", - "referrer": "default", - "actionsHistory": [ + debug: false, + tab: 'default', + referrer: 'default', + actionsHistory: [ { - "name": "Query", - "time": "\"2024-03-04T22:19:01.829Z\"", - "value": "this is beacon testing" + name: 'Query', + time: '\'2024-03-04T22:19:01.829Z\'', + value: 'this is beacon testing', }, { - "name": "Query", - "time": "\"2024-03-04T22:17:18.017Z\"", - "value": "promega corporation" + name: 'Query', + time: '\'2024-03-04T22:17:18.017Z\'', + value: 'promega corporation', }, { - "name": "Query", - "time": "\"2024-03-04T22:17:10.215Z\"" + name: 'Query', + time: '\'2024-03-04T22:17:10.215Z\'', }, { - "name": "Query", - "time": "\"2024-03-04T20:02:41.386Z\"", - "value": "bank" + name: 'Query', + time: '\'2024-03-04T20:02:41.386Z\'', + value: 'bank', }, { - "name": "Query", - "time": "\"2024-03-04T20:02:32.491Z\"" + name: 'Query', + time: '\'2024-03-04T20:02:32.491Z\'', }, { - "name": "Query", - "time": "\"2024-03-04T18:21:47.520Z\"" + name: 'Query', + time: '\'2024-03-04T18:21:47.520Z\'', }, { - "name": "Query", - "time": "\"2024-03-04T18:20:23.534Z\"" + name: 'Query', + time: '\'2024-03-04T18:20:23.534Z\'', }, { - "name": "Query", - "time": "\"2024-03-04T16:53:48.016Z\"", - "value": "bank" + name: 'Query', + time: '\'2024-03-04T16:53:48.016Z\'', + value: 'bank', }, { - "name": "Query", - "time": "\"2024-03-04T16:52:20.699Z\"" + name: 'Query', + time: '\'2024-03-04T16:52:20.699Z\'', }, { - "name": "Query", - "time": "\"2024-03-04T16:47:47.427Z\"" + name: 'Query', + time: '\'2024-03-04T16:47:47.427Z\'', }, { - "name": "Query", - "time": "\"2024-02-21T14:10:02.721Z\"" + name: 'Query', + time: '\'2024-02-21T14:10:02.721Z\'', }, { - "name": "Query", - "time": "\"2024-02-20T18:58:45.364Z\"" + name: 'Query', + time: '\'2024-02-20T18:58:45.364Z\'', }, { - "name": "Query", - "time": "\"2024-02-20T18:45:48.757Z\"" + name: 'Query', + time: '\'2024-02-20T18:45:48.757Z\'', }, { - "name": "Query", - "time": "\"2024-02-20T18:43:58.682Z\"" + name: 'Query', + time: '\'2024-02-20T18:43:58.682Z\'', }, { - "name": "Query", - "time": "\"2023-12-07T19:35:58.897Z\"" + name: 'Query', + time: '\'2023-12-07T19:35:58.897Z\'', }, { - "name": "Query", - "time": "\"2023-12-07T19:34:42.960Z\"" + name: 'Query', + time: '\'2023-12-07T19:34:42.960Z\'', }, { - "name": "Query", - "time": "\"2023-12-07T19:34:33.361Z\"", - "value": "covid" + name: 'Query', + time: '\'2023-12-07T19:34:33.361Z\'', + value: 'covid', }, { - "name": "Query", - "time": "\"2023-12-07T19:33:31.851Z\"" + name: 'Query', + time: '\'2023-12-07T19:33:31.851Z\'', }, { - "name": "Query", - "time": "\"2023-12-07T19:33:28.699Z\"", - "value": "bank" + name: 'Query', + time: '\'2023-12-07T19:33:28.699Z\'', + value: 'bank', }, { - "name": "Query", - "time": "\"2023-12-07T19:33:26.959Z\"", - "value": "the bank" - } + name: 'Query', + time: '\'2023-12-07T19:33:26.959Z\'', + value: 'the bank', + }, ], - "fieldsToInclude": [ - "author", - "language", - "urihash", - "objecttype", - "collection", - "source", - "permanentid", - "date", - "filetype", - "parents", - "ec_price", - "ec_name", - "ec_description", - "ec_brand", - "ec_category", - "ec_item_group_id", - "ec_shortdesc", - "ec_thumbnails", - "ec_images", - "ec_promo_price", - "ec_in_stock", - "ec_rating", - "snrating", - "sncost" + fieldsToInclude: [ + 'author', + 'language', + 'urihash', + 'objecttype', + 'collection', + 'source', + 'permanentid', + 'date', + 'filetype', + 'parents', + 'ec_price', + 'ec_name', + 'ec_description', + 'ec_brand', + 'ec_category', + 'ec_item_group_id', + 'ec_shortdesc', + 'ec_thumbnails', + 'ec_images', + 'ec_promo_price', + 'ec_in_stock', + 'ec_rating', + 'snrating', + 'sncost', ], - "q": "", - "enableQuerySyntax": false, - "sortCriteria": "relevancy", - "queryCorrection": { - "enabled": false, - "options": { - "automaticallyCorrect": "whenNoResults" - } + q: '', + enableQuerySyntax: false, + sortCriteria: 'relevancy', + queryCorrection: { + enabled: false, + options: { + automaticallyCorrect: 'whenNoResults', + }, }, - "enableDidYouMean": true, - "facets": [ - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 6, - "sortCriteria": "occurrences", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ + enableDidYouMean: true, + facets: [ + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 6, + sortCriteria: 'occurrences', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ { - "value": "Image", - "state": "idle" + value: 'Image', + state: 'idle', }, { - "value": "lithiummessage", - "state": "idle" + value: 'lithiummessage', + state: 'idle', }, { - "value": "lithiumthread", - "state": "idle" + value: 'lithiumthread', + state: 'idle', }, { - "value": "pdf", - "state": "idle" - } + value: 'pdf', + state: 'idle', + }, ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "filetype", - "field": "filetype" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ - { - "value": "Coveo Sample - Lithium Community", - "state": "idle" - } + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'filetype', + field: 'filetype', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ + { + value: 'Coveo Sample - Lithium Community', + state: 'idle', + }, ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "source", - "field": "source" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'source', + field: 'source', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ { - "value": "2021", - "state": "idle" + value: '2021', + state: 'idle', }, { - "value": "2022", - "state": "idle" + value: '2022', + state: 'idle', }, { - "value": "2023", - "state": "idle" - } + value: '2023', + state: 'idle', + }, ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "year", - "field": "year" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 7, - "sortCriteria": "descending", - "rangeAlgorithm": "even", - "resultsMustMatch": "atLeastOneValue", - "currentValues": [ + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'year', + field: 'year', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 7, + sortCriteria: 'descending', + rangeAlgorithm: 'even', + resultsMustMatch: 'atLeastOneValue', + currentValues: [ { - "start": "2024/03/04@17:19:01", - "end": "2034/03/04@17:19:01", - "endInclusive": false, - "state": "idle" + start: '2024/03/04@17:19:01', + end: '2034/03/04@17:19:01', + endInclusive: false, + state: 'idle', }, { - "start": "2024/03/04@16:19:01", - "end": "2024/03/04@17:19:01", - "endInclusive": false, - "state": "idle" + start: '2024/03/04@16:19:01', + end: '2024/03/04@17:19:01', + endInclusive: false, + state: 'idle', }, { - "start": "2024/03/03@17:19:01", - "end": "2024/03/04@17:19:01", - "endInclusive": false, - "state": "idle" + start: '2024/03/03@17:19:01', + end: '2024/03/04@17:19:01', + endInclusive: false, + state: 'idle', }, { - "start": "2024/02/26@17:19:01", - "end": "2024/03/04@17:19:01", - "endInclusive": false, - "state": "idle" + start: '2024/02/26@17:19:01', + end: '2024/03/04@17:19:01', + endInclusive: false, + state: 'idle', }, { - "start": "2024/02/04@17:19:01", - "end": "2024/03/04@17:19:01", - "endInclusive": false, - "state": "idle" + start: '2024/02/04@17:19:01', + end: '2024/03/04@17:19:01', + endInclusive: false, + state: 'idle', }, { - "start": "2023/12/04@17:19:01", - "end": "2024/03/04@17:19:01", - "endInclusive": false, - "state": "idle" + start: '2023/12/04@17:19:01', + end: '2024/03/04@17:19:01', + endInclusive: false, + state: 'idle', }, { - "start": "2023/03/04@17:19:01", - "end": "2024/03/04@17:19:01", - "endInclusive": false, - "state": "idle" - } + start: '2023/03/04@17:19:01', + end: '2024/03/04@17:19:01', + endInclusive: false, + state: 'idle', + }, ], - "preventAutoSelect": false, - "type": "dateRange", - "facetId": "date", - "field": "date", - "generateAutomaticRanges": false - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 1, - "sortCriteria": "ascending", - "rangeAlgorithm": "even", - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "dateRange", - "facetId": "date_input_range", - "generateAutomaticRanges": true, - "field": "date" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 0, - "sortCriteria": "ascending", - "rangeAlgorithm": "even", - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "dateRange", - "facetId": "date_input", - "field": "date", - "generateAutomaticRanges": false - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 6, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "inat_kingdom", - "field": "inat_kingdom", - "hasBreadcrumbs": false - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [ - { - "value": "mardueng", - "state": "idle" - } + preventAutoSelect: false, + type: 'dateRange', + facetId: 'date', + field: 'date', + generateAutomaticRanges: false, + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 1, + sortCriteria: 'ascending', + rangeAlgorithm: 'even', + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'dateRange', + facetId: 'date_input_range', + generateAutomaticRanges: true, + field: 'date', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 0, + sortCriteria: 'ascending', + rangeAlgorithm: 'even', + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'dateRange', + facetId: 'date_input', + field: 'date', + generateAutomaticRanges: false, + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 6, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'inat_kingdom', + field: 'inat_kingdom', + hasBreadcrumbs: false, + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [ + { + value: 'mardueng', + state: 'idle', + }, ], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "author", - "field": "author" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "inat_family", - "field": "inat_family" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "automatic", - "resultsMustMatch": "atLeastOneValue", - "type": "specific", - "currentValues": [], - "freezeCurrentValues": false, - "isFieldExpanded": false, - "preventAutoSelect": false, - "facetId": "inat_class", - "field": "inat_class" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "ascending", - "rangeAlgorithm": "equiprobable", - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "numericalRange", - "facetId": "sncost", - "field": "sncost", - "generateAutomaticRanges": true - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 1, - "sortCriteria": "ascending", - "rangeAlgorithm": "equiprobable", - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "numericalRange", - "generateAutomaticRanges": true, - "facetId": "ytviewcount_input_range", - "field": "ytviewcount" - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 0, - "sortCriteria": "ascending", - "rangeAlgorithm": "even", - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "numericalRange", - "facetId": "ytviewcount_input", - "field": "ytviewcount", - "generateAutomaticRanges": false - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 5, - "sortCriteria": "descending", - "rangeAlgorithm": "even", - "resultsMustMatch": "atLeastOneValue", - "currentValues": [ - { - "start": 5, - "end": 5, - "endInclusive": true, - "state": "idle" - }, - { - "start": 4, - "end": 5, - "endInclusive": true, - "state": "idle" - }, - { - "start": 3, - "end": 5, - "endInclusive": true, - "state": "idle" - }, - { - "start": 2, - "end": 5, - "endInclusive": true, - "state": "idle" - }, - { - "start": 1, - "end": 5, - "endInclusive": true, - "state": "idle" - } + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'author', + field: 'author', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'inat_family', + field: 'inat_family', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [], + freezeCurrentValues: false, + isFieldExpanded: false, + preventAutoSelect: false, + facetId: 'inat_class', + field: 'inat_class', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'ascending', + rangeAlgorithm: 'equiprobable', + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'numericalRange', + facetId: 'sncost', + field: 'sncost', + generateAutomaticRanges: true, + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 1, + sortCriteria: 'ascending', + rangeAlgorithm: 'equiprobable', + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'numericalRange', + generateAutomaticRanges: true, + facetId: 'ytviewcount_input_range', + field: 'ytviewcount', + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 0, + sortCriteria: 'ascending', + rangeAlgorithm: 'even', + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'numericalRange', + facetId: 'ytviewcount_input', + field: 'ytviewcount', + generateAutomaticRanges: false, + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 5, + sortCriteria: 'descending', + rangeAlgorithm: 'even', + resultsMustMatch: 'atLeastOneValue', + currentValues: [ + { + start: 5, + end: 5, + endInclusive: true, + state: 'idle', + }, + { + start: 4, + end: 5, + endInclusive: true, + state: 'idle', + }, + { + start: 3, + end: 5, + endInclusive: true, + state: 'idle', + }, + { + start: 2, + end: 5, + endInclusive: true, + state: 'idle', + }, + { + start: 1, + end: 5, + endInclusive: true, + state: 'idle', + }, ], - "preventAutoSelect": false, - "type": "numericalRange", - "facetId": "snrating_range", - "field": "snrating", - "generateAutomaticRanges": false - }, - { - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 5, - "sortCriteria": "descending", - "rangeAlgorithm": "even", - "resultsMustMatch": "atLeastOneValue", - "currentValues": [ + preventAutoSelect: false, + type: 'numericalRange', + facetId: 'snrating_range', + field: 'snrating', + generateAutomaticRanges: false, + }, + { + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 5, + sortCriteria: 'descending', + rangeAlgorithm: 'even', + resultsMustMatch: 'atLeastOneValue', + currentValues: [ { - "start": 5, - "end": 6, - "endInclusive": false, - "state": "idle" + start: 5, + end: 6, + endInclusive: false, + state: 'idle', }, { - "start": 4, - "end": 5, - "endInclusive": false, - "state": "idle" + start: 4, + end: 5, + endInclusive: false, + state: 'idle', }, { - "start": 3, - "end": 4, - "endInclusive": false, - "state": "idle" + start: 3, + end: 4, + endInclusive: false, + state: 'idle', }, { - "start": 2, - "end": 3, - "endInclusive": false, - "state": "idle" + start: 2, + end: 3, + endInclusive: false, + state: 'idle', }, { - "start": 1, - "end": 2, - "endInclusive": false, - "state": "idle" - } + start: 1, + end: 2, + endInclusive: false, + state: 'idle', + }, ], - "preventAutoSelect": false, - "type": "numericalRange", - "facetId": "snrating", - "field": "snrating", - "generateAutomaticRanges": false - }, - { - "delimitingCharacter": ";", - "filterFacetCount": true, - "injectionDepth": 1000, - "numberOfValues": 8, - "sortCriteria": "occurrences", - "basePath": [], - "filterByBasePath": true, - "resultsMustMatch": "atLeastOneValue", - "currentValues": [], - "preventAutoSelect": false, - "type": "hierarchical", - "facetId": "geographicalhierarchy", - "field": "geographicalhierarchy" - } + preventAutoSelect: false, + type: 'numericalRange', + facetId: 'snrating', + field: 'snrating', + generateAutomaticRanges: false, + }, + { + delimitingCharacter: ';', + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'occurrences', + basePath: [], + filterByBasePath: true, + resultsMustMatch: 'atLeastOneValue', + currentValues: [], + preventAutoSelect: false, + type: 'hierarchical', + facetId: 'geographicalhierarchy', + field: 'geographicalhierarchy', + }, ], - "numberOfResults": 10, - "firstResult": 0, - "facetOptions": { - "freezeFacetOrder": false - } -} \ No newline at end of file + numberOfResults: 10, + firstResult: 0, + facetOptions: { + freezeFacetOrder: false, + }, +}; diff --git a/blocks/header/header.js b/blocks/header/header.js index 0562c3ca6..9c4f15681 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -7,7 +7,13 @@ import { makeCoveoApiRequest, } from '../../scripts/commerce.js'; import { createRequest, debounce, getCookie } from '../../scripts/scripts.js'; -import { facetDeselect, facetSelect, finishType, quickSearch, suggestions } from './coveo-body-requests.js'; +import { + facetDeselect, + facetSelect, + finishType, + // quickSearch, + suggestions, +} from './coveo-body-requests.js'; const baseURL = getCommerceBase(); @@ -20,50 +26,59 @@ const bearerToken = 'xx2a2e7271-78c3-4e3b-bac3-2fcbab75323b'; let selectedSuggestionIndex = -1; -const fetchSuggestions = debounce(async (value) => { - try { - const url = `https://${organizationId}.org.coveo.com/rest/search/v2/querySuggest`; - suggestions.q = value; - const body = JSON.stringify(suggestions); - const request = await createRequest({ - url, - method: 'POST', - authToken: bearerToken, - body, - }); - const response = await request.json(); - // console.log(response); - // CREATING THE LAYOUT - const suggestionsBox = document.querySelector('#search-suggestions'); - suggestionsBox.innerHTML = ''; - if (response.completions && response.completions.length > 0) { - for (let suggestionRes of response.completions) { - // console.log(suggestionRes); - const suggestion = p({ - class: 'flex items-center gap-x-3 px-1 py-1 select-none cursor-pointer hover:bg-gray-600/40', - }); - suggestion.innerHTML = - ''; - suggestion.append(span({ class: '' }, suggestionRes.expression)); - suggestionsBox.append(suggestion); - suggestion.addEventListener('click', () => { - // console.log('Suggestion clicked', suggestionRes.expression); - document.querySelector('#search-input').value = suggestionRes.expression; - fetchFinishType(suggestionRes.expression); - document.querySelector('#search-suggestions').innerHTML = ''; - }); - } - } else { - suggestionsBox.append(p({ class: 'text-center' }, 'No Results Found')); - } - } catch (e) { - console.log('Something happenned during request submission', e); - } -}); +const selectFacet = debounce(async (selected, list) => { + // console.log('Select Facet: ', selected, list); + const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; + facetSelect.q = document.querySelector('#search-input').value; + facetSelect.facets = list; + const body = JSON.stringify(facetSelect); + const request = await createRequest({ + url, + method: 'POST', + authToken: bearerToken, + body, + }); + // eslint-disable-next-line no-unused-vars + const response = await request.json(); + // console.log(response); +}, 100); + +const deselectFacet = debounce(async (selected, list) => { + // console.log('De-select Facet: ', selected, list); + const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; + facetSelect.q = document.querySelector('#search-input').value; + facetSelect.facets = list; + const body = JSON.stringify(facetDeselect); + const request = await createRequest({ + url, + method: 'POST', + authToken: bearerToken, + body, + }); + // eslint-disable-next-line no-unused-vars + const response = await request.json(); + // console.log(response); + const searchInput = document.querySelector('#search-input'); + searchInput.parentElement.querySelector(`#facet-${selected.value}`).remove(); +}, 100); + +// const fetchQuickSearch = debounce(async (value) => { +// const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; +// quickSearch.q = value; +// const body = JSON.stringify(quickSearch); +// const request = await createRequest({ +// url, +// method: 'POST', +// authToken: bearerToken, +// body, +// }); +// const response = await request.json(); +// // console.log(response); +// }, 400); const fetchFinishType = debounce(async (value) => { // console.log(value); - const url = `https://fashioncoveodemocomgzh7iep8.org.coveo.com/rest/search/v2`; + const url = 'https://fashioncoveodemocomgzh7iep8.org.coveo.com/rest/search/v2'; finishType.q = value; const body = JSON.stringify(finishType); const request = await createRequest({ @@ -74,29 +89,32 @@ const fetchFinishType = debounce(async (value) => { }); const response = await request.json(); // console.log('Finish Typing: ', response); - const { facets, totalCount=0 } = response; + const { facets, totalCount = 0 } = response; // CREATING THE LAYOUT document.querySelector('#total-result-count').innerHTML = totalCount; if (facets && facets.length > 0) { const searchContent = document.querySelector('#search-content'); searchContent.innerHTML = ''; - const facetWithContent = facets.filter(facet => facet.values.length > 0); - // console.log(facets, searchContent, facetWithContent); - for (let facetCategoryIndex = 0; facetCategoryIndex < facetWithContent.length; facetCategoryIndex++) { + const facetWithContent = facets.filter((facet) => facet.values.length > 0); + for ( + let facetCategoryIndex = 0; + facetCategoryIndex < facetWithContent.length; + facetCategoryIndex += 1 + ) { const facetCategory = facetWithContent[facetCategoryIndex]; const facetGroup = div({ class: 'flex flex-col' }); const facetList = ul({ class: 'space-y-3 pl-3 border-l border-black' }); if (facetCategory.values.length > 0) { - for (let facetIndex = 0; facetIndex < facetCategory.values.length; facetIndex++) { + for (let facetIndex = 0; facetIndex < facetCategory.values.length; facetIndex += 1) { if (facetCategory.values[facetIndex].value) { const facetElement = li({ class: 'w-max px-4 py-2 rounded-full select-none bg-danaherpurple-25 hover:bg-danaherpurple-50 text-base leading-4 text-danaherpurple-800 font-normal space-x-1 cursor-pointer' }, facetCategory.values[facetIndex].value); facetList.append(facetElement); - facetElement.addEventListener('click', function() { + facetElement.addEventListener('click', () => { selectFacet(facetCategory.values[facetIndex], facetWithContent); const searchInput = document.querySelector('#search-input'); - const selectedFacet = span({ id: `facet-${facetCategory.values[facetIndex].value}`, class: 'flex gap-x-2 px-5 py-2 bg-danaherpurple-50 rounded-full' }, facetCategory.values[facetIndex].value); + const selectedFacet = span({ id: `facet-${facetCategory.values[facetIndex].value}`, class: 'flex gap-x-2 pr-[5px] py-[5px] pl-4 text-white bg-danaherpurple-500 rounded-full select-none' }, facetCategory.values[facetIndex].value); selectedFacet.innerHTML += ''; - selectedFacet.addEventListener('click', function() { + selectedFacet.addEventListener('click', () => { deselectFacet(facetCategory.values[facetIndex], facetWithContent); }); searchInput.parentElement.insertBefore(selectedFacet, searchInput); @@ -111,53 +129,51 @@ const fetchFinishType = debounce(async (value) => { } }, 800); -const selectFacet = debounce(async (selected, list) => { - // console.log('Select Facet: ', selected, list); - const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; - facetSelect.q = document.querySelector('#search-input').value; - facetSelect.facets = list; - const body = JSON.stringify(facetSelect); - const request = await createRequest({ - url, - method: 'POST', - authToken: bearerToken, - body, - }); - const response = await request.json(); - // console.log(response); -}, 100); - -const deselectFacet = debounce(async (selected, list) => { - // console.log('De-select Facet: ', selected, list); - const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; - facetSelect.q = document.querySelector('#search-input').value; - facetSelect.facets = list; - const body = JSON.stringify(facetDeselect); - const request = await createRequest({ - url, - method: 'POST', - authToken: bearerToken, - body, - }); - const response = await request.json(); - // console.log(response); - const searchInput = document.querySelector('#search-input'); - searchInput.parentElement.querySelector(`#facet-${selected.value}`).remove(); -}, 100); - -const fetchQuickSearch = debounce(async (value) => { - const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; - quickSearch.q = value; - const body = JSON.stringify(quickSearch); - const request = await createRequest({ - url, - method: 'POST', - authToken: bearerToken, - body, - }); - const response = await request.json(); - // console.log(response); -}, 400); +const fetchSuggestions = debounce(async (value) => { + try { + const url = `https://${organizationId}.org.coveo.com/rest/search/v2/querySuggest`; + suggestions.q = value; + const body = JSON.stringify(suggestions); + const request = await createRequest({ + url, + method: 'POST', + authToken: bearerToken, + body, + }); + const response = await request.json(); + // console.log(response); + // CREATING THE LAYOUT + const suggestionsBox = document.querySelector('#search-suggestions'); + suggestionsBox.innerHTML = ''; + if (response.completions && response.completions.length > 0) { + for ( + let suggestionIndex = 0; + suggestionIndex < response.completions.length; + suggestionIndex += 1 + ) { + const suggestionRes = response.completions[suggestionIndex]; + const suggestion = p({ + class: 'flex items-center gap-x-3 px-1 py-1 select-none cursor-pointer hover:bg-gray-600/40', + }); + suggestion.innerHTML = ''; + suggestion.append(span({ class: '' }, suggestionRes.expression)); + suggestionsBox.append(suggestion); + suggestion.addEventListener('click', () => { + document.querySelector('#search-input').value = suggestionRes.expression; + fetchFinishType(suggestionRes.expression); + document.querySelector('#search-suggestions').innerHTML = ''; + }); + } + // for (const suggestionRes of response.completions) { + // console.log(suggestionRes); + // } + } else { + suggestionsBox.append(p({ class: 'text-center' }, 'No Results Found')); + } + } catch (e) { + // console.log('Something happenned during request submission', e); + } +}); function shortName(user) { if (user) { @@ -310,7 +326,7 @@ async function buildSearchSuggestions(searchbox) { const inputText = searchboxInput.value; const requestPayload = getCoveoApiPayload(inputText, 'search'); const suggestionsResponseData = await makeCoveoApiRequest('/rest/search/v2/querySuggest', 'searchKey', requestPayload); - const suggestions = suggestionsResponseData.completions; + const suggestionsData = suggestionsResponseData.completions; const wrapper = searchbox.querySelector('.search-suggestions-wrapper'); const searchSuggestions = wrapper.querySelector('.search-suggestions'); searchSuggestions.innerHTML = ''; @@ -331,7 +347,7 @@ async function buildSearchSuggestions(searchbox) { searchSuggestions.append(recentSearchesHeading); recentSearches.forEach((recentSearch) => searchSuggestions.append(buildSearchSuggestion(recentSearch, 'recent'))); } - suggestions.forEach((suggestion) => searchSuggestions.append( + suggestionsData.forEach((suggestion) => searchSuggestions.append( buildSearchSuggestion(formatSuggestionString(suggestion.highlighted, inputText), 'suggestion'), )); } @@ -420,11 +436,10 @@ function getSearchInput() { type: 'text', placeholder: 'Search', id: 'search-by-coveo', - 'autocomplete': 'off', class: 'h-full outline-none bg-transparent w-full grow px-4 py-3.5 text-lg', title: 'Search field with suggestions. Suggestions may be available under this field. To send, press Enter.', }), - ) + ); const inputWrapper = div( { class: 'w-full relative flex bg-gray-50 border border-gray-600 rounded-lg focus-within:ring focus-within:border-primary focus-within:ring-ring-primary', @@ -870,17 +885,17 @@ export default async function decorate(block) { } // DISPLAY COVEO { BACKDROP } ON DESKTOP - document.querySelector('#search-by-coveo').addEventListener('click', function () { + document.querySelector('#search-by-coveo').addEventListener('click', () => { // console.log('Coveo being clicked'); document.querySelector('#search-container').classList.toggle('-translate-y-full'); document.querySelector('#search-input').focus(); }); // CLOSE COVEO { BACKDROP } ON DESKTOP/MOBILE - document.querySelector('#close-search-container').addEventListener('click', function () { + document.querySelector('#close-search-container').addEventListener('click', () => { document.querySelector('#search-container').classList.toggle('-translate-y-full'); }); - document.querySelector('#search-input').addEventListener('keyup', function (event) { - const value = event.target.value; + document.querySelector('#search-input').addEventListener('keyup', (event) => { + const { value } = event.target; if (value.trim() !== '') { fetchSuggestions(value); fetchFinishType(value); @@ -889,13 +904,13 @@ export default async function decorate(block) { document.querySelector('#search-suggestions').innerHTML = ''; } }); - document.querySelector('#search-input').addEventListener('blur', function () { + document.querySelector('#search-input').addEventListener('blur', () => { setTimeout(() => { document.querySelector('#search-suggestions').innerHTML = ''; }, 200); }); // NULLIFY COVEO SEARCH TYPE-VALUE & SUGGESTIONS - document.querySelector('#empty-searchbar').addEventListener('click', function () { + document.querySelector('#empty-searchbar').addEventListener('click', () => { document.querySelector('#search-input').value = ''; document.querySelector('#search-suggestions').innerHTML = ''; }); diff --git a/scripts/carousel.js b/scripts/carousel.js index a607bbf26..e1ceae8cf 100644 --- a/scripts/carousel.js +++ b/scripts/carousel.js @@ -1,4 +1,4 @@ -import { debounce } from "./scripts.js"; +import { debounce } from './scripts.js'; export default function Carousel({ wrapperEl, diff --git a/scripts/scripts.js b/scripts/scripts.js index a8edbc271..d22a66f61 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -54,10 +54,13 @@ export function createRequest(config) { 'Content-Type': type, Accept: 'application/json', }; - let configuration = { method, headers }; - if (body) configuration['body'] = body; - if (authToken && authToken.trim() !== '') - headers['Authorization'] = `Bearer ${authToken}`; + const configuration = { method, headers }; + if (body) { + configuration.body = body; + } + if (authToken && authToken.trim() !== '') { + headers.Authorization = `Bearer ${authToken}`; + } return fetch(url, configuration); } diff --git a/styles/styles.css b/styles/styles.css index 1341f6fa6..e4e487d42 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -4729,6 +4729,11 @@ main .default-content-wrapper ul { padding-bottom: 2.25rem; } +.py-\[5px\] { + padding-top: 5px; + padding-bottom: 5px; +} + .\!pb-0 { padding-bottom: 0px !important; } @@ -4829,6 +4834,10 @@ main .default-content-wrapper ul { padding-right: 2rem; } +.pr-\[5px\] { + padding-right: 5px; +} + .ps-2 { padding-inline-start: 0.5rem; } From 0f2e520f206a8b7916c60dfa5e204a49abd5167c Mon Sep 17 00:00:00 2001 From: Amlan Sengupta Date: Tue, 19 Mar 2024 23:19:27 +0530 Subject: [PATCH 3/8] removed comments --- blocks/header/header.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 9c4f15681..42a376c4f 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -164,9 +164,6 @@ const fetchSuggestions = debounce(async (value) => { document.querySelector('#search-suggestions').innerHTML = ''; }); } - // for (const suggestionRes of response.completions) { - // console.log(suggestionRes); - // } } else { suggestionsBox.append(p({ class: 'text-center' }, 'No Results Found')); } From 4a022bcd8e25e9195feeef50a95a90157a3e8104 Mon Sep 17 00:00:00 2001 From: Amlan Sengupta Date: Sat, 6 Apr 2024 02:14:57 +0530 Subject: [PATCH 4/8] Search Popup all API integration along with facet-selection-and-de_selection, facet-with-number-of-results, search-result-page --- blocks/header/header.js | 197 ++++++++++++++++++++++++---------------- styles/styles.css | 46 +++++----- 2 files changed, 140 insertions(+), 103 deletions(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index d799482e1..24c1dc2c9 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -8,47 +8,85 @@ import { } from '../../scripts/commerce.js'; import { createRequest, debounce, getCookie } from '../../scripts/scripts.js'; import { - facetDeselect, facetSelect, finishType, - // quickSearch, suggestions, } from './coveo-body-requests.js'; +let payload = {}; +const facetsCollection = {}; + const baseURL = getCommerceBase(); const COVEO_SEARCH_HUB = 'DanaherMainSearch'; const COVEO_PIPELINE = 'Danaher Marketplace'; const COVEO_MAX_RECENT_SEARCHES = 3; -const organizationId = 'danahernonproduction1892f3fhz'; -const bearerToken = 'xx2a2e7271-78c3-4e3b-bac3-2fcbab75323b'; +const organizationId = window.DanaherConfig.searchOrg; +const bearerToken = window.DanaherConfig.searchKey; let selectedSuggestionIndex = -1; -const selectFacet = debounce(async (selected, list) => { - // console.log('Select Facet: ', selected, list); - const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; - facetSelect.q = document.querySelector('#search-input').value; - facetSelect.facets = list; - const body = JSON.stringify(facetSelect); - const request = await createRequest({ - url, - method: 'POST', - authToken: bearerToken, - body, - }); - // eslint-disable-next-line no-unused-vars - const response = await request.json(); - // console.log(response); -}, 100); +function decorateViewResultsURL() { + const queryParam = new URLSearchParams(''); + if ((Object.keys(payload).length > 0 && payload.q && payload.q !== '') || Object.keys(facetsCollection).length > 0) { + if (Object.keys(payload).length > 0 && payload.q && payload.q !== '') { + queryParam.append('q', payload.q); + } + if (Object.keys(facetsCollection).length > 0) { + Object.keys(facetsCollection).forEach((facetCollect) => { + queryParam.append(`f-${facetCollect}`, facetsCollection[facetCollect]); + }); + } + const allSearchResultAnchors = document.querySelectorAll('#search-container a'); + if (allSearchResultAnchors.length > 0) { + allSearchResultAnchors.forEach((searchResultAnchors) => { + searchResultAnchors.href = `${window.location.href}?${queryParam.toString()}`; + }); + } + } +} -const deselectFacet = debounce(async (selected, list) => { - // console.log('De-select Facet: ', selected, list); +const facetAction = debounce(async (selected, listType, mode) => { const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; - facetSelect.q = document.querySelector('#search-input').value; - facetSelect.facets = list; - const body = JSON.stringify(facetDeselect); + const query = document.querySelector('#search-input')?.value; + const filteredFacets = payload.facets.map((fac) => { + if (fac.facetId === listType) { + fac.values.forEach((curFacVal, curFacValIndex) => { + if (curFacVal.value === selected.value) fac.values[curFacValIndex].state = (mode === 'select') ? 'selected' : 'idle'; + delete fac.values[curFacValIndex]?.numberOfResults; + }); + } + const newFac = { + ...fac, + filterFacetCount: true, + injectionDepth: 1000, + numberOfValues: 8, + sortCriteria: 'automatic', + resultsMustMatch: 'atLeastOneValue', + type: 'specific', + currentValues: [...fac.values], + }; + delete newFac.values; + return newFac; + }); + const facetSelectJSON = { + ...payload, + ...{ + facets: filteredFacets, + q: query, + fieldsToInclude: facetSelect.fieldsToInclude, + pipeline: facetSelect.pipeline, + context: facetSelect.context, + searchHub: facetSelect.searchHub, + sortCriteria: facetSelect.sortCriteria, + }, + }; + delete facetSelectJSON?.index; + delete facetSelectJSON?.indexDuration; + delete facetSelectJSON?.indexRegion; + delete facetSelectJSON?.indexToken; + const body = JSON.stringify(facetSelectJSON); const request = await createRequest({ url, method: 'POST', @@ -57,41 +95,13 @@ const deselectFacet = debounce(async (selected, list) => { }); // eslint-disable-next-line no-unused-vars const response = await request.json(); - // console.log(response); - const searchInput = document.querySelector('#search-input'); - searchInput.parentElement.querySelector(`#facet-${selected.value}`).remove(); + const { facets, totalCount = 0 } = response; + payload = { ...payload, ...response, ...{ q: query } }; + // eslint-disable-next-line no-use-before-define + decorateSearchPopup(facets, totalCount); }, 100); -// const fetchQuickSearch = debounce(async (value) => { -// const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; -// quickSearch.q = value; -// const body = JSON.stringify(quickSearch); -// const request = await createRequest({ -// url, -// method: 'POST', -// authToken: bearerToken, -// body, -// }); -// const response = await request.json(); -// // console.log(response); -// }, 400); - -const fetchFinishType = debounce(async (value) => { - // console.log(value); - const url = 'https://fashioncoveodemocomgzh7iep8.org.coveo.com/rest/search/v2'; - finishType.q = value; - const body = JSON.stringify(finishType); - const request = await createRequest({ - url, - method: 'POST', - authToken: 'xx149e3ec9-786f-4c6c-b64f-49a403b930de', - body, - }); - const response = await request.json(); - // console.log('Finish Typing: ', response); - const { facets, totalCount = 0 } = response; - // CREATING THE LAYOUT - document.querySelector('#total-result-count').innerHTML = totalCount; +function decorateSearchPopup(facets, totalCount) { if (facets && facets.length > 0) { const searchContent = document.querySelector('#search-content'); searchContent.innerHTML = ''; @@ -102,31 +112,58 @@ const fetchFinishType = debounce(async (value) => { facetCategoryIndex += 1 ) { const facetCategory = facetWithContent[facetCategoryIndex]; + const listType = facetCategory.facetId; const facetGroup = div({ class: 'flex flex-col' }); const facetList = ul({ class: 'space-y-3 pl-3 border-l border-black' }); if (facetCategory.values.length > 0) { for (let facetIndex = 0; facetIndex < facetCategory.values.length; facetIndex += 1) { - if (facetCategory.values[facetIndex].value) { - const facetElement = li({ class: 'w-max px-4 py-2 rounded-full select-none bg-danaherpurple-25 hover:bg-danaherpurple-50 text-base leading-4 text-danaherpurple-800 font-normal space-x-1 cursor-pointer' }, facetCategory.values[facetIndex].value); + const searchExistingFacet = listType in facetsCollection; + if (facetCategory.values[facetIndex].value && (!searchExistingFacet)) { + const facetElement = li({ class: 'w-max px-4 py-2 rounded-full select-none bg-danaherpurple-25 hover:bg-danaherpurple-50 text-base leading-4 text-danaherpurple-800 font-normal flex items-center gap-x-2 cursor-pointer' }, span({ class: 'w-40 truncate', title: facetCategory.values[facetIndex].value }, facetCategory.values[facetIndex].value)); + facetElement.append(span({ class: 'text-xs font-normal bg-white text-danaher-purple-800 rounded-full py-1 px-2' }, facetCategory.values[facetIndex]?.numberOfResults)); facetList.append(facetElement); facetElement.addEventListener('click', () => { - selectFacet(facetCategory.values[facetIndex], facetWithContent); + facetsCollection[listType] = facetCategory.values[facetIndex].value; + facetAction(facetCategory.values[facetIndex], listType, 'select'); const searchInput = document.querySelector('#search-input'); - const selectedFacet = span({ id: `facet-${facetCategory.values[facetIndex].value}`, class: 'flex gap-x-2 pr-[5px] py-[5px] pl-4 text-white bg-danaherpurple-500 rounded-full select-none' }, facetCategory.values[facetIndex].value); + const selectedFacet = span({ id: `facet-${facetCategory.values[facetIndex].value}`, class: 'flex gap-x-2 pr-[5px] py-[5px] pl-4 text-white bg-danaherpurple-500 rounded-full select-none', title: facetCategory.values[facetIndex].value }, span({ class: 'max-w-24 truncate' }, facetCategory.values[facetIndex].value)); selectedFacet.innerHTML += ''; selectedFacet.addEventListener('click', () => { - deselectFacet(facetCategory.values[facetIndex], facetWithContent); + facetAction(facetCategory.values[facetIndex], listType, 'idle'); + searchInput.parentElement.removeChild(selectedFacet); + if (searchExistingFacet) delete facetsCollection[listType]; }); searchInput.parentElement.insertBefore(selectedFacet, searchInput); }); } } - facetGroup.append(h3({ class: 'font-medium text-black text-2xl leading-8 mb-2' }, facetCategory.facetId.replace(/([A-Z])/g, ' $&'))); - facetGroup.append(facetList); - searchContent.append(facetGroup); + if (facetList.children.length > 0) { + facetGroup.append(h3({ class: 'font-medium text-black text-2xl leading-8 mb-2' }, facetCategory.facetId.replace(/([A-Z])/g, ' $&'))); + facetGroup.append(facetList); + searchContent.append(facetGroup); + } } } + decorateViewResultsURL(); } + document.querySelector('#total-result-count').innerHTML = totalCount; +} + +const fetchFinishType = debounce(async (value) => { + const url = `https://${organizationId}.org.coveo.com/rest/search/v2`; + const facetSelectJSON = { ...finishType, q: value, ...payload?.facets }; + const body = JSON.stringify(facetSelectJSON); + const request = await createRequest({ + url, + method: 'POST', + authToken: bearerToken, + body, + }); + const response = await request.json(); + const { facets, totalCount = 0 } = response; + payload = { ...payload, ...response, ...{ q: value } }; + // CREATING THE LAYOUT + decorateSearchPopup(facets, totalCount); }, 800); const fetchSuggestions = debounce(async (value) => { @@ -141,7 +178,6 @@ const fetchSuggestions = debounce(async (value) => { body, }); const response = await request.json(); - // console.log(response); // CREATING THE LAYOUT const suggestionsBox = document.querySelector('#search-suggestions'); suggestionsBox.innerHTML = ''; @@ -168,7 +204,8 @@ const fetchSuggestions = debounce(async (value) => { suggestionsBox.append(p({ class: 'text-center' }, 'No Results Found')); } } catch (e) { - // console.log('Something happenned during request submission', e); + // eslint-disable-next-line no-console + console.error('Something happenned during request submission', e); } }); @@ -223,7 +260,7 @@ function getCoveoApiPayload(searchValue, type) { const clientId = getCookie('coveo_visitorId'); const searchHistoryString = localStorage.getItem('__coveo.analytics.history'); const searchHistory = searchHistoryString ? JSON.parse(searchHistoryString) : []; - const payload = { + const coveoPayload = { analytics: { clientId, clientTimestamp: userTimestamp, @@ -240,14 +277,15 @@ function getCoveoApiPayload(searchValue, type) { }; if (type === 'search') { - payload.actionsHistory = searchHistory.map(({ time, value, name }) => ({ time, value, name })); - payload.clientId = clientId; - payload.clientTimestamp = userTimestamp; - payload.originContext = 'Search'; - payload.count = 8; - payload.referrer = document.referrer; + // eslint-disable-next-line max-len + coveoPayload.actionsHistory = searchHistory.map(({ time, value, name }) => ({ time, value, name })); + coveoPayload.clientId = clientId; + coveoPayload.clientTimestamp = userTimestamp; + coveoPayload.originContext = 'Search'; + coveoPayload.count = 8; + coveoPayload.referrer = document.referrer; } - return payload; + return coveoPayload; } async function submitSearchQuery(searchInput, actionCause = '') { @@ -804,15 +842,14 @@ function buildFlyoutMenus(headerBlock) { } function buildSearchBackdrop(headerBlock) { - // console.log('Search Backdrop', headerBlock); const searchBackdropContainer = div({ id: 'search-container', class: 'w-screen h-screen fixed top-0 left-0 bg-white opacity-100 z-50 transition-all -translate-y-full' }); const resultsBanner = '

Total results

0

Visit Results
'; - const closeSearchBackdrop = '
'; + const closeSearchBackdrop = '
'; const searchProduct = div({ id: 'search-product', class: 'w-full md:w-3/4 mx-auto sm:py-7' }); searchProduct.innerHTML += ''; - searchProduct.innerHTML += '
'; + searchProduct.innerHTML += ''; searchProduct.innerHTML += '

Search for targets, biochemicals, applications, species and more

'; - const searchContent = div({ id: 'search-content', class: 'w-full md:w-3/4 mx-auto mb-3 grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-x-12 gap-y-3' }); + const searchContent = div({ id: 'search-content', class: 'w-full md:w-3/4 grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-x-12 gap-y-3 overflow-auto mx-auto mb-3' }); searchBackdropContainer.append(searchProduct); searchBackdropContainer.append(searchContent); searchBackdropContainer.innerHTML += closeSearchBackdrop; diff --git a/styles/styles.css b/styles/styles.css index 9b10f91db..04c74e6fb 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -3749,6 +3749,10 @@ main .default-content-wrapper ul { width: 80%; } +.w-40 { + width: 10rem; +} + .w-48 { width: 12rem; } @@ -3814,6 +3818,11 @@ main .default-content-wrapper ul { width: max-content; } +.w-min { + width: -moz-min-content; + width: min-content; +} + .w-screen { width: 100vw; } @@ -4156,12 +4165,6 @@ main .default-content-wrapper ul { row-gap: 2rem; } -.space-x-1 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(0.25rem * var(--tw-space-x-reverse)); - margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse))); -} - .space-x-2 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(0.5rem * var(--tw-space-x-reverse)); @@ -4267,6 +4270,12 @@ main .default-content-wrapper ul { overflow-x: auto; } +.truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + .whitespace-nowrap { white-space: nowrap; } @@ -4429,11 +4438,6 @@ main .default-content-wrapper ul { background-color: transparent !important; } -.bg-\[\#F5EFFF\] { - --tw-bg-opacity: 1; - background-color: rgb(245 239 255 / var(--tw-bg-opacity)); -} - .bg-black { --tw-bg-opacity: 1; background-color: rgb(0 0 0 / var(--tw-bg-opacity)); @@ -5672,10 +5676,6 @@ main .section.top-border { border-width: 1px; } - .sm\:border-solid { - border-style: solid; - } - .sm\:px-0 { padding-left: 0px; padding-right: 0px; @@ -5943,16 +5943,16 @@ main .section.top-border { padding-bottom: 0px; } - .md\:py-1 { - padding-top: 0.25rem; - padding-bottom: 0.25rem; - } - .md\:py-16 { padding-top: 4rem; padding-bottom: 4rem; } + .md\:py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + } + .md\:py-4 { padding-top: 1rem; padding-bottom: 1rem; @@ -6222,9 +6222,9 @@ main .section.top-border { padding-bottom: 3.5rem; } - .lg\:py-2 { - padding-top: 0.5rem; - padding-bottom: 0.5rem; + .lg\:py-4 { + padding-top: 1rem; + padding-bottom: 1rem; } .lg\:py-8 { From 678a5855a8effb25d162d0317b66565e7c6a8375 Mon Sep 17 00:00:00 2001 From: davenichols-DHLS <124819426+davenichols-DHLS@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:17:02 +0100 Subject: [PATCH 5/8] Update header.js Updating to use hostname and search page --- blocks/header/header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 24c1dc2c9..61546e242 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -41,7 +41,7 @@ function decorateViewResultsURL() { const allSearchResultAnchors = document.querySelectorAll('#search-container a'); if (allSearchResultAnchors.length > 0) { allSearchResultAnchors.forEach((searchResultAnchors) => { - searchResultAnchors.href = `${window.location.href}?${queryParam.toString()}`; + searchResultAnchors.href = `${window.location.hostname}/us/en/search.html?${queryParam.toString()}`; }); } } From a37f362e24b7dd9832b20ad3ccdd5175e7795505 Mon Sep 17 00:00:00 2001 From: davenichols-DHLS <124819426+davenichols-DHLS@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:18:58 +0100 Subject: [PATCH 6/8] Update header.js --- blocks/header/header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 61546e242..7c599d42a 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -41,7 +41,7 @@ function decorateViewResultsURL() { const allSearchResultAnchors = document.querySelectorAll('#search-container a'); if (allSearchResultAnchors.length > 0) { allSearchResultAnchors.forEach((searchResultAnchors) => { - searchResultAnchors.href = `${window.location.hostname}/us/en/search.html?${queryParam.toString()}`; + searchResultAnchors.href = `/us/en/search.html?${queryParam.toString()}`; }); } } From b2cd6d11197d335fbfb4859d458c4f22364c5596 Mon Sep 17 00:00:00 2001 From: davenichols-DHLS <124819426+davenichols-DHLS@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:02:04 +0100 Subject: [PATCH 7/8] Update header.js Testing out function call to search page --- blocks/header/header.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 7c599d42a..829dc4968 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -41,7 +41,8 @@ function decorateViewResultsURL() { const allSearchResultAnchors = document.querySelectorAll('#search-container a'); if (allSearchResultAnchors.length > 0) { allSearchResultAnchors.forEach((searchResultAnchors) => { - searchResultAnchors.href = `/us/en/search.html?${queryParam.toString()}`; + //searchResultAnchors.href = `/us/en/search.html#${queryParam.toString()}`; + searchResultAnchors.href = `https://lifesciences.danaher.com/us/en/search.html#${queryParam.toString()}`; }); } } From ee1dbfbcb6c0507a5dc5d51f3060b5ec1899fbd3 Mon Sep 17 00:00:00 2001 From: "Sengupta, Amlan" Date: Fri, 10 May 2024 01:20:38 +0530 Subject: [PATCH 8/8] lint fixes & re-design changes for mobile --- blocks/header/header.js | 14 +++++++------- styles/styles.css | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 933dd81aa..8c04f81dd 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -833,12 +833,12 @@ function buildSearchBackdrop(headerBlock) { div( { id: 'search-product', - class: 'container mx-auto sm:py-7', + class: 'container mx-auto sm:pt-7', }, div( - { class: 'hidden md:flex justify-between items-center mb-4' }, - h1({ class: 'text-5xl text-black mb-3' }, 'Search'), - p({ class: 'w-96 ml-28' }, 'Search by keyword phrase, products, or applications across the Life Science Companies of Danaher'), + { class: 'flex justify-between items-center mb-0 md:mb-4 px-4 md:px-0' }, + h1({ class: 'text-2xl md:text-5xl font-normal tracking-wide text-black mb-3' }, 'Search'), + p({ class: 'hidden md:block w-96 ml-28' }, 'Search by keyword phrase, products, or applications across the Life Science Companies of Danaher'), p( { class: 'flex items-center' }, 'Close', @@ -850,7 +850,7 @@ function buildSearchBackdrop(headerBlock) { div( { class: 'flex flex-col md:flex-row gap-x-2 gap-y-4 px-4 md:px-0' }, div( - { class: 'w-full relative sm:border border-b sm:border-solid rounded flex flex-wrap gap-1 py-0 md:py-1 lg:py-2 px-8 md:px-14 mt-6 md:mt-0 bg-[#F5EFFF]' }, + { class: 'w-full relative sm:border border-b sm:border-solid rounded flex flex-wrap gap-1 py-2 pl-8 pr-0 md:px-14 bg-[#F5EFFF]' }, span({ class: 'icon icon-search bg-transparent text-black absolute ms-2 md:ms-1 p-1 md:p-0 inset-y-0 start-0 w-6 my-auto md:w-10 [&_svg]:fill-current cursor-pointer', }), @@ -861,7 +861,7 @@ function buildSearchBackdrop(headerBlock) { type: 'text', autocomplete: 'off', }), - span({ class: 'icon icon-close absolute me-2 md:me-1 inset-y-0 right-0 w-6 my-auto md:w-10 text-black fill-current cursor-pointer', id: 'empty-searchbar' }), + span({ class: 'icon icon-close hidden md:block absolute me-2 md:me-1 inset-y-0 right-0 w-6 my-auto md:w-10 text-black fill-current cursor-pointer', id: 'empty-searchbar' }), ), a({ href: '#', class: 'btn btn-primary-purple flex h-max my-auto px-5 py-3 rounded-full font-bold' }, 'View Results'), ), @@ -871,7 +871,7 @@ function buildSearchBackdrop(headerBlock) { ), ), ), - div({ id: 'search-content', class: 'container h-4/5 md:h-2/4 overflow-y-scroll mt-4 mx-auto mb-3 grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 auto-rows-max gap-x-12 gap-y-3' }), + div({ id: 'search-content', class: 'container h-4/6 md:h-3/5 overflow-y-scroll mt-4 mx-auto mb-3 grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 auto-rows-max gap-x-12 gap-y-3' }), div( { class: 'w-full fixed bottom-0 text-black font-normal hidden' }, div( diff --git a/styles/styles.css b/styles/styles.css index 6e653ce1b..c6626f867 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -1712,6 +1712,10 @@ header { height: 100vh; } +.h-4\/6 { + height: 66.666667%; +} + .min-h-\[13rem\] { min-height: 13rem; } @@ -3046,6 +3050,10 @@ header { padding-top: 2rem; } +.pr-0 { + padding-right: 0px; +} + .text-left { text-align: left; } @@ -3898,6 +3906,14 @@ main .section.top-border { padding-top: 2rem; } + .sm\:pb-4 { + padding-bottom: 1rem; + } + + .sm\:pt-7 { + padding-top: 1.75rem; + } + .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; @@ -4003,6 +4019,10 @@ main .section.top-border { margin-top: 0px; } + .md\:mb-4 { + margin-bottom: 1rem; + } + .md\:line-clamp-3 { overflow: hidden; display: -webkit-box; @@ -4050,6 +4070,14 @@ main .section.top-border { height: 100%; } + .md\:h-3\/6 { + height: 50%; + } + + .md\:h-3\/5 { + height: 60%; + } + .md\:min-h-\[37rem\] { min-height: 37rem; } @@ -4245,6 +4273,11 @@ main .section.top-border { line-height: 2.25rem; } + .md\:text-5xl { + font-size: 3rem; + line-height: 1; + } + .md\:leading-7 { line-height: 1.75rem; }