@patientos/website-kit 0.1.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/LICENSE +201 -0
- package/README.md +30 -0
- package/dist/checkout-block-CrO7OxI9.d.ts +121 -0
- package/dist/chunk-G3U6EXJM.js +1240 -0
- package/dist/chunk-JTZ6GYA7.js +30 -0
- package/dist/chunk-LCHW6XF4.js +64 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-Q4URDZAK.js +36 -0
- package/dist/chunk-QDO3SJWR.js +72 -0
- package/dist/chunk-THMT43MV.js +61 -0
- package/dist/chunk-TOPPLOH2.js +12229 -0
- package/dist/chunk-ZOF22TJA.js +19 -0
- package/dist/consult-room.d.ts +35 -0
- package/dist/consult-room.js +31540 -0
- package/dist/contrast.d.ts +63 -0
- package/dist/contrast.js +15 -0
- package/dist/index.d.ts +189 -0
- package/dist/index.js +484 -0
- package/dist/islands-impl.d.ts +68 -0
- package/dist/islands-impl.js +23 -0
- package/dist/islands-registry.d.ts +17 -0
- package/dist/islands-registry.js +14 -0
- package/dist/islands.d.ts +57 -0
- package/dist/islands.js +15 -0
- package/dist/patient-surface-theme.d.ts +22 -0
- package/dist/patient-surface-theme.js +7 -0
- package/dist/portal-account-EhOtLV5u.d.ts +113 -0
- package/dist/portal-account.client-CTget1-3.d.ts +169 -0
- package/dist/portal-booking-client.d.ts +232 -0
- package/dist/portal-booking-client.js +51 -0
- package/dist/script-sources.d.ts +11 -0
- package/dist/script-sources.js +17 -0
- package/dist/show-when.d.ts +70 -0
- package/dist/show-when.js +9 -0
- package/dist/website-kit.css +3580 -0
- package/package.json +120 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** An answer value as gathered at runtime. Mirrors the engine's `AnswerValue`. */
|
|
2
|
+
type AnswerValue = string | number | boolean | null;
|
|
3
|
+
/** The answers gathered so far, keyed by question key. */
|
|
4
|
+
type Answers = Record<string, AnswerValue | undefined>;
|
|
5
|
+
/** The branch-condition grammar. Structurally identical to the engine's `ShowWhenCondition`. */
|
|
6
|
+
type ShowWhenCondition = {
|
|
7
|
+
op: 'equals';
|
|
8
|
+
questionKey: string;
|
|
9
|
+
value: string | number | boolean;
|
|
10
|
+
} | {
|
|
11
|
+
op: 'notEquals';
|
|
12
|
+
questionKey: string;
|
|
13
|
+
value: string | number | boolean;
|
|
14
|
+
} | {
|
|
15
|
+
op: 'in';
|
|
16
|
+
questionKey: string;
|
|
17
|
+
value: (string | number | boolean)[];
|
|
18
|
+
} | {
|
|
19
|
+
op: 'answered';
|
|
20
|
+
questionKey: string;
|
|
21
|
+
} | {
|
|
22
|
+
op: 'gt';
|
|
23
|
+
questionKey: string;
|
|
24
|
+
value: number;
|
|
25
|
+
} | {
|
|
26
|
+
op: 'gte';
|
|
27
|
+
questionKey: string;
|
|
28
|
+
value: number;
|
|
29
|
+
} | {
|
|
30
|
+
op: 'lt';
|
|
31
|
+
questionKey: string;
|
|
32
|
+
value: number;
|
|
33
|
+
} | {
|
|
34
|
+
op: 'lte';
|
|
35
|
+
questionKey: string;
|
|
36
|
+
value: number;
|
|
37
|
+
} | {
|
|
38
|
+
op: 'before';
|
|
39
|
+
questionKey: string;
|
|
40
|
+
value: string;
|
|
41
|
+
} | {
|
|
42
|
+
op: 'after';
|
|
43
|
+
questionKey: string;
|
|
44
|
+
value: string;
|
|
45
|
+
} | {
|
|
46
|
+
and: ShowWhenCondition[];
|
|
47
|
+
} | {
|
|
48
|
+
or: ShowWhenCondition[];
|
|
49
|
+
} | {
|
|
50
|
+
not: ShowWhenCondition;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Should a question with this condition be asked, given the answers so far?
|
|
54
|
+
*
|
|
55
|
+
* `null` / absent ⇒ always asked. Anything the evaluator cannot resolve ⇒ HIDDEN.
|
|
56
|
+
*/
|
|
57
|
+
declare function evaluateShowWhen(cond: unknown, answers: Answers): boolean;
|
|
58
|
+
/** A question as this evaluator needs to see it — the set's order plus its condition. */
|
|
59
|
+
interface ConditionalQuestion {
|
|
60
|
+
sortOrder: number;
|
|
61
|
+
showWhen?: unknown;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The questions currently askable, in order. Assumes `ordered` is already sorted by
|
|
65
|
+
* `sortOrder` (the public API returns it that way) — this filters, it does not re-sort,
|
|
66
|
+
* so a caller that shuffles the list breaks forward-only evaluation, not this function.
|
|
67
|
+
*/
|
|
68
|
+
declare function visibleQuestions<T extends ConditionalQuestion>(ordered: readonly T[], answers: Answers): T[];
|
|
69
|
+
|
|
70
|
+
export { type AnswerValue, type Answers, type ConditionalQuestion, type ShowWhenCondition, evaluateShowWhen, visibleQuestions };
|