diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..ad196181ae --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +[*.js] +indent_size = 2 + +[*.css] +indent_size = 4 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 026dac98f7..9c78492f75 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,5 +3,5 @@ Please always provide the [GitHub issue(s)](../issues) your PR is for, as well a Fix # Test URLs: -- Before: https://main--{repo}--{owner}.hlx.live/ -- After: https://--{repo}--{owner}.hlx.live/ +- Before: https://main--{repo}--{owner}.aem.live/ +- After: https://--{repo}--{owner}.aem.live/ diff --git a/404.html b/404.html index 63c78b8d1e..6d14b1f9bc 100644 --- a/404.html +++ b/404.html @@ -51,7 +51,7 @@ } main.error .error-number text { - font-family: var(--type-fixed-font-family); + font-family: monospace; } diff --git a/README.md b/README.md index 707c3bb124..1746cc66d8 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ This project boilerplate is for Edge Delivery Services projects that integrate w https://experienceleague.adobe.com/developer/commerce/storefront/ ## Environments -- Preview: https://main--{repo}--{owner}.hlx.page/ -- Live: https://main--{repo}--{owner}.hlx.live/ +- Preview: https://main--{repo}--{owner}.aem.page/ +- Live: https://main--{repo}--{owner}.aem.live/ ## Installation diff --git a/blocks/cards/cards.css b/blocks/cards/cards.css index ba5cfa912d..61ff6fe059 100644 --- a/blocks/cards/cards.css +++ b/blocks/cards/cards.css @@ -3,8 +3,8 @@ margin: 0; padding: 0; display: grid; - grid-template-columns: repeat(auto-fill, minmax(278px, 1fr)); - grid-gap: 16px; + grid-template-columns: repeat(auto-fill, minmax(257px, 1fr)); + grid-gap: 24px; } .cards > ul > li { @@ -20,10 +20,6 @@ line-height: 0; } -.cards .cards-card-body > *:first-child { - margin-top: 0; -} - .cards > ul > li img { width: 100%; aspect-ratio: 4 / 3; diff --git a/blocks/cards/cards.js b/blocks/cards/cards.js index 58993b13d3..016481686a 100644 --- a/blocks/cards/cards.js +++ b/blocks/cards/cards.js @@ -12,7 +12,7 @@ export default function decorate(block) { }); ul.append(li); }); - ul.querySelectorAll('img').forEach((img) => img.closest('picture').replaceWith(createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }]))); + ul.querySelectorAll('picture > img').forEach((img) => img.closest('picture').replaceWith(createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }]))); block.textContent = ''; block.append(ul); } diff --git a/blocks/columns/columns.css b/blocks/columns/columns.css index 99eda087c4..f2b203e76f 100644 --- a/blocks/columns/columns.css +++ b/blocks/columns/columns.css @@ -23,7 +23,7 @@ .columns > div { align-items: center; flex-direction: unset; - gap: 32px; + gap: 24px; } .columns > div > div { diff --git a/blocks/footer/footer.css b/blocks/footer/footer.css index 7d0acd87c0..d3d624840a 100644 --- a/blocks/footer/footer.css +++ b/blocks/footer/footer.css @@ -1,15 +1,21 @@ footer { - padding: 2rem; background-color: var(--color-neutral-100); font: var(--type-body-2-default-font); letter-spacing: var(--type-body-2-default-letter-spacing); } -footer .footer { - max-width: 1200px; +footer .footer > div { margin: auto; + max-width: 1200px; + padding: 40px 24px 24px; } footer .footer p { margin: 0; } + +@media (width >= 900px) { + footer .footer > div { + padding: 40px 32px 24px; + } +} diff --git a/blocks/fragment/fragment.css b/blocks/fragment/fragment.css index b38cf89607..ff7112406e 100644 --- a/blocks/fragment/fragment.css +++ b/blocks/fragment/fragment.css @@ -1,13 +1 @@ -/* suppress nested section padding */ -.fragment-wrapper > .section { - padding-left: 0; - padding-right: 0; -} - -.fragment-wrapper > .section:first-of-type { - padding-top: 0; -} - -.fragment-wrapper > .section:last-of-type { - padding-bottom: 0; -} +/* stylelint-disable no-empty-source */ diff --git a/blocks/header/header.css b/blocks/header/header.css index d7e453a043..287a932d48 100644 --- a/blocks/header/header.css +++ b/blocks/header/header.css @@ -15,11 +15,11 @@ header nav { 'hamburger brand tools' var(--nav-height) 'sections sections sections' 1fr / auto 1fr auto; align-items: center; - gap: 0 32px; + gap: 0 24px; margin: auto; - max-width: 1264px; + max-width: 1248px; height: var(--nav-height); - padding: 0 16px; + padding: 0 24px; font-family: var(--type-base-font-family); } @@ -29,19 +29,16 @@ header nav[aria-expanded='true'] { 'sections sections' 1fr 'tools tools' var(--nav-height) / auto 1fr; overflow-y: auto; - min-height: 100vh; -} - -@media (width >= 600px) { - header nav { - padding: 0 32px; - } + min-height: 100dvh; } @media (width >= 900px) { header nav { display: flex; justify-content: space-between; + gap: 0 32px; + max-width: 1264px; + padding: 0 32px; } header nav[aria-expanded='true'] { @@ -175,7 +172,7 @@ header nav .nav-sections ul { } header nav .nav-sections ul > li { - font-weight: 700; + font-weight: 500; } header nav .nav-sections ul > li > ul { @@ -183,7 +180,7 @@ header nav .nav-sections ul > li > ul { } header nav .nav-sections ul > li > ul > li { - font-weight: 500; + font-weight: 400; } @media (width >= 900px) { @@ -225,14 +222,13 @@ header nav .nav-sections ul > li > ul > li { header nav .nav-sections ul { display: flex; - gap: 2em; + gap: 24px; margin: 0; } header nav .nav-sections .default-content-wrapper > ul > li { flex: 0 1 auto; position: relative; - font-weight: 500; } header nav .nav-sections .default-content-wrapper > ul > li > ul { @@ -243,10 +239,10 @@ header nav .nav-sections ul > li > ul > li { header nav .nav-sections .default-content-wrapper > ul > li[aria-expanded='true'] > ul { display: block; position: absolute; - left: -1em; + left: -24px; width: 200px; - margin-top: 12px; - padding: 1em; + top: 150%; + padding: 16px; background-color: var(--color-neutral-500); white-space: initial; } @@ -255,7 +251,7 @@ header nav .nav-sections ul > li > ul > li { content: ''; position: absolute; top: -8px; - left: 8px; + left: 16px; width: 0; height: 0; border-left: 8px solid transparent; diff --git a/blocks/header/header.js b/blocks/header/header.js index 2d85efc8bf..a1b6d1ea7f 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -22,6 +22,21 @@ function closeOnEscape(e) { } } +function closeOnFocusLost(e) { + const nav = e.currentTarget; + if (!nav.contains(e.relatedTarget)) { + const navSections = nav.querySelector('.nav-sections'); + const navSectionExpanded = navSections.querySelector('[aria-expanded="true"]'); + if (navSectionExpanded && isDesktop.matches) { + // eslint-disable-next-line no-use-before-define + toggleAllNavSections(navSections, false); + } else if (!isDesktop.matches) { + // eslint-disable-next-line no-use-before-define + toggleMenu(nav, navSections, false); + } + } +} + function openOnKeydown(e) { const focused = document.activeElement; const isNavDrop = focused.className === 'nav-drop'; @@ -66,24 +81,26 @@ function toggleMenu(nav, navSections, forceExpanded = null) { if (isDesktop.matches) { navDrops.forEach((drop) => { if (!drop.hasAttribute('tabindex')) { - drop.setAttribute('role', 'button'); drop.setAttribute('tabindex', 0); drop.addEventListener('focus', focusNavSection); } }); } else { navDrops.forEach((drop) => { - drop.removeAttribute('role'); drop.removeAttribute('tabindex'); drop.removeEventListener('focus', focusNavSection); }); } + // enable menu collapse on escape keypress if (!expanded || isDesktop.matches) { // collapse menu on escape press window.addEventListener('keydown', closeOnEscape); + // collapse menu on focus lost + nav.addEventListener('focusout', closeOnFocusLost); } else { window.removeEventListener('keydown', closeOnEscape); + nav.removeEventListener('focusout', closeOnFocusLost); } } diff --git a/blocks/header/searchbar.js b/blocks/header/searchbar.js index f4a8e341fc..b2d4d799ee 100644 --- a/blocks/header/searchbar.js +++ b/blocks/header/searchbar.js @@ -2,13 +2,14 @@ import { loadScript } from '../../scripts/aem.js'; import { getConfigValue } from '../../scripts/configs.js'; (async () => { - const widgetProd = '/scripts/widgets/LiveSearchAutocomplete.js'; + const widgetProd = '/scripts/widgets/SearchAsYouType.js'; await loadScript(widgetProd); const storeDetails = { environmentId: await getConfigValue('commerce-environment-id'), environmentType: (await getConfigValue('commerce-endpoint')).includes('sandbox') ? 'testing' : '', apiKey: await getConfigValue('commerce-x-api-key'), + apiUrl: await getConfigValue('commerce-endpoint'), websiteCode: await getConfigValue('commerce-website-code'), storeCode: await getConfigValue('commerce-store-code'), storeViewCode: await getConfigValue('commerce-store-view-code'), diff --git a/blocks/hero/hero.css b/blocks/hero/hero.css index 1a377ac18e..974eaf2260 100644 --- a/blocks/hero/hero.css +++ b/blocks/hero/hero.css @@ -1,14 +1,11 @@ -main .hero-container > div { +.hero-container .hero-wrapper { max-width: unset; -} - -main .hero-container { padding: 0; } .hero { position: relative; - padding: 32px; + padding: 40px 24px; min-height: 300px; } @@ -16,7 +13,7 @@ main .hero-container { max-width: 1200px; margin-left: auto; margin-right: auto; - color: white; + color: var(--background-color); } .hero picture { @@ -32,3 +29,9 @@ main .hero-container { width: 100%; height: 100%; } + +@media (width >= 900px) { + .hero { + padding: 40px 32px; + } +} \ No newline at end of file diff --git a/blocks/product-details-custom/product-details-custom.js b/blocks/product-details-custom/product-details-custom.js index 749072b3f5..25c338c1fa 100644 --- a/blocks/product-details-custom/product-details-custom.js +++ b/blocks/product-details-custom/product-details-custom.js @@ -13,7 +13,7 @@ import { performCatalogServiceQuery, refineProductQuery, setJsonLd, - loadErrorPage, + loadErrorPage, variantsQuery, } from '../../scripts/commerce.js'; import { readBlockConfig } from '../../scripts/aem.js'; @@ -40,18 +40,17 @@ async function setJsonLdProduct(product) { const amount = priceRange?.minimum?.final?.amount || price?.final?.amount; const brand = attributes.find((attr) => attr.name === 'brand'); - setJsonLd({ + // get variants + const { variants } = (await performCatalogServiceQuery(variantsQuery, { sku }))?.variants + || { variants: [] }; + + const ldJson = { '@context': 'http://schema.org', '@type': 'Product', name, description, image: images[0]?.url, - offers: [{ - '@type': 'http://schema.org/Offer', - price: amount?.value, - priceCurrency: amount?.currency, - availability: inStock ? 'http://schema.org/InStock' : 'http://schema.org/OutOfStock', - }], + offers: [], productID: sku, brand: { '@type': 'Brand', @@ -60,7 +59,28 @@ async function setJsonLdProduct(product) { url: new URL(`/products/${urlKey}/${sku}`, window.location), sku, '@id': new URL(`/products/${urlKey}/${sku}`, window.location), - }, 'product'); + }; + + if (variants.length > 1) { + ldJson.offers.push(...variants.map((variant) => ({ + '@type': 'Offer', + name: variant.product.name, + image: variant.product.images[0]?.url, + price: variant.product.price.final.amount.value, + priceCurrency: variant.product.price.final.amount.currency, + availability: variant.product.inStock ? 'http://schema.org/InStock' : 'http://schema.org/OutOfStock', + sku: variant.product.sku, + }))); + } else { + ldJson.offers.push({ + '@type': 'Offer', + price: amount?.value, + priceCurrency: amount?.currency, + availability: inStock ? 'http://schema.org/InStock' : 'http://schema.org/OutOfStock', + }); + } + + setJsonLd(ldJson, 'product'); } class ProductDetailPage extends Component { diff --git a/blocks/product-details/product-details.js b/blocks/product-details/product-details.js index d7391824e3..10ae60e9d5 100644 --- a/blocks/product-details/product-details.js +++ b/blocks/product-details/product-details.js @@ -11,7 +11,7 @@ import { getProduct, getSkuFromUrl, setJsonLd, - loadErrorPage, + loadErrorPage, performCatalogServiceQuery, variantsQuery, } from '../../scripts/commerce.js'; import { getConfigValue } from '../../scripts/configs.js'; import { fetchPlaceholders } from '../../scripts/aem.js'; @@ -31,18 +31,17 @@ async function setJsonLdProduct(product) { const amount = priceRange?.minimum?.final?.amount || price?.final?.amount; const brand = attributes.find((attr) => attr.name === 'brand'); - setJsonLd({ + // get variants + const { variants } = (await performCatalogServiceQuery(variantsQuery, { sku }))?.variants + || { variants: [] }; + + const ldJson = { '@context': 'http://schema.org', '@type': 'Product', name, description, image: images[0]?.url, - offers: [{ - '@type': 'http://schema.org/Offer', - price: amount?.value, - priceCurrency: amount?.currency, - availability: inStock ? 'http://schema.org/InStock' : 'http://schema.org/OutOfStock', - }], + offers: [], productID: sku, brand: { '@type': 'Brand', @@ -51,7 +50,28 @@ async function setJsonLdProduct(product) { url: new URL(`/products/${urlKey}/${sku}`, window.location), sku, '@id': new URL(`/products/${urlKey}/${sku}`, window.location), - }, 'product'); + }; + + if (variants.length > 1) { + ldJson.offers.push(...variants.map((variant) => ({ + '@type': 'Offer', + name: variant.product.name, + image: variant.product.images[0]?.url, + price: variant.product.price.final.amount.value, + priceCurrency: variant.product.price.final.amount.currency, + availability: variant.product.inStock ? 'http://schema.org/InStock' : 'http://schema.org/OutOfStock', + sku: variant.product.sku, + }))); + } else { + ldJson.offers.push({ + '@type': 'Offer', + price: amount?.value, + priceCurrency: amount?.currency, + availability: inStock ? 'http://schema.org/InStock' : 'http://schema.org/OutOfStock', + }); + } + + setJsonLd(ldJson, 'product'); } function createMetaTag(property, content, type) { @@ -85,13 +105,13 @@ function setMetaTags(product) { const price = product.priceRange ? product.priceRange.minimum.final.amount : product.price.final.amount; - createMetaTag('title', product.metaTitle, 'name'); + createMetaTag('title', product.metaTitle || product.name, 'name'); createMetaTag('description', product.metaDescription, 'name'); createMetaTag('keywords', product.metaKeyword, 'name'); createMetaTag('og:type', 'og:product', 'property'); createMetaTag('og:description', product.shortDescription, 'property'); - createMetaTag('og:title', product.metaTitle, 'property'); + createMetaTag('og:title', product.metaTitle || product.name, 'property'); createMetaTag('og:url', window.location.href, 'property'); const mainImage = product?.images?.filter((image) => image.roles.includes('thumbnail'))[0]; const metaImage = mainImage?.url || product?.images[0]?.url; diff --git a/blocks/product-list-page/product-list-page.js b/blocks/product-list-page/product-list-page.js index 3ce89f9f21..044702d1d8 100644 --- a/blocks/product-list-page/product-list-page.js +++ b/blocks/product-list-page/product-list-page.js @@ -12,6 +12,7 @@ export default async function decorate(block) { environmentId: await getConfigValue('commerce-environment-id'), environmentType: (await getConfigValue('commerce-endpoint')).includes('sandbox') ? 'testing' : '', apiKey: await getConfigValue('commerce-x-api-key'), + apiUrl: await getConfigValue('commerce-endpoint'), websiteCode: await getConfigValue('commerce-website-code'), storeCode: await getConfigValue('commerce-store-code'), storeViewCode: await getConfigValue('commerce-store-view-code'), diff --git a/blocks/product-recommendations/product-recommendations.js b/blocks/product-recommendations/product-recommendations.js index 07f1303d5f..ec0eb5ad4d 100644 --- a/blocks/product-recommendations/product-recommendations.js +++ b/blocks/product-recommendations/product-recommendations.js @@ -117,7 +117,7 @@ function renderItems(block, results) { inViewObserver.disconnect(); } }); - }); + }, { threshold: 0.5 }); inViewObserver.observe(block); } @@ -152,8 +152,13 @@ async function loadRecommendation(block, context, visibility, filters) { return; } - if (!unitsPromise) { - const storeViewCode = await getConfigValue('commerce-store-view-code'); + const storeViewCode = await getConfigValue('commerce-store-view-code'); + + if (unitsPromise) { + return; + } + + unitsPromise = new Promise((resolve, reject) => { // Get product view history try { const viewHistory = window.localStorage.getItem(`${storeViewCode}:productViewHistory`) || '[]'; @@ -176,16 +181,19 @@ async function loadRecommendation(block, context, visibility, filters) { dl.push({ event: 'recs-api-request-sent', eventInfo: { ...dl.getState() } }); }); - unitsPromise = performCatalogServiceQuery(recommendationsQuery, context); - const { recommendations } = await unitsPromise; - - window.adobeDataLayer.push((dl) => { - dl.push({ recommendationsContext: { units: recommendations.results.map(mapUnit) } }); - dl.push({ event: 'recs-api-response-received', eventInfo: { ...dl.getState() } }); + performCatalogServiceQuery(recommendationsQuery, context).then(({ recommendations }) => { + window.adobeDataLayer.push((dl) => { + dl.push({ recommendationsContext: { units: recommendations.results.map(mapUnit) } }); + dl.push({ event: 'recs-api-response-received', eventInfo: { ...dl.getState() } }); + }); + resolve(recommendations); + }).catch((error) => { + console.error('Error fetching recommendations', error); + reject(error); }); - } + }); - let { results } = (await unitsPromise).recommendations; + let { results } = await unitsPromise; results = results.filter((unit) => (filters.typeId ? unit.typeId === filters.typeId : true)); renderItems(block, results); diff --git a/fonts/roboto-condensed-bold.woff2 b/fonts/roboto-condensed-bold.woff2 new file mode 100644 index 0000000000..dd0eb2becc Binary files /dev/null and b/fonts/roboto-condensed-bold.woff2 differ diff --git a/fonts/roboto-medium.woff2 b/fonts/roboto-medium.woff2 new file mode 100644 index 0000000000..8b1aebb23d Binary files /dev/null and b/fonts/roboto-medium.woff2 differ diff --git a/head.html b/head.html index 94e9444b04..a31239217b 100644 --- a/head.html +++ b/head.html @@ -29,6 +29,3 @@ - - - diff --git a/package-lock.json b/package-lock.json index e7aa649ee2..3ccf823490 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,16 +12,16 @@ "dependencies": { "@adobe/magento-storefront-event-collector": "^1.8.0", "@adobe/magento-storefront-events-sdk": "^1.8.0", - "@dropins/storefront-pdp": "^0.3.0", - "@dropins/tools": "^0.25.0" + "@dropins/storefront-pdp": "0.4.0", + "@dropins/tools": "^0.33.0" }, "devDependencies": { "@adobe/aem-cli": "^16.5.8", - "@babel/eslint-parser": "7.24.8", + "@babel/eslint-parser": "7.25.1", "eslint": "8.57.0", "eslint-config-airbnb-base": "15.0.0", "eslint-plugin-import": "2.29.1", - "stylelint": "16.7.0", + "stylelint": "16.8.2", "stylelint-config-standard": "36.0.1" } }, @@ -145,6 +145,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@adobe/aem-cli/node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/@adobe/aem-cli/node_modules/ini": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", @@ -243,6 +252,23 @@ "node": ">=14.16" } }, + "node_modules/@adobe/fetch/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/@adobe/helix-log": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@adobe/helix-log/-/helix-log-6.0.3.tgz", @@ -293,6 +319,15 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/@adobe/helix-shared-config/node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/@adobe/helix-shared-config/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -350,9 +385,10 @@ } }, "node_modules/@adobe/magento-storefront-event-collector": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@adobe/magento-storefront-event-collector/-/magento-storefront-event-collector-1.8.0.tgz", - "integrity": "sha512-9kPdeJyT199N5y2hRIFTiJbOMXvQnj9S7uUkViTYz7lgHUjZOQn7AP+h9UELrPmc6zYY4imOScK4jB34fiFEPA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@adobe/magento-storefront-event-collector/-/magento-storefront-event-collector-1.11.0.tgz", + "integrity": "sha512-6nhRqaaiqRcPQ4uGB3M33oTRBzwR+2dNt7+eBfech6x2YKF6qT5eXuqDk8Rtj7O9FCs/QUjvOnPS6VOcV5fcNg==", + "license": "MIT", "dependencies": { "@adobe/adobe-client-data-layer": "^2.0.2", "@adobe/alloy": "^2.9.0", @@ -488,9 +524,9 @@ } }, "node_modules/@babel/eslint-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.24.8.tgz", - "integrity": "sha512-nYAikI4XTGokU2QX7Jx+v4rxZKhKivaQaREZjuW3mrJrbdWJ5yUfohnoUULge+zEEaKjPYNxhoRgUKktjXtbwA==", + "version": "7.25.1", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.25.1.tgz", + "integrity": "sha512-Y956ghgTT4j7rKesabkh5WeqgSFZVFwaPR0IWFm7KFHFmmJ4afbG49SmfW4S+GyRPx0Dy5jxEWA5t0rpxfElWg==", "dev": true, "license": "MIT", "dependencies": { @@ -795,77 +831,10 @@ "node": ">=6.9.0" } }, - "node_modules/@csstools/css-parser-algorithms": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.7.1.tgz", - "integrity": "sha512-2SJS42gxmACHgikc1WGesXLIT8d/q2l0UFM7TaEeIzdFCE/FPMtTiizcPGGJtlPo2xuQzY09OhrLTzRxqJqwGw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "@csstools/css-tokenizer": "^2.4.1" - } - }, - "node_modules/@csstools/css-tokenizer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.4.1.tgz", - "integrity": "sha512-eQ9DIktFJBhGjioABJRtUucoWR2mwllurfnM8LuNGAqX3ViZXaUchqk+1s7jjtkFiT9ySdACsFEA3etErkALUg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "engines": { - "node": "^14 || ^16 || >=18" - } - }, - "node_modules/@csstools/media-query-list-parser": { - "version": "2.1.13", - "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.13.tgz", - "integrity": "sha512-XaHr+16KRU9Gf8XLi3q8kDlI18d5vzKSKCY510Vrtc9iNR0NJzbY9hhTmwhzYZj/ZwGL4VmB3TA9hJW0Um2qFA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.7.1", - "@csstools/css-tokenizer": "^2.4.1" - } - }, "node_modules/@csstools/selector-specificity": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.1.1.tgz", - "integrity": "sha512-a7cxGcJ2wIlMFLlh8z2ONm+715QkPHiyJcxwQlKOz/03GPw1COpfhcmC9wm4xlZfp//jWHNNMwzjtqHXVWU9KA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-4.0.0.tgz", + "integrity": "sha512-189nelqtPd8++phaHNwYovKZI0FOzH1vQEE3QhHHkNIGrg5fSs9CbYP3RvfEH5geztnIA9Jwq91wyOIwAW5JIQ==", "dev": true, "funding": [ { @@ -877,22 +846,23 @@ "url": "https://opencollective.com/csstools" } ], + "license": "MIT-0", "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "peerDependencies": { - "postcss-selector-parser": "^6.0.13" + "postcss-selector-parser": "^6.1.0" } }, "node_modules/@dropins/storefront-pdp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@dropins/storefront-pdp/-/storefront-pdp-0.3.0.tgz", - "integrity": "sha512-WoPE8o4CrPMX+gf1AXB39rf6TEDYSrct7Wfs1s5ShyKy/FxzP7B4qftkQsRi5mO9nwHx+brNS2AevEablGzP4Q==" + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@dropins/storefront-pdp/-/storefront-pdp-0.4.0.tgz", + "integrity": "sha512-njTZ6gCbqeMANmabRWo/cnFUthPKix6lgQ04r1N5frFbEXvaKGpiWXsAdRZ+NjhdU8Lvz2zKDR9WwIyx3P2whA==" }, "node_modules/@dropins/tools": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@dropins/tools/-/tools-0.25.0.tgz", - "integrity": "sha512-HebXmOInpqWlotjfnR13QdAA9KCVlPeSLgDA4EDFNUJbrXAY/LVBbnMJxz0yx7MWPYxDJ81Kza0aE/lb08imHg==" + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@dropins/tools/-/tools-0.33.0.tgz", + "integrity": "sha512-XJUvEw4uPDd1mBRytHVf5mHb7El4I+xOWW4KBRpg+GtZ9VRESZkwg00fCo12tOl6/fX68zg9bffDjQNsbnCSig==" }, "node_modules/@dual-bundle/import-meta-resolve": { "version": "4.1.0", @@ -2344,10 +2314,11 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -4279,10 +4250,11 @@ } }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -5771,9 +5743,9 @@ } }, "node_modules/postcss": { - "version": "8.4.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", - "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "dev": true, "funding": [ { @@ -5800,9 +5772,9 @@ } }, "node_modules/postcss-resolve-nested-selector": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", - "integrity": "sha1-Kcy8fDfe36wwTp//C/FZaz9qDk4=", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz", + "integrity": "sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==", "dev": true }, "node_modules/postcss-safe-parser": { @@ -5832,10 +5804,11 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz", - "integrity": "sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dev": true, + "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -6768,9 +6741,9 @@ } }, "node_modules/stylelint": { - "version": "16.7.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.7.0.tgz", - "integrity": "sha512-Q1ATiXlz+wYr37a7TGsfvqYn2nSR3T/isw3IWlZQzFzCNoACHuGBb6xBplZXz56/uDRJHIygxjh7jbV/8isewA==", + "version": "16.8.2", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.8.2.tgz", + "integrity": "sha512-fInKATippQhcSm7AB+T32GpI+626yohrg33GkFT/5jzliUw5qhlwZq2UQQwgl3HsHrf09oeARi0ZwgY/UWEv9A==", "dev": true, "funding": [ { @@ -6784,17 +6757,17 @@ ], "license": "MIT", "dependencies": { - "@csstools/css-parser-algorithms": "^2.7.1", - "@csstools/css-tokenizer": "^2.4.1", - "@csstools/media-query-list-parser": "^2.1.13", - "@csstools/selector-specificity": "^3.1.1", + "@csstools/css-parser-algorithms": "^3.0.0", + "@csstools/css-tokenizer": "^3.0.0", + "@csstools/media-query-list-parser": "^3.0.0", + "@csstools/selector-specificity": "^4.0.0", "@dual-bundle/import-meta-resolve": "^4.1.0", "balanced-match": "^2.0.0", "colord": "^2.9.3", "cosmiconfig": "^9.0.0", "css-functions-list": "^3.2.2", "css-tree": "^2.3.1", - "debug": "^4.3.5", + "debug": "^4.3.6", "fast-glob": "^3.3.2", "fastest-levenshtein": "^1.0.16", "file-entry-cache": "^9.0.0", @@ -6802,7 +6775,7 @@ "globby": "^11.1.0", "globjoin": "^0.1.4", "html-tags": "^3.3.1", - "ignore": "^5.3.1", + "ignore": "^5.3.2", "imurmurhash": "^0.1.4", "is-plain-object": "^5.0.0", "known-css-properties": "^0.34.0", @@ -6811,10 +6784,10 @@ "micromatch": "^4.0.7", "normalize-path": "^3.0.0", "picocolors": "^1.0.1", - "postcss": "^8.4.39", - "postcss-resolve-nested-selector": "^0.1.1", + "postcss": "^8.4.41", + "postcss-resolve-nested-selector": "^0.1.6", "postcss-safe-parser": "^7.0.0", - "postcss-selector-parser": "^6.1.0", + "postcss-selector-parser": "^6.1.2", "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "string-width": "^4.2.3", @@ -6880,6 +6853,73 @@ "stylelint": "^16.1.0" } }, + "node_modules/stylelint/node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.0.tgz", + "integrity": "sha512-20hEErXV9GEx15qRbsJVzB91ryayx1F2duHPBrfZXQAHz/dJG0u/611URpr28+sFjm3EI7U17Pj9SVA9NSAGJA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.0" + } + }, + "node_modules/stylelint/node_modules/@csstools/css-tokenizer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.0.tgz", + "integrity": "sha512-efZvfJyYrqH9hPCKtOBywlTsCXnEzAI9sLHFzUsDpBb+1bQ+bxJnwL9V2bRKv9w4cpIp75yxGeZRaVKoMQnsEg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/stylelint/node_modules/@csstools/media-query-list-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-3.0.0.tgz", + "integrity": "sha512-W0JlkUFwXjo703wt06AcaWuUcS+6x6IEDyxV6W65Sw+vLCYp+uPsrps+PXTiIfN0V1Pqj5snPzN7EYLmbz1zjg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.0", + "@csstools/css-tokenizer": "^3.0.0" + } + }, "node_modules/stylelint/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", diff --git a/package.json b/package.json index 04fc4fad6f..9de9e3d7bb 100644 --- a/package.json +++ b/package.json @@ -24,17 +24,17 @@ "homepage": "https://github.com/adobe/aem-boilerplate#readme", "devDependencies": { "@adobe/aem-cli": "^16.5.8", - "@babel/eslint-parser": "7.24.8", + "@babel/eslint-parser": "7.25.1", "eslint": "8.57.0", "eslint-config-airbnb-base": "15.0.0", "eslint-plugin-import": "2.29.1", - "stylelint": "16.7.0", + "stylelint": "16.8.2", "stylelint-config-standard": "36.0.1" }, "dependencies": { "@adobe/magento-storefront-event-collector": "^1.8.0", "@adobe/magento-storefront-events-sdk": "^1.8.0", - "@dropins/storefront-pdp": "^0.3.0", - "@dropins/tools": "^0.25.0" + "@dropins/storefront-pdp": "0.4.0", + "@dropins/tools": "^0.33.0" } } diff --git a/scripts/__dropins__/storefront-pdp/__mocks__/product-mocks.d.ts b/scripts/__dropins__/storefront-pdp/__mocks__/product-mocks.d.ts new file mode 100644 index 0000000000..0583bef6fb --- /dev/null +++ b/scripts/__dropins__/storefront-pdp/__mocks__/product-mocks.d.ts @@ -0,0 +1,157 @@ +export declare const MOCK_DATA_BUNDLE: { + __typename: string; + id: string; + sku: string; + name: string; + shortDescription: string; + metaDescription: string; + metaKeyword: string; + metaTitle: string; + description: string; + inStock: boolean; + addToCartAllowed: boolean; + url: string; + urlKey: string; + externalId: string; + images: { + url: string; + label: string; + roles: string[]; + }[]; + options: { + id: string; + title: string; + required: boolean; + multi: null; + values: { + id: string; + title: string; + inStock: boolean; + __typename: string; + quantity: number; + isDefault: boolean; + product: { + sku: string; + shortDescription: string; + metaDescription: string; + metaKeyword: string; + metaTitle: string; + name: string; + price: { + final: { + amount: { + value: number; + currency: string; + }; + }; + regular: { + amount: { + value: number; + currency: string; + }; + }; + roles: string[]; + }; + }; + }[]; + }[]; + priceRange: { + maximum: { + final: { + amount: { + value: number; + currency: string; + }; + }; + regular: { + amount: { + value: number; + currency: string; + }; + }; + roles: string[]; + }; + minimum: { + final: { + amount: { + value: number; + currency: string; + }; + }; + regular: { + amount: { + value: number; + currency: string; + }; + }; + roles: string[]; + }; + }; +}; +export declare const MOCK_DATA_BUNDLE_TRANSFORMED: { + name: string; + sku: string; + addToCartAllowed: boolean; + inStock: boolean; + shortDescription: string; + metaDescription: string; + metaKeyword: string; + metaTitle: string; + description: string; + images: { + url: string; + label: string; + width: number; + height: number; + }[]; + prices: { + final: { + amount: number; + currency: string; + }; + regular: { + amount: number; + currency: string; + }; + visible: boolean; + }; + options: { + id: string; + type: "text" | "image" | "color" | "dropdown"; + typename: "ProductViewOptionValueProduct" | "ProductViewOptionValueSwatch" | "ProductViewOptionValueConfiguration"; + label: string; + required: boolean; + multiple: boolean; + items: { + id: string; + inStock: boolean; + label: string; + selected: boolean; + value: string; + product: { + sku: string; + shortDescription: string; + metaDescription: string; + metaKeyword: string; + metaTitle: string; + name: string; + price: { + final: { + amount: { + value: number; + currency: string; + }; + }; + regular: { + amount: { + value: number; + currency: string; + }; + }; + roles: string[]; + }; + }; + }[]; + }[]; +}; +//# sourceMappingURL=product-mocks.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/fetch-graphql/fetch-graphql.d.ts b/scripts/__dropins__/storefront-pdp/api/fetch-graphql/fetch-graphql.d.ts index c1cc3ef7c6..b20f64921e 100644 --- a/scripts/__dropins__/storefront-pdp/api/fetch-graphql/fetch-graphql.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/fetch-graphql/fetch-graphql.d.ts @@ -1,3 +1,18 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, setFetchGraphQlHeaders: (header: import('@adobe/fetch-graphql').Header) => void, fetchGraphQl: (query: string, options?: import('@adobe/fetch-graphql').FetchOptions | undefined) => Promise<{ errors?: import('@adobe/fetch-graphql').FetchQueryError | undefined; data: T; diff --git a/scripts/__dropins__/storefront-pdp/api/fetch-graphql/index.d.ts b/scripts/__dropins__/storefront-pdp/api/fetch-graphql/index.d.ts index ea5ac123d4..89ebf4772f 100644 --- a/scripts/__dropins__/storefront-pdp/api/fetch-graphql/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/fetch-graphql/index.d.ts @@ -1,2 +1,17 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './fetch-graphql'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/getProductData/graphql/getProductData.graphql.d.ts b/scripts/__dropins__/storefront-pdp/api/getProductData/graphql/getProductData.graphql.d.ts index 5d759279bd..970065abc0 100644 --- a/scripts/__dropins__/storefront-pdp/api/getProductData/graphql/getProductData.graphql.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/getProductData/graphql/getProductData.graphql.d.ts @@ -1,2 +1,17 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export declare const GET_PRODUCT_DATA: string; //# sourceMappingURL=getProductData.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/getProductData/index.d.ts b/scripts/__dropins__/storefront-pdp/api/getProductData/index.d.ts index 1e7443b95f..10b13f0efb 100644 --- a/scripts/__dropins__/storefront-pdp/api/getProductData/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/getProductData/index.d.ts @@ -1,2 +1,17 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './getProductData'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/getRefinedProduct.d.ts b/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/getRefinedProduct.d.ts index 45e37e356e..5c7ec9a4d7 100644 --- a/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/getRefinedProduct.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/getRefinedProduct.d.ts @@ -1,4 +1,4 @@ import { ProductModel } from '../../data/models'; -export declare const getRefinedProduct: (sku: string, optionUIDs: string[], anchorOptions?: string[]) => Promise; +export declare const getRefinedProduct: (sku: string, optionUIDs: string[], anchorOptions?: string[], isBundle?: boolean) => Promise; //# sourceMappingURL=getRefinedProduct.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/graphql/RefineProductQuery.graphql.d.ts b/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/graphql/RefineProductQuery.graphql.d.ts index 048f9bffb2..7fd151f9af 100644 --- a/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/graphql/RefineProductQuery.graphql.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/graphql/RefineProductQuery.graphql.d.ts @@ -1,2 +1,17 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export declare const REFINE_PRODUCT_QUERY: string; //# sourceMappingURL=RefineProductQuery.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/index.d.ts b/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/index.d.ts index 81dd71d506..1c85c49e19 100644 --- a/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/getRefinedProduct/index.d.ts @@ -1,2 +1,17 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './getRefinedProduct'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/graphql/ProductFragment.graphql.d.ts b/scripts/__dropins__/storefront-pdp/api/graphql/ProductFragment.graphql.d.ts index 6bccece164..d672860813 100644 --- a/scripts/__dropins__/storefront-pdp/api/graphql/ProductFragment.graphql.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/graphql/ProductFragment.graphql.d.ts @@ -1,2 +1,17 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export declare const ProductFragment: string; //# sourceMappingURL=ProductFragment.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/graphql/ProductOptionFragment.graphql.d.ts b/scripts/__dropins__/storefront-pdp/api/graphql/ProductOptionFragment.graphql.d.ts index 8aabe1fa93..5a73338093 100644 --- a/scripts/__dropins__/storefront-pdp/api/graphql/ProductOptionFragment.graphql.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/graphql/ProductOptionFragment.graphql.d.ts @@ -1,2 +1,17 @@ -export declare const ProductOptionFragment = "\nfragment ProductOptionFragment on ProductViewOption {\n id\n title\n required\n multi\n values {\n id\n title\n inStock\n __typename\n ... on ProductViewOptionValueProduct {\n title\n quantity\n isDefault\n product {\n sku\n shortDescription\n metaDescription\n metaKeyword\n metaTitle\n name\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n ... on ProductViewOptionValueSwatch {\n id\n title\n type\n value\n inStock\n }\n }\n }\n"; +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ +export declare const ProductOptionFragment = "\nfragment ProductOptionFragment on ProductViewOption {\n id\n title\n required\n multi\n values {\n id\n title\n inStock\n __typename\n ... on ProductViewOptionValueProduct {\n title\n quantity\n isDefault\n __typename\n product {\n sku\n shortDescription\n metaDescription\n metaKeyword\n metaTitle\n name\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n ... on ProductViewOptionValueSwatch {\n id\n title\n type\n value\n inStock\n }\n }\n }\n"; //# sourceMappingURL=ProductOptionFragment.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/api/index.d.ts b/scripts/__dropins__/storefront-pdp/api/index.d.ts index 374c320538..f3e6257bbf 100644 --- a/scripts/__dropins__/storefront-pdp/api/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/index.d.ts @@ -1,3 +1,18 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './initialize'; export * from './fetch-graphql'; export * from './getProductData'; diff --git a/scripts/__dropins__/storefront-pdp/api/initialize/index.d.ts b/scripts/__dropins__/storefront-pdp/api/initialize/index.d.ts index 66c241dc2d..1ab10aa2fb 100644 --- a/scripts/__dropins__/storefront-pdp/api/initialize/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/api/initialize/index.d.ts @@ -1,2 +1,17 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './initialize'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/chunks/getRefinedProduct.js b/scripts/__dropins__/storefront-pdp/chunks/getRefinedProduct.js index b36d22759f..fb71cf4b8e 100644 --- a/scripts/__dropins__/storefront-pdp/chunks/getRefinedProduct.js +++ b/scripts/__dropins__/storefront-pdp/chunks/getRefinedProduct.js @@ -1,4 +1,4 @@ -import{c as h}from"./initialize.js";import{FetchGraphQL as Q}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:W,setFetchGraphQlHeader:Z,removeFetchGraphQlHeader:R,setFetchGraphQlHeaders:tt,fetchGraphQl:A,getConfig:et}=new Q().getMethods();function D(e){var o,u,n;const r=e?{name:e.name,sku:e.sku,addToCartAllowed:e.addToCartAllowed,inStock:e.inStock,shortDescription:e.shortDescription,metaDescription:e.metaDescription,metaKeyword:e.metaKeyword,metaTitle:e.metaTitle,description:e.description,images:K(e),prices:j(e),attributes:M(e),options:N(e),optionUIDs:e.optionUIDs,url:e.url,urlKey:e.urlKey,externalId:e.externalId,externalParentId:e.externalParentId,variantSku:e.variantSku}:null,t=(n=(u=(o=h.getConfig())==null?void 0:o.models)==null?void 0:u.ProductDetails)==null?void 0:n.transform;return t&&r?t(r):r}function K(e){var r;return(r=e.images)==null?void 0:r.map(t=>(t.url=t.url.replace(/^https?:/,""),t))}function M(e){var r,t;return(t=(r=e.attributes)==null?void 0:r.filter(({roles:o})=>(o==null?void 0:o.indexOf("visible_in_pdp"))!==-1))==null?void 0:t.map(({label:o,value:u,name:n})=>({id:n,label:o,value:u.toString().split(",").join(", ")}))}function N(e){const{options:r,optionUIDs:t}=e;return r==null?void 0:r.map(({id:o,title:u,required:n,multi:c,values:i})=>{var d,f;const l=(d=i==null?void 0:i[0])==null?void 0:d.__typename;let a=i==null?void 0:i[0].type;return((f=i==null?void 0:i[0])==null?void 0:f.__typename)==="ProductViewOptionValueProduct"?a=void 0:a?a=a.replace("COLOR_HEX","color").replace("TEXT","text").replace("IMAGE","image"):a="dropdown",{id:o,type:a,typename:l,label:u,required:n,multiple:c,items:i==null?void 0:i.map(({id:m,title:g,inStock:p,value:P})=>({id:m,label:g,inStock:p,value:(a==null?void 0:a.toLowerCase())==="dropdown"?m:P==null?void 0:P.replace(/^https?:/,""),selected:(t==null?void 0:t.indexOf(m))>-1}))}})}function j(e){var d,f,m,g,p;const{price:r,priceRange:t,__typename:o}=e;function u(){var k;const P=r.regular.amount.value,y=((k=r.final)==null?void 0:k.amount.value)??r.regular.amount.value,w=r.regular.amount.currency==="NONE"?"USD":r==null?void 0:r.regular.amount.currency;return[P,y,y,w]}function n(){var x,_,b,S,E,T,C,O,v,F,V,$;const P=(x=t==null?void 0:t.minimum)==null?void 0:x.final.amount.value,y=(_=t==null?void 0:t.maximum)==null?void 0:_.final.amount.value;let w;((S=(b=t==null?void 0:t.minimum)==null?void 0:b.regular)==null?void 0:S.amount.value)===((T=(E=t==null?void 0:t.maximum)==null?void 0:E.regular)==null?void 0:T.amount.value)&&(w=(O=(C=t==null?void 0:t.minimum)==null?void 0:C.regular)==null?void 0:O.amount.value);const k=((F=(v=t==null?void 0:t.minimum)==null?void 0:v.final)==null?void 0:F.amount.currency)==="NONE"?"USD":($=(V=t==null?void 0:t.minimum)==null?void 0:V.final)==null?void 0:$.amount.currency;return[w,P,y,k]}const[c,i,l,a]=o==="SimpleProductView"?u():n(),s=o==="SimpleProductView"?(d=r==null?void 0:r.roles)==null?void 0:d.includes("visible"):((m=(f=t==null?void 0:t.maximum)==null?void 0:f.roles)==null?void 0:m.includes("visible"))&&((p=(g=t==null?void 0:t.minimum)==null?void 0:g.roles)==null?void 0:p.includes("visible"));return l&&i===l?{regular:{amount:c,currency:a,variant:c&&i!==c?"strikethrough":"default"},final:{amount:l,currency:a,variant:"default"},visible:s}:{final:{minimumAmount:i,maximumAmount:l,currency:a},visible:s}}const U=` +import{c as B}from"./initialize.js";import{FetchGraphQL as et}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:gt,setFetchGraphQlHeader:ht,removeFetchGraphQlHeader:wt,setFetchGraphQlHeaders:xt,fetchGraphQl:q,getConfig:_t}=new et().getMethods();function K(e,r){var i,u,o;const n=e?{name:e.name,sku:e.sku,addToCartAllowed:e.addToCartAllowed,inStock:e.inStock,shortDescription:e.shortDescription,metaDescription:e.metaDescription,metaKeyword:e.metaKeyword,metaTitle:e.metaTitle,description:e.description,images:rt(e),prices:mt(e,!!r),attributes:nt(e),options:ut(e),optionUIDs:at(e),url:e.url,urlKey:e.urlKey,externalId:e.externalId,externalParentId:e.externalParentId,variantSku:e.variantSku}:null,t=(o=(u=(i=B.getConfig())==null?void 0:i.models)==null?void 0:u.ProductDetails)==null?void 0:o.transform;return t&&n?t(n):n}function rt(e){var r;return(r=e.images)==null?void 0:r.map(n=>(n.url=n.url.replace(/^https?:/,""),n))}function nt(e){var r,n;return(n=(r=e.attributes)==null?void 0:r.filter(({roles:t})=>(t==null?void 0:t.indexOf("visible_in_pdp"))!==-1))==null?void 0:n.map(({label:t,value:i,name:u})=>({id:u,label:t,value:i.toString().split(",").join(", ")}))}function ut(e){const{options:r,optionUIDs:n}=e;return r==null?void 0:r.map(({id:t,title:i,required:u,multi:o,values:m})=>{var d,s;const a=(d=m==null?void 0:m[0])==null?void 0:d.__typename;let l=m==null?void 0:m[0].type;const c=((s=m==null?void 0:m[0])==null?void 0:s.__typename)==="ProductViewOptionValueProduct";return l?l=l.replace("COLOR_HEX","color").replace("TEXT","text").replace("IMAGE","image"):l="dropdown",{id:t,type:l,typename:a,label:i,required:u,multiple:o,items:c?it(m,n):ot(m,n,l)}})}function it(e,r){return e==null?void 0:e.map(({id:n,title:t,inStock:i,isDefault:u,product:o})=>({id:n,inStock:i,label:t,selected:(r==null?void 0:r.indexOf(n))>-1||u,value:n,product:o}))}function ot(e,r,n){return e==null?void 0:e.map(({id:t,title:i,inStock:u,value:o})=>({id:t,inStock:u,label:i,selected:(r==null?void 0:r.indexOf(t))>-1,value:(n==null?void 0:n.toLowerCase())==="dropdown"?t:o==null?void 0:o.replace(/^https?:/,"")}))}function mt(e,r){var E,x,H,I,L;const{price:n,priceRange:t,options:i,optionUIDs:u}=e;let{__typename:o}=e;function m(){var g;const P=n.regular.amount.value,f=((g=n.final)==null?void 0:g.amount.value)??n.regular.amount.value,y=n.regular.amount.currency==="NONE"?"USD":n==null?void 0:n.regular.amount.currency;return[P,f,f,y]}function a(){var _,b,S,V,T,C,D,A,F,$,G,M;const P=(_=t==null?void 0:t.minimum)==null?void 0:_.final.amount.value,f=(b=t==null?void 0:t.maximum)==null?void 0:b.final.amount.value;let y;((V=(S=t==null?void 0:t.minimum)==null?void 0:S.regular)==null?void 0:V.amount.value)===((C=(T=t==null?void 0:t.maximum)==null?void 0:T.regular)==null?void 0:C.amount.value)&&(y=(A=(D=t==null?void 0:t.minimum)==null?void 0:D.regular)==null?void 0:A.amount.value);const g=(($=(F=t==null?void 0:t.minimum)==null?void 0:F.final)==null?void 0:$.amount.currency)==="NONE"?"USD":(M=(G=t==null?void 0:t.minimum)==null?void 0:G.final)==null?void 0:M.amount.currency;return[y,P,f,g]}function l(){var S,V,T,C,D,A,F,$,G,M,X,Y;let P=0,f=0;i==null||i.forEach(k=>{var z;const j=k==null?void 0:k.values;if(j&&Array.isArray(j)){const h=j.map(p=>{var Q,N,J,W;return(W=(J=(N=(Q=p==null?void 0:p.product)==null?void 0:Q.price)==null?void 0:N.regular)==null?void 0:J.amount)==null?void 0:W.value}).filter(p=>p!==void 0),v=h.length>0?Math.max(...h):0;P+=v}else P+=0;(z=k==null?void 0:k.values)==null||z.forEach(h=>{var v,p,Q,N;u!=null&&u.includes(h.id)&&(f+=(N=(Q=(p=(v=h==null?void 0:h.product)==null?void 0:v.price)==null?void 0:p.final)==null?void 0:Q.amount)==null?void 0:N.value)})});const y=(S=t==null?void 0:t.minimum)==null?void 0:S.final.amount.value,g=(V=t==null?void 0:t.maximum)==null?void 0:V.final.amount.value;let _;((C=(T=t==null?void 0:t.minimum)==null?void 0:T.regular)==null?void 0:C.amount.value)===((A=(D=t==null?void 0:t.maximum)==null?void 0:D.regular)==null?void 0:A.amount.value)&&(_=($=(F=t==null?void 0:t.minimum)==null?void 0:F.regular)==null?void 0:$.amount.value);const b=((M=(G=t==null?void 0:t.minimum)==null?void 0:G.final)==null?void 0:M.amount.currency)==="NONE"?"USD":(Y=(X=t==null?void 0:t.minimum)==null?void 0:X.final)==null?void 0:Y.amount.currency;return r&&!u?[_,y,g,b]:P===(t==null?void 0:t.maximum.regular.amount.value)?[f,f,f,b]:[_,y,g,b]}const[c,d,s,w]=o==="SimpleProductView"?m():r?l():a(),O=o==="SimpleProductView"?(E=n==null?void 0:n.roles)==null?void 0:E.includes("visible"):((H=(x=t==null?void 0:t.maximum)==null?void 0:x.roles)==null?void 0:H.includes("visible"))&&((L=(I=t==null?void 0:t.minimum)==null?void 0:I.roles)==null?void 0:L.includes("visible"));return s&&d===s?{regular:{amount:c,currency:w,variant:c&&d!==c?"strikethrough":"default"},final:{amount:s,currency:w,variant:"default"},visible:O}:{final:{minimumAmount:d,maximumAmount:s,currency:w},visible:O}}function at(e){var n;let{optionUIDs:r}=e;return(n=e==null?void 0:e.options)==null||n.map(({values:t})=>{var u;((u=t==null?void 0:t[0])==null?void 0:u.__typename)==="ProductViewOptionValueProduct"&&!r&&(r=[],t==null||t.map(({id:o,isDefault:m})=>{m&&(r==null?void 0:r.indexOf(o))===-1&&r.push(o)}))}),r}const lt=` fragment ProductOptionFragment on ProductViewOption { id title @@ -13,6 +13,7 @@ fragment ProductOptionFragment on ProductViewOption { title quantity isDefault + __typename product { sku shortDescription @@ -46,7 +47,7 @@ fragment ProductOptionFragment on ProductViewOption { } } } -`,G=` +`,R=` fragment ProductFragment on ProductView { __typename id @@ -137,16 +138,16 @@ fragment ProductFragment on ProductView { } } -${U} -`,q=` +${lt} +`,tt=` query GET_PRODUCT_DATA($skus: [String]) { products(skus: $skus) { ...ProductFragment } } -${G} -`,rt=async e=>{var u,n,c,i,l;const r=(i=(c=(n=(u=h)==null?void 0:u.getConfig())==null?void 0:n.models)==null?void 0:c.ProductDetails)==null?void 0:i.initialData;if(r)return D(r);const{data:t}=await A(q,{method:"GET",variables:{skus:[e]}}),o=(l=t==null?void 0:t.products)==null?void 0:l[0];return D(o)},H=` +${R} +`;function Z(e){return e.some(r=>(r==null?void 0:r.__typename)==="ProductViewOptionValueProduct")}const bt=async e=>{var u,o,m,a,l,c,d;const r=(a=(m=(o=(u=B)==null?void 0:u.getConfig())==null?void 0:o.models)==null?void 0:m.ProductDetails)==null?void 0:a.initialData;let n=(l=r==null?void 0:r.options)==null?void 0:l.some(s=>Z(s.values));if(r)return K(r,!!n);const{data:t}=await q(tt,{method:"GET",variables:{skus:[e]}}),i=(c=t==null?void 0:t.products)==null?void 0:c[0];return n=(d=i==null?void 0:i.options)==null?void 0:d.some(s=>Z(s.values)),K(i,!!n)},ct=` query REFINE_PRODUCT_QUERY( $optionIds: [String!]! $sku: String! @@ -167,11 +168,11 @@ query REFINE_PRODUCT_QUERY( # %extendedPlaceholder% } -${G} -`;async function I(e,r){const t=L(r),o=B(t,e),u=H.replace("# %extendedPlaceholder%",o),{data:n}=await A(u,{method:"GET",variables:{optionIds:r,sku:e}});return n}const nt=async(e,r,t)=>{var d,f,m,g;const o=await I(e,r);if(!o)return null;let{products:u,refineProduct:n,...c}=o;const i=u==null?void 0:u[0],l=X(Object.values(c),i.options,t);if(t!=null&&t.length&&n===null){r=Y(l,r,t);const p=await I(e,r);n=p==null?void 0:p.refineProduct}const a=D({...n||i,sku:i.sku,name:i.name,externalParentId:i==null?void 0:i.externalId,options:l,optionUIDs:r,variantSku:(n==null?void 0:n.__typename)==="SimpleProductView"?n==null?void 0:n.sku:void 0}),s=(g=(m=(f=(d=h)==null?void 0:d.getConfig())==null?void 0:f.models)==null?void 0:m.ProductDetails)==null?void 0:g.fallbackData;return s?s(i,a):a};function L(e){if(e.length<2)return[e];const r=[];return e.forEach(t=>{const o=[];e.forEach(u=>{t!==u&&o.push(u)}),r.push(o)}),r}function B(e,r){return e.map((t,o)=>` - ProductOption${o}: refineProduct( +${R} +`;async function U(e,r,n){var m;if(n)return{...(m=(await q(tt,{method:"GET",variables:{skus:[e]}})).data)==null?void 0:m.products[0],optionUIDs:r};const t=st(r),i=dt(t,e),u=ct.replace("# %extendedPlaceholder%",i),{data:o}=await q(u,{method:"GET",variables:{optionIds:r,sku:e}});return o}const kt=async(e,r,n,t)=>{var s,w,O,E;let i;if(i=await U(e,r,t),!i)return null;if(t)return K({...i,optionUIDs:r},!0);let{products:u,refineProduct:o,...m}=i;const a=u==null?void 0:u[0],l=ft(Object.values(m),a.options,n);if(n!=null&&n.length&&o===null){r=Pt(l,r,n);const x=await U(e,r);o=x==null?void 0:x.refineProduct}const c=K({...o||a,sku:a.sku,name:a.name,externalParentId:a==null?void 0:a.externalId,options:l,optionUIDs:r,variantSku:(o==null?void 0:o.__typename)==="SimpleProductView"?o==null?void 0:o.sku:void 0}),d=(E=(O=(w=(s=B)==null?void 0:s.getConfig())==null?void 0:w.models)==null?void 0:O.ProductDetails)==null?void 0:E.fallbackData;return d?d(a,c):c};function st(e){if(e.length<2)return[e];const r=[];return e.forEach(n=>{const t=[];e.forEach(i=>{n!==i&&t.push(i)}),r.push(t)}),r}function dt(e,r){return e.map((n,t)=>` + ProductOption${t}: refineProduct( optionIds: [ - ${t.map(u=>`"${u}"`).join(", ")} + ${n.map(i=>`"${i}"`).join(", ")} ] sku: "${r}" ) { @@ -181,4 +182,4 @@ ${G} } } } - `).join("")}function X(e,r,t){const o=Object.values(e).filter(n=>!!n).reduce((n,c)=>c.options?[...n,...c.options]:[...n],[]),u=new Map(r.map(n=>[n.id,n]));return o.forEach(n=>{t!=null&&t.includes(n.id)||u.set(n.id,n)}),[...u.values()]}function Y(e,r,t){const o=[];let u;return e.forEach(n=>{var c,i,l,a;t.includes(n.id)?u=((i=(c=n.values)==null?void 0:c.find(s=>r.includes(s==null?void 0:s.id)))==null?void 0:i.id)||((l=n.values[0])==null?void 0:l.id):u=(a=n.values[0])==null?void 0:a.id,o.push(u)}),o}export{Z as a,tt as b,rt as c,nt as d,A as f,et as g,R as r,W as s}; + `).join("")}function ft(e,r,n){const t=Object.values(e).filter(u=>!!u).reduce((u,o)=>o.options?[...u,...o.options]:[...u],[]),i=new Map(r.map(u=>[u.id,u]));return t.forEach(u=>{n!=null&&n.includes(u.id)||i.set(u.id,u)}),[...i.values()]}function Pt(e,r,n){const t=[];let i;return e.forEach(u=>{var o,m,a,l;n.includes(u.id)?i=((m=(o=u.values)==null?void 0:o.find(c=>r.includes(c==null?void 0:c.id)))==null?void 0:m.id)||((a=u.values[0])==null?void 0:a.id):i=(l=u.values[0])==null?void 0:l.id,t.push(i)}),t}export{ht as a,xt as b,bt as c,kt as d,q as f,_t as g,wt as r,gt as s}; diff --git a/scripts/__dropins__/storefront-pdp/components/Carousel/index.d.ts b/scripts/__dropins__/storefront-pdp/components/Carousel/index.d.ts index 0d674beb6a..b8caa98dfb 100644 --- a/scripts/__dropins__/storefront-pdp/components/Carousel/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/components/Carousel/index.d.ts @@ -1,3 +1,18 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './Carousel'; export { Carousel as default } from './Carousel'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/components/GalleryGrid/index.d.ts b/scripts/__dropins__/storefront-pdp/components/GalleryGrid/index.d.ts index 4129d6f6e5..235f864347 100644 --- a/scripts/__dropins__/storefront-pdp/components/GalleryGrid/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/components/GalleryGrid/index.d.ts @@ -1,3 +1,18 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './GalleryGrid'; export { GalleryGrid as default } from './GalleryGrid'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/components/Overlay/index.d.ts b/scripts/__dropins__/storefront-pdp/components/Overlay/index.d.ts index a397ae0107..f315b9cca9 100644 --- a/scripts/__dropins__/storefront-pdp/components/Overlay/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/components/Overlay/index.d.ts @@ -1,3 +1,18 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './Overlay'; export { Overlay as default } from './Overlay'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/components/PriceRange/index.d.ts b/scripts/__dropins__/storefront-pdp/components/PriceRange/index.d.ts index 67cf4a2492..58d6c774e7 100644 --- a/scripts/__dropins__/storefront-pdp/components/PriceRange/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/components/PriceRange/index.d.ts @@ -1,3 +1,18 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './PriceRange'; export { PriceRange as default } from './PriceRange'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/components/Product/Product.d.ts b/scripts/__dropins__/storefront-pdp/components/Product/Product.d.ts index 55ff3f49f1..d04e7ed0f6 100644 --- a/scripts/__dropins__/storefront-pdp/components/Product/Product.d.ts +++ b/scripts/__dropins__/storefront-pdp/components/Product/Product.d.ts @@ -23,6 +23,8 @@ export interface ProductProps extends Omit, 'titl actions?: VNode; quantity?: VNode; carouselConfig?: ProductCarouselConfig; + zoomType?: 'zoom' | 'overlay'; + closeButton?: boolean; } export declare const Product: FunctionComponent; export {}; diff --git a/scripts/__dropins__/storefront-pdp/components/Product/index.d.ts b/scripts/__dropins__/storefront-pdp/components/Product/index.d.ts index 22d0aa6db9..1f8ee77a3b 100644 --- a/scripts/__dropins__/storefront-pdp/components/Product/index.d.ts +++ b/scripts/__dropins__/storefront-pdp/components/Product/index.d.ts @@ -1,3 +1,18 @@ +/** + * ADOBE CONFIDENTIAL + * __________________ + * Copyright 2023 Adobe + * All Rights Reserved. + * __________________ + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + */ export * from './Product'; export { Product as default } from './Product'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-pdp/components/Swatches/Swatches.d.ts b/scripts/__dropins__/storefront-pdp/components/Swatches/Swatches.d.ts index 148438f53b..fb5fd5efef 100644 --- a/scripts/__dropins__/storefront-pdp/components/Swatches/Swatches.d.ts +++ b/scripts/__dropins__/storefront-pdp/components/Swatches/Swatches.d.ts @@ -24,14 +24,7 @@ type Selection = { }; }; export interface SwatchesProps extends HTMLAttributes { - options: Array<{ - id: string; - type: (typeof supportedTypes)[number]; - label: string; - required?: boolean; - multiple?: boolean; - items: OptionValue[]; - }>; + options: Array