@odla-ai/chapter 0.56.0 → 0.56.2

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,6 +1,6 @@
1
1
  export { APPLICATION_STAGES, AdminAccountMenuProps, AdminBuilderLibraryData, AdminChrome, AdminMemberContentData, AdminNote, AdminPage, AdminResource, AdminRouteState, AdminRouteTarget, AdminRouting, AdminSection, AdminSectionContext, AdminWorkspace, AdminWorkspaceFrameProps, AdminWorkspaceNavProps, AdmissionGrantsWorkspace, AvailabilitySectionOptions, BillingSectionOptions, BuilderLibraryAdmin, CandidateStagePanel, CandidateStagePanelProps, ChapterAdmin, ChapterAdminAuthAdapter, ChapterAdminAuthConfig, ChapterAdminAuthLoadContext, ChapterAdminProps, ChapterAdminUser, CollectionSectionOptions, DashboardSectionOptions, EmailSectionOptions, LeaderAdmissionAction, LeaderAdmissionActionProps, LeaderNetworkOverview, MeetingsSectionOptions, MemberContentAdmin, MembershipPolicyVersions, MembershipPolicyVersionsProps, NamedSeatRecordPanel, NamedSeatRecordPanelProps, NetworkRecordEditor, NetworkRecordsWorkspace, NetworkSeatBilling, NetworkShareActions, NetworkShareActionsProps, Panel, PaymentRecoveryQueue, PeopleSectionOptions, RecordActions, RecordActionsProps, RecordAdmissionPanel, RecordAdmissionPanelProps, ThemeWarning, adminFetch, adminRouteFromUrl, adminRouteHref, adminSectionFromUrl, adminSectionHref, admissionGrantsWorkspace, applicationLifecycleAdapter, availabilitySection, billingSection, builderLibrarySection, collectionSection, dashboardSection, defaultAdminSections, defaultAdminWorkspaces, emailSection, loadChapterAdminConfig, loadChapterAdminUser, meetingsSection, memberContentSection, networkRecordsWorkspace, peopleSection, useAdminResource } from './admin/index.js';
2
2
  export { C as ChapterCopyProvider, u as useChapterCopy } from '../copy-context-CaUXIxUI.js';
