@syntrologie/adapt-product 2.46.0 → 2.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cdn.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  onActivate,
3
3
  runtime
4
- } from "./chunk-VUU65MYQ.js";
4
+ } from "./chunk-4DLT7VV6.js";
5
5
  import "./chunk-Y2QAYCSK.js";
6
6
 
7
7
  // src/cdn.ts
@@ -4885,6 +4885,15 @@ function createCardEffectExecutor(ports) {
4885
4885
  return { execute };
4886
4886
  }
4887
4887
 
4888
+ // src/detail-cta.ts
4889
+ var VIEW_DETAIL_ACTION_ID = "view_detail";
4890
+ function pickDetailCta(ctas) {
4891
+ if (!ctas?.length) return void 0;
4892
+ const navigates = ctas.filter((c2) => !!c2.href);
4893
+ if (!navigates.length) return void 0;
4894
+ return navigates.find((c2) => c2.actionId === VIEW_DETAIL_ACTION_ID) ?? navigates.find((c2) => c2.variant && c2.variant !== "primary") ?? navigates[0];
4895
+ }
4896
+
4888
4897
  // src/sanitizer.ts
4889
4898
  var ALLOWED_TAGS = /* @__PURE__ */ new Set([
4890
4899
  "b",
@@ -6714,9 +6723,12 @@ function renderProductCardInner(product, density, resolved, visibleFacts, ctas,
6714
6723
  // as the comparison's name-link) — so a canvas that hides the
6715
6724
  // secondary CTA pill (velvet: --sc-card-secondary-display: none, to
6716
6725
  // avoid mid-word clipping in the narrow right column) still keeps
6717
- // the product page reachable.
6726
+ // the product page reachable. `pickDetailCta` resolves WHICH cta
6727
+ // that is semantically (actionId "view_detail"); "first cta with an
6728
+ // href" assumed the commerce shape and sent booking-fulfilment
6729
+ // products to their booker instead — see detail-cta.ts.
6718
6730
  (() => {
6719
- const navCta = ctas.find((c2) => c2.href);
6731
+ const navCta = pickDetailCta(ctas);
6720
6732
  return navCta?.href ? html8`<a
6721
6733
  data-product-name-link
6722
6734
  href=${navCta.href}
@@ -7284,7 +7296,7 @@ renderMatrix_fn = function(products, rows) {
7284
7296
  const resolved = this.resolved[p.id];
7285
7297
  const imgSrc = resolved?.image ?? p.image.src;
7286
7298
  const priceText = resolved?.price ?? p.price?.amount;
7287
- const navCta = p.ctas.find((c2) => c2.href);
7299
+ const navCta = pickDetailCta(p.ctas);
7288
7300
  const pdpHref = navCta?.href;
7289
7301
  const pillBase = `position:absolute;top:4px;display:inline-flex;align-items:center;background:rgba(17,17,17,0.66);color:#fff;border-radius:9999px;padding:0.12rem 0.36rem;font-size:${compactHeaders ? "0.56rem" : "0.64rem"};line-height:1.2;font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,0.25);max-width:calc(100% - 8px);min-width:0;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;`;
7290
7302
  const showRatingPill = !compactHeaders && p.rating;
@@ -11937,4 +11949,4 @@ export {
11937
11949
  * SPDX-License-Identifier: BSD-3-Clause
11938
11950
  *)
11939
11951
  */
11940
- //# sourceMappingURL=chunk-VUU65MYQ.js.map
11952
+ //# sourceMappingURL=chunk-4DLT7VV6.js.map