@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 +1 -1
- package/dist/{chunk-VUU65MYQ.js → chunk-4DLT7VV6.js} +16 -4
- package/dist/chunk-4DLT7VV6.js.map +7 -0
- package/dist/detail-cta.d.ts +49 -0
- package/dist/detail-cta.d.ts.map +1 -0
- package/dist/runtime.js +1 -1
- package/dist/widgets/ProductCardLit.d.ts.map +1 -1
- package/dist/widgets/ProductComparisonLit.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-VUU65MYQ.js.map +0 -7
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which CTA opens the item's own page?
|
|
3
|
+
*
|
|
4
|
+
* Both tappable product surfaces (the comparison media card, the card's
|
|
5
|
+
* name-link) used to answer this with `ctas.find((c) => c.href)` — "the first
|
|
6
|
+
* CTA that navigates". That silently encoded the COMMERCE CTA shape:
|
|
7
|
+
*
|
|
8
|
+
* commerce: [0] Add to cart (actionId, NO href) -> skipped
|
|
9
|
+
* [1] Product Page (href) -> correct target
|
|
10
|
+
*
|
|
11
|
+
* booking: [0] Book a consult (href!) -> STOPS HERE (bug)
|
|
12
|
+
* [1] Service Page (href) -> the real target
|
|
13
|
+
*
|
|
14
|
+
* On iGlow Med Spa every catalog entry is booking fulfilment with no href of
|
|
15
|
+
* its own, so all 50 resolved to ONE generic workspace default
|
|
16
|
+
* (go.booker.com/location/iglowmed/service-menu). Tapping a comparison image
|
|
17
|
+
* opened a generic scheduling menu instead of the treatment's page.
|
|
18
|
+
*
|
|
19
|
+
* The server now marks the entity's own page in BOTH shapes with
|
|
20
|
+
* `actionId: "view_detail"` (product_hydration.VIEW_DETAIL_ACTION_ID), so the
|
|
21
|
+
* choice is semantic instead of positional.
|
|
22
|
+
*/
|
|
23
|
+
/** The server's marker for "this CTA points at the entity's own page". */
|
|
24
|
+
export declare const VIEW_DETAIL_ACTION_ID = "view_detail";
|
|
25
|
+
/** Structural minimum this module needs; the full CTA type lives in the Zod schema. */
|
|
26
|
+
export interface DetailCtaLike {
|
|
27
|
+
href?: string;
|
|
28
|
+
actionId?: string;
|
|
29
|
+
variant?: string;
|
|
30
|
+
target?: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolve the detail-page CTA, or `undefined` when nothing navigates (the card
|
|
35
|
+
* then renders as plain, non-tappable content rather than a dead link).
|
|
36
|
+
*
|
|
37
|
+
* Preference order — a marked CTA always wins, but the unmarked tiers keep
|
|
38
|
+
* LLM- and config-authored `ctas[]` (which never carry `view_detail`) working,
|
|
39
|
+
* and cover a runtime talking to a server older than the marker:
|
|
40
|
+
*
|
|
41
|
+
* 1. `actionId === "view_detail"` WITH an href — the explicit answer.
|
|
42
|
+
* 2. A navigating CTA that is not the primary action. In both server shapes
|
|
43
|
+
* the page link is the ghost/secondary one, so this recovers the correct
|
|
44
|
+
* target for unmarked booking data instead of reproducing the bug.
|
|
45
|
+
* 3. Any navigating CTA — the tier-3 hydration case, where the primary CTA
|
|
46
|
+
* IS the entity's page and no second CTA exists.
|
|
47
|
+
*/
|
|
48
|
+
export declare function pickDetailCta<T extends DetailCtaLike>(ctas: readonly T[] | undefined): T | undefined;
|
|
49
|
+
//# sourceMappingURL=detail-cta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-cta.d.ts","sourceRoot":"","sources":["../src/detail-cta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,uFAAuF;AACvF,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,IAAI,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,GAC7B,CAAC,GAAG,SAAS,CASf"}
|
package/dist/runtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCardLit.d.ts","sourceRoot":"","sources":["../../src/widgets/ProductCardLit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrE,OAAO,EAEL,KAAK,SAAS,EAIf,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductCardLit.d.ts","sourceRoot":"","sources":["../../src/widgets/ProductCardLit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrE,OAAO,EAEL,KAAK,SAAS,EAIf,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAAE,KAAK,SAAS,EAAiC,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAC/F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;SAAE,CAAC;QAChC,OAAO,CAAC,EAAE;YACR,MAAM,CAAC,EAAE;gBACP,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAOjE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MA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AE,WAAW,CAAa;IAEjC,cAAc,EAAE,SAAS,CAA4B;IA6B5C,gBAAgB;IAIhB,iBAAiB,IAAI,IAAI;IA2CzB,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAa/C,OAAO,IAAI,IAAI;IA8Df,oBAAoB,IAAI,IAAI;IA8ErC,OAAO,CAAC,cAAc,CAGpB;IAEF,OAAO,CAAC,yBAAyB,CAQ/B;IAEF,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,eAAe,CAGrB;IA0CO,MAAM,IAAI,cAAc,GAAG,OAAO,OAAO;CA2GnD;AAo/BD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,SAAS,GAAG,UAAU,EAC/B,QAAQ,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EACxD,YAAY,CAAC,EAAE,SAAS,cAAc,EAAE,GACvC,cAAc,CAahB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductComparisonLit.d.ts","sourceRoot":"","sources":["../../src/widgets/ProductComparisonLit.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,UAAU,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductComparisonLit.d.ts","sourceRoot":"","sources":["../../src/widgets/ProductComparisonLit.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,UAAU,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrE,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,WAAW,CAAC;AAInE,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtE,qBAAa,oBAAqB,SAAQ,UAAU;;IAClD,OAAgB,UAAU;;;;;;;;;;;;;MAKxB;IAEF,KAAK,EAAE,eAAe,GAAG,SAAS,CAAa;IAC/C,QAAQ,EAAE,WAAW,CAAM;IAC3B,eAAe,UAAS;IACxB;yEACqE;IACrE,UAAU,UAAS;;IA2BV,gBAAgB;IAIhB,iBAAiB,IAAI,IAAI;IAyBzB,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAM/C,oBAAoB,IAAI,IAAI;IAqD5B,MAAM,IAAI,cAAc,GAAG,OAAO,OAAO;IAwJzC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CA0RtD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntrologie/adapt-product",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.47.0",
|
|
4
4
|
"description": "Adaptive Product — product cards, comparison, hero, and grid tile widgets with optional price/image binding to host-page sources.",
|
|
5
5
|
"license": "Proprietary",
|
|
6
6
|
"private": false,
|