3
- export { ApiFn, BrandStyle, BrandStyleProps, GiftCodeRedeemResult, GiftCodeRedeemer, GiftCodeRedeemerCopy, GiftCodeRedeemerProps, GiftOfferCards, GiftOfferCardsMode, GiftOfferCardsProps, GiftPurchases, GiftPurchasesProps, JoinBookingSimulation, JoinConfig, JoinFlowState, JoinIsland, JoinIslandProps, JoinSimulation, JoinStepRenderContext, JoinSubmitRenderContext, JoinTier, JoinTierRenderContext, JourneyFrame, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberContentArea, MemberContentAreaProps, MemberGifts, MemberProvisionalRenderContext, MemberRestart, MembersArea, MembersAreaProps, MembershipCardTokenName, MembershipCards, MembershipCardsMode, MembershipCardsProps, NAMED_SEAT_RECIPIENT_WORDS, NamedSeatPurchase, NamedSeatRecipientLine, PaymentPriceLines, PaymentStep, PaymentStepProps, PaymentStepSimulation, RescheduleProps, Rescheduler, Slot, SlotPicker, SlotPickerClasses, SlotPickerProps, SubResponse, TierPlaceholder, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection } from './member/index.js';
3
+ export { ADDITIONAL_MEMBER_COPY, AdditionalMemberCopy, AdditionalMemberDraft, AdditionalMemberEditor, AdditionalMemberEditorOptions, AdditionalMemberEditorProps, AdditionalMemberFieldNames, AdditionalMemberFields, AdditionalMemberFieldsProps, AdditionalMemberOffer, AdditionalMemberOptions, ApiFn, BrandStyle, BrandStyleProps, CheckoutSeatEditor, CheckoutSeatEditorContext, GiftCodeRedeemResult, GiftCodeRedeemer, GiftCodeRedeemerCopy, GiftCodeRedeemerProps, GiftOfferCards, GiftOfferCardsMode, GiftOfferCardsProps, GiftPurchases, GiftPurchasesProps, JoinBookingSimulation, JoinConfig, JoinFlowState, JoinIsland, JoinIslandProps, JoinSimulation, JoinStepRenderContext, JoinSubmitButton, JoinSubmitRenderContext, JoinTier, JoinTierRenderContext, JourneyFrame, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberContentArea, MemberContentAreaProps, MemberGifts, MemberProvisionalRenderContext, MemberRestart, MembersArea, MembersAreaProps, MembershipCardTokenName, MembershipCards, MembershipCardsMode, MembershipCardsProps, NAMED_SEAT_RECIPIENT_WORDS, NamedSeatPurchase, NamedSeatRecipientLine, PaymentPriceLines, PaymentStep, PaymentStepProps, PaymentStepSimulation, RescheduleProps, Rescheduler, Slot, SlotPicker, SlotPickerClasses, SlotPickerProps, SubResponse, TierPlaceholder, additionalMemberSelection, 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
@@ -1,8 +1,12 @@
1
1
  import {
2
+ ADDITIONAL_MEMBER_COPY,
3
+ AdditionalMemberEditor,
4
+ AdditionalMemberFields,
2
5
  GiftCodeRedeemer,
3
6
  GiftOfferCards,
4
7
  GiftPurchases,
5
8
  JoinIsland,
9
+ JoinSubmitButton,
6
10
  JourneyFrame,
7
11
  MEMBERSHIP_CARD_TOKEN_DEFAULTS,
8
12
  MemberContentArea,
@@ -17,6 +21,7 @@ import {
17
21
  Rescheduler,
18
22
  SlotPicker,
19
23
  TierPlaceholder,
24
+ additionalMemberSelection,
20
25
  dayKey,
21
26
  dayLabel,
22
27
  fmtDate,
@@ -29,7 +34,7 @@ import {
29
34
  timeLabel,
30
35
  tzShort,
31
36
  useTierSelection
32
- } from "../chunk-IQZWCG42.js";
37
+ } from "../chunk-E7CB5K2D.js";
33
38
  import {
34
39
  APPLICATION_STAGES,
35
40
  AdminNote,
@@ -82,7 +87,10 @@ import {
82
87
  } from "../chunk-4M2PN5K3.js";
83
88
  import "../chunk-IVXVECKR.js";
84
89
  export {
90
+ ADDITIONAL_MEMBER_COPY,
85
91
  APPLICATION_STAGES,
92
+ AdditionalMemberEditor,
93
+ AdditionalMemberFields,
86
94
  AdminNote,
87
95
  AdminPage,
88
96
  AdmissionGrantsWorkspace,
@@ -95,6 +103,7 @@ export {
95
103
  GiftOfferCards,
96
104
  GiftPurchases,
97
105
  JoinIsland,
106
+ JoinSubmitButton,
98
107
  JourneyFrame,
99
108
  LeaderAdmissionAction,
100
109
  LeaderNetworkOverview,
@@ -123,6 +132,7 @@ export {
123
132
  SlotPicker,
124
133
  ThemeWarning,
125
134
  TierPlaceholder,
135
+ additionalMemberSelection,
126
136
  adminFetch,
127
137
  adminRouteFromUrl,
128
138
  adminRouteHref,
@@ -209,6 +209,8 @@ interface PaymentPriceLines {
209
209
  dueTodayCents: number;
210
210
  /** Included in dueTodayCents; zero means the selected SKU includes the additional member. */
211
211
  namedSeatCents?: number;
212
+ /** True when an included additional member is available but no recipient was selected. Display Pick later. */
213
+ namedSeatPickLater?: boolean;
212
214
  founding?: {
213
215
  cohortLabel: string;
214
216
  };
@@ -374,6 +376,106 @@ interface ChapterFlowFieldContract {
374
376
  fields: readonly ChapterFlowField[];
375
377
  }
376
378
 
379
+ /** The optional recipient selected before the applicant consents to payment. */
380
+ interface CheckoutNamedSeatSelection {
381
+ recipientName: string;
382
+ recipientEmail: string;
383
+ }
384
+
385
+ /** Reopens the host's original recipient fields before payment begins. */
386
+ interface CheckoutSeatEditorContext {
387
+ /** Server-saved selection; null means the applicant has not chosen a recipient. */
388
+ selection: CheckoutNamedSeatSelection | null;
389
+ /** The current authority-owned additional-member price and billing interval. */
390
+ offer: {
391
+ amountCents: number;
392
+ currency: string;
393
+ interval: string;
394
+ };
395
+ /** Validate and save a recipient, or null to remove them, then return to checkout. */
396
+ save: (selection: CheckoutNamedSeatSelection | null) => Promise<void>;
397
+ /** Return to checkout without changing its saved selection. */
398
+ cancel: () => void;
399
+ }
400
+ /** Host-owned recipient fields reused from the application instead of a second checkout editor. */
401
+ type CheckoutSeatEditor = (context: CheckoutSeatEditorContext) => ComponentChildren;
402
+
403
+ /** Editable additional-member values retained while the selection checkbox is off. */
404
+ interface AdditionalMemberDraft {
405
+ /** Whether the applicant wants to include this recipient. */
406
+ selected: boolean;
407
+ /** Recipient's full name. */
408
+ name: string;
409
+ /** Recipient's email address. */
410
+ email: string;
411
+ }
412
+ /** Price information supplied by the membership authority; zero means included. */
413
+ interface AdditionalMemberOffer {
414
+ /** Additional amount in minor currency units. */
415
+ amountCents: number;
416
+ /** ISO currency code; defaults to USD for display. */
417
+ currency?: string;
418
+ /** Billing interval; defaults to year for display. */
419
+ interval?: string;
420
+ }
421
+ /** Site wording for shared recipient controls; behavior and validation remain in Chapter. */
422
+ interface AdditionalMemberCopy {
423
+ /** Heading above the selection. */
424
+ label: string;
425
+ /** Checkbox label for an included recipient. */
426
+ includedChoice: string;
427
+ /** Checkbox label for a paid recipient. */
428
+ paidChoice: string;
429
+ /** Explanation when the additional membership costs zero. */
430
+ includedHint: string;
431
+ /** Explanation when the authority has not supplied a price yet. */
432
+ pendingHint: string;
433
+ /** Heading when editing a previously selected recipient. */
434
+ editTitle: string;
435
+ }
436
+ /** Form field names must match the host's server-side application field contract. */
437
+ interface AdditionalMemberFieldNames {
438
+ /** Selection checkbox field. */
439
+ selected: string;
440
+ /** Full-name field. */
441
+ name: string;
442
+ /** Email field. */
443
+ email: string;
444
+ }
445
+ /** Presentation options shared by the initial fields and the checkout editor. */
446
+ interface AdditionalMemberOptions {
447
+ /** Overrides for site-specific language. */
448
+ copy?: Partial<AdditionalMemberCopy>;
449
+ /** Application field names; defaults use the additionalMember prefix. */
450
+ names?: Partial<AdditionalMemberFieldNames>;
451
+ }
452
+ /** Controlled field props for application composition. */
453
+ interface AdditionalMemberFieldsProps extends AdditionalMemberOptions {
454
+ /** Current draft, including details retained when unchecked. */
455
+ value: AdditionalMemberDraft;
456
+ /** Receive the next draft after a field changes. */
457
+ onChange: (value: AdditionalMemberDraft) => void;
458
+ /** Authoritative additional-member price, when available. */
459
+ offer?: AdditionalMemberOffer;
460
+ }
461
+ /** Default wording for additional-member controls. */
462
+ declare const ADDITIONAL_MEMBER_COPY: AdditionalMemberCopy;
463
+ /** Convert an editor draft to the selection accepted by checkout; null removes the recipient. */
464
+ declare function additionalMemberSelection(value: AdditionalMemberDraft): CheckoutNamedSeatSelection | null;
465
+ /** One field set for included and paid recipients, reused on Apply and when editing checkout details. */
466
+ declare function AdditionalMemberFields({ value, onChange, offer, ...options }: AdditionalMemberFieldsProps): preact.JSX.Element;
467
+
468
+ /** Optional host notification after Chapter saves the selection successfully. */
469
+ interface AdditionalMemberEditorOptions extends AdditionalMemberOptions {
470
+ /** Sync the application's draft after a successful save or removal. */
471
+ onSaved?: (value: AdditionalMemberDraft) => void;
472
+ }
473
+ /** Shared editor receives the server-saved recipient and authoritative save/cancel actions. */
474
+ interface AdditionalMemberEditorProps extends CheckoutSeatEditorContext, AdditionalMemberEditorOptions {
475
+ }
476
+ /** Own validation, saving, error recovery and action layout for included and paid recipients. */
477
+ declare function AdditionalMemberEditor({ selection, offer, save, cancel, onSaved, ...options }: AdditionalMemberEditorProps): preact.JSX.Element;
478
+
377
479
  /** The public join config (the shape `GET /api/join-config` returns). */
378
480
  interface JoinConfig {
379
481
  id: string;
@@ -426,12 +528,15 @@ type JoinFlowState = {
426
528
  /** Canonical flow state supplied to a site's per-step heading render slot. */
427
529
  interface JoinStepRenderContext {
428
530
  state: JoinFlowState;
531
+ /** True while returning to the application's family-member fields; the saved application stays on its payment step. */
532
+ editingNamedSeat?: boolean;
429
533
  invitation?: JoinInvitation;
430
534
  applicationId?: string;
431
535
  }
432
536
  /** Submission state supplied to a site's submit-control render slot. */
433
537
  interface JoinSubmitRenderContext {
434
538
  submitting: boolean;
539
+ /** True while submitting, while a host gate is closed, or while required form/recipient fields are invalid. */
435
540
  disabled: boolean;
436
541
  }
437
542
  /** Props for {@link JoinIsland}. */
@@ -484,6 +589,12 @@ interface JoinIslandProps {
484
589
  recipientName: string;
485
590
  recipientEmail: string;
486
591
  };
592
+ /** Use Chapter's recipient editor and read-only checkout review; configure only copy and field names. */
593
+ additionalMember?: AdditionalMemberEditorOptions;
594
+ /** Reuse the application's recipient fields for edits. Checkout automatically quotes initialNamedSeat and shows a read-only review. */
595
+ renderNamedSeatEditor?: CheckoutSeatEditor;
596
+ /** Heading for the read-only recipient review. Defaults to Additional member. */
597
+ namedSeatLabel?: string;
487
598
  appearance?: Record<string, unknown>;
488
599
  fonts?: readonly Record<string, unknown>[];
489
600
  /** Render the server-owned price lines; `lines.founding` says the difference is a policy-backed founding discount,
@@ -711,4 +822,7 @@ declare function JourneyFrame({ children }: {
711
822
  children: ComponentChildren;
712
823
  }): preact.JSX.Element;
713
824
 
714
- export { type ApiFn, BrandStyle, type BrandStyleProps, type GiftCodeRedeemResult, GiftCodeRedeemer, type GiftCodeRedeemerCopy, type GiftCodeRedeemerProps, GiftOfferCards, type GiftOfferCardsMode, type GiftOfferCardsProps, GiftPurchases, type GiftPurchasesProps, type JoinBookingSimulation, type JoinConfig, type JoinFlowState, JoinIsland, type JoinIslandProps, type JoinSimulation, type JoinStepRenderContext, type JoinSubmitRenderContext, type JoinTier, type JoinTierRenderContext, JourneyFrame, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberContentArea, type MemberContentAreaProps, MemberGifts, type MemberProvisionalRenderContext, MemberRestart, MembersArea, type MembersAreaProps, type MembershipCardTokenName, MembershipCards, type MembershipCardsMode, type MembershipCardsProps, NAMED_SEAT_RECIPIENT_WORDS, NamedSeatPurchase, NamedSeatRecipientLine, type PaymentPriceLines, PaymentStep, type PaymentStepProps, type PaymentStepSimulation, type RescheduleProps, Rescheduler, type Slot, SlotPicker, type SlotPickerClasses, type SlotPickerProps, type SubResponse, TierPlaceholder, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection };
825
+ /** A themed application submit control. Pass the disabled state supplied by JoinIsland's renderSubmit slot. */
826
+ declare function JoinSubmitButton(props: JSX.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
827
+
828
+ export { ADDITIONAL_MEMBER_COPY, type AdditionalMemberCopy, type AdditionalMemberDraft, AdditionalMemberEditor, type AdditionalMemberEditorOptions, type AdditionalMemberEditorProps, type AdditionalMemberFieldNames, AdditionalMemberFields, type AdditionalMemberFieldsProps, type AdditionalMemberOffer, type AdditionalMemberOptions, type ApiFn, BrandStyle, type BrandStyleProps, type CheckoutSeatEditor, type CheckoutSeatEditorContext, type GiftCodeRedeemResult, GiftCodeRedeemer, type GiftCodeRedeemerCopy, type GiftCodeRedeemerProps, GiftOfferCards, type GiftOfferCardsMode, type GiftOfferCardsProps, GiftPurchases, type GiftPurchasesProps, type JoinBookingSimulation, type JoinConfig, type JoinFlowState, JoinIsland, type JoinIslandProps, type JoinSimulation, type JoinStepRenderContext, JoinSubmitButton, type JoinSubmitRenderContext, type JoinTier, type JoinTierRenderContext, JourneyFrame, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberContentArea, type MemberContentAreaProps, MemberGifts, type MemberProvisionalRenderContext, MemberRestart, MembersArea, type MembersAreaProps, type MembershipCardTokenName, MembershipCards, type MembershipCardsMode, type MembershipCardsProps, NAMED_SEAT_RECIPIENT_WORDS, NamedSeatPurchase, NamedSeatRecipientLine, type PaymentPriceLines, PaymentStep, type PaymentStepProps, type PaymentStepSimulation, type RescheduleProps, Rescheduler, type Slot, SlotPicker, type SlotPickerClasses, type SlotPickerProps, type SubResponse, TierPlaceholder, additionalMemberSelection, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection };
@@ -1,8 +1,12 @@
1
1
  import {
2
+ ADDITIONAL_MEMBER_COPY,
3
+ AdditionalMemberEditor,
4
+ AdditionalMemberFields,
2
5
  GiftCodeRedeemer,
3
6
  GiftOfferCards,
4
7
  GiftPurchases,
5
8
  JoinIsland,
9
+ JoinSubmitButton,
6
10
  JourneyFrame,
7
11
  MEMBERSHIP_CARD_TOKEN_DEFAULTS,
8
12
  MemberContentArea,
@@ -17,6 +21,7 @@ import {
17
21
  Rescheduler,
18
22
  SlotPicker,
19
23
  TierPlaceholder,
24
+ additionalMemberSelection,
20
25
  dayKey,
21
26
  dayLabel,
22
27
  fmtDate,
@@ -29,7 +34,7 @@ import {
29
34
  timeLabel,
30
35
  tzShort,
31
36
  useTierSelection
32
- } from "../../chunk-IQZWCG42.js";
37
+ } from "../../chunk-E7CB5K2D.js";
33
38
  import {
34
39
  BrandStyle,
35
40
  ChapterCopyProvider,
@@ -37,12 +42,16 @@ import {
37
42
  } from "../../chunk-4M2PN5K3.js";
38
43
  import "../../chunk-IVXVECKR.js";
39
44
  export {
45
+ ADDITIONAL_MEMBER_COPY,
46
+ AdditionalMemberEditor,
47
+ AdditionalMemberFields,
40
48
  BrandStyle,
41
49
  ChapterCopyProvider,
42
50
  GiftCodeRedeemer,
43
51
  GiftOfferCards,
44
52
  GiftPurchases,
45
53
  JoinIsland,
54
+ JoinSubmitButton,
46
55
  JourneyFrame,
47
56
  MEMBERSHIP_CARD_TOKEN_DEFAULTS,
48
57
  MemberContentArea,
@@ -57,6 +66,7 @@ export {
57
66
  Rescheduler,
58
67
  SlotPicker,
59
68
  TierPlaceholder,
69
+ additionalMemberSelection,
60
70
  dayKey,
61
71
  dayLabel,
62
72
  fmtDate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odla-ai/chapter",
3
- "version": "0.56.0",
3
+ "version": "0.56.2",
4
4
  "description": "A leader/follower foundation for branded membership sites: shared CRM, admin, auth, payments, booking, and explicit record delivery from one defineChapter config.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://odla.ai/docs/packages/chapter",