@syntrologie/adapt-product 2.28.0 → 2.29.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/__fixtures__/variant-payloads.d.ts +33 -0
- package/dist/__fixtures__/variant-payloads.d.ts.map +1 -0
- package/dist/cdn.d.ts +1 -0
- package/dist/cdn.d.ts.map +1 -1
- package/dist/cdn.js +9 -3
- package/dist/cdn.js.map +2 -2
- package/dist/{chunk-SGJGJRCP.js → chunk-7Z4Y44WC.js} +139 -6
- package/dist/chunk-7Z4Y44WC.js.map +7 -0
- package/dist/chunk-VY23O32Z.js +10963 -0
- package/dist/chunk-VY23O32Z.js.map +7 -0
- package/dist/decision/card-effects.d.ts +20 -0
- package/dist/decision/card-effects.d.ts.map +1 -0
- package/dist/decision/card.d.ts +150 -0
- package/dist/decision/card.d.ts.map +1 -0
- package/dist/decision/pdp-compose.d.ts +69 -0
- package/dist/decision/pdp-compose.d.ts.map +1 -0
- package/dist/decision/pdp-effects.d.ts +17 -0
- package/dist/decision/pdp-effects.d.ts.map +1 -0
- package/dist/decision/pdp.d.ts +214 -0
- package/dist/decision/pdp.d.ts.map +1 -0
- package/dist/native/nativeSlotSwap.d.ts +40 -0
- package/dist/native/nativeSlotSwap.d.ts.map +1 -0
- package/dist/native/nativeSlotWatcher.d.ts +135 -0
- package/dist/native/nativeSlotWatcher.d.ts.map +1 -0
- package/dist/platformAdapter.d.ts +82 -0
- package/dist/platformAdapter.d.ts.map +1 -0
- package/dist/runtime.d.ts +318 -36
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +10 -2
- package/dist/sanitizer.d.ts.map +1 -1
- package/dist/schema-primitives.d.ts +197 -12
- package/dist/schema-primitives.d.ts.map +1 -1
- package/dist/schema.d.ts +2098 -164
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +11 -1
- package/dist/scoring/pool-selection.d.ts +35 -0
- package/dist/scoring/pool-selection.d.ts.map +1 -0
- package/dist/scoring/scored-template.d.ts +106 -0
- package/dist/scoring/scored-template.d.ts.map +1 -0
- package/dist/variantCache.d.ts +5 -0
- package/dist/variantCache.d.ts.map +1 -0
- package/dist/widgets/OtherProductTileLit.d.ts +46 -0
- package/dist/widgets/OtherProductTileLit.d.ts.map +1 -0
- package/dist/widgets/PdpChartBarStackedLit.d.ts +33 -0
- package/dist/widgets/PdpChartBarStackedLit.d.ts.map +1 -0
- package/dist/widgets/PdpChartLit.d.ts +56 -0
- package/dist/widgets/PdpChartLit.d.ts.map +1 -0
- package/dist/widgets/PdpChartMetricPullLit.d.ts +33 -0
- package/dist/widgets/PdpChartMetricPullLit.d.ts.map +1 -0
- package/dist/widgets/PdpOtherProductsCarouselLit.d.ts +33 -0
- package/dist/widgets/PdpOtherProductsCarouselLit.d.ts.map +1 -0
- package/dist/widgets/PdpOtherProductsGridLit.d.ts +20 -0
- package/dist/widgets/PdpOtherProductsGridLit.d.ts.map +1 -0
- package/dist/widgets/PdpOtherProductsLit.d.ts +35 -0
- package/dist/widgets/PdpOtherProductsLit.d.ts.map +1 -0
- package/dist/widgets/PdpPeerFeedCarouselLit.d.ts +30 -0
- package/dist/widgets/PdpPeerFeedCarouselLit.d.ts.map +1 -0
- package/dist/widgets/PdpPeerFeedLit.d.ts +51 -0
- package/dist/widgets/PdpPeerFeedLit.d.ts.map +1 -0
- package/dist/widgets/PdpPeerFeedMasonryLit.d.ts +30 -0
- package/dist/widgets/PdpPeerFeedMasonryLit.d.ts.map +1 -0
- package/dist/widgets/PdpQaAccordionLit.d.ts +27 -0
- package/dist/widgets/PdpQaAccordionLit.d.ts.map +1 -0
- package/dist/widgets/PdpQaLit.d.ts +48 -0
- package/dist/widgets/PdpQaLit.d.ts.map +1 -0
- package/dist/widgets/PdpQaSideBySideLit.d.ts +27 -0
- package/dist/widgets/PdpQaSideBySideLit.d.ts.map +1 -0
- package/dist/widgets/PdpRegionalFullBleedLit.d.ts +27 -0
- package/dist/widgets/PdpRegionalFullBleedLit.d.ts.map +1 -0
- package/dist/widgets/PdpRegionalInlineNoteLit.d.ts +27 -0
- package/dist/widgets/PdpRegionalInlineNoteLit.d.ts.map +1 -0
- package/dist/widgets/PdpRegionalLit.d.ts +48 -0
- package/dist/widgets/PdpRegionalLit.d.ts.map +1 -0
- package/dist/widgets/PdpRibbonLit.d.ts +31 -0
- package/dist/widgets/PdpRibbonLit.d.ts.map +1 -0
- package/dist/widgets/PdpSectionHeaderLit.d.ts +30 -0
- package/dist/widgets/PdpSectionHeaderLit.d.ts.map +1 -0
- package/dist/widgets/PdpSlotLit.d.ts +30 -0
- package/dist/widgets/PdpSlotLit.d.ts.map +1 -0
- package/dist/widgets/PdpSlotPlaceholderLit.d.ts +22 -0
- package/dist/widgets/PdpSlotPlaceholderLit.d.ts.map +1 -0
- package/dist/widgets/PdpTrendingNewsHeroLit.d.ts +32 -0
- package/dist/widgets/PdpTrendingNewsHeroLit.d.ts.map +1 -0
- package/dist/widgets/PdpTrendingNewsLit.d.ts +42 -0
- package/dist/widgets/PdpTrendingNewsLit.d.ts.map +1 -0
- package/dist/widgets/PdpTrendingNewsMagazineLit.d.ts +32 -0
- package/dist/widgets/PdpTrendingNewsMagazineLit.d.ts.map +1 -0
- package/dist/widgets/ProductCardLit.d.ts +78 -0
- package/dist/widgets/ProductCardLit.d.ts.map +1 -1
- package/dist/widgets/ProductComparisonLit.d.ts +9 -4
- package/dist/widgets/ProductComparisonLit.d.ts.map +1 -1
- package/dist/widgets/ProductGridLit.d.ts +1 -0
- package/dist/widgets/ProductGridLit.d.ts.map +1 -1
- package/dist/widgets/ProductHeroLit.d.ts +1 -0
- package/dist/widgets/ProductHeroLit.d.ts.map +1 -1
- package/dist/widgets/ProductRecoCarouselLit.d.ts +24 -0
- package/dist/widgets/ProductRecoCarouselLit.d.ts.map +1 -0
- package/dist/widgets/SyntroPdpLit.d.ts +366 -0
- package/dist/widgets/SyntroPdpLit.d.ts.map +1 -0
- package/dist/widgets/VariantPanelLit.d.ts +98 -0
- package/dist/widgets/VariantPanelLit.d.ts.map +1 -0
- package/dist/widgets/ensureStylesInRoot.d.ts +22 -0
- package/dist/widgets/ensureStylesInRoot.d.ts.map +1 -0
- package/dist/widgets/entrance.d.ts +35 -0
- package/dist/widgets/entrance.d.ts.map +1 -0
- package/dist/widgets/renderHealth.d.ts +57 -0
- package/dist/widgets/renderHealth.d.ts.map +1 -0
- package/dist/widgets/renderHealthReporter.d.ts +66 -0
- package/dist/widgets/renderHealthReporter.d.ts.map +1 -0
- package/package.json +4 -1
- package/dist/chunk-QZZVFYL6.js +0 -1352
- package/dist/chunk-QZZVFYL6.js.map +0 -7
- package/dist/chunk-SGJGJRCP.js.map +0 -7
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* renderHealthReporter — the shared, reusable half of runtime render-health
|
|
3
|
+
* self-detection.
|
|
4
|
+
*
|
|
5
|
+
* `renderHealth.ts` MEASURES a rendered element (pure DOM read: undeclared clips
|
|
6
|
+
* + blank paint). This module is the counterpart that REPORTS the measurement:
|
|
7
|
+
* it emits `app:<category>:blank` / `app:<category>:clipped` through the ONE
|
|
8
|
+
* consent-gated door to PostHog (`window.SynOS.runtime.events.emit`), and packages
|
|
9
|
+
* the once-per-visual-state scheduling as a Lit ReactiveController so every tile
|
|
10
|
+
* widget adopts the same self-detection with ~5 lines and no copy-paste.
|
|
11
|
+
*
|
|
12
|
+
* COE-051 lesson: `publish()` only notifies in-process canvas subscribers — it
|
|
13
|
+
* NEVER reaches PostHog. `emit()` is the sanctioned capture path: the EventBus
|
|
14
|
+
* forwards emit()'d events to its posthogCapture sink (bootstrap-runtime wires it
|
|
15
|
+
* to the consent-gated `telemetry.track`). We never call posthog directly. The
|
|
16
|
+
* event name MUST satisfy validateEventName (`app:{category}:{action}`, colon
|
|
17
|
+
* segments, no `app:` prefix stripped) or the EventBus silently drops it — the
|
|
18
|
+
* exact silent failure this telemetry exists to surface.
|
|
19
|
+
*
|
|
20
|
+
* NON-PII discipline: only element tag/class PATHS and pixel numbers ever leave a
|
|
21
|
+
* widget — never text content, never customer copy.
|
|
22
|
+
*/
|
|
23
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
24
|
+
import { type RenderHealth } from './renderHealth';
|
|
25
|
+
export interface RenderHealthReportOptions {
|
|
26
|
+
/** Event category segment: emits `app:<category>:blank` / `:clipped`. Must be a
|
|
27
|
+
* valid segment (`^[a-z][a-z0-9_]*$`), e.g. `product_comparison`. */
|
|
28
|
+
category: string;
|
|
29
|
+
/** `widget_kind` tag included in every payload, e.g. `adaptive-product:comparison`. */
|
|
30
|
+
widgetKind: string;
|
|
31
|
+
/** Extra NON-PII context merged into every payload (density, velvet, …). */
|
|
32
|
+
context?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Measure `root` and, if it clips or paints blank, emit the corresponding
|
|
36
|
+
* self-detection event via the consent-gated emit() path. Returns the measured
|
|
37
|
+
* health (so callers/tests can inspect it). Never throws — a measurement or
|
|
38
|
+
* telemetry failure must never crash the widget or the host page.
|
|
39
|
+
*/
|
|
40
|
+
export declare function reportRenderHealth(root: Element, opts: RenderHealthReportOptions): RenderHealth;
|
|
41
|
+
/** What a widget's probe returns for one measurement pass. */
|
|
42
|
+
export interface RenderHealthProbe extends RenderHealthReportOptions {
|
|
43
|
+
/** The element to measure, or `null` to SKIP this pass. A widget returns null
|
|
44
|
+
* for any UNSETTLED state (loading, error, empty, wrong face) so a transient
|
|
45
|
+
* no-content frame is never mis-reported as a blank tile. */
|
|
46
|
+
root: Element | null;
|
|
47
|
+
/** Stable key for the current visual state; a state reports AT MOST ONCE
|
|
48
|
+
* (prevents event spam across re-renders of the same visual state). */
|
|
49
|
+
stateKey: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Lit ReactiveController that runs a widget's render-health probe after each
|
|
53
|
+
* paint settles (rAF then a 0ms timeout, so lazy images / web fonts land first),
|
|
54
|
+
* at most once per visual state. Attach in a widget's field initializer:
|
|
55
|
+
*
|
|
56
|
+
* #health = new RenderHealthController(this, () => this.#healthProbe());
|
|
57
|
+
*
|
|
58
|
+
* The controller's `hostUpdated` fires automatically after every host update.
|
|
59
|
+
*/
|
|
60
|
+
export declare class RenderHealthController implements ReactiveController {
|
|
61
|
+
#private;
|
|
62
|
+
constructor(host: ReactiveControllerHost, probe: () => RenderHealthProbe | null);
|
|
63
|
+
hostUpdated(): void;
|
|
64
|
+
hostDisconnected(): void;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=renderHealthReporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderHealthReporter.d.ts","sourceRoot":"","sources":["../../src/widgets/renderHealthReporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AACtE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwBxE,MAAM,WAAW,yBAAyB;IACxC;0EACsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,GAAG,YAAY,CA2B/F;AAED,8DAA8D;AAC9D,MAAM,WAAW,iBAAkB,SAAQ,yBAAyB;IAClE;;kEAE8D;IAC9D,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACrB;4EACwE;IACxE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,qBAAa,sBAAuB,YAAW,kBAAkB;;gBAKnD,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,iBAAiB,GAAG,IAAI;IAK/E,WAAW,IAAI,IAAI;IAInB,gBAAgB,IAAI,IAAI;CA6CzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntrologie/adapt-product",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.29.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,
|
|
@@ -46,6 +46,9 @@
|
|
|
46
46
|
"lit": "^3.0.0",
|
|
47
47
|
"zod": "^3.0.0"
|
|
48
48
|
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@syntrologie/runtime-contracts": "*"
|
|
51
|
+
},
|
|
49
52
|
"devDependencies": {
|
|
50
53
|
"@open-wc/testing-helpers": "3.0.1",
|
|
51
54
|
"@syntrologie/sdk-contracts": "*",
|