@odla-ai/chapter 0.36.0 → 0.38.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.
@@ -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-0k0-yWHL.js';
5
- export { C as ChapterCopyProvider, u as useChapterCopy } from '../../copy-context-0k0-yWHL.js';
4
+ import { a as Chapter, b as ChapterCopy, M as MemberContentDocument, E as EffectiveMemberContent, c as MemberContentTierAuthority } from '../../copy-context-Pbs3keLx.js';
5
+ export { C as ChapterCopyProvider, u as useChapterCopy } from '../../copy-context-Pbs3keLx.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. */
@@ -293,6 +293,30 @@ declare function AdmissionGrantsWorkspace(props: {
293
293
  /** Create the standard Chapter admission workspace definition. */
294
294
  declare function admissionGrantsWorkspace(label?: string): AdminWorkspace;
295
295
 
296
+ /** Admin-safe inventory of inherited content, local content, tiers, and composition state. */
297
+ interface AdminMemberContentData {
298
+ parent: {
299
+ revision: number;
300
+ digest: string;
301
+ document: MemberContentDocument;
302
+ } | null;
303
+ chapter: {
304
+ revision: number;
305
+ document: MemberContentDocument;
306
+ } | null;
307
+ effective: EffectiveMemberContent;
308
+ tiers: MemberContentTierAuthority[];
309
+ localAuthoring: boolean;
310
+ }
311
+ /** Agent-friendly editor with read-only inherited inventory and one local JSON contract. */
312
+ declare function MemberContentAdmin({ ctx, initialData, }: {
313
+ ctx: AdminSectionContext;
314
+ /** Exact preloaded state for package-identical previews and SSR tests. */
315
+ initialData?: AdminMemberContentData;
316
+ }): preact.JSX.Element;
317
+ /** Reusable nested admin section for the standard Settings workspace. */
318
+ declare function memberContentSection(): AdminSection;
319
+
296
320
  /** Fetch a JSON `/api/admin/*` route with the admin bearer token. Throws on a
297
321
  * non-2xx (the body's `error`, else the status). */
298
322
  declare function adminFetch<T = unknown>(getToken: () => Promise<string | null>, path: string, init?: RequestInit): Promise<T>;
@@ -325,4 +349,4 @@ declare function AdminNote({ children }: {
325
349
  children: ComponentChildren;
326
350
  }): JSX.Element;
327
351
 
328
- export { type AdminAccountMenuProps, type AdminChrome, AdminNote, AdminPage, type AdminResource, type AdminRouteState, type AdminRouteTarget, type AdminRouting, type AdminSection, type AdminSectionContext, type AdminWorkspace, type AdminWorkspaceNavProps, AdmissionGrantsWorkspace, type AvailabilitySectionOptions, type BillingSectionOptions, ChapterAdmin, type ChapterAdminAuthAdapter, type ChapterAdminAuthConfig, type ChapterAdminAuthLoadContext, type ChapterAdminProps, type ChapterAdminUser, type CollectionSectionOptions, type DashboardSectionOptions, type EmailSectionOptions, LeaderNetworkOverview, type MeetingsSectionOptions, NetworkRecordsWorkspace, NetworkShareActions, type NetworkShareActionsProps, Panel, type PeopleSectionOptions, RecordActions, type RecordActionsProps, ThemeWarning, adminFetch, adminRouteFromUrl, adminRouteHref, adminSectionFromUrl, adminSectionHref, admissionGrantsWorkspace, applicationLifecycleAdapter, availabilitySection, billingSection, collectionSection, dashboardSection, defaultAdminSections, defaultAdminWorkspaces, emailSection, loadChapterAdminConfig, loadChapterAdminUser, meetingsSection, networkRecordsWorkspace, peopleSection, useAdminResource };
352
+ export { type AdminAccountMenuProps, type AdminChrome, type AdminMemberContentData, AdminNote, AdminPage, type AdminResource, type AdminRouteState, type AdminRouteTarget, type AdminRouting, type AdminSection, type AdminSectionContext, type AdminWorkspace, type AdminWorkspaceNavProps, AdmissionGrantsWorkspace, type AvailabilitySectionOptions, type BillingSectionOptions, ChapterAdmin, type ChapterAdminAuthAdapter, type ChapterAdminAuthConfig, type ChapterAdminAuthLoadContext, type ChapterAdminProps, type ChapterAdminUser, type CollectionSectionOptions, type DashboardSectionOptions, type EmailSectionOptions, LeaderNetworkOverview, type MeetingsSectionOptions, MemberContentAdmin, NetworkRecordsWorkspace, NetworkShareActions, type NetworkShareActionsProps, Panel, type PeopleSectionOptions, RecordActions, type RecordActionsProps, ThemeWarning, adminFetch, adminRouteFromUrl, adminRouteHref, adminSectionFromUrl, adminSectionHref, admissionGrantsWorkspace, applicationLifecycleAdapter, availabilitySection, billingSection, collectionSection, dashboardSection, defaultAdminSections, defaultAdminWorkspaces, emailSection, loadChapterAdminConfig, loadChapterAdminUser, meetingsSection, memberContentSection, networkRecordsWorkspace, peopleSection, useAdminResource };
@@ -4,6 +4,7 @@ import {
4
4
  AdmissionGrantsWorkspace,
5
5
  ChapterAdmin,
6
6
  LeaderNetworkOverview,
7
+ MemberContentAdmin,
7
8
  NetworkRecordsWorkspace,
8
9
  NetworkShareActions,
9
10
  Panel,
@@ -26,10 +27,11 @@ import {
26
27
  loadChapterAdminConfig,
27
28
  loadChapterAdminUser,
28
29
  meetingsSection,
30
+ memberContentSection,
29
31
  networkRecordsWorkspace,
30
32
  peopleSection,
31
33
  useAdminResource
32
- } from "../../chunk-LWM32REV.js";
34
+ } from "../../chunk-SI3JHSEX.js";
33
35
  import {
34
36
  ChapterCopyProvider,
35
37
  useChapterCopy
@@ -41,6 +43,7 @@ export {
41
43
  ChapterAdmin,
42
44
  ChapterCopyProvider,
43
45
  LeaderNetworkOverview,
46
+ MemberContentAdmin,
44
47
  NetworkRecordsWorkspace,
45
48
  NetworkShareActions,
46
49
  Panel,
@@ -63,6 +66,7 @@ export {
63
66
  loadChapterAdminConfig,
64
67
  loadChapterAdminUser,
65
68
  meetingsSection,
69
+ memberContentSection,
66
70
  networkRecordsWorkspace,
67
71
  peopleSection,
68
72
  useAdminResource,
@@ -1,6 +1,6 @@
1
- export { AdminAccountMenuProps, AdminChrome, AdminNote, AdminPage, AdminResource, AdminRouteState, AdminRouteTarget, AdminRouting, AdminSection, AdminSectionContext, AdminWorkspace, AdminWorkspaceNavProps, AdmissionGrantsWorkspace, 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, admissionGrantsWorkspace, 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-0k0-yWHL.js';
3
- export { ApiFn, BrandStyle, BrandStyleProps, GiftOfferCards, GiftOfferCardsMode, GiftOfferCardsProps, JoinBookingSimulation, JoinConfig, JoinFlowState, JoinIsland, JoinIslandProps, JoinSimulation, JoinStepRenderContext, JoinSubmitRenderContext, JoinTier, JoinTierRenderContext, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberGifts, MemberProvisionalRenderContext, MembersArea, MembersAreaProps, MembershipCardTokenName, MembershipCards, MembershipCardsMode, MembershipCardsProps, 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';
1
+ export { AdminAccountMenuProps, AdminChrome, AdminMemberContentData, AdminNote, AdminPage, AdminResource, AdminRouteState, AdminRouteTarget, AdminRouting, AdminSection, AdminSectionContext, AdminWorkspace, AdminWorkspaceNavProps, AdmissionGrantsWorkspace, AvailabilitySectionOptions, BillingSectionOptions, ChapterAdmin, ChapterAdminAuthAdapter, ChapterAdminAuthConfig, ChapterAdminAuthLoadContext, ChapterAdminProps, ChapterAdminUser, CollectionSectionOptions, DashboardSectionOptions, EmailSectionOptions, LeaderNetworkOverview, MeetingsSectionOptions, MemberContentAdmin, NetworkRecordsWorkspace, NetworkShareActions, NetworkShareActionsProps, Panel, PeopleSectionOptions, RecordActions, RecordActionsProps, ThemeWarning, adminFetch, adminRouteFromUrl, adminRouteHref, adminSectionFromUrl, adminSectionHref, admissionGrantsWorkspace, applicationLifecycleAdapter, availabilitySection, billingSection, collectionSection, dashboardSection, defaultAdminSections, defaultAdminWorkspaces, emailSection, loadChapterAdminConfig, loadChapterAdminUser, meetingsSection, memberContentSection, networkRecordsWorkspace, peopleSection, useAdminResource } from './admin/index.js';
2
+ export { C as ChapterCopyProvider, u as useChapterCopy } from '../copy-context-Pbs3keLx.js';
3
+ export { ApiFn, BrandStyle, BrandStyleProps, GiftOfferCards, GiftOfferCardsMode, GiftOfferCardsProps, JoinBookingSimulation, JoinConfig, JoinFlowState, JoinIsland, JoinIslandProps, JoinSimulation, JoinStepRenderContext, JoinSubmitRenderContext, JoinTier, JoinTierRenderContext, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberContentArea, MemberContentAreaProps, MemberGifts, MemberProvisionalRenderContext, MembersArea, MembersAreaProps, MembershipCardTokenName, MembershipCards, MembershipCardsMode, MembershipCardsProps, 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';
4
4
  import 'preact';
5
5
  import '@odla-ai/crm';
6
6
  import '@odla-ai/crm/ui';
package/dist/ui/index.js CHANGED
@@ -2,6 +2,7 @@ import {
2
2
  GiftOfferCards,
3
3
  JoinIsland,
4
4
  MEMBERSHIP_CARD_TOKEN_DEFAULTS,
5
+ MemberContentArea,
5
6
  MemberGifts,
6
7
  MembersArea,
7
8
  MembershipCards,
@@ -21,13 +22,14 @@ import {
21
22
  timeLabel,
22
23
  tzShort,
23
24
  useTierSelection
24
- } from "../chunk-I45VYBUV.js";
25
+ } from "../chunk-BIYWPPH6.js";
25
26
  import {
26
27
  AdminNote,
27
28
  AdminPage,
28
29
  AdmissionGrantsWorkspace,
29
30
  ChapterAdmin,
30
31
  LeaderNetworkOverview,
32
+ MemberContentAdmin,
31
33
  NetworkRecordsWorkspace,
32
34
  NetworkShareActions,
33
35
  Panel,
@@ -50,10 +52,11 @@ import {
50
52
  loadChapterAdminConfig,
51
53
  loadChapterAdminUser,
52
54
  meetingsSection,
55
+ memberContentSection,
53
56
  networkRecordsWorkspace,
54
57
  peopleSection,
55
58
  useAdminResource
56
- } from "../chunk-LWM32REV.js";
59
+ } from "../chunk-SI3JHSEX.js";
57
60
  import {
58
61
  BrandStyle,
59
62
  ChapterCopyProvider,
@@ -71,6 +74,8 @@ export {
71
74
  JoinIsland,
72
75
  LeaderNetworkOverview,
73
76
  MEMBERSHIP_CARD_TOKEN_DEFAULTS,
77
+ MemberContentAdmin,
78
+ MemberContentArea,
74
79
  MemberGifts,
75
80
  MembersArea,
76
81
  MembershipCards,
@@ -107,6 +112,7 @@ export {
107
112
  loadChapterAdminUser,
108
113
  loadJoinResume,
109
114
  meetingsSection,
115
+ memberContentSection,
110
116
  membershipApplicationHref,
111
117
  networkRecordsWorkspace,
112
118
  peopleSection,
@@ -1,8 +1,8 @@
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-0k0-yWHL.js';
4
- export { C as ChapterCopyProvider, u as useChapterCopy } from '../../copy-context-0k0-yWHL.js';
5
- import '@odla-ai/crm';
3
+ import { d as MemberContentProjection, e as MemberContentPageProjection, b as ChapterCopy, f as ChapterBrand } from '../../copy-context-Pbs3keLx.js';
4
+ export { C as ChapterCopyProvider, u as useChapterCopy } from '../../copy-context-Pbs3keLx.js';
5
+ import { FieldType, FieldConditions } from '@odla-ai/crm';
6
6
 
7
7
  /** A bookable slot: a start instant in epoch milliseconds. */
8
8
  interface Slot {
@@ -74,6 +74,8 @@ interface ApplicationSummary {
74
74
  paid: boolean;
75
75
  renewalAt: number | null;
76
76
  canceled: boolean;
77
+ /** Server-authoritative membership tier selected on this application. */
78
+ tierId: string | null;
77
79
  }
78
80
  /** A summary plus the reconciled meeting fields — the `application` the member
79
81
  * area renders. */
@@ -83,6 +85,27 @@ interface MemberApplication extends ApplicationSummary {
83
85
  timezone: string;
84
86
  }
85
87
 
88
+ /** Inputs for the stock authenticated member-content navigator. */
89
+ interface MemberContentAreaProps {
90
+ api: ApiFn;
91
+ /** Defaults to the package-owned `/api/member-content` projection. */
92
+ path?: string;
93
+ initialPageId?: string;
94
+ /** Exact preloaded projection for SSR, tests, or package-identical previews. */
95
+ initialData?: MemberContentProjection;
96
+ /** Return a host-owned upgrade URL. Omit to render an informational offer. */
97
+ upsellHref?: (tierId: string, page: MemberContentPageProjection) => string | undefined;
98
+ /** Optional action for a host-owned upgrade journey. */
99
+ onUpsell?: (tierId: string, page: MemberContentPageProjection) => void;
100
+ loadingContent?: ComponentChildren;
101
+ emptyContent?: ComponentChildren;
102
+ }
103
+ /**
104
+ * Render the exact server-filtered catalog. This component never receives a
105
+ * restricted body: locked access is a wire-level omission, not a CSS gate.
106
+ */
107
+ declare function MemberContentArea(props: MemberContentAreaProps): preact.JSX.Element;
108
+
86
109
  /** Props for {@link MembersArea}. */
87
110
  interface MembersAreaProps {
88
111
  api: ApiFn;
@@ -94,6 +117,8 @@ interface MembersAreaProps {
94
117
  applyHref?: string;
95
118
  /** What a full (non-provisional) member sees below the account header. */
96
119
  memberContent?: ComponentChildren;
120
+ /** Opt into the standard server-filtered member-page navigator. */
121
+ memberPages?: true | Omit<MemberContentAreaProps, "api">;
97
122
  /** Resolved member-area copy. */
98
123
  copy?: ChapterCopy["members"];
99
124
  /** Replace the provisional application card without replacing auth/data load. */
@@ -277,6 +302,38 @@ interface GiftOffer {
277
302
  /** Provider-free gift offer shape rendered by Chapter and exact CMS previews. */
278
303
  type PublicGiftOffer = Omit<GiftOffer, "stripePriceId" | "target">;
279
304
 
305
+ /** Current public schema version for Chapter flow-field contracts. */
306
+ declare const CHAPTER_FLOW_FIELDS_SCHEMA_VERSION: 1;
307
+ /** Configurable Chapter intake journeys that publish field contracts. */
308
+ type ChapterFieldFlow = "join" | "formation";
309
+ /** Email comparison policy advertised by an email field. */
310
+ type ChapterEmailIdentity = "literal";
311
+ /**
312
+ * One effective field in a Chapter intake journey.
313
+ *
314
+ * IDs, value types, and options come from the follower-declared schema. A hub
315
+ * or CMS may select, order, and configure only those declared fields; it cannot
316
+ * use this presentation document to add storage or widen follower authority.
317
+ */
318
+ interface ChapterFlowField {
319
+ id: string;
320
+ label: string;
321
+ type: FieldType;
322
+ required: boolean;
323
+ order: number;
324
+ maxLength?: number;
325
+ options?: readonly string[];
326
+ conditions?: FieldConditions;
327
+ /** Present only for an email identity field. Aliases such as `+tag` remain significant. */
328
+ emailIdentity?: ChapterEmailIdentity;
329
+ }
330
+ /** Ordered, versioned effective field state for one Chapter journey. */
331
+ interface ChapterFlowFieldContract {
332
+ schemaVersion: typeof CHAPTER_FLOW_FIELDS_SCHEMA_VERSION;
333
+ flow: ChapterFieldFlow;
334
+ fields: readonly ChapterFlowField[];
335
+ }
336
+
280
337
  /** The public join config (the shape `GET /api/join-config` returns). */
281
338
  interface JoinConfig {
282
339
  id: string;
@@ -289,6 +346,8 @@ interface JoinConfig {
289
346
  /** Resolved copy for the packaged join flow. */
290
347
  copy?: ChapterCopy["join"];
291
348
  giftOffers?: readonly PublicGiftOffer[];
349
+ /** Exact ordered field state accepted by the effective server-side join flow. */
350
+ fieldContract?: ChapterFlowFieldContract;
292
351
  }
293
352
  /** Server-validated state used to resume a join journey after a redirect. */
294
353
  type JoinFlowState = {
@@ -506,4 +565,4 @@ interface BrandStyleProps {
506
565
  * there is no brand to theme). */
507
566
  declare function BrandStyle(props: BrandStyleProps): preact.JSX.Element | null;
508
567
 
509
- export { type ApiFn, BrandStyle, type BrandStyleProps, GiftOfferCards, type GiftOfferCardsMode, type GiftOfferCardsProps, type JoinBookingSimulation, type JoinConfig, type JoinFlowState, JoinIsland, type JoinIslandProps, type JoinSimulation, type JoinStepRenderContext, type JoinSubmitRenderContext, type JoinTier, type JoinTierRenderContext, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberGifts, 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, type SubResponse, TierPlaceholder, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection };
568
+ export { type ApiFn, BrandStyle, type BrandStyleProps, GiftOfferCards, type GiftOfferCardsMode, type GiftOfferCardsProps, type JoinBookingSimulation, type JoinConfig, type JoinFlowState, JoinIsland, type JoinIslandProps, type JoinSimulation, type JoinStepRenderContext, type JoinSubmitRenderContext, type JoinTier, type JoinTierRenderContext, MEMBERSHIP_CARD_TOKEN_DEFAULTS, MemberContentArea, type MemberContentAreaProps, MemberGifts, 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, type SubResponse, TierPlaceholder, dayKey, dayLabel, fmtDate, fmtMoney, fullLabel, groupSlotsByDay, loadJoinResume, membershipApplicationHref, tierNeedsPayment, timeLabel, tzShort, useTierSelection };
@@ -2,6 +2,7 @@ import {
2
2
  GiftOfferCards,
3
3
  JoinIsland,
4
4
  MEMBERSHIP_CARD_TOKEN_DEFAULTS,
5
+ MemberContentArea,
5
6
  MemberGifts,
6
7
  MembersArea,
7
8
  MembershipCards,
@@ -21,7 +22,7 @@ import {
21
22
  timeLabel,
22
23
  tzShort,
23
24
  useTierSelection
24
- } from "../../chunk-I45VYBUV.js";
25
+ } from "../../chunk-BIYWPPH6.js";
25
26
  import {
26
27
  BrandStyle,
27
28
  ChapterCopyProvider,
@@ -34,6 +35,7 @@ export {
34
35
  GiftOfferCards,
35
36
  JoinIsland,
36
37
  MEMBERSHIP_CARD_TOKEN_DEFAULTS,
38
+ MemberContentArea,
37
39
  MemberGifts,
38
40
  MembersArea,
39
41
  MembershipCards,