@syntrologie/adapt-faq 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/FAQWidgetLit.d.ts +147 -7
- package/dist/FAQWidgetLit.d.ts.map +1 -1
- package/dist/cdn.d.ts +56 -0
- package/dist/cdn.d.ts.map +1 -0
- package/dist/cdn.js +35 -0
- package/dist/cdn.js.map +7 -0
- package/dist/{chunk-5WRI5ZAA.js → chunk-7DTOSQNC.js} +14 -2
- package/dist/chunk-AJELMQH5.js +1671 -0
- package/dist/chunk-AJELMQH5.js.map +7 -0
- package/dist/{chunk-IMSLXYXR.js → chunk-YNDAVOD7.js} +51 -1
- package/dist/chunk-YNDAVOD7.js.map +7 -0
- package/dist/editor.js +5 -2
- package/dist/editor.js.map +2 -2
- package/dist/faq-styles.d.ts +66 -1
- package/dist/faq-styles.d.ts.map +1 -1
- package/dist/renderHealth.d.ts +81 -0
- package/dist/renderHealth.d.ts.map +1 -0
- package/dist/runtime.js +7 -834
- package/dist/runtime.js.map +4 -4
- package/dist/schema.d.ts +191 -73
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +12 -2
- package/dist/schema.js.map +2 -2
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -1
- package/dist/chunk-IMSLXYXR.js.map +0 -7
- /package/dist/{chunk-5WRI5ZAA.js.map → chunk-7DTOSQNC.js.map} +0 -0
package/dist/faq-styles.d.ts
CHANGED
|
@@ -29,7 +29,9 @@ export declare const baseStyles: {
|
|
|
29
29
|
readonly gap: "var(--sc-content-item-gap, 6px)";
|
|
30
30
|
};
|
|
31
31
|
readonly item: {
|
|
32
|
-
readonly borderRadius: "var(--sc-content-border-radius,
|
|
32
|
+
readonly borderRadius: "var(--sc-content-item-border-radius, 10px)";
|
|
33
|
+
readonly border: "var(--sc-content-item-border, 1px solid rgba(0, 0, 0, 0.08))";
|
|
34
|
+
readonly background: "var(--sc-content-item-background, rgba(255, 255, 255, 0.5))";
|
|
33
35
|
readonly overflow: "hidden";
|
|
34
36
|
readonly transition: "box-shadow 0.15s ease";
|
|
35
37
|
};
|
|
@@ -98,6 +100,69 @@ export declare const baseStyles: {
|
|
|
98
100
|
readonly borderColor: "rgba(0, 0, 0, 0.2)";
|
|
99
101
|
readonly backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
100
102
|
};
|
|
103
|
+
readonly detail: {
|
|
104
|
+
readonly display: "flex";
|
|
105
|
+
readonly flexDirection: "column";
|
|
106
|
+
readonly gap: "0";
|
|
107
|
+
readonly minHeight: "0";
|
|
108
|
+
readonly padding: "var(--sc-content-item-padding, 10px 16px)";
|
|
109
|
+
};
|
|
110
|
+
readonly detailBack: {
|
|
111
|
+
readonly display: "inline-flex";
|
|
112
|
+
readonly alignItems: "center";
|
|
113
|
+
readonly gap: "4px";
|
|
114
|
+
readonly alignSelf: "flex-start";
|
|
115
|
+
readonly background: "none";
|
|
116
|
+
readonly border: "none";
|
|
117
|
+
readonly padding: "4px 0";
|
|
118
|
+
readonly marginBottom: "6px";
|
|
119
|
+
readonly cursor: "pointer";
|
|
120
|
+
readonly fontSize: "13px";
|
|
121
|
+
readonly fontWeight: 600;
|
|
122
|
+
readonly opacity: 0.85;
|
|
123
|
+
};
|
|
124
|
+
readonly detailQuestion: {
|
|
125
|
+
readonly fontSize: "var(--sc-content-item-font-size, 16px)";
|
|
126
|
+
readonly fontWeight: 600;
|
|
127
|
+
readonly lineHeight: 1.4;
|
|
128
|
+
readonly marginBottom: "4px";
|
|
129
|
+
};
|
|
130
|
+
readonly detailAnswer: {
|
|
131
|
+
readonly fontSize: "var(--sc-content-body-font-size, 14px)";
|
|
132
|
+
readonly lineHeight: 1.6;
|
|
133
|
+
readonly display: "flex";
|
|
134
|
+
readonly flexDirection: "column";
|
|
135
|
+
readonly flex: "1 1 auto";
|
|
136
|
+
readonly minHeight: "0";
|
|
137
|
+
};
|
|
138
|
+
readonly detailAnswerClamp: {
|
|
139
|
+
readonly margin: "0";
|
|
140
|
+
readonly display: "-webkit-box";
|
|
141
|
+
readonly WebkitLineClamp: "var(--sc-faq-answer-clamp, 3)";
|
|
142
|
+
readonly WebkitBoxOrient: "vertical";
|
|
143
|
+
readonly overflow: "hidden";
|
|
144
|
+
readonly flex: "1 1 auto";
|
|
145
|
+
readonly minHeight: "0";
|
|
146
|
+
};
|
|
147
|
+
readonly detailFooter: {
|
|
148
|
+
readonly display: "flex";
|
|
149
|
+
readonly alignItems: "center";
|
|
150
|
+
readonly justifyContent: "flex-end";
|
|
151
|
+
readonly gap: "8px";
|
|
152
|
+
readonly marginTop: "6px";
|
|
153
|
+
readonly flexShrink: 0;
|
|
154
|
+
};
|
|
155
|
+
readonly detailDiveDeeper: {
|
|
156
|
+
readonly flex: "0 0 auto";
|
|
157
|
+
readonly padding: "4px 10px";
|
|
158
|
+
readonly borderRadius: "9999px";
|
|
159
|
+
readonly border: "1px solid var(--sc-color-border, rgba(0,0,0,0.14))";
|
|
160
|
+
readonly background: "transparent";
|
|
161
|
+
readonly cursor: "pointer";
|
|
162
|
+
readonly font: "600 12px/1.2 var(--sc-font-family, inherit)";
|
|
163
|
+
readonly color: "var(--sc-color-primary, #3d8a5e)";
|
|
164
|
+
readonly whiteSpace: "nowrap";
|
|
165
|
+
};
|
|
101
166
|
readonly emptyState: {
|
|
102
167
|
readonly textAlign: "center";
|
|
103
168
|
readonly padding: "48px 24px";
|
package/dist/faq-styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faq-styles.d.ts","sourceRoot":"","sources":["../src/faq-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"faq-styles.d.ts","sourceRoot":"","sources":["../src/faq-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Mb,CAAC;AAMX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFvB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* renderHealth — runtime self-detection of blank render and undeclared clipping
|
|
3
|
+
* for the FAQ accordion.
|
|
4
|
+
*
|
|
5
|
+
* A tile can look correct in tests yet paint blank on a real host (a device
|
|
6
|
+
* compositing quirk, a font that measures wider, a broken image CDN). After the
|
|
7
|
+
* accordion paints, this module re-measures it and emits a PostHog signal via
|
|
8
|
+
* the ONE consent-gated door (`window.SynOS.runtime.events.emit`) when it finds a
|
|
9
|
+
* blank tile or an undeclared clip. Field-RUM for "the FAQ broke on a customer's
|
|
10
|
+
* page".
|
|
11
|
+
*
|
|
12
|
+
* This is a lean, package-LOCAL copy of the pattern adaptive-product owns:
|
|
13
|
+
* `@syntrologie/adapt-faq` does not (and should not) depend on
|
|
14
|
+
* `@syntrologie/adapt-product`, and the two share no runtime-util package. The
|
|
15
|
+
* blank check is identical; the clip check is the generic text-overflow subset
|
|
16
|
+
* (the FAQ has no `[data-critical-text]` identity nodes, so the product card's
|
|
17
|
+
* Tier-1 identity rule does not apply here).
|
|
18
|
+
* Follow-up: extract a shared runtime-util package so both adaptives import one
|
|
19
|
+
* copy.
|
|
20
|
+
*
|
|
21
|
+
* COE-051 lesson: `publish()` only notifies in-process canvas subscribers — it
|
|
22
|
+
* NEVER reaches PostHog. `emit()` is the sanctioned capture path (the EventBus
|
|
23
|
+
* forwards emit()'d events to its consent-gated posthogCapture sink). The event
|
|
24
|
+
* name MUST satisfy validateEventName (`app:{category}:{action}`, colon segments)
|
|
25
|
+
* or the bus silently drops it.
|
|
26
|
+
*
|
|
27
|
+
* NON-PII discipline: only element tag/class PATHS and pixel numbers ever leave
|
|
28
|
+
* the widget — never text content, never customer copy.
|
|
29
|
+
*/
|
|
30
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
31
|
+
export interface ClipFinding {
|
|
32
|
+
/** Structural path to the offending node (NON-PII), e.g. `div.faq>button`. */
|
|
33
|
+
path: string;
|
|
34
|
+
/** Horizontal overflow in px, rounded. */
|
|
35
|
+
over_px: number;
|
|
36
|
+
}
|
|
37
|
+
export interface RenderHealth {
|
|
38
|
+
/** Undeclared clips found inside the tile (empty = clean). */
|
|
39
|
+
clips: ClipFinding[];
|
|
40
|
+
/** True when the tile occupies real area but painted no text and no complete
|
|
41
|
+
* image (a blank tile). */
|
|
42
|
+
blank: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Measure the render health of a tile root. Pure DOM read — no side effects, no
|
|
46
|
+
* telemetry. Safe to call any time after paint.
|
|
47
|
+
* - text-clip: an element with its own text whose scrollWidth exceeds
|
|
48
|
+
* clientWidth by >1px, with no textOverflow:ellipsis, not under [data-clip-ok].
|
|
49
|
+
* - blank: the tile has real area but no painted text and no complete image.
|
|
50
|
+
*/
|
|
51
|
+
export declare function measureRenderHealth(root: Element): RenderHealth;
|
|
52
|
+
export interface RenderHealthReportOptions {
|
|
53
|
+
/** Event category: emits `app:<category>:blank` / `:clipped`. */
|
|
54
|
+
category: string;
|
|
55
|
+
/** `widget_kind` tag included in every payload. */
|
|
56
|
+
widgetKind: string;
|
|
57
|
+
/** Extra NON-PII context merged into every payload. */
|
|
58
|
+
context?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
/** Measure `root` and, if it clips or paints blank, emit the self-detection
|
|
61
|
+
* event via the consent-gated emit() path. Returns the measured health. Never
|
|
62
|
+
* throws. */
|
|
63
|
+
export declare function reportRenderHealth(root: Element, opts: RenderHealthReportOptions): RenderHealth;
|
|
64
|
+
/** What the widget's probe returns for one measurement pass. */
|
|
65
|
+
export interface RenderHealthProbe extends RenderHealthReportOptions {
|
|
66
|
+
/** The element to measure, or `null` to SKIP this pass (unsettled state). */
|
|
67
|
+
root: Element | null;
|
|
68
|
+
/** Stable key for the current visual state; a state reports AT MOST ONCE. */
|
|
69
|
+
stateKey: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Lit ReactiveController that runs a widget's render-health probe after each
|
|
73
|
+
* paint settles (rAF then a 0ms timeout), at most once per visual state.
|
|
74
|
+
*/
|
|
75
|
+
export declare class RenderHealthController implements ReactiveController {
|
|
76
|
+
#private;
|
|
77
|
+
constructor(host: ReactiveControllerHost, probe: () => RenderHealthProbe | null);
|
|
78
|
+
hostUpdated(): void;
|
|
79
|
+
hostDisconnected(): void;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=renderHealth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderHealth.d.ts","sourceRoot":"","sources":["../src/renderHealth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAEtE,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,8DAA8D;IAC9D,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB;gCAC4B;IAC5B,KAAK,EAAE,OAAO,CAAC;CAChB;AAoCD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CA6C/D;AAwBD,MAAM,WAAW,yBAAyB;IACxC,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAID;;cAEc;AACd,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,GAAG,YAAY,CAqB/F;AAED,gEAAgE;AAChE,MAAM,WAAW,iBAAkB,SAAQ,yBAAyB;IAClE,6EAA6E;IAC7E,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACrB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;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;CAyCzB"}
|