@odla-ai/chapter 0.32.3 → 0.33.1

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.
@@ -1,8 +1,8 @@
1
1
  import * as preact from 'preact';
2
2
  import { ComponentChildren, JSX } from 'preact';
3
3
  import { CrmClient, Crm, CrmRecord } from '@odla-ai/crm';
4
- import { a as Chapter, b as ChapterCopy } from '../../copy-context-BXBEdp4p.js';
5
- export { C as ChapterCopyProvider, u as useChapterCopy } from '../../copy-context-BXBEdp4p.js';
4
+ import { a as Chapter, b as ChapterCopy } from '../../copy-context-c1tqPXOR.js';
5
+ export { C as ChapterCopyProvider, u as useChapterCopy } from '../../copy-context-c1tqPXOR.js';
6
6
  import { CrmLifecycleAdapter, CrmWorkspaceMasterContext, CrmWorkspaceRecordContext, RecordPanelTab } from '@odla-ai/crm/ui';
7
7
 
8
8
  /** Normalized public auth configuration consumed by the Clerk gate. */
@@ -1,6 +1,6 @@
1
1
  export { AdminAccountMenuProps, AdminChrome, AdminNote, AdminPage, AdminResource, AdminRouteState, AdminRouteTarget, AdminRouting, AdminSection, AdminSectionContext, AdminWorkspace, AdminWorkspaceNavProps, AvailabilitySectionOptions, BillingSectionOptions, ChapterAdmin, ChapterAdminAuthAdapter, ChapterAdminAuthConfig, ChapterAdminAuthLoadContext, ChapterAdminProps, ChapterAdminUser, CollectionSectionOptions, DashboardSectionOptions, EmailSectionOptions, LeaderNetworkOverview, MeetingsSectionOptions, NetworkRecordsWorkspace, NetworkShareActions, NetworkShareActionsProps, Panel, PeopleSectionOptions, RecordActions, RecordActionsProps, ThemeWarning, adminFetch, adminRouteFromUrl, adminRouteHref, adminSectionFromUrl, adminSectionHref, applicationLifecycleAdapter, availabilitySection, billingSection, collectionSection, dashboardSection, defaultAdminSections, defaultAdminWorkspaces, emailSection, loadChapterAdminConfig, loadChapterAdminUser, meetingsSection, networkRecordsWorkspace, peopleSection, useAdminResource } from './admin/index.js';
2
- export { C as ChapterCopyProvider, u as useChapterCopy } from '../copy-context-BXBEdp4p.js';
3
- export { ApiFn, BrandStyle, BrandStyleProps, JoinConfig, JoinFlowState, JoinIsland, JoinIslandProps, JoinStepRenderContext, JoinSubmitRenderContext, JoinTier, JoinTierRenderContext, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberProvisionalRenderContext, MembersArea, MembersAreaProps, MembershipCardTokenName, MembershipCards, MembershipCardsMode, MembershipCardsProps, PaymentPriceLines, PaymentStep, PaymentStepProps, RescheduleProps, Rescheduler, Slot, SlotPicker, SlotPickerClasses, SlotPickerProps, TierPlaceholder, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection } from './member/index.js';
2
+ export { C as ChapterCopyProvider, u as useChapterCopy } from '../copy-context-c1tqPXOR.js';
3
+ export { ApiFn, BrandStyle, BrandStyleProps, JoinBookingSimulation, JoinConfig, JoinFlowState, JoinIsland, JoinIslandProps, JoinSimulation, JoinStepRenderContext, JoinSubmitRenderContext, JoinTier, JoinTierRenderContext, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberProvisionalRenderContext, MembersArea, MembersAreaProps, MembershipCardTokenName, MembershipCards, MembershipCardsMode, MembershipCardsProps, PaymentPriceLines, PaymentStep, PaymentStepProps, PaymentStepSimulation, RescheduleProps, Rescheduler, Slot, SlotPicker, SlotPickerClasses, SlotPickerProps, TierPlaceholder, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection } from './member/index.js';
4
4
  import 'preact';
5
5
  import '@odla-ai/crm';
6
6
  import '@odla-ai/crm/ui';
package/dist/ui/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  timeLabel,
20
20
  tzShort,
21
21
  useTierSelection
22
- } from "../chunk-NYMLKPQF.js";
22
+ } from "../chunk-UJIVBGL5.js";
23
23
  import {
24
24
  AdminNote,
25
25
  AdminPage,
@@ -1,7 +1,7 @@
1
1
  import * as preact from 'preact';
2
2
  import { ComponentChildren, JSX } from 'preact';
3
- import { b as ChapterCopy, c as ChapterBrand } from '../../copy-context-BXBEdp4p.js';
4
- export { C as ChapterCopyProvider, u as useChapterCopy } from '../../copy-context-BXBEdp4p.js';
3
+ import { b as ChapterCopy, c as ChapterBrand } from '../../copy-context-c1tqPXOR.js';
4
+ export { C as ChapterCopyProvider, u as useChapterCopy } from '../../copy-context-c1tqPXOR.js';
5
5
  import '@odla-ai/crm';
6
6
 
7
7
  /** A bookable slot: a start instant in epoch milliseconds. */
@@ -127,6 +127,67 @@ interface RescheduleProps {
127
127
  * rebooks on pick. Degrades to a message when scheduling is unavailable. */
128
128
  declare function Rescheduler(props: RescheduleProps): preact.JSX.Element;
129
129
 
130
+ /** Deterministic, side-effect-free availability for a simulated join flow. */
131
+ interface JoinBookingSimulation {
132
+ slots: readonly Slot[];
133
+ timezone: string;
134
+ }
135
+
136
+ /** Props for {@link PaymentStep}. */
137
+ interface PaymentStepProps {
138
+ /** The application to attach the subscription to (the capability). */
139
+ applicationId: string;
140
+ /** Refund-policy copy the applicant must acknowledge to start payment. */
141
+ refundPolicyText: string;
142
+ /** Called once the payment succeeds (or is processing) — advance to booking. */
143
+ onPaid: () => void;
144
+ /** Stripe Elements appearance passed through without Chapter reinterpretation. */
145
+ appearance?: Record<string, unknown>;
146
+ /** Stripe Elements custom-font descriptors. */
147
+ fonts?: readonly Record<string, unknown>[];
148
+ /** Resolved payment-step copy. */
149
+ copy?: ChapterCopy["join"]["payment"];
150
+ /** Render the server-returned membership price breakdown. */
151
+ renderPriceLines?: (lines: PaymentPriceLines) => ComponentChildren;
152
+ /** Site-owned trust, security, or explanatory content. */
153
+ children?: ComponentChildren;
154
+ /**
155
+ * Side-effect-free payment data for a Studio or test journey. When present,
156
+ * this component never calls the subscription route or loads Stripe.js; it
157
+ * presents an inert card form and advances only the local flow.
158
+ */
159
+ simulation?: PaymentStepSimulation;
160
+ }
161
+ /** Server-authoritative membership amounts supplied to the payment price slot. */
162
+ interface PaymentPriceLines {
163
+ standardCents: number;
164
+ discountCents: number;
165
+ dueTodayCents: number;
166
+ }
167
+ /** Deterministic, non-charging inputs for a simulated payment step. */
168
+ interface PaymentStepSimulation {
169
+ lineItems: PaymentPriceLines;
170
+ }
171
+ /** The card-entry step: acknowledge the refund policy → create the subscription
172
+ * → mount Stripe Elements → confirm. */
173
+ declare function PaymentStep(props: PaymentStepProps): preact.JSX.Element;
174
+
175
+ /**
176
+ * Side-effect-free boundaries for an explorable Studio or test journey.
177
+ * JoinIsland retains the production step order and presentation, while
178
+ * application creation, charging, and booking remain entirely local.
179
+ */
180
+ interface JoinSimulation {
181
+ /** Stable capability-shaped id surfaced to render slots during the journey. */
182
+ applicationId?: string;
183
+ /** Server-shaped price lines shown by the simulated payment step. */
184
+ payment: {
185
+ lineItems: PaymentPriceLines;
186
+ };
187
+ /** Deterministic availability shown by the simulated booking step. */
188
+ booking: JoinBookingSimulation;
189
+ }
190
+
130
191
  /** One membership tier as the public join config exposes it. */
131
192
  interface JoinTier {
132
193
  id: string;
@@ -184,7 +245,7 @@ interface JoinConfig {
184
245
  paymentsReady: boolean;
185
246
  refundPolicyText?: string;
186
247
  /** Offered membership tiers, in display order. Empty on a chapter that
187
- * declares none, in which case no tier is posted and nothing renders. */
248
+ * declares none, in which case no tier is posted and nothing renders. */
188
249
  tiers?: readonly JoinTier[];
189
250
  /** Resolved copy for the packaged join flow. */
190
251
  copy?: ChapterCopy["join"];
@@ -219,13 +280,10 @@ interface JoinSubmitRenderContext {
219
280
  submitting: boolean;
220
281
  disabled: boolean;
221
282
  }
222
- /** Load canonical server state for a capability-bearing application id. */
223
- declare function loadJoinResume(applicationId: string, fetcher?: typeof fetch): Promise<JoinFlowState>;
224
283
  /** Props for {@link JoinIsland}. */
225
284
  interface JoinIslandProps {
226
285
  config: JoinConfig;
227
- /** The site's application form fields — inputs with `name` attributes; their
228
- * values are collected via FormData and posted to /api/applications. */
286
+ /** Site application inputs; named values post to `/api/applications`. */
229
287
  children: ComponentChildren;
230
288
  /** Where the confirmation links after booking. Default "/members/". */
231
289
  membersHref?: string;
@@ -235,7 +293,7 @@ interface JoinIslandProps {
235
293
  initialState?: JoinFlowState;
236
294
  /** Resolve redirect/query state against the server before resuming the flow. */
237
295
  loadResume?: () => Promise<JoinFlowState | null>;
238
- /** Render a heading or other site-owned framing above each packaged step. */
296
+ /** Render site-owned framing above each packaged step. */
239
297
  renderStepHeader?: (context: JoinStepRenderContext) => ComponentChildren;
240
298
  /** Replace the packaged completion card while retaining flow orchestration. */
241
299
  renderDone?: (context: Extract<JoinFlowState, {
@@ -245,11 +303,9 @@ interface JoinIslandProps {
245
303
  }) => ComponentChildren;
246
304
  /** Replace the submit control without replacing the application form. */
247
305
  renderSubmit?: (context: JoinSubmitRenderContext) => ComponentChildren;
248
- /** Render the site's own tier chooser. Omitted, the flow still works and
249
- * emits an unstyled placeholder meant to be replaced, never shipped. */
306
+ /** Render the site's tier chooser; the fallback is intentionally unstyled. */
250
307
  renderTiers?: (context: JoinTierRenderContext) => ComponentChildren;
251
- /** Preselect a tier, e.g. from a pricing page link. Ignored if not offered.
252
- * With exactly one offered tier the selection is implicit and needs no UI. */
308
+ /** Preselect a tier when it is offered. */
253
309
  initialTierId?: string;
254
310
  /** Additional host validation gate for the submit action. */
255
311
  submitDisabled?: boolean;
@@ -264,7 +320,12 @@ interface JoinIslandProps {
264
320
  }) => ComponentChildren;
265
321
  children?: ComponentChildren;
266
322
  };
323
+ /** Run the canonical journey without network, Stripe, or calendar writes. */
324
+ simulation?: JoinSimulation;
267
325
  }
326
+
327
+ /** Load canonical server state for a capability-bearing application id. */
328
+ declare function loadJoinResume(applicationId: string, fetcher?: typeof fetch): Promise<JoinFlowState>;
268
329
  /** The signup island. Renders the site's form, keeps one application
269
330
  * `submissionId` across ambiguous retries, then drives payment (when the
270
331
  * chapter charges) and booking (when a calendar is connected) to confirmation. */
@@ -356,35 +417,6 @@ declare function membershipApplicationHref(applicationPath: string | undefined,
356
417
  */
357
418
  declare function MembershipCards(props: MembershipCardsProps): JSX.Element;
358
419
 
359
- /** Props for {@link PaymentStep}. */
360
- interface PaymentStepProps {
361
- /** The application to attach the subscription to (the capability). */
362
- applicationId: string;
363
- /** Refund-policy copy the applicant must acknowledge to start payment. */
364
- refundPolicyText: string;
365
- /** Called once the payment succeeds (or is processing) — advance to booking. */
366
- onPaid: () => void;
367
- /** Stripe Elements appearance passed through without Chapter reinterpretation. */
368
- appearance?: Record<string, unknown>;
369
- /** Stripe Elements custom-font descriptors. */
370
- fonts?: readonly Record<string, unknown>[];
371
- /** Resolved payment-step copy. */
372
- copy?: ChapterCopy["join"]["payment"];
373
- /** Render the server-returned membership price breakdown. */
374
- renderPriceLines?: (lines: PaymentPriceLines) => ComponentChildren;
375
- /** Site-owned trust, security, or explanatory content. */
376
- children?: ComponentChildren;
377
- }
378
- /** Server-authoritative membership amounts supplied to the payment price slot. */
379
- interface PaymentPriceLines {
380
- standardCents: number;
381
- discountCents: number;
382
- dueTodayCents: number;
383
- }
384
- /** The card-entry step: acknowledge the refund policy → create the subscription
385
- * → mount Stripe Elements → confirm. */
386
- declare function PaymentStep(props: PaymentStepProps): preact.JSX.Element;
387
-
388
420
  /** Props for {@link BrandStyle}. */
389
421
  interface BrandStyleProps {
390
422
  brand: ChapterBrand | undefined;
@@ -395,4 +427,4 @@ interface BrandStyleProps {
395
427
  * there is no brand to theme). */
396
428
  declare function BrandStyle(props: BrandStyleProps): preact.JSX.Element | null;
397
429
 
398
- export { type ApiFn, BrandStyle, type BrandStyleProps, type JoinConfig, type JoinFlowState, JoinIsland, type JoinIslandProps, type JoinStepRenderContext, type JoinSubmitRenderContext, type JoinTier, type JoinTierRenderContext, MEMBERSHIP_CARD_TOKEN_DEFAULTS, type MemberProvisionalRenderContext, MembersArea, type MembersAreaProps, type MembershipCardTokenName, MembershipCards, type MembershipCardsMode, type MembershipCardsProps, type PaymentPriceLines, PaymentStep, type PaymentStepProps, type RescheduleProps, Rescheduler, type Slot, SlotPicker, type SlotPickerClasses, type SlotPickerProps, TierPlaceholder, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection };
430
+ export { type ApiFn, BrandStyle, type BrandStyleProps, type JoinBookingSimulation, type JoinConfig, type JoinFlowState, JoinIsland, type JoinIslandProps, type JoinSimulation, type JoinStepRenderContext, type JoinSubmitRenderContext, type JoinTier, type JoinTierRenderContext, MEMBERSHIP_CARD_TOKEN_DEFAULTS, type MemberProvisionalRenderContext, MembersArea, type MembersAreaProps, type MembershipCardTokenName, MembershipCards, type MembershipCardsMode, type MembershipCardsProps, type PaymentPriceLines, PaymentStep, type PaymentStepProps, type PaymentStepSimulation, type RescheduleProps, Rescheduler, type Slot, SlotPicker, type SlotPickerClasses, type SlotPickerProps, TierPlaceholder, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection };
@@ -19,7 +19,7 @@ import {
19
19
  timeLabel,
20
20
  tzShort,
21
21
  useTierSelection
22
- } from "../../chunk-NYMLKPQF.js";
22
+ } from "../../chunk-UJIVBGL5.js";
23
23
  import {
24
24
  BrandStyle,
25
25
  ChapterCopyProvider,