@everfur/sdk 0.13.0 → 0.15.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/CHANGELOG.md +206 -0
- package/README.md +11 -10
- package/dist/{Chat.d-Dts8u_1a.d.cts → Chat.d-CtfANk3A.d.cts} +12 -4
- package/dist/{Chat.d-DUNTfzqC.d.ts → Chat.d-a7Ksz7NZ.d.ts} +12 -4
- package/dist/{DepthViews.d-CubkMPbU.d.ts → DepthViews.d-BqMnWSMu.d.cts} +1 -1
- package/dist/{DepthViews.d-BMU2jFPw.d.cts → DepthViews.d-CuBElgEc.d.ts} +1 -1
- package/dist/{DepthViews.d-Ce2Zhnrb.d.ts → DepthViews.d-DbJejGm3.d.ts} +1 -1
- package/dist/{DepthViews.d-BIp599lz.d.cts → DepthViews.d-dXWL6ToG.d.cts} +1 -1
- package/dist/RecordsPage.d-DKrZ9rHX.d.ts +93 -0
- package/dist/RecordsPage.d-DRPdUAo4.d.cts +93 -0
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +7 -5
- package/dist/animations/index.d.ts +7 -5
- package/dist/animations/index.js +1 -1
- package/dist/{attachments.d-Djy9z_0Z.d.ts → attachments.d-BGn2_knv.d.ts} +6 -24
- package/dist/{attachments.d-D1yhJjcZ.d.ts → attachments.d-CoQhXrP9.d.ts} +2 -2
- package/dist/{attachments.d-Bp2qbHxn.d.cts → attachments.d-CpaOfi2g.d.cts} +6 -24
- package/dist/{attachments.d-DisnvB9R.d.cts → attachments.d-CqHMGoER.d.cts} +2 -2
- package/dist/{bookingCopy.d-BlBmhAJc.d.cts → bookingCopy.d-Bnq2zk0F.d.cts} +2 -2
- package/dist/{bookingCopy.d-BJF6gd1A.d.ts → bookingCopy.d-BwCOCZUj.d.ts} +2 -2
- package/dist/{branding.d-DI8S400y.d.cts → branding.d-Bbc6p1XY.d.cts} +2 -2
- package/dist/{branding.d-OIGLbQeM.d.ts → branding.d-y6c0UwhE.d.ts} +2 -2
- package/dist/{casesRepository.d-CT2LTicS.d.cts → casesRepository.d-CsUJ2Oyb.d.cts} +1 -1
- package/dist/{casesRepository.d-UsWOz9bv.d.ts → casesRepository.d-DG83Ggbq.d.ts} +1 -1
- package/dist/chat/index.cjs +45 -43
- package/dist/chat/index.d.cts +26 -13
- package/dist/chat/index.d.ts +26 -13
- package/dist/chat/index.js +45 -43
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +12 -12
- package/dist/client/index.d.ts +12 -12
- package/dist/client/index.js +3 -3
- package/dist/clinicBatch.d-BLpbpS51.d.cts +71 -0
- package/dist/clinicBatch.d-Byjx4y_W.d.ts +71 -0
- package/dist/clinicModels.d-BXgKZqDb.d.cts +68 -0
- package/dist/clinicModels.d-CaS64-P-.d.ts +68 -0
- package/dist/clinicRequestProps.d-1dCtouGA.d.cts +65 -0
- package/dist/clinicRequestProps.d-CjsMg_OD.d.ts +65 -0
- package/dist/{config.d-BR3DT9ho.d.cts → config.d-C0WgjutL.d.cts} +1 -1
- package/dist/{config.d-Dy6igYlH.d.ts → config.d-zd2eTb2L.d.ts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-QcCgguzA.d.ts → context.d-BBjmV0rz.d.ts} +8 -8
- package/dist/{context.d-Cwks0p3C.d.cts → context.d-Du_UPxa1.d.cts} +8 -8
- package/dist/{copy.d-CiMn2IIt.d.ts → copy.d-D_VVj01o.d.ts} +2 -2
- package/dist/{copy.d-DLJTyRfT.d.cts → copy.d-Da_PP2K3.d.cts} +2 -2
- package/dist/core/index.cjs +3 -3
- package/dist/core/index.d.cts +21 -19
- package/dist/core/index.d.ts +21 -19
- package/dist/core/index.js +3 -3
- package/dist/{depth.d-OSALbYM7.d.ts → depth.d-BEedifOR.d.ts} +6 -133
- package/dist/{depth.d-CjPGVPDL.d.cts → depth.d-RTV61QNf.d.cts} +6 -133
- package/dist/{entitlementRepository.d-Cf3LbTwD.d.ts → entitlementRepository.d-BwThmh3V.d.ts} +4 -4
- package/dist/{entitlementRepository.d-CVQa1DA1.d.cts → entitlementRepository.d-C-stdRyA.d.cts} +4 -4
- package/dist/{features.d-fNsGcg0R.d.ts → features.d-DrQxTw3-.d.cts} +1 -1
- package/dist/{features.d-fNsGcg0R.d.cts → features.d-DrQxTw3-.d.ts} +1 -1
- package/dist/{focus.d-DMg2ngHI.d.ts → focus.d-CtotIyEt.d.ts} +127 -350
- package/dist/{focus.d-az9cqUz3.d.cts → focus.d-Dsm39DjO.d.cts} +127 -350
- package/dist/health-plan/index.cjs +182 -163
- package/dist/health-plan/index.d.cts +53 -11
- package/dist/health-plan/index.d.ts +53 -11
- package/dist/health-plan/index.js +185 -166
- package/dist/{idempotency.d-WpXx9zQo.d.ts → idempotency.d-Bfm7oIxS.d.cts} +158 -6
- package/dist/{idempotency.d-D461_DPD.d.cts → idempotency.d-Cv-B7SfC.d.ts} +158 -6
- package/dist/{identity.d-DzTijonw.d.ts → identity.d-BksOEa6m.d.ts} +1 -1
- package/dist/{identity.d-60LeJt_s.d.cts → identity.d-CioQhZrq.d.cts} +1 -1
- package/dist/index.cjs +48 -46
- package/dist/index.d.cts +20 -19
- package/dist/index.d.ts +20 -19
- package/dist/index.js +48 -46
- package/dist/introEvents.d-dS3fJCH1.d.cts +5 -0
- package/dist/introEvents.d-dS3fJCH1.d.ts +5 -0
- package/dist/introEvents.d-fAZitxMA.d.cts +175 -0
- package/dist/introEvents.d-tOi4o3F4.d.ts +175 -0
- package/dist/{models.d-BnLm3VAA.d.cts → models.d-BSqvbTE1.d.cts} +8 -1
- package/dist/{models.d-BagXhafD.d.ts → models.d-DOwnr8fi.d.ts} +8 -1
- package/dist/notifications/index.d.cts +4 -4
- package/dist/notifications/index.d.ts +4 -4
- package/dist/{optInView.d-acKpV8V2.d.ts → optInView.d-B8zTORO2.d.ts} +119 -3
- package/dist/{optInView.d-CEyHR6PK.d.cts → optInView.d-BkNSv4Gk.d.cts} +119 -3
- package/dist/{parse.d-C8CXyS58.d.ts → parse.d-B5JHS6Pr.d.ts} +1 -1
- package/dist/{parse.d-tEzufgJX.d.cts → parse.d-BgjO82mY.d.cts} +1 -1
- package/dist/{pets.d-NbJvP_kh.d.cts → pets.d-B_LoizOv.d.cts} +1 -1
- package/dist/{pets.d-C_53_fzo.d.ts → pets.d-OWxskXCP.d.ts} +1 -1
- package/dist/{petsRepository.d-lp1BHRqM.d.cts → petsRepository.d-B5DWzU7C.d.cts} +1 -1
- package/dist/{petsRepository.d-BuGHymNx.d.ts → petsRepository.d-Ba3xhJcj.d.ts} +1 -1
- package/dist/planSignals.d-Cl6n5QpS.d.cts +126 -0
- package/dist/planSignals.d-DtxZoWGM.d.ts +126 -0
- package/dist/{ports.d-COIyN624.d.ts → ports.d-BDtwHxmW.d.ts} +4 -4
- package/dist/{ports.d-CEROoqnA.d.cts → ports.d-gZNTn8Qf.d.cts} +4 -4
- package/dist/{presentation.d-DMbdad7G.d.cts → presentation.d-vy8kTGfR.d.cts} +6 -0
- package/dist/{presentation.d-DMbdad7G.d.ts → presentation.d-vy8kTGfR.d.ts} +6 -0
- package/dist/quickPrompts.d-NM_81Jc1.d.cts +19 -0
- package/dist/quickPrompts.d-NM_81Jc1.d.ts +19 -0
- package/dist/records/depth/index.d.cts +13 -9
- package/dist/records/depth/index.d.ts +13 -9
- package/dist/records/index.cjs +264 -140
- package/dist/records/index.d.cts +95 -24
- package/dist/records/index.d.ts +95 -24
- package/dist/records/index.js +265 -141
- package/dist/{requestFunnel.d-DWQQpjFR.d.cts → requestFunnel.d-CR4akGCY.d.cts} +2 -2
- package/dist/{requestFunnel.d-CXUMPw1K.d.ts → requestFunnel.d-DFf9C__p.d.ts} +2 -2
- package/dist/{resolve.d-jI8FmBj3.d.cts → resolve.d-CoQWUy1Y.d.cts} +1 -1
- package/dist/{resolve.d-jI8FmBj3.d.ts → resolve.d-CoQWUy1Y.d.ts} +1 -1
- package/dist/{runtimeTypes.d-4yFNNuYR.d.ts → runtimeTypes.d-BqBOrZxa.d.ts} +6 -6
- package/dist/{runtimeTypes.d-D6N_fhxx.d.cts → runtimeTypes.d-CHdH-y2c.d.cts} +6 -6
- package/dist/{useRecordsDepth.d-sAq2Qkhr.d.cts → screenProps.d-B1dIANI0.d.cts} +5 -91
- package/dist/{useRecordsDepth.d-DFcCfiXm.d.ts → screenProps.d-CVqFJw-J.d.ts} +5 -91
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/{sheetSeam.d-Cviqk89n.d.ts → sheetSeam.d-B09jf4YC.d.ts} +8 -4
- package/dist/{sheetSeam.d-DCS3LW8g.d.cts → sheetSeam.d-BBuEIVsa.d.cts} +8 -4
- package/dist/shop/index.cjs +227 -60
- package/dist/shop/index.d.cts +35 -5
- package/dist/shop/index.d.ts +35 -5
- package/dist/shop/index.js +228 -61
- package/dist/tabs/index.cjs +195 -0
- package/dist/tabs/index.d.cts +175 -0
- package/dist/tabs/index.d.ts +175 -0
- package/dist/tabs/index.js +195 -0
- package/dist/tabsModel.d-BfIQg6yS.d.cts +31 -0
- package/dist/tabsModel.d-BfIQg6yS.d.ts +31 -0
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +12 -12
- package/dist/testing/rn/index.d.ts +12 -12
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.d.cts +13 -13
- package/dist/testing/web/index.d.ts +13 -13
- package/dist/texting/index.cjs +40 -5
- package/dist/texting/index.d.cts +40 -7
- package/dist/texting/index.d.ts +40 -7
- package/dist/texting/index.js +40 -5
- package/dist/threadOptions.d-CnSfFVMr.d.cts +458 -0
- package/dist/threadOptions.d-DZ0AoQGk.d.ts +458 -0
- package/dist/{timelineRows.d-BNxgzYRW.d.cts → timelineRows.d-CF1KvLcQ.d.cts} +1 -1
- package/dist/{timelineRows.d-CU5GvvLk.d.ts → timelineRows.d-CtL0y7y1.d.ts} +1 -1
- package/dist/{tokens.d-DarDaV39.d.cts → tokens.d-BUVqme2D.d.cts} +1 -1
- package/dist/{tokens.d-DarDaV39.d.ts → tokens.d-BUVqme2D.d.ts} +1 -1
- package/dist/{typeStyle.d-C1HBRAI3.d.ts → typeStyle.d-B3Kdtjie.d.ts} +2 -2
- package/dist/{typeStyle.d-Bl8pzbBy.d.cts → typeStyle.d-DmlwyJq-.d.cts} +2 -2
- package/dist/useIntroSeen.d-CTWFUthO.d.cts +35 -0
- package/dist/useIntroSeen.d-CTWFUthO.d.ts +35 -0
- package/dist/usePresentation.d-BsR08Wxt.d.ts +285 -0
- package/dist/usePresentation.d-CZS0qlLI.d.cts +285 -0
- package/dist/{useRecords.d-Cb-36SF5.d.cts → useRecords.d-BYNX01El.d.cts} +2 -2
- package/dist/{useRecords.d-aQTzQZoV.d.ts → useRecords.d-DWk61a4c.d.ts} +2 -2
- package/dist/useRecordsDepth.d-DTAxFf5s.d.ts +32 -0
- package/dist/useRecordsDepth.d-k-zYIHTe.d.cts +32 -0
- package/dist/{view.d-C-SNpDJX.d.ts → view.d-BE7VOlsB.d.ts} +6 -4
- package/dist/{view.d-Dps5C8-s.d.cts → view.d-CAWQjcY_.d.cts} +6 -4
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.cjs +65 -53
- package/dist/web/health-plan/index.d.cts +46 -192
- package/dist/web/health-plan/index.d.ts +46 -192
- package/dist/web/health-plan/index.js +79 -67
- package/dist/web/index.cjs +62 -46
- package/dist/web/index.d.cts +168 -27
- package/dist/web/index.d.ts +168 -27
- package/dist/web/index.js +63 -47
- package/dist/web/intro/index.cjs +167 -0
- package/dist/web/intro/index.d.cts +79 -0
- package/dist/web/intro/index.d.ts +79 -0
- package/dist/web/intro/index.js +167 -0
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.d.cts +13 -9
- package/dist/web/records/depth/index.d.ts +13 -9
- package/dist/web/records/index.cjs +7 -7
- package/dist/web/records/index.d.cts +21 -82
- package/dist/web/records/index.d.ts +21 -82
- package/dist/web/records/index.js +7 -7
- package/dist/web/records-sheet/index.cjs +207 -128
- package/dist/web/records-sheet/index.d.cts +25 -16
- package/dist/web/records-sheet/index.d.ts +25 -16
- package/dist/web/records-sheet/index.js +207 -128
- package/dist/web/shop/index.cjs +194 -78
- package/dist/web/shop/index.d.cts +21 -4
- package/dist/web/shop/index.d.ts +21 -4
- package/dist/web/shop/index.js +194 -78
- package/dist/web/televet/booking/index.d.cts +7 -7
- package/dist/web/televet/booking/index.d.ts +7 -7
- package/dist/web/texting/index.cjs +36 -5
- package/dist/web/texting/index.d.cts +40 -7
- package/dist/web/texting/index.d.ts +40 -7
- package/dist/web/texting/index.js +36 -5
- package/package.json +36 -4
- package/tabs/package.json +8 -0
- package/web/intro/native-blocked.cjs +12 -0
- package/web/intro/package.json +8 -0
- package/dist/threadOptions.d-B1pTMmDF.d.cts +0 -260
- package/dist/threadOptions.d-B1pTMmDF.d.ts +0 -260
- package/dist/usePresentation.d-D6qsFzBz.d.cts +0 -9
- package/dist/usePresentation.d-DuGQe_Do.d.ts +0 -9
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { P as PetRef, U as UserRef } from './ids.d-B2GAAifq.cjs';
|
|
3
1
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
4
|
-
import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.cjs';
|
|
5
2
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { P as PetRef, U as UserRef } from './ids.d-B2GAAifq.cjs';
|
|
4
|
+
import { R as RequestFunnel } from './requestFunnel.d-CR4akGCY.cjs';
|
|
5
|
+
import { A as AuthContext } from './identity.d-CioQhZrq.cjs';
|
|
8
6
|
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
9
7
|
|
|
10
8
|
/** Where a reason comes from. An unknown kind reads as `profile` (a fact about the pet). */
|
|
@@ -83,209 +81,6 @@ declare function createHealthPlanRepository(runtime: HealthPlanRuntime): HealthP
|
|
|
83
81
|
/** The same repository over one auth context (or an injected funnel). Internal seam, for deterministic tests. */
|
|
84
82
|
declare function createHealthPlanRepositoryOver(deps: HealthPlanRepositoryDeps): HealthPlanRepository;
|
|
85
83
|
|
|
86
|
-
type EverfurHealthPlanStatus = 'signedOut' | 'noPet' | 'loading' | 'failed' | 'empty' | 'ready';
|
|
87
|
-
/** The member's cart: the items in the plan, and their total when one can honestly be given. */
|
|
88
|
-
interface HealthPlanCart {
|
|
89
|
-
readonly items: readonly HealthPlanItem[];
|
|
90
|
-
readonly count: number;
|
|
91
|
-
/**
|
|
92
|
-
* The sum of the priced items, or null when any item has no price or the items do not share one currency
|
|
93
|
-
* (a total across currencies is a number nobody can pay).
|
|
94
|
-
*/
|
|
95
|
-
readonly subtotal: number | null;
|
|
96
|
-
/** The shared currency of `subtotal`, or null. */
|
|
97
|
-
readonly currency: string | null;
|
|
98
|
-
}
|
|
99
|
-
interface EverfurHealthPlanOptions {
|
|
100
|
-
/** The pet whose plan to show. Omit it and the provider's active pet is used. */
|
|
101
|
-
readonly petRef?: PetRef | null;
|
|
102
|
-
/**
|
|
103
|
-
* The host's lifecycle signals: coming back to the foreground re-reads a plan shown for more than a minute, quietly
|
|
104
|
-
* (the plan stays on screen). Absent, only `refreshKey` and `refresh()` re-read.
|
|
105
|
-
*/
|
|
106
|
-
readonly lifecycle?: LifecyclePort | null;
|
|
107
|
-
/** Change it to re-read the plan now, quietly (for example after your checkout completed). */
|
|
108
|
-
readonly refreshKey?: string | number;
|
|
109
|
-
}
|
|
110
|
-
interface EverfurHealthPlanState {
|
|
111
|
-
readonly status: EverfurHealthPlanStatus;
|
|
112
|
-
readonly petRef: PetRef | null;
|
|
113
|
-
readonly plan: HealthPlan | null;
|
|
114
|
-
readonly cart: HealthPlanCart;
|
|
115
|
-
/** Product ids whose add or remove is in flight. */
|
|
116
|
-
readonly pending: readonly string[];
|
|
117
|
-
/** The last refused write per product id. */
|
|
118
|
-
readonly itemErrors: Readonly<Record<string, EverfurError>>;
|
|
119
|
-
/** The refused read, or null. */
|
|
120
|
-
readonly error: EverfurError | null;
|
|
121
|
-
/** Put an item in the plan (`true`) or take it out (`false`). Optimistic; rolls back on a refusal. */
|
|
122
|
-
setInPlan(productId: string, inPlan: boolean): Promise<boolean>;
|
|
123
|
-
refresh(): Promise<void>;
|
|
124
|
-
}
|
|
125
|
-
/** The cart a plan makes. Pure, so a partner's own cart UI reads the same totals. */
|
|
126
|
-
declare function healthPlanCart(plan: HealthPlan | null): HealthPlanCart;
|
|
127
|
-
/**
|
|
128
|
-
* A price as the member reads it: the platform's own currency format (`$19.99`), or `USD 19.99` where the runtime
|
|
129
|
-
* has no formatter for that currency. Null for an item with no price; the surface shows none rather than `$0`.
|
|
130
|
-
* `locale` picks the number format (omit it for the platform default). With `format.dropZeroCents` a whole amount
|
|
131
|
-
* reads without minor units (`$39`); a non-whole one keeps them (`$29.99`).
|
|
132
|
-
*/
|
|
133
|
-
declare function formatHealthPlanPrice(amount: number | null, currency: string | null, locale?: string, format?: Pick<HealthPlanPriceFormat, 'dropZeroCents'>): string | null;
|
|
134
|
-
/** `formatHealthPlanPrice` with a page's `priceFormat` option. */
|
|
135
|
-
declare function formatHealthPlanPriceWith(amount: number | null, currency: string | null, format?: HealthPlanPriceFormat): string | null;
|
|
136
|
-
/** The Health Plan repository bound to the runtime under your provider, for a partner's own UI. */
|
|
137
|
-
declare function useEverfurHealthPlanRepository(): HealthPlanRepository;
|
|
138
|
-
/** One pet's Health Plan and the member's cart. `EverfurHealthPlan` renders it on either host. */
|
|
139
|
-
declare function useEverfurHealthPlan(options?: EverfurHealthPlanOptions): EverfurHealthPlanState;
|
|
140
|
-
|
|
141
|
-
/** Where a product's picture sits on its card. */
|
|
142
|
-
type HealthPlanImageVariant = 'wide' | 'thumbnail';
|
|
143
|
-
/** How a product's reasons are drawn. */
|
|
144
|
-
type HealthPlanReasonVariant = 'pills' | 'rows';
|
|
145
|
-
/** When the page draws the cart bar. */
|
|
146
|
-
type HealthPlanCartBarVisibility = 'whenItems' | 'always';
|
|
147
|
-
/** Where the cart bar lives: stuck to the foot of the page, or nowhere on the page (the host docks its own). */
|
|
148
|
-
type HealthPlanCartBarPlacement = 'sticky' | 'none';
|
|
149
|
-
/** The size of a product card's add control: a named size, or the pill's height in px. */
|
|
150
|
-
type HealthPlanAddButtonSize = 'full' | 'compact' | number;
|
|
151
|
-
/** How a product in the cart shows: "Added" with a Remove link, or the add pill held pressed. */
|
|
152
|
-
type HealthPlanAddedVariant = 'link' | 'pressed';
|
|
153
|
-
/** How a product's category reads: body text, or the reason-row label face (mono, uppercase). */
|
|
154
|
-
type HealthPlanCategoryVariant = 'text' | 'label';
|
|
155
|
-
/** A shadow of the partner's own, painted the same way on both hosts. Lengths are px. */
|
|
156
|
-
interface HealthPlanShadow {
|
|
157
|
-
/** Any colour the theme parser reads (`#RRGGBB`, `rgba(...)`). */
|
|
158
|
-
readonly color: string;
|
|
159
|
-
readonly offsetX?: number;
|
|
160
|
-
readonly offsetY: number;
|
|
161
|
-
readonly blur: number;
|
|
162
|
-
/** 0..1, multiplied into the colour's own alpha. Default 1. */
|
|
163
|
-
readonly opacity?: number;
|
|
164
|
-
}
|
|
165
|
-
/** A card shadow: `true` for the SDK's soft one, a CSS shadow string, or a `HealthPlanShadow`. */
|
|
166
|
-
type HealthPlanCardShadow = boolean | string | HealthPlanShadow;
|
|
167
|
-
/** A font weight a card text accepts. */
|
|
168
|
-
type HealthPlanFontWeight = 400 | 500 | 600 | 700 | 800 | 900;
|
|
169
|
-
/** How a price reads. Prices always go through `Intl.NumberFormat` with the item's own currency. */
|
|
170
|
-
interface HealthPlanPriceFormat {
|
|
171
|
-
/** A BCP 47 locale for the number format. Omit it and the platform's default locale is used. */
|
|
172
|
-
readonly locale?: string;
|
|
173
|
-
/** True to drop zero minor units on a whole amount (`$39` instead of `$39.00`). A non-whole amount keeps them. */
|
|
174
|
-
readonly dropZeroCents?: boolean;
|
|
175
|
-
}
|
|
176
|
-
declare const HEALTH_PLAN_LAYOUT_DEFAULTS: Readonly<{
|
|
177
|
-
imageVariant: HealthPlanImageVariant;
|
|
178
|
-
reasonVariant: HealthPlanReasonVariant;
|
|
179
|
-
cartBarVisibility: HealthPlanCartBarVisibility;
|
|
180
|
-
cartBarPlacement: HealthPlanCartBarPlacement;
|
|
181
|
-
addButtonSize: HealthPlanAddButtonSize;
|
|
182
|
-
addedVariant: HealthPlanAddedVariant;
|
|
183
|
-
categoryVariant: HealthPlanCategoryVariant;
|
|
184
|
-
showCategory: false;
|
|
185
|
-
cardShadow: false;
|
|
186
|
-
cardBorder: true;
|
|
187
|
-
}>;
|
|
188
|
-
/** True when the page should draw the cart bar for a cart of `count` items. */
|
|
189
|
-
declare function showHealthPlanCartBar(visibility: HealthPlanCartBarVisibility | undefined, count: number): boolean;
|
|
190
|
-
/**
|
|
191
|
-
* What a partner's header and footer nodes are handed: the pet, its plan and the member's cart, as the page draws
|
|
192
|
-
* them. `cart.items` are the products in the plan, `cart.count` how many, `cart.subtotal` their sum (null when the
|
|
193
|
-
* currencies differ or a price is missing).
|
|
194
|
-
*/
|
|
195
|
-
interface HealthPlanHeaderContext {
|
|
196
|
-
readonly petRef: PetRef | null;
|
|
197
|
-
readonly plan: HealthPlan | null;
|
|
198
|
-
readonly cart: HealthPlanCart;
|
|
199
|
-
/**
|
|
200
|
-
* Put a product in the plan (`true`) or take it out (`false`), through the same optimistic write the cards use:
|
|
201
|
-
* the card flips at once and a refusal puts it back. Resolves true when the server accepted it.
|
|
202
|
-
*/
|
|
203
|
-
readonly setInPlan: (productId: string, inPlan: boolean) => Promise<boolean>;
|
|
204
|
-
/** Put every product not yet in the plan into it. Resolves true when every write was accepted. */
|
|
205
|
-
readonly addAll: () => Promise<boolean>;
|
|
206
|
-
}
|
|
207
|
-
/** The same context, named for the page footer. */
|
|
208
|
-
type HealthPlanPageContext = HealthPlanHeaderContext;
|
|
209
|
-
/** The card options `HealthPlanItemCard` takes, on both hosts. */
|
|
210
|
-
interface HealthPlanCardOptions {
|
|
211
|
-
/** True to draw the product's category above its name. Default false. */
|
|
212
|
-
readonly showCategory?: boolean;
|
|
213
|
-
/**
|
|
214
|
-
* A shadow under the card: `true` for the SDK's soft one (the theme's shadow colour at 8%), a CSS shadow string
|
|
215
|
-
* (`0 1px 3px rgba(38,37,35,.06)`; React Native reads the first shadow's offset, blur and colour), or a
|
|
216
|
-
* `HealthPlanShadow`. Default none.
|
|
217
|
-
*/
|
|
218
|
-
readonly cardShadow?: HealthPlanCardShadow;
|
|
219
|
-
/** False to drop the card's hairline edge. Default true. */
|
|
220
|
-
readonly cardBorder?: boolean;
|
|
221
|
-
/** `'full'` (default, 44 high), `'compact'` (32 high), or the pill's height in px. The tap area stays 44. */
|
|
222
|
-
readonly addButtonSize?: HealthPlanAddButtonSize;
|
|
223
|
-
/** The add control's font size in px. Default: body for a pill 40 or taller, else caption. */
|
|
224
|
-
readonly addButtonFontSize?: number;
|
|
225
|
-
/** `'link'` (default): "Added" and a Remove link. `'pressed'`: the pill stays, pressed; a tap removes it. */
|
|
226
|
-
readonly addedVariant?: HealthPlanAddedVariant;
|
|
227
|
-
/** `'text'` (default) or `'label'` (the reason-row label face). Only read with `showCategory`. */
|
|
228
|
-
readonly categoryVariant?: HealthPlanCategoryVariant;
|
|
229
|
-
/** The card's inner padding in px. Default the theme's `space.lg`. */
|
|
230
|
-
readonly cardPadding?: number;
|
|
231
|
-
/** The product name's size (px) and weight. Default body size, bold. */
|
|
232
|
-
readonly itemTitleSize?: number;
|
|
233
|
-
readonly itemTitleWeight?: HealthPlanFontWeight;
|
|
234
|
-
/** The price's size (px) and weight. Default body size, bold. */
|
|
235
|
-
readonly priceSize?: number;
|
|
236
|
-
readonly priceWeight?: HealthPlanFontWeight;
|
|
237
|
-
/** The reason text's size (px). Default caption size. */
|
|
238
|
-
readonly reasonTextSize?: number;
|
|
239
|
-
/** The label column of `'rows'` reasons in px. Default sized to the longest label (web) or 72 (React Native). */
|
|
240
|
-
readonly reasonLabelWidth?: number;
|
|
241
|
-
/** The space between a reason row's label and its text in px. Default the theme's `space.lg`. */
|
|
242
|
-
readonly reasonGap?: number;
|
|
243
|
-
}
|
|
244
|
-
/** The layout props `EverfurHealthPlan` takes on both hosts. Paint stays the theme's. */
|
|
245
|
-
interface HealthPlanLayoutProps extends HealthPlanCardOptions {
|
|
246
|
-
/** Where each product's picture sits. Default `'wide'`. */
|
|
247
|
-
readonly imageVariant?: HealthPlanImageVariant;
|
|
248
|
-
/** How each product's reasons are drawn. Default `'pills'`. */
|
|
249
|
-
readonly reasonVariant?: HealthPlanReasonVariant;
|
|
250
|
-
/** When the cart bar is drawn. Default `'whenItems'`. */
|
|
251
|
-
readonly cartBarVisibility?: HealthPlanCartBarVisibility;
|
|
252
|
-
/** How prices and the subtotal read. */
|
|
253
|
-
readonly priceFormat?: HealthPlanPriceFormat;
|
|
254
|
-
/**
|
|
255
|
-
* Your own node between the plan title and the products (a summary or risk card of yours). Drawn on the plan and
|
|
256
|
-
* on the empty plan. A throw while rendering it draws nothing in its place.
|
|
257
|
-
*/
|
|
258
|
-
readonly renderHeader?: (context: HealthPlanHeaderContext) => ReactNode;
|
|
259
|
-
/** Your own node at the foot of each product card, above its control. A throw draws nothing in its place. */
|
|
260
|
-
readonly renderItemFooter?: (item: HealthPlanItem) => ReactNode;
|
|
261
|
-
/**
|
|
262
|
-
* Your own node after the products, before the cart bar (totals, an upsell row, fine print). Drawn on the plan only.
|
|
263
|
-
* A throw draws nothing in its place.
|
|
264
|
-
*/
|
|
265
|
-
readonly renderFooter?: (context: HealthPlanPageContext) => ReactNode;
|
|
266
|
-
/** The plan title's font size in px. Default the theme's heading size. */
|
|
267
|
-
readonly titleSize?: number;
|
|
268
|
-
/** The space under the plan title in px. Default the section gap. */
|
|
269
|
-
readonly titleGap?: number;
|
|
270
|
-
/** The space between the page's blocks in px. Default the theme's `space.lg`. */
|
|
271
|
-
readonly sectionGap?: number;
|
|
272
|
-
/** Where the cart bar lives. Default `'sticky'`. With `'none'`, wrap the page and your bar in `HealthPlanCartScope`. */
|
|
273
|
-
readonly cartBarPlacement?: HealthPlanCartBarPlacement;
|
|
274
|
-
/** The plan title's line height as a ratio of its size (1.15 reads tight). Default the theme's snug ratio. */
|
|
275
|
-
readonly titleLineHeight?: number;
|
|
276
|
-
/**
|
|
277
|
-
* Your own node between two products (a group label such as a list heading), drawn before the product at `index`
|
|
278
|
-
* (1 and up; never before the first). Return null for no node. A throw draws nothing in its place.
|
|
279
|
-
*/
|
|
280
|
-
readonly renderBetweenItems?: (index: number, item: HealthPlanItem) => ReactNode;
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* True for a refusal because the session is not a SIGNED member session: the plan routes answer a publishable-key or
|
|
284
|
-
* unsigned caller 403 `session_required` (EFBackend partner_shop_widget_router.py). A retry cannot help, so the
|
|
285
|
-
* surface shows the sign-in line and no retry.
|
|
286
|
-
*/
|
|
287
|
-
declare function isHealthPlanSessionRequired(error: EverfurError | null): boolean;
|
|
288
|
-
|
|
289
84
|
/** The icons the layout draws. `renderIcon` lets the host draw its own; the SDK has a plain default for each. */
|
|
290
85
|
type HealthPlanFocusIcon = 'shield' | 'arrow' | 'check' | 'star' | 'truck' | 'refresh' | 'card' | 'alert' | 'x' | 'chat' | 'repeat' | 'calendar' | 'flame' | 'box' | 'cart' | 'minus' | 'plus' | 'chev' | 'pulse' | 'file' | 'kit' | 'dna' | 'heart' | 'bottle' | 'harness' | 'ramp';
|
|
291
86
|
/** One free tip of the routine. Tips are numbered in order and never checked off. */
|
|
@@ -298,6 +93,12 @@ interface HealthPlanFocusStep {
|
|
|
298
93
|
readonly tone?: 'y' | 'c' | 'g' | 'r';
|
|
299
94
|
/** The icon beside the tip's number. */
|
|
300
95
|
readonly icon?: HealthPlanFocusIcon;
|
|
96
|
+
/**
|
|
97
|
+
* The vet's own tip: its source line names the vet from the page's one vet setting (`byline.shortName`, "From
|
|
98
|
+
* {shortName}") in place of `source`, and is not drawn when the setting has no short name. A vet's name is never
|
|
99
|
+
* typed into a tip.
|
|
100
|
+
*/
|
|
101
|
+
readonly fromVet?: boolean;
|
|
301
102
|
}
|
|
302
103
|
/** One review of the product, word for word from the partner's store. */
|
|
303
104
|
interface HealthPlanFocusReview {
|
|
@@ -323,7 +124,11 @@ interface HealthPlanFocusExtra {
|
|
|
323
124
|
readonly icon?: HealthPlanFocusIcon;
|
|
324
125
|
/** A modifier kind for the row (`extra:<kind>`) and for its title (`extraTitle:<kind>`). */
|
|
325
126
|
readonly kind?: string;
|
|
326
|
-
/**
|
|
127
|
+
/**
|
|
128
|
+
* The button's words before ("Add a kit") and after ("Added to cart") it is pressed. An offer that is a plan item
|
|
129
|
+
* (`productId`) reads `copy.viewCart` once in the cart, so the backend may leave `added` out; the SDK then keeps
|
|
130
|
+
* `action` here.
|
|
131
|
+
*/
|
|
327
132
|
readonly action: string;
|
|
328
133
|
readonly added: string;
|
|
329
134
|
/**
|
|
@@ -331,6 +136,8 @@ interface HealthPlanFocusExtra {
|
|
|
331
136
|
* button puts that item in the cart (and reads "View cart" once it is in). Without one, the button is `onExtra`'s.
|
|
332
137
|
*/
|
|
333
138
|
readonly productId?: string;
|
|
139
|
+
/** True when the member already ordered it: an item she owns is not offered again (Raph round 5, step 3). */
|
|
140
|
+
readonly owned?: boolean;
|
|
334
141
|
}
|
|
335
142
|
/** One step of a tracker (an order's, a test kit's). The words and dates are the host's or the server's. */
|
|
336
143
|
interface HealthPlanTrackStep {
|
|
@@ -354,10 +161,15 @@ interface HealthPlanFocusWait {
|
|
|
354
161
|
readonly track?: readonly HealthPlanTrackStep[];
|
|
355
162
|
/** The heading over the rows ("What her plan will hold"). */
|
|
356
163
|
readonly heading?: string;
|
|
164
|
+
/**
|
|
165
|
+
* A row with `fromVet` names the vet from the page's one vet setting ("Free tips from {byline.name}, built around
|
|
166
|
+
* that risk") in place of `text`, and is not drawn without a byline.
|
|
167
|
+
*/
|
|
357
168
|
readonly rows?: readonly {
|
|
358
169
|
readonly icon: HealthPlanFocusIcon;
|
|
359
170
|
readonly label: string;
|
|
360
171
|
readonly text: string;
|
|
172
|
+
readonly fromVet?: boolean;
|
|
361
173
|
}[];
|
|
362
174
|
/** The line with the chat icon under the rows ("We'll text you when it's ready."). */
|
|
363
175
|
readonly note?: string;
|
|
@@ -377,6 +189,11 @@ interface HealthPlanFocusSign {
|
|
|
377
189
|
readonly body: string;
|
|
378
190
|
/** An emergency sign: drawn with the alert icon and the `sign:urgent` modifier. */
|
|
379
191
|
readonly urgent?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* The sign that sends her to her vet ("Call her vet today"). Its title follows what the SDK knows of her vet: with
|
|
194
|
+
* her vet records, `title`; without them, `copy.callYourVet`; with no vet yet, `copy.callAVet` (Raph round 5).
|
|
195
|
+
*/
|
|
196
|
+
readonly callVet?: boolean;
|
|
380
197
|
}
|
|
381
198
|
/**
|
|
382
199
|
* Everything the focus layout says about the pet. Every string is the host's (or the backend page's), drawn verbatim.
|
|
@@ -386,12 +203,23 @@ interface HealthPlanFocusDesign {
|
|
|
386
203
|
readonly eyebrow?: string;
|
|
387
204
|
readonly title: string;
|
|
388
205
|
readonly subtitle?: string;
|
|
206
|
+
/** The line under the title in place of `subtitle` while her vet records are missing (`recordsMissing`). */
|
|
207
|
+
readonly subtitleNoRecords?: string;
|
|
389
208
|
/** https or a same-origin path; the pet's photo beside the title. */
|
|
390
209
|
readonly headImageUrl?: string;
|
|
210
|
+
/**
|
|
211
|
+
* THE VET, ONE SETTING (Raph round 5, `VET`). Every vet mention on the page reads it: the byline ("Built with
|
|
212
|
+
* {name}"), the vet's note (photo and short name), the vet's tips (`fromVet`, "From {shortName}") and the waiting
|
|
213
|
+
* card's tips row. Absent, every vet mention hides. On Everfur's plan page it is drawn only when the page is vet
|
|
214
|
+
* reviewed (Q2). `name` is the vet's own full name, as the vet is credited: the SDK says "Built with" itself. `role`
|
|
215
|
+
* is the line under it (credentials and title). `shortName` is the short form the vet goes by on the page; absent,
|
|
216
|
+
* the short-form mentions hide (the SDK never derives one from `name`).
|
|
217
|
+
*/
|
|
391
218
|
readonly byline?: {
|
|
392
219
|
readonly name: string;
|
|
393
220
|
readonly role?: string;
|
|
394
221
|
readonly imageUrl?: string;
|
|
222
|
+
readonly shortName?: string;
|
|
395
223
|
};
|
|
396
224
|
readonly focus?: {
|
|
397
225
|
readonly kicker: string;
|
|
@@ -413,11 +241,16 @@ interface HealthPlanFocusDesign {
|
|
|
413
241
|
readonly to: string;
|
|
414
242
|
readonly toLabel?: string;
|
|
415
243
|
};
|
|
416
|
-
/**
|
|
244
|
+
/**
|
|
245
|
+
* The vet's note. Drawn only with a `byline` (the vet, one setting): the vet's photo and short name come from the
|
|
246
|
+
* byline, never from here. `kicker` and `imageUrl` are kept for older hosts and no longer drawn.
|
|
247
|
+
*/
|
|
417
248
|
readonly quote?: {
|
|
418
|
-
|
|
249
|
+
/** @deprecated Not drawn: the note names the vet from `byline.shortName`. */
|
|
250
|
+
readonly kicker?: string;
|
|
419
251
|
readonly tag?: string;
|
|
420
252
|
readonly text: string;
|
|
253
|
+
/** @deprecated Not drawn: the note's photo is `byline.imageUrl`. */
|
|
421
254
|
readonly imageUrl?: string;
|
|
422
255
|
};
|
|
423
256
|
/** The strip that jumps to the product. Its kicker is `copy.jumpKicker`. */
|
|
@@ -434,6 +267,17 @@ interface HealthPlanFocusDesign {
|
|
|
434
267
|
};
|
|
435
268
|
readonly pick: {
|
|
436
269
|
readonly title: string;
|
|
270
|
+
/**
|
|
271
|
+
* True when no product fits her risk (Raph round 5, step 2 "No"): part 2 and the jump strip are not drawn, and
|
|
272
|
+
* `copy.noPick` takes their place ("No supplement for this one. Her vet comes first."). The rest of `pick` is not
|
|
273
|
+
* read. The page's plan item, if any, is not offered.
|
|
274
|
+
*/
|
|
275
|
+
readonly none?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* True when the page has no product part at all (the everyday plan, the waiting screen, a pet whose risk is not
|
|
278
|
+
* known yet): with `none`, not even `copy.noPick` is drawn, and the plan's other items are not listed.
|
|
279
|
+
*/
|
|
280
|
+
readonly hidden?: boolean;
|
|
437
281
|
/**
|
|
438
282
|
* The plan item to recommend: the item with this Everfur product id, else the item with `partnerSku` (your own
|
|
439
283
|
* catalog id, the same in every environment). Neither found or given: the plan's first item.
|
|
@@ -454,7 +298,11 @@ interface HealthPlanFocusDesign {
|
|
|
454
298
|
};
|
|
455
299
|
/** The line under the product in the checkout and manage sheets ("For her back · 1 chew a day"). Defaults to `line`. */
|
|
456
300
|
readonly checkoutLine?: string;
|
|
457
|
-
/**
|
|
301
|
+
/**
|
|
302
|
+
* Why it fits, one row per real signal. With `score`, the count line under them is drawn, counted from the rows
|
|
303
|
+
* (`copy.signalsFit`, "2 of 2 signals fit Georgia", "2/2"), never from `score`'s own words, and hidden with fewer
|
|
304
|
+
* than two rows (Raph round 5, step 3).
|
|
305
|
+
*/
|
|
458
306
|
readonly why?: {
|
|
459
307
|
readonly title: string;
|
|
460
308
|
readonly rows: readonly HealthPlanFocusReasonRow[];
|
|
@@ -463,14 +311,25 @@ interface HealthPlanFocusDesign {
|
|
|
463
311
|
readonly value: string;
|
|
464
312
|
};
|
|
465
313
|
};
|
|
314
|
+
/**
|
|
315
|
+
* Sized for her. A stat's `kind` names what it is; the daily dose (`dose`, "1" "chew a day") also fills the three
|
|
316
|
+
* blanks' dose row. With no stat marked `dose`, the first stat is the daily dose (Everfur's plan page sends the
|
|
317
|
+
* daily dose first, then the days a box).
|
|
318
|
+
*/
|
|
466
319
|
readonly dose?: {
|
|
467
320
|
readonly title: string;
|
|
468
321
|
readonly stats: readonly {
|
|
469
322
|
readonly value: string;
|
|
470
323
|
readonly label: string;
|
|
324
|
+
readonly kind?: 'weight' | 'dose' | 'days';
|
|
471
325
|
}[];
|
|
472
326
|
readonly note?: string;
|
|
473
327
|
};
|
|
328
|
+
/**
|
|
329
|
+
* The daily dose's unit ("chew a day") when her weight is not known yet, so `dose` is not sized. The three blanks
|
|
330
|
+
* keep their dose row with this label and an empty blank until her records give a weight.
|
|
331
|
+
*/
|
|
332
|
+
readonly doseLabel?: string;
|
|
474
333
|
readonly ingredients?: {
|
|
475
334
|
readonly label?: string;
|
|
476
335
|
readonly items: readonly string[];
|
|
@@ -498,7 +357,12 @@ interface HealthPlanFocusDesign {
|
|
|
498
357
|
readonly add: string;
|
|
499
358
|
readonly added: string;
|
|
500
359
|
};
|
|
501
|
-
/**
|
|
360
|
+
/**
|
|
361
|
+
* The partner's other offers, last ("More from <your brand>"). An offer with a `productId` that is one of the plan's
|
|
362
|
+
* items is drawn whenever the surface can sell it (the shop on, or the one-box checkout); any other offer only with
|
|
363
|
+
* `onExtra`. When any offer names a `productId`, the plan's other items are not listed under the pick: these
|
|
364
|
+
* offers are the partner's own list of them.
|
|
365
|
+
*/
|
|
502
366
|
readonly extras?: {
|
|
503
367
|
readonly title: string;
|
|
504
368
|
readonly items: readonly HealthPlanFocusExtra[];
|
|
@@ -699,6 +563,54 @@ interface HealthPlanFocusCopy {
|
|
|
699
563
|
readonly weightSavedKg: (kilograms: string) => string;
|
|
700
564
|
/** A payment that failed or a checkout that expired: the cart opens again with its items and this line. */
|
|
701
565
|
readonly checkoutFailed: string;
|
|
566
|
+
/** The byline's title: "Built with {vet}". */
|
|
567
|
+
readonly builtWith: (vet: string) => string;
|
|
568
|
+
/** A vet's tip's source line (`fromVet`): "From {shortName}". */
|
|
569
|
+
readonly fromVet: (shortName: string) => string;
|
|
570
|
+
/** The waiting card's tips row (`fromVet`): "Free tips from {vet}, built around that risk". */
|
|
571
|
+
readonly waitVetTips: (vet: string) => string;
|
|
572
|
+
/** The score line under why it fits, counted from the rows: "2 of 2 signals fit Georgia". */
|
|
573
|
+
readonly signalsFit: (count: number) => string;
|
|
574
|
+
/** The score's short form beside it: "2/2". */
|
|
575
|
+
readonly signalsValue: (count: number) => string;
|
|
576
|
+
/** In place of part 2 and the jump strip when no product fits (`pick.none`). */
|
|
577
|
+
readonly noPick: string;
|
|
578
|
+
/** The vet sign's title (`HealthPlanFocusSign.callVet`) without her vet records: "Call your vet today". */
|
|
579
|
+
readonly callYourVet: string;
|
|
580
|
+
/** The vet sign's title when she has no vet yet: "Call a vet today". */
|
|
581
|
+
readonly callAVet: string;
|
|
582
|
+
/** The checkup button without her vet records or without a vet: "Save for her next checkup". */
|
|
583
|
+
readonly saveForCheckup: string;
|
|
584
|
+
/** The same button once pressed: "Saved for her next checkup". */
|
|
585
|
+
readonly savedForCheckup: string;
|
|
586
|
+
/** The card's accessible name ("Her three blanks"). */
|
|
587
|
+
readonly blanksLabel: string;
|
|
588
|
+
/** The waiting card's kicker: "Asked {clinic}". */
|
|
589
|
+
readonly blanksAsked: (clinic: string) => string;
|
|
590
|
+
/** The waiting card's kicker when the request names no clinic. Empty by default (copy owed by design): no kicker. */
|
|
591
|
+
readonly blanksAskedNoClinic: string;
|
|
592
|
+
/** The waiting card's pill: "2 to 5 days". */
|
|
593
|
+
readonly blanksWaitPill: string;
|
|
594
|
+
/** The filled card's kicker: "From her vet records". */
|
|
595
|
+
readonly blanksFilledKicker: string;
|
|
596
|
+
/** The filled card's pill, counted from the rows: "3 of 3 filled". */
|
|
597
|
+
readonly blanksFilled: (filled: number, total: number) => string;
|
|
598
|
+
/** Before her weight: "Keep her at " (then the weight, then `weightUnit` or `weightUnitKg`). */
|
|
599
|
+
readonly blanksWeight: string;
|
|
600
|
+
/** Her weight row's source line: "From her vet visits". */
|
|
601
|
+
readonly blanksWeightSource: string;
|
|
602
|
+
/** After her dose: "{chew a day} of {product}". Both are data (the dose's label and the product's name). */
|
|
603
|
+
readonly blanksDose: (dose: string, product: string) => string;
|
|
604
|
+
/** Her dose row's source line: "Sized to her weight". */
|
|
605
|
+
readonly blanksDoseSource: string;
|
|
606
|
+
/** Before her next shots' date: "Her next shots are due ". */
|
|
607
|
+
readonly blanksShots: string;
|
|
608
|
+
/** Her next shots row's source line: "From her clinic". */
|
|
609
|
+
readonly blanksShotsSource: string;
|
|
610
|
+
/** A blank's name for a screen reader. */
|
|
611
|
+
readonly blankEmpty: string;
|
|
612
|
+
/** The toast when her records land and the blanks fill. */
|
|
613
|
+
readonly recordsLanded: string;
|
|
702
614
|
}
|
|
703
615
|
/** The steps an order goes through, in order. */
|
|
704
616
|
type HealthPlanOrderStatus = 'ordered' | 'shipped' | 'out_for_delivery' | 'delivered';
|
|
@@ -1001,143 +913,8 @@ declare function createHealthPlanPageRepositoryOver(deps: HealthPlanRepositoryDe
|
|
|
1001
913
|
/** The repository over the runtime under your provider. Auth is read at CALL time; a disposed runtime sends nothing. */
|
|
1002
914
|
declare function createHealthPlanPageRepository(runtime: HealthPlanRuntime): HealthPlanPageRepository;
|
|
1003
915
|
|
|
1004
|
-
/** What a docked bar needs, as the plan page last published it. */
|
|
1005
|
-
interface HealthPlanCartDock {
|
|
1006
|
-
/** The member's cart: the items in the plan, their count and subtotal. */
|
|
1007
|
-
readonly cart: HealthPlanCart;
|
|
1008
|
-
/** True while an add or remove is in flight (draw the checkout control disabled). */
|
|
1009
|
-
readonly busy: boolean;
|
|
1010
|
-
/** The pet whose plan the page shows, or null. */
|
|
1011
|
-
readonly petRef: PetRef | null;
|
|
1012
|
-
/** The plan the page shows, or null before it loads. */
|
|
1013
|
-
readonly plan: HealthPlan | null;
|
|
1014
|
-
/** Adds (`true`) or removes (`false`) one product, as the page's own control does. Resolves true when it took. */
|
|
1015
|
-
readonly setInPlan: (productId: string, inPlan: boolean) => Promise<boolean>;
|
|
1016
|
-
/** Adds every product not yet in the plan. Resolves true when every add took. */
|
|
1017
|
-
readonly addAll: () => Promise<boolean>;
|
|
1018
|
-
}
|
|
1019
|
-
interface HealthPlanCartScopeProps {
|
|
1020
|
-
readonly children?: ReactNode;
|
|
1021
|
-
}
|
|
1022
|
-
/** The scope a plan page with `cartBarPlacement: 'none'` publishes its cart to. Wrap the page and your bar in it. */
|
|
1023
|
-
declare function HealthPlanCartScope({ children }: HealthPlanCartScopeProps): ReactNode;
|
|
1024
|
-
/** The cart the plan page in the nearest `HealthPlanCartScope` published, or null (no scope, or no page yet). */
|
|
1025
|
-
declare function useHealthPlanCartDock(): HealthPlanCartDock | null;
|
|
1026
|
-
|
|
1027
|
-
declare const HEALTH_PLAN_COPY: Readonly<{
|
|
1028
|
-
loading: "Loading";
|
|
1029
|
-
retry: "Try again";
|
|
1030
|
-
signedOut: "Sign in required";
|
|
1031
|
-
addToCart: "Add to cart";
|
|
1032
|
-
added: "Added";
|
|
1033
|
-
remove: "Remove";
|
|
1034
|
-
checkout: "Checkout";
|
|
1035
|
-
subtotal: "Subtotal";
|
|
1036
|
-
sample: "Sample";
|
|
1037
|
-
cartEmpty: "Your cart is empty.";
|
|
1038
|
-
choosePet: "Choose a pet";
|
|
1039
|
-
emptyTitle: "";
|
|
1040
|
-
emptyBody: "";
|
|
1041
|
-
emptyAsk: "";
|
|
1042
|
-
}>;
|
|
1043
|
-
/** The Health Plan's empty state words (Q1). Each is '' by default: an empty title and body draw nothing. */
|
|
1044
|
-
interface HealthPlanEmptyCopy {
|
|
1045
|
-
readonly emptyTitle: string;
|
|
1046
|
-
readonly emptyBody: string;
|
|
1047
|
-
/** The empty state's Ask button. */
|
|
1048
|
-
readonly emptyAsk: string;
|
|
1049
|
-
}
|
|
1050
|
-
/**
|
|
1051
|
-
* The reason labels, one per kind. An empty label is not drawn (the reason's text still is). `profile` (a pet profile
|
|
1052
|
-
* fact) has no source yet; `dna` names one partner's product, so the SDK leaves it to that partner (Q3).
|
|
1053
|
-
*/
|
|
1054
|
-
declare const HEALTH_PLAN_REASON_LABELS: Readonly<Record<HealthPlanReasonKind, string>>;
|
|
1055
|
-
/** ADAPTED from Raph. Listed for approval. */
|
|
1056
|
-
declare const HEALTH_PLAN_TEMPLATES: Readonly<{
|
|
1057
|
-
/** Raph: "Georgia's care plan". Used only when the plan carries no `headline` of the tenant's own. */
|
|
1058
|
-
planTitle: (petName: string) => string;
|
|
1059
|
-
/** Raph: "<brand> cart" (his demo named the partner). */
|
|
1060
|
-
cartLabel: (brand: string) => string;
|
|
1061
|
-
}>;
|
|
1062
|
-
/** Every key still waiting on Raph's words (empty, so not drawn), so the list a reviewer approves cannot drift from the file. */
|
|
1063
|
-
declare const HEALTH_PLAN_COPY_PLACEHOLDERS: readonly string[];
|
|
1064
|
-
|
|
1065
|
-
type HealthPlanPagePhase = 'idle' | 'loading' | 'failed' | 'ready';
|
|
1066
|
-
interface HealthPlanPageOptions {
|
|
1067
|
-
readonly petRef: PetRef | null;
|
|
1068
|
-
/** False skips the read. Defaults to true. */
|
|
1069
|
-
readonly enabled?: boolean;
|
|
1070
|
-
/** A repository of your own (tests, a stub backend). Defaults to the one over the provider's runtime. */
|
|
1071
|
-
readonly repository?: HealthPlanPageRepository;
|
|
1072
|
-
/** Coming back to the foreground re-reads a page shown for more than a minute, quietly. Absent, it does not. */
|
|
1073
|
-
readonly lifecycle?: LifecyclePort | null;
|
|
1074
|
-
/** Change it to re-read the page now, quietly. */
|
|
1075
|
-
readonly refreshKey?: string | number;
|
|
1076
|
-
}
|
|
1077
|
-
interface HealthPlanPageState {
|
|
1078
|
-
readonly phase: HealthPlanPagePhase;
|
|
1079
|
-
/** The answer for `petRef`, or null until it lands. */
|
|
1080
|
-
readonly page: HealthPlanPage | null;
|
|
1081
|
-
readonly error: EverfurError | null;
|
|
1082
|
-
/** True when the read answered not found: this pet has no plan page. `phase` is then `ready` and `page` null. */
|
|
1083
|
-
readonly missing: boolean;
|
|
1084
|
-
refresh(): Promise<void>;
|
|
1085
|
-
}
|
|
1086
|
-
/** The plan page repository bound to the runtime under your provider. */
|
|
1087
|
-
declare function useHealthPlanPageRepository(): HealthPlanPageRepository;
|
|
1088
|
-
/** One pet's Health Plan page. Re-read when the pet changes. */
|
|
1089
|
-
declare function useHealthPlanPage(options: HealthPlanPageOptions): HealthPlanPageState;
|
|
1090
|
-
|
|
1091
|
-
type HealthPlanPhase = 'idle' | 'loading' | 'failed' | 'ready';
|
|
1092
|
-
interface HealthPlanSnapshot {
|
|
1093
|
-
readonly phase: HealthPlanPhase;
|
|
1094
|
-
readonly petRef: PetRef | null;
|
|
1095
|
-
readonly plan: HealthPlan | null;
|
|
1096
|
-
/** Product ids whose add or remove is in flight. */
|
|
1097
|
-
readonly pending: readonly string[];
|
|
1098
|
-
/** The last refused write per product id. */
|
|
1099
|
-
readonly itemErrors: Readonly<Record<string, EverfurError>>;
|
|
1100
|
-
/** The refused read, or null. */
|
|
1101
|
-
readonly error: EverfurError | null;
|
|
1102
|
-
}
|
|
1103
|
-
declare class HealthPlanController {
|
|
1104
|
-
private readonly repository;
|
|
1105
|
-
private snapshot;
|
|
1106
|
-
private readonly listeners;
|
|
1107
|
-
private generation;
|
|
1108
|
-
/** Bumped by every add or remove, so a quiet re-read that started before one never overwrites it. */
|
|
1109
|
-
private writes;
|
|
1110
|
-
/** Bumped by every quiet re-read, so an older one that settles after a newer one never overwrites it. */
|
|
1111
|
-
private revalidations;
|
|
1112
|
-
/** A host refresh asked for while a write was in flight: the quiet re-read runs once the last write settles. */
|
|
1113
|
-
private refreshAfterWrites;
|
|
1114
|
-
private disposed;
|
|
1115
|
-
constructor(repository: HealthPlanRepository);
|
|
1116
|
-
readonly subscribe: (listener: () => void) => (() => void);
|
|
1117
|
-
readonly getSnapshot: () => HealthPlanSnapshot;
|
|
1118
|
-
private set;
|
|
1119
|
-
/** Read the plan for `petRef` (null clears to `idle`). A different pet drops the old plan before the read lands. */
|
|
1120
|
-
load(petRef: PetRef | null): Promise<void>;
|
|
1121
|
-
/**
|
|
1122
|
-
* Re-read the shown plan WITHOUT a loading state (a member coming back to a page that sat open, a host's
|
|
1123
|
-
* `refreshKey`). Only from `ready` with nothing in flight; the answer replaces the plan only while the same pet is
|
|
1124
|
-
* shown and no add, remove or full read happened meanwhile. A refused re-read keeps the plan on screen.
|
|
1125
|
-
*/
|
|
1126
|
-
revalidate(): Promise<void>;
|
|
1127
|
-
/**
|
|
1128
|
-
* The host says the plan changed (its `refreshKey`), so the request is never dropped: from `ready` a quiet
|
|
1129
|
-
* re-read, held until the last add or remove in flight settles; from `failed` or `loading` a full read for the
|
|
1130
|
-
* shown pet (there is no plan to keep on screen, and a read in flight may predate the change).
|
|
1131
|
-
*/
|
|
1132
|
-
refresh(): Promise<void>;
|
|
1133
|
-
private settleWrite;
|
|
1134
|
-
/** Put an item in the plan (`true`) or take it out (`false`). Settles true when the server accepted it. */
|
|
1135
|
-
setInPlan(productId: string, inPlan: boolean): Promise<boolean>;
|
|
1136
|
-
dispose(): void;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
916
|
/** A named element of the focus layout. Pass a class for it in `classNames` and its inline default is dropped. */
|
|
1140
|
-
type HealthPlanFocusPart = 'root' | 'head' | 'eyebrow' | 'serif' | 'headImage' | 'by' | 'byOk' | 'need' | 'needKicker' | 'sources' | 'source' | 'needRisk' | 'dot' | 'odds' | 'oddsKicker' | 'oddsNumbers' | 'tag' | 'says' | 'saysKicker' | 'jump' | 'jumpGo' | 'steps' | 'stepsHead' | 'n' | 'list' | 'tip' | 'tipN' | 'tipTop' | 'section' | 'sectionTitle' | 'pick' | 'others' | 'other' | 'otherCategory' | 'pickTop' | 'pickImage' | 'stars' | 'pickLine' | 'reviews' | 'review' | 'reviewStars' | 'score' | 'why' | 'mini' | 'chip' | 'dose' | 'ingredients' | 'opts' | 'opt' | 'optText' | 'optTag' | 'price' | 'optPrice' | 'buy' | 'button' | 'proof' | 'trust' | 'on' | 'onIcon' | 'more' | 'fine' | 'sign' | 'questionsKicker' | 'questions' | 'add' | 'extras' | 'extrasTitle' | 'extra' | 'extraIcon' | 'extraTitle' | 'extraPrice' | 'extraGo' | 'pageFine' | 'stateOn' | 'scrim' | 'sheet' | 'sheetGrab' | 'sheetTop' | 'sheetKicker' | 'sheetClose' | 'srOnly' | 'co' | 'coProd' | 'coProdImage' | 'coProdTitle' | 'coOpts' | 'coOpt' | 'coHit' | 'radio' | 'coPrice' | 'coWhen' | 'coKey' | 'coEvery' | 'coRows' | 'buttonLarge' | 'buttonGhost' | 'coFine' | 'mgCancel' | 'started' | 'startedScroll' | 'done' | 'doneCheck' | 'doneTitle' | 'doneWhen' | 'doneWho' | 'next' | 'nextIcon' | 'foot' | 'toast' | 'tools' | 'toolsEnd' | 'ordersButton' | 'cartButton' | 'cartCount' | 'askRow' | 'askRowIcon' | 'wait' | 'waitTop' | 'waitTile' | 'waitKey' | 'waitText' | 'track' | 'trackDot' | 'push' | 'shop' | 'shopTitle' | 'shopSub' | 'shopKey' | 'shopCard' | 'shopItems' | 'shopItem' | 'shopItemImage' | 'shopItemPrice' | 'shopItemActions' | 'stepper' | 'shopRemove' | 'shopMode' | 'summary' | 'shopFine' | 'shopEmpty' | 'shopTile' | 'shopLink' | 'shopActions' | 'subCard' | 'orderList' | 'order' | 'orderTop' | 'orderPill' | 'orderNo' | 'orderWhat' | 'orderMeta' | 'orderPics' | 'carrier' | 'carrierIcon' | 'carrierWait' | 'buttonSmall' | 'coItems' | 'weightField' | 'weightInput' | 'weightUnit' | 'weightError' | 'weightActions' | 'summaryRow' | 'trackStep' | 'shopTag' | 'sheetBody';
|
|
917
|
+
type HealthPlanFocusPart = 'root' | 'head' | 'eyebrow' | 'serif' | 'headImage' | 'by' | 'byOk' | 'need' | 'needKicker' | 'sources' | 'source' | 'needRisk' | 'dot' | 'odds' | 'oddsKicker' | 'oddsNumbers' | 'tag' | 'says' | 'saysKicker' | 'jump' | 'jumpGo' | 'steps' | 'stepsHead' | 'n' | 'list' | 'tip' | 'tipN' | 'tipTop' | 'section' | 'sectionTitle' | 'pick' | 'others' | 'other' | 'otherCategory' | 'pickTop' | 'pickImage' | 'stars' | 'pickLine' | 'reviews' | 'review' | 'reviewStars' | 'score' | 'why' | 'mini' | 'chip' | 'dose' | 'ingredients' | 'opts' | 'opt' | 'optText' | 'optTag' | 'price' | 'optPrice' | 'buy' | 'button' | 'proof' | 'trust' | 'on' | 'onIcon' | 'more' | 'fine' | 'sign' | 'questionsKicker' | 'questions' | 'add' | 'extras' | 'extrasTitle' | 'extra' | 'extraIcon' | 'extraTitle' | 'extraPrice' | 'extraGo' | 'pageFine' | 'stateOn' | 'scrim' | 'sheet' | 'sheetGrab' | 'sheetTop' | 'sheetKicker' | 'sheetClose' | 'srOnly' | 'co' | 'coProd' | 'coProdImage' | 'coProdTitle' | 'coOpts' | 'coOpt' | 'coHit' | 'radio' | 'coPrice' | 'coWhen' | 'coKey' | 'coEvery' | 'coRows' | 'buttonLarge' | 'buttonGhost' | 'coFine' | 'mgCancel' | 'started' | 'startedScroll' | 'done' | 'doneCheck' | 'doneTitle' | 'doneWhen' | 'doneWho' | 'next' | 'nextIcon' | 'foot' | 'toast' | 'tools' | 'toolsEnd' | 'ordersButton' | 'cartButton' | 'cartCount' | 'askRow' | 'askRowIcon' | 'wait' | 'waitTop' | 'waitTile' | 'waitKey' | 'waitText' | 'track' | 'trackDot' | 'push' | 'shop' | 'shopTitle' | 'shopSub' | 'shopKey' | 'shopCard' | 'shopItems' | 'shopItem' | 'shopItemImage' | 'shopItemPrice' | 'shopItemActions' | 'stepper' | 'shopRemove' | 'shopMode' | 'summary' | 'shopFine' | 'shopEmpty' | 'shopTile' | 'shopLink' | 'shopActions' | 'subCard' | 'orderList' | 'order' | 'orderTop' | 'orderPill' | 'orderNo' | 'orderWhat' | 'orderMeta' | 'orderPics' | 'carrier' | 'carrierIcon' | 'carrierWait' | 'buttonSmall' | 'coItems' | 'weightField' | 'weightInput' | 'weightUnit' | 'weightError' | 'weightActions' | 'summaryRow' | 'trackStep' | 'shopTag' | 'sheetBody' | 'blanks' | 'blanksCard' | 'blanksHead' | 'blank' | 'noPick' | 'mgOrders';
|
|
1141
918
|
/**
|
|
1142
919
|
* Classes per part. A key `part:kind` adds a modifier class for one kind of a part (`sign:urgent`, `chip:rec`,
|
|
1143
920
|
* `source:dna`, `dot:risk`, `opt:once`, `extra:kit`); the kinds come from the design rows.
|
|
@@ -1175,4 +952,4 @@ declare const HEALTH_PLAN_FOCUS_COPY: HealthPlanFocusCopy;
|
|
|
1175
952
|
/** A UTC calendar date (`2026-10-30`) as a short day (`Oct 30`). */
|
|
1176
953
|
declare function formatHealthPlanDay(iso: string | null, locale?: string): string | null;
|
|
1177
954
|
|
|
1178
|
-
export {
|
|
955
|
+
export { createHealthPlanRepositoryOver as $, type HealthPlanCheckoutStatus as A, type HealthPlanFocusExtra as B, type HealthPlanFocusPrices as C, type HealthPlanFocusReasonRow as D, type HealthPlanFocusReview as E, type HealthPlanFocusSign as F, type HealthPlanFocusStep as G, type HealthPlanPage as H, type HealthPlanFocusWait as I, type HealthPlanOneBoxOffer as J, type HealthPlanOneBoxOrderPage as K, type HealthPlanOneBoxOrderPageOptions as L, type HealthPlanOrderStatus as M, type HealthPlanOrderTracking as N, type HealthPlanOrderTrackingStatus as O, type HealthPlanPurchase as P, type HealthPlanReason as Q, type HealthPlanRepositoryDeps as R, type HealthPlanRuntime as S, type HealthPlanSubscriptionRenewal as T, type HealthPlanSubscriptionStatus as U, type HealthPlanSubscriptionStep as V, type HealthPlanSubscriptionSupply as W, type HealthPlanTrackStep as X, createHealthPlanPageRepository as Y, createHealthPlanPageRepositoryOver as Z, createHealthPlanRepository as _, type HealthPlanPetWords as a, createHealthPlanSubscriptionRepository as a0, createHealthPlanSubscriptionRepositoryOver as a1, formatHealthPlanDay as a2, healthPlanCheckoutRefusal as a3, healthPlanCheckoutSessionFromWire as a4, healthPlanCheckoutStateFromWire as a5, healthPlanFocusCopyFor as a6, healthPlanFocusDesignFromWire as a7, healthPlanFromWire as a8, healthPlanOneBoxOrderFromWire as a9, healthPlanOneBoxOrderPageFromWire as aa, healthPlanOrderTrackingFromWire as ab, healthPlanPageFromWire as ac, healthPlanPetWords as ad, healthPlanSubscriptionFromWire as ae, healthPlanSubscriptionQuoteFromWire as af, isHealthPlanSubscriptionUnavailable as ag, type HealthPlanFocusDesign as b, type HealthPlanFocusCopy as c, type HealthPlanFocusClassNames as d, type HealthPlanFocusIcon as e, type HealthPlanItem as f, type HealthPlanSubscription as g, type HealthPlanOneBoxOrder as h, type HealthPlanSubscriptionRepository as i, type HealthPlanPageRepository as j, type HealthPlanShopOrder as k, type HealthPlanCheckoutProvider as l, type HealthPlan as m, type HealthPlanRepository as n, type HealthPlanReasonKind as o, type HealthPlanFocusPart as p, type HealthPlanSubscriptionQuote as q, type HealthPlanPagePet as r, HEALTH_PLAN_FOCUS_COPY as s, HEALTH_PLAN_REASON_KINDS as t, type HealthPlanCartCheckoutRequest as u, type HealthPlanCheckoutItem as v, type HealthPlanCheckoutRefusal as w, type HealthPlanCheckoutRequest as x, type HealthPlanCheckoutSession as y, type HealthPlanCheckoutState as z };
